00001 /* 00002 * synergy -- mouse and keyboard sharing utility 00003 * Copyright (C) 2003 Chris Schoeneman 00004 * 00005 * This package is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * found in the file COPYING that should have accompanied this file. 00008 * 00009 * This package is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 */ 00014 00015 #ifndef IPRIMARYSCREEN_H 00016 #define IPRIMARYSCREEN_H 00017 00018 #include "IInterface.h" 00019 #include "KeyTypes.h" 00020 #include "MouseTypes.h" 00021 #include "CEvent.h" 00022 00024 00028 class IPrimaryScreen : public IInterface { 00029 public: 00031 class CButtonInfo { 00032 public: 00033 static CButtonInfo* alloc(ButtonID, KeyModifierMask); 00034 static CButtonInfo* alloc(const CButtonInfo&); 00035 00036 static bool equal(const CButtonInfo*, const CButtonInfo*); 00037 00038 public: 00039 ButtonID m_button; 00040 KeyModifierMask m_mask; 00041 }; 00043 class CMotionInfo { 00044 public: 00045 static CMotionInfo* alloc(SInt32 x, SInt32 y); 00046 00047 public: 00048 SInt32 m_x; 00049 SInt32 m_y; 00050 }; 00052 class CWheelInfo { 00053 public: 00054 static CWheelInfo* alloc(SInt32 xDelta, SInt32 yDelta); 00055 00056 public: 00057 SInt32 m_xDelta; 00058 SInt32 m_yDelta; 00059 }; 00061 class CHotKeyInfo { 00062 public: 00063 static CHotKeyInfo* alloc(UInt32 id); 00064 00065 public: 00066 UInt32 m_id; 00067 }; 00068 00070 00071 00073 00079 virtual void reconfigure(UInt32 activeSides) = 0; 00080 00082 00087 virtual void warpCursor(SInt32 x, SInt32 y) = 0; 00088 00090 00110 virtual UInt32 registerHotKey(KeyID key, KeyModifierMask mask) = 0; 00111 00113 00116 virtual void unregisterHotKey(UInt32 id) = 0; 00117 00119 00125 virtual void fakeInputBegin() = 0; 00126 00128 00131 virtual void fakeInputEnd() = 0; 00132 00134 00135 00136 00138 00142 virtual SInt32 getJumpZoneSize() const = 0; 00143 00145 00150 virtual bool isAnyMouseButtonDown() const = 0; 00151 00153 00158 virtual void getCursorCenter(SInt32& x, SInt32& y) const = 0; 00159 00161 static CEvent::Type getButtonDownEvent(); 00163 static CEvent::Type getButtonUpEvent(); 00165 00168 static CEvent::Type getMotionOnPrimaryEvent(); 00170 00174 static CEvent::Type getMotionOnSecondaryEvent(); 00176 static CEvent::Type getWheelEvent(); 00178 static CEvent::Type getScreensaverActivatedEvent(); 00180 static CEvent::Type getScreensaverDeactivatedEvent(); 00182 static CEvent::Type getHotKeyDownEvent(); 00184 static CEvent::Type getHotKeyUpEvent(); 00186 static CEvent::Type getFakeInputBeginEvent(); 00188 static CEvent::Type getFakeInputEndEvent(); 00189 00191 00192 private: 00193 static CEvent::Type s_buttonDownEvent; 00194 static CEvent::Type s_buttonUpEvent; 00195 static CEvent::Type s_motionPrimaryEvent; 00196 static CEvent::Type s_motionSecondaryEvent; 00197 static CEvent::Type s_wheelEvent; 00198 static CEvent::Type s_ssActivatedEvent; 00199 static CEvent::Type s_ssDeactivatedEvent; 00200 static CEvent::Type s_hotKeyDownEvent; 00201 static CEvent::Type s_hotKeyUpEvent; 00202 static CEvent::Type s_fakeInputBegin; 00203 static CEvent::Type s_fakeInputEnd; 00204 }; 00205 00206 #endif