| 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 CBASECLIENTPROXY_H
|
|---|
| 16 | #define CBASECLIENTPROXY_H
|
|---|
| 17 |
|
|---|
| 18 | #include "IClient.h"
|
|---|
| 19 | #include "CString.h"
|
|---|
| 20 |
|
|---|
| 21 | //! Generic proxy for client or primary
|
|---|
| 22 | class CBaseClientProxy : public IClient {
|
|---|
| 23 | public:
|
|---|
| 24 | /*!
|
|---|
| 25 | \c name is the name of the client.
|
|---|
| 26 | */
|
|---|
| 27 | CBaseClientProxy(const CString& name);
|
|---|
| 28 | ~CBaseClientProxy();
|
|---|
| 29 |
|
|---|
| 30 | //! @name manipulators
|
|---|
| 31 | //@{
|
|---|
| 32 |
|
|---|
| 33 | //! Save cursor position
|
|---|
| 34 | /*!
|
|---|
| 35 | Save the position of the cursor when jumping from client.
|
|---|
| 36 | */
|
|---|
| 37 | void setJumpCursorPos(SInt32 x, SInt32 y);
|
|---|
| 38 |
|
|---|
| 39 | //@}
|
|---|
| 40 | //! @name accessors
|
|---|
| 41 | //@{
|
|---|
| 42 |
|
|---|
| 43 | //! Get cursor position
|
|---|
| 44 | /*!
|
|---|
| 45 | Get the position of the cursor when last jumping from client.
|
|---|
| 46 | */
|
|---|
| 47 | void getJumpCursorPos(SInt32& x, SInt32& y) const;
|
|---|
| 48 |
|
|---|
| 49 | //@}
|
|---|
| 50 |
|
|---|
| 51 | // IScreen
|
|---|
| 52 | virtual void* getEventTarget() const = 0;
|
|---|
| 53 | virtual bool getClipboard(ClipboardID id, IClipboard*) const = 0;
|
|---|
| 54 | virtual void getShape(SInt32& x, SInt32& y,
|
|---|
| 55 | SInt32& width, SInt32& height) const = 0;
|
|---|
| 56 | virtual void getCursorPos(SInt32& x, SInt32& y) const = 0;
|
|---|
| 57 |
|
|---|
| 58 | // IClient overrides
|
|---|
| 59 | virtual void enter(SInt32 xAbs, SInt32 yAbs,
|
|---|
| 60 | UInt32 seqNum, KeyModifierMask mask,
|
|---|
| 61 | bool forScreensaver) = 0;
|
|---|
| 62 | virtual bool leave() = 0;
|
|---|
| 63 | virtual void setClipboard(ClipboardID, const IClipboard*) = 0;
|
|---|
| 64 | virtual void grabClipboard(ClipboardID) = 0;
|
|---|
| 65 | virtual void setClipboardDirty(ClipboardID, bool) = 0;
|
|---|
| 66 | virtual void keyDown(KeyID, KeyModifierMask, KeyButton) = 0;
|
|---|
| 67 | virtual void keyRepeat(KeyID, KeyModifierMask,
|
|---|
| 68 | SInt32 count, KeyButton) = 0;
|
|---|
| 69 | virtual void keyUp(KeyID, KeyModifierMask, KeyButton) = 0;
|
|---|
| 70 | virtual void mouseDown(ButtonID) = 0;
|
|---|
| 71 | virtual void mouseUp(ButtonID) = 0;
|
|---|
| 72 | virtual void mouseMove(SInt32 xAbs, SInt32 yAbs) = 0;
|
|---|
| 73 | virtual void mouseRelativeMove(SInt32 xRel, SInt32 yRel) = 0;
|
|---|
| 74 | virtual void mouseWheel(SInt32 xDelta, SInt32 yDelta) = 0;
|
|---|
| 75 | virtual void screensaver(bool activate) = 0;
|
|---|
| 76 | virtual void resetOptions() = 0;
|
|---|
| 77 | virtual void setOptions(const COptionsList& options) = 0;
|
|---|
| 78 | virtual CString getName() const;
|
|---|
| 79 |
|
|---|
| 80 | private:
|
|---|
| 81 | CString m_name;
|
|---|
| 82 | SInt32 m_x, m_y;
|
|---|
| 83 | };
|
|---|
| 84 |
|
|---|
| 85 | #endif
|
|---|