/* # Copyright (c) 2009, 2010 - OpenSLX Project, Computer Center University of # Freiburg # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING # # If you have any feedback please consult http://openslx.org/feedback and # send your suggestions, praise, or complaints to feedback@openslx.org # # General information about OpenSLX can be found at http://openslx.org/ */ #ifndef CLIENTVNCVIEWER_H_ #define CLIENTVNCVIEWER_H_ #include #include #include "pvsinterface.h" #include "../util/vncClientThread.h" // Definition of key modifier mask constants #define KMOD_Alt_R 0x01 #define KMOD_Alt_L 0x02 #define KMOD_Meta_L 0x04 #define KMOD_Control_L 0x08 #define KMOD_Shift_L 0x10 class ClientVNCViewer: public QDialog { Q_OBJECT public: ClientVNCViewer(QWidget *parent = 0); virtual ~ClientVNCViewer(); public Q_SLOTS: void open(QString host, int port, QString passwd, bool fullscreen = false, bool smoothTransformation = false, int quality = 0); void close(); void updateImage(int x, int y, int w, int h); protected: void paintEvent(QPaintEvent *event); //bool event(QEvent *event); //bool eventFilter(QObject *obj, QEvent *event); private: VNCClientThread *_thread; //rfbClient *_rfbclient; QImage _img; bool _viewOnly; int _buttonMask; QMap _modkeys; bool eventFilter(QObject *obj, QEvent *event); void keyEventHandler(QKeyEvent *e); void unpressModifiers(); void wheelEventHandler(QWheelEvent *event); void mouseEventHandler(QMouseEvent *event); Qt::TransformationMode _mode; OrgOpenslxPvsInterface *_ifaceDBus; }; #endif /* CLIENTVNCVIEWER_H_ */