diff options
Diffstat (limited to 'krdc/vnc/threads.h')
-rw-r--r-- | krdc/vnc/threads.h | 102 |
1 files changed, 45 insertions, 57 deletions
diff --git a/krdc/vnc/threads.h b/krdc/vnc/threads.h index 08ca4c20..6b4d154e 100644 --- a/krdc/vnc/threads.h +++ b/krdc/vnc/threads.h @@ -2,7 +2,8 @@ threads.h - threads for kvncview ------------------- begin : Thu May 09 16:01:42 CET 2002 - copyright : (C) 2002 by Tim Jansen + copyright : (C) 2015 Timothy Pearson <[email protected]> + (C) 2002 by Tim Jansen email : [email protected] ***************************************************************************/ @@ -26,11 +27,15 @@ #include <tqevent.h> #include <tqvaluelist.h> #include <tqdatetime.h> +#include <tqimage.h> #include <stdlib.h> #include "events.h" -#include "vnctypes.h" + +extern "C" { +#include <rfb/rfbclient.h> +} class KVncView; @@ -57,68 +62,51 @@ struct InputEvent { } e; }; +class ControllerThreadObject : public TQObject { + Q_OBJECT -class WriterThread : public TQThread { -private: - TQMutex m_lock; - TQWaitCondition m_waiter; - volatile bool &m_quitFlag; - KVncView *m_view; + public: + ControllerThreadObject(KVncView *v, volatile bool &quitFlag); + ~ControllerThreadObject(); - TQTime m_lastIncrUpdate; // start()ed when a incr update is sent - bool m_lastIncrUpdatePostponed; + enum RemoteViewStatus status(); - // all things that can be send follow: - bool m_incrementalUpdateRQ; // for sending an incremental request - bool m_incrementalUpdateAnnounced; // set when a RQ will come soon - TQRegion m_updateRegionRQ; // for sending updates, null if it is done - TQValueList<InputEvent> m_inputEvents; // list of unsent input events - MouseEvent m_lastMouseEvent; - int m_mouseEventNum, m_keyEventNum; - TQString m_clientCut; + void setImage(const TQImage &img); + const TQImage image(int x = 0, int y = 0, int w = 0, int h = 0); + void authenticationResults(int resultCode); + void networkStatus(int statusCode); - void sendFatalError(ErrorCode s); + void setScaling(int w, int h); + void queueDrawRegion(int x, int y, int w, int h); -public: - WriterThread(KVncView *v, volatile bool &quitFlag); + rfbClient *cl; - void queueIncrementalUpdateRequest(); - void announceIncrementalUpdateRequest(); - void queueUpdateRequest(const TQRegion &r); - void queueMouseEvent(int x, int y, int buttonMask); - void queueKeyEvent(unsigned int k, bool down); - void queueClientCut(const TQString &text); - void kick(); + public slots: + void run(); -protected: - void run(); - bool sendIncrementalUpdateRequest(); - bool sendUpdateRequest(const TQRegion &r); - bool sendInputEvents(const TQValueList<InputEvent> &events); -}; - - - -class ControllerThread : public TQThread { -private: - KVncView *m_view; - enum RemoteViewStatus m_status; - WriterThread &m_wthread; - volatile bool &m_quitFlag; - volatile bool m_desktopInitialized; - TQWaitCondition m_waiter; - - void changeStatus(RemoteViewStatus s); - void sendFatalError(ErrorCode s); - -public: - ControllerThread(KVncView *v, WriterThread &wt, volatile bool &quitFlag); - enum RemoteViewStatus status(); - void desktopInit(); - void kick(); - -protected: - void run(); + public: + void queueMouseEvent(int x, int y, int buttonMask); + void queueKeyEvent(unsigned int k, bool down); + void queueClientCut(const TQString &text); + + private: + KVncView *m_view; + TQImage m_image; + TQImage m_scaledImage; + TQMutex mutex; + enum RemoteViewStatus m_status; + volatile bool &m_quitFlag; + + bool m_scaling; + int m_scalingWidth; + int m_scalingHeight; + bool m_resizeEntireFrame; + + // all things that can be send follow: + TQValueList<InputEvent> m_inputEvents; // list of unsent input events + + void changeStatus(RemoteViewStatus s); + void sendFatalError(ErrorCode s); }; |