krfb
events.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef EVENTS_H
00012 #define EVENTS_H
00013
00014 #include <QDesktopWidget>
00015 #include <QEvent>
00016 #include <QString>
00017
00018 #include <X11/Xlib.h>
00019
00020 class ConnectionController;
00021
00022 class QCursor;
00023
00024 class VNCEvent {
00025 public:
00026 virtual void exec() = 0;
00027 virtual ~VNCEvent();
00028 };
00029
00030 class KeyboardEvent : public VNCEvent {
00031 bool down;
00032 KeySym keySym;
00033
00034 static Display *dpy;
00035 static signed char modifiers[0x100];
00036 static KeyCode keycodes[0x100], leftShiftCode, rightShiftCode, altGrCode;
00037 static const int LEFTSHIFT;
00038 static const int RIGHTSHIFT;
00039 static const int ALTGR;
00040 static char ModifierState;
00041 static bool initDone;
00042
00043 static void tweakModifiers(signed char mod, bool down);
00044 public:
00045 static void initKeycodes();
00046
00047 KeyboardEvent(bool d, KeySym k);
00048 virtual void exec();
00049 };
00050
00051 class PointerEvent : public VNCEvent {
00052 int button_mask, x, y;
00053
00054 static bool initialized;
00055 static Display *dpy;
00056 static int buttonMask;
00057 public:
00058 PointerEvent(int b, int _x, int _y);
00059 virtual void exec();
00060 };
00061
00062 class ClipboardEvent : public VNCEvent {
00063 ConnectionController *controller;
00064 QString text;
00065 public:
00066 ClipboardEvent(ConnectionController *c, const QString &text);
00067 virtual void exec();
00068 };
00069
00070 #endif