6#include "rfb/SConnection.h"
7#include "rfb/EncodeManager.h"
8#include "rfb/UpdateTracker.h"
14#include "../../RabbitVNC/InStreamChannel.h"
15#include "../../RabbitVNC/OutStreamChannel.h"
16#include "ServiceTigerVNC.h"
17#include "ParameterServiceTigerVNC.h"
18#include "InputDevice.h"
21class CConnection :
public QObject,
public rfb::SConnection
31 virtual void queryConnection(
const char *userName)
override;
32 virtual void authSuccess()
override;
35 virtual void clientInit(
bool shared)
override;
36 virtual void setDesktopSize(
int fb_width,
int fb_height,
const rfb::ScreenSet &layout)
override;
37 virtual void setPixelFormat(
const rfb::PixelFormat &pf)
override;
38 virtual void framebufferUpdateRequest(
const rfb::Rect &r,
bool incremental)
override;
39 virtual void fence(rdr::U32 flags,
unsigned len,
const char data[])
override;
40 virtual void enableContinuousUpdates(
bool enable,
int x,
int y,
int w,
int h)
override;
43 virtual void keyEvent(rdr::U32 keysym, rdr::U32 keycode,
bool down)
override;
44 virtual void pointerEvent(
const rfb::Point& pos,
int buttonMask)
override;
45 virtual void clientCutText(
const char* str)
override;
48 void sigDisconnected();
49 void sigError(
int nErr,
const QString& szErr);
52 QSharedPointer<rfb::PixelBuffer> GetBufferFromQImage(QImage &img);
53 void writeNoDataUpdate();
54 void writeDataUpdate(QImage img, QRect rect);
59 void slotDisconnected();
60 void slotError(
int nRet,
const QString &szErr);
61 void slotDesktopUpdate(QImage img, QRect rect);
64 QSharedPointer<CChannel> m_Channel;
65 QSharedPointer<rdr::InStream> m_InStream;
66 QSharedPointer<rdr::OutStream> m_OutStream;
68 QSharedPointer<CInputDevice> m_InputDevice;
70 rfb::PixelFormat m_PixelFormat;
72 bool inProcessMessages;
74 bool pendingSyncFence, syncFence;
76 unsigned fenceDataLen;
79 rfb::EncodeManager m_EncodeManager;
80 rfb::SimpleUpdateTracker m_Updates;
81 rfb::Region requested;
82 bool continuousUpdates;