2007-04-04 14:57:27 +00:00
|
|
|
/* This file is part of the KDE project
|
|
|
|
|
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
|
|
|
|
(C) 2001-2003 by Tim Jansen <tim@tjansen.de>
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public
|
2007-11-08 18:50:58 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
2007-04-04 14:57:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef EVENTS_H
|
|
|
|
|
#define EVENTS_H
|
|
|
|
|
|
2007-07-24 19:31:30 +00:00
|
|
|
#include <QDesktopWidget>
|
|
|
|
|
#include <QEvent>
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
2007-04-04 14:57:27 +00:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
|
|
2007-04-05 20:21:15 +00:00
|
|
|
class ConnectionController;
|
2007-04-04 14:57:27 +00:00
|
|
|
|
2007-07-24 19:31:30 +00:00
|
|
|
class QCursor;
|
|
|
|
|
|
2007-04-04 14:57:27 +00:00
|
|
|
class VNCEvent {
|
|
|
|
|
public:
|
|
|
|
|
virtual void exec() = 0;
|
|
|
|
|
virtual ~VNCEvent();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class KeyboardEvent : public VNCEvent {
|
|
|
|
|
bool down;
|
|
|
|
|
KeySym keySym;
|
|
|
|
|
|
|
|
|
|
static Display *dpy;
|
|
|
|
|
static signed char modifiers[0x100];
|
|
|
|
|
static KeyCode keycodes[0x100], leftShiftCode, rightShiftCode, altGrCode;
|
|
|
|
|
static const int LEFTSHIFT;
|
|
|
|
|
static const int RIGHTSHIFT;
|
|
|
|
|
static const int ALTGR;
|
|
|
|
|
static char ModifierState;
|
2007-04-05 20:21:15 +00:00
|
|
|
static bool initDone;
|
2007-04-04 14:57:27 +00:00
|
|
|
|
|
|
|
|
static void tweakModifiers(signed char mod, bool down);
|
|
|
|
|
public:
|
|
|
|
|
static void initKeycodes();
|
|
|
|
|
|
|
|
|
|
KeyboardEvent(bool d, KeySym k);
|
|
|
|
|
virtual void exec();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class PointerEvent : public VNCEvent {
|
|
|
|
|
int button_mask, x, y;
|
|
|
|
|
|
|
|
|
|
static bool initialized;
|
|
|
|
|
static Display *dpy;
|
|
|
|
|
static int buttonMask;
|
|
|
|
|
public:
|
|
|
|
|
PointerEvent(int b, int _x, int _y);
|
|
|
|
|
virtual void exec();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ClipboardEvent : public VNCEvent {
|
2007-04-05 20:21:15 +00:00
|
|
|
ConnectionController *controller;
|
2007-04-04 14:57:27 +00:00
|
|
|
QString text;
|
|
|
|
|
public:
|
2007-04-05 20:21:15 +00:00
|
|
|
ClipboardEvent(ConnectionController *c, const QString &text);
|
2007-04-04 14:57:27 +00:00
|
|
|
virtual void exec();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|