source: trunk/synergy/lib/server/CClientProxy1_0.h

Last change on this file was 2749, checked in by bird, 19 years ago

synergy v1.3.1 sources (zip).

File size: 3.0 KB
Line 
1/*
2 * synergy -- mouse and keyboard sharing utility
3 * Copyright (C) 2002 Chris Schoeneman
4 *
5 * This package is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * found in the file COPYING that should have accompanied this file.
8 *
9 * This package is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#ifndef CCLIENTPROXY1_0_H
16#define CCLIENTPROXY1_0_H
17
18#include "CClientProxy.h"
19#include "CClipboard.h"
20#include "ProtocolTypes.h"
21
22class CEvent;
23class CEventQueueTimer;
24
25//! Proxy for client implementing protocol version 1.0
26class CClientProxy1_0 : public CClientProxy {
27public:
28 CClientProxy1_0(const CString& name, IStream* adoptedStream);
29 ~CClientProxy1_0();
30
31 // IScreen
32 virtual bool getClipboard(ClipboardID id, IClipboard*) const;
33 virtual void getShape(SInt32& x, SInt32& y,
34 SInt32& width, SInt32& height) const;
35 virtual void getCursorPos(SInt32& x, SInt32& y) const;
36
37 // IClient overrides
38 virtual void enter(SInt32 xAbs, SInt32 yAbs,
39 UInt32 seqNum, KeyModifierMask mask,
40 bool forScreensaver);
41 virtual bool leave();
42 virtual void setClipboard(ClipboardID, const IClipboard*);
43 virtual void grabClipboard(ClipboardID);
44 virtual void setClipboardDirty(ClipboardID, bool);
45 virtual void keyDown(KeyID, KeyModifierMask, KeyButton);
46 virtual void keyRepeat(KeyID, KeyModifierMask,
47 SInt32 count, KeyButton);
48 virtual void keyUp(KeyID, KeyModifierMask, KeyButton);
49 virtual void mouseDown(ButtonID);
50 virtual void mouseUp(ButtonID);
51 virtual void mouseMove(SInt32 xAbs, SInt32 yAbs);
52 virtual void mouseRelativeMove(SInt32 xRel, SInt32 yRel);
53 virtual void mouseWheel(SInt32 xDelta, SInt32 yDelta);
54 virtual void screensaver(bool activate);
55 virtual void resetOptions();
56 virtual void setOptions(const COptionsList& options);
57
58protected:
59 virtual bool parseHandshakeMessage(const UInt8* code);
60 virtual bool parseMessage(const UInt8* code);
61
62 virtual void resetHeartbeatRate();
63 virtual void setHeartbeatRate(double rate, double alarm);
64 virtual void resetHeartbeatTimer();
65 virtual void addHeartbeatTimer();
66 virtual void removeHeartbeatTimer();
67
68private:
69 void disconnect();
70 void removeHandlers();
71
72 void handleData(const CEvent&, void*);
73 void handleDisconnect(const CEvent&, void*);
74 void handleWriteError(const CEvent&, void*);
75 void handleFlatline(const CEvent&, void*);
76
77 bool recvInfo();
78 bool recvClipboard();
79 bool recvGrabClipboard();
80
81private:
82 typedef bool (CClientProxy1_0::*MessageParser)(const UInt8*);
83 struct CClientClipboard {
84 public:
85 CClientClipboard();
86
87 public:
88 CClipboard m_clipboard;
89 UInt32 m_sequenceNumber;
90 bool m_dirty;
91 };
92
93 CClientInfo m_info;
94 CClientClipboard m_clipboard[kClipboardEnd];
95 double m_heartbeatAlarm;
96 CEventQueueTimer* m_heartbeatTimer;
97 MessageParser m_parser;
98};
99
100#endif
Note: See TracBrowser for help on using the repository browser.