• Main Page
  • Classes
  • Files
  • File List

CClientProxy1_0.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2012 Bolton Software Ltd.
00004  * Copyright (C) 2002 Chris Schoeneman
00005  * 
00006  * This package is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * found in the file COPYING that should have accompanied this file.
00009  * 
00010  * This package is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017  */
00018 
00019 #ifndef CCLIENTPROXY1_0_H
00020 #define CCLIENTPROXY1_0_H
00021 
00022 #include "CClientProxy.h"
00023 #include "CClipboard.h"
00024 #include "ProtocolTypes.h"
00025 
00026 class CEvent;
00027 class CEventQueueTimer;
00028 class IEventQueue;
00029 
00031 class CClientProxy1_0 : public CClientProxy {
00032 public:
00033     CClientProxy1_0(const CString& name, synergy::IStream* adoptedStream, IEventQueue* eventQueue);
00034     ~CClientProxy1_0();
00035 
00036     // IScreen
00037     virtual bool        getClipboard(ClipboardID id, IClipboard*) const;
00038     virtual void        getShape(SInt32& x, SInt32& y,
00039                             SInt32& width, SInt32& height) const;
00040     virtual void        getCursorPos(SInt32& x, SInt32& y) const;
00041 
00042     // IClient overrides
00043     virtual void        enter(SInt32 xAbs, SInt32 yAbs,
00044                             UInt32 seqNum, KeyModifierMask mask,
00045                             bool forScreensaver);
00046     virtual bool        leave();
00047     virtual void        setClipboard(ClipboardID, const IClipboard*);
00048     virtual void        grabClipboard(ClipboardID);
00049     virtual void        setClipboardDirty(ClipboardID, bool);
00050     virtual void        keyDown(KeyID, KeyModifierMask, KeyButton);
00051     virtual void        keyRepeat(KeyID, KeyModifierMask,
00052                             SInt32 count, KeyButton);
00053     virtual void        keyUp(KeyID, KeyModifierMask, KeyButton);
00054     virtual void        mouseDown(ButtonID);
00055     virtual void        mouseUp(ButtonID);
00056     virtual void        mouseMove(SInt32 xAbs, SInt32 yAbs);
00057     virtual void        mouseRelativeMove(SInt32 xRel, SInt32 yRel);
00058     virtual void        mouseWheel(SInt32 xDelta, SInt32 yDelta);
00059     virtual void        screensaver(bool activate);
00060     virtual void        resetOptions();
00061     virtual void        setOptions(const COptionsList& options);
00062     virtual void        gameDeviceButtons(GameDeviceID id, GameDeviceButton buttons);
00063     virtual void        gameDeviceSticks(GameDeviceID id, SInt16 x1, SInt16 y1, SInt16 x2, SInt16 y2);
00064     virtual void        gameDeviceTriggers(GameDeviceID id, UInt8 t1, UInt8 t2);
00065     virtual void        gameDeviceTimingReq();
00066     virtual void        cryptoIv(const UInt8* iv);
00067 
00068 protected:
00069     virtual bool        parseHandshakeMessage(const UInt8* code);
00070     virtual bool        parseMessage(const UInt8* code);
00071 
00072     virtual void        resetHeartbeatRate();
00073     virtual void        setHeartbeatRate(double rate, double alarm);
00074     virtual void        resetHeartbeatTimer();
00075     virtual void        addHeartbeatTimer();
00076     virtual void        removeHeartbeatTimer();
00077 
00078 private:
00079     void                disconnect();
00080     void                removeHandlers();
00081 
00082     void                handleData(const CEvent&, void*);
00083     void                handleDisconnect(const CEvent&, void*);
00084     void                handleWriteError(const CEvent&, void*);
00085     void                handleFlatline(const CEvent&, void*);
00086 
00087     bool                recvInfo();
00088     bool                recvClipboard();
00089     bool                recvGrabClipboard();
00090 
00091 private:
00092     typedef bool (CClientProxy1_0::*MessageParser)(const UInt8*);
00093     struct CClientClipboard {
00094     public:
00095         CClientClipboard();
00096 
00097     public:
00098         CClipboard      m_clipboard;
00099         UInt32          m_sequenceNumber;
00100         bool            m_dirty;
00101     };
00102 
00103     CClientInfo         m_info;
00104     CClientClipboard    m_clipboard[kClipboardEnd];
00105     double              m_heartbeatAlarm;
00106     CEventQueueTimer*   m_heartbeatTimer;
00107     MessageParser       m_parser;
00108     IEventQueue*        m_eventQueue;
00109 };
00110 
00111 #endif

Generated on Thu May 23 2013 00:00:03 for Synergy by  doxygen 1.7.1