diff options
| author | Sebastien Braun | 2010-10-04 00:22:14 +0200 |
|---|---|---|
| committer | Sebastien Braun | 2010-10-05 18:15:48 +0200 |
| commit | 266eb5fb14c07e67aa211a5860e9abf3009136e3 (patch) | |
| tree | 9eeb8b159edf6e83880c056f1177cebec2ad354c /src/gui/frame.h | |
| parent | Defect #715, apply patch by Sébastien (diff) | |
| download | pvs-266eb5fb14c07e67aa211a5860e9abf3009136e3.tar.gz pvs-266eb5fb14c07e67aa211a5860e9abf3009136e3.tar.xz pvs-266eb5fb14c07e67aa211a5860e9abf3009136e3.zip | |
Implement first version of basic input event support
Diffstat (limited to 'src/gui/frame.h')
| -rw-r--r-- | src/gui/frame.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/gui/frame.h b/src/gui/frame.h index 3004e0c..19b330a 100644 --- a/src/gui/frame.h +++ b/src/gui/frame.h @@ -8,6 +8,7 @@ class VNCClientThread; class ConnectionWindow; class ConnectionFrame; class MainWindow; +class InputEvent; class Frame: public QLabel { @@ -48,8 +49,13 @@ public: QToolButton* button_lock; QToolButton* button_unlock; QToolButton* button_dozent; + QToolButton* button_control; + QToolButton* button_control_all; QList<QToolButton*> toolButtonList; + bool _remoteControlEnabled; + bool _remoteControlToAll; + public Q_SLOTS: void updateImage(int x, int y, int w, int h); void iamDown(); @@ -68,13 +74,23 @@ public Q_SLOTS: void setLock(); //void unlock(); void setDozent(); +private Q_SLOTS: + void remoteControlClicked(); + void remoteControlAllClicked(); + void sendMouseMotionEvent(); signals: - void clicked(); + void clicked(); protected: void paintEvent(QPaintEvent *event); void mousePressEvent ( QMouseEvent * event ); void mouseReleaseEvent ( QMouseEvent * event ); + void mouseMoveEvent ( QMouseEvent * event ); + void enterEvent(QEvent* event); + void leaveEvent(QEvent* event); + void keyPressEvent(QKeyEvent* event); + void keyReleaseEvent(QKeyEvent* event); + bool event(QEvent* event); private: QToolButton* createToolButton(const QString &toolTip, const QIcon &icon, const char *member); @@ -85,6 +101,15 @@ private: bool _isLocked; bool _dozent; int _ux, _uy; + + // for remote control: + QPoint _lastRecordedMousePosition; + bool _mousePositionChanged; + QTimer* _mouseMotionEventTimer; + bool _mouseOver; + QPoint rescalePosition(QPointF guiPosition); + void updateMousePosition(QMouseEvent* event); + void sendInputEvent(InputEvent const&); }; #endif /* FRAME_H_ */ |
