2002-07-10 20:18:32 +00:00
|
|
|
#ifndef CSERVERPROXY_H
|
|
|
|
#define CSERVERPROXY_H
|
|
|
|
|
2002-07-10 21:22:28 +00:00
|
|
|
#include "IScreenReceiver.h"
|
2002-07-10 20:18:32 +00:00
|
|
|
#include "CMutex.h"
|
|
|
|
|
|
|
|
class IClient;
|
|
|
|
class IInputStream;
|
|
|
|
class IOutputStream;
|
|
|
|
|
2002-07-10 21:22:28 +00:00
|
|
|
class CServerProxy : public IScreenReceiver {
|
2002-07-10 20:18:32 +00:00
|
|
|
public:
|
|
|
|
CServerProxy(IClient* client,
|
|
|
|
IInputStream* adoptedInput,
|
|
|
|
IOutputStream* adoptedOutput);
|
|
|
|
~CServerProxy();
|
|
|
|
|
|
|
|
// manipulators
|
|
|
|
|
|
|
|
// handle messages. returns true iff server didn't reject our
|
|
|
|
// connection.
|
|
|
|
bool run();
|
|
|
|
|
|
|
|
// accessors
|
|
|
|
|
|
|
|
// get the client
|
|
|
|
IClient* getClient() const;
|
|
|
|
|
|
|
|
// get the client name
|
|
|
|
CString getName() const;
|
|
|
|
|
|
|
|
// get the input and output streams for the server
|
|
|
|
IInputStream* getInputStream() const;
|
|
|
|
IOutputStream* getOutputStream() const;
|
|
|
|
|
2002-07-10 21:22:28 +00:00
|
|
|
// IScreenReceiver overrides
|
2002-07-16 16:52:26 +00:00
|
|
|
virtual void onError();
|
2002-07-10 21:22:28 +00:00
|
|
|
virtual void onInfoChanged(const CClientInfo&);
|
|
|
|
virtual bool onGrabClipboard(ClipboardID);
|
|
|
|
virtual void onClipboardChanged(ClipboardID, const CString& data);
|
2002-07-10 20:18:32 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// if compressing mouse motion then send the last motion now
|
|
|
|
void flushCompressedMouse();
|
|
|
|
|
|
|
|
void sendInfo(const CClientInfo&);
|
|
|
|
|
|
|
|
// message handlers
|
|
|
|
void enter();
|
|
|
|
void leave();
|
|
|
|
void setClipboard();
|
|
|
|
void grabClipboard();
|
|
|
|
void keyDown();
|
|
|
|
void keyRepeat();
|
|
|
|
void keyUp();
|
|
|
|
void mouseDown();
|
|
|
|
void mouseUp();
|
|
|
|
void mouseMove();
|
|
|
|
void mouseWheel();
|
2002-07-13 22:00:38 +00:00
|
|
|
void screensaver();
|
2002-07-10 20:18:32 +00:00
|
|
|
void queryInfo();
|
|
|
|
void infoAcknowledgment();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CMutex m_mutex;
|
|
|
|
|
|
|
|
IClient* m_client;
|
|
|
|
IInputStream* m_input;
|
|
|
|
IOutputStream* m_output;
|
|
|
|
|
2002-07-10 21:22:28 +00:00
|
|
|
UInt32 m_seqNum;
|
|
|
|
|
2002-07-10 20:18:32 +00:00
|
|
|
bool m_compressMouse;
|
|
|
|
SInt32 m_xMouse, m_yMouse;
|
|
|
|
|
|
|
|
bool m_ignoreMouse;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|