00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef IPRIMARYSCREEN_H
00020 #define IPRIMARYSCREEN_H
00021
00022 #include "IInterface.h"
00023 #include "KeyTypes.h"
00024 #include "MouseTypes.h"
00025 #include "CEvent.h"
00026 #include "GameDeviceTypes.h"
00027
00029
00033 class IPrimaryScreen : public IInterface {
00034 public:
00036 class CButtonInfo {
00037 public:
00038 static CButtonInfo* alloc(ButtonID, KeyModifierMask);
00039 static CButtonInfo* alloc(const CButtonInfo&);
00040
00041 static bool equal(const CButtonInfo*, const CButtonInfo*);
00042
00043 public:
00044 ButtonID m_button;
00045 KeyModifierMask m_mask;
00046 };
00048 class CMotionInfo {
00049 public:
00050 static CMotionInfo* alloc(SInt32 x, SInt32 y);
00051
00052 public:
00053 SInt32 m_x;
00054 SInt32 m_y;
00055 };
00057 class CWheelInfo {
00058 public:
00059 static CWheelInfo* alloc(SInt32 xDelta, SInt32 yDelta);
00060
00061 public:
00062 SInt32 m_xDelta;
00063 SInt32 m_yDelta;
00064 };
00066 class CHotKeyInfo {
00067 public:
00068 static CHotKeyInfo* alloc(UInt32 id);
00069
00070 public:
00071 UInt32 m_id;
00072 };
00074 class CGameDeviceButtonInfo {
00075 public:
00076 CGameDeviceButtonInfo(GameDeviceID id, GameDeviceButton buttons) :
00077 m_id(id), m_buttons(buttons) { }
00078 public:
00079 GameDeviceID m_id;
00080 GameDeviceButton m_buttons;
00081 };
00083 class CGameDeviceStickInfo {
00084 public:
00085 CGameDeviceStickInfo(GameDeviceID id, SInt16 x1, SInt16 y1, SInt16 x2, SInt16 y2) :
00086 m_id(id), m_x1(x1), m_x2(x2), m_y1(y1), m_y2(y2) { }
00087 public:
00088 GameDeviceID m_id;
00089 SInt16 m_x1;
00090 SInt16 m_x2;
00091 SInt16 m_y1;
00092 SInt16 m_y2;
00093 };
00095 class CGameDeviceTriggerInfo {
00096 public:
00097 CGameDeviceTriggerInfo(GameDeviceID id, UInt8 t1, UInt8 t2) :
00098 m_id(id), m_t1(t1), m_t2(t2) { }
00099 public:
00100 GameDeviceID m_id;
00101 UInt8 m_t1;
00102 UInt8 m_t2;
00103 };
00105 class CGameDeviceTimingRespInfo {
00106 public:
00107 CGameDeviceTimingRespInfo(UInt16 freq) :
00108 m_freq(freq) { }
00109 public:
00110 UInt16 m_freq;
00111 };
00113 class CGameDeviceFeedbackInfo {
00114 public:
00115 CGameDeviceFeedbackInfo(GameDeviceID id, UInt16 m1, UInt16 m2) :
00116 m_id(id), m_m1(m1), m_m2(m2) { }
00117 public:
00118 GameDeviceID m_id;
00119 UInt16 m_m1;
00120 UInt16 m_m2;
00121 };
00122
00124
00125
00127
00133 virtual void reconfigure(UInt32 activeSides) = 0;
00134
00136
00141 virtual void warpCursor(SInt32 x, SInt32 y) = 0;
00142
00144
00164 virtual UInt32 registerHotKey(KeyID key, KeyModifierMask mask) = 0;
00165
00167
00170 virtual void unregisterHotKey(UInt32 id) = 0;
00171
00173
00179 virtual void fakeInputBegin() = 0;
00180
00182
00185 virtual void fakeInputEnd() = 0;
00186
00188
00189
00190
00192
00196 virtual SInt32 getJumpZoneSize() const = 0;
00197
00199
00204 virtual bool isAnyMouseButtonDown() const = 0;
00205
00207
00212 virtual void getCursorCenter(SInt32& x, SInt32& y) const = 0;
00213
00215 virtual void gameDeviceTimingResp(UInt16 freq) = 0;
00216
00218 virtual void gameDeviceFeedback(GameDeviceID id, UInt16 m1, UInt16 m2) = 0;
00219
00221 static CEvent::Type getButtonDownEvent();
00223 static CEvent::Type getButtonUpEvent();
00225
00228 static CEvent::Type getMotionOnPrimaryEvent();
00230
00234 static CEvent::Type getMotionOnSecondaryEvent();
00236 static CEvent::Type getWheelEvent();
00238 static CEvent::Type getScreensaverActivatedEvent();
00240 static CEvent::Type getScreensaverDeactivatedEvent();
00242 static CEvent::Type getHotKeyDownEvent();
00244 static CEvent::Type getHotKeyUpEvent();
00246 static CEvent::Type getFakeInputBeginEvent();
00248 static CEvent::Type getFakeInputEndEvent();
00249 public:
00251 static CEvent::Type getGameDeviceButtonsEvent();
00253 static CEvent::Type getGameDeviceSticksEvent();
00255 static CEvent::Type getGameDeviceTriggersEvent();
00257 static CEvent::Type getGameDeviceTimingReqEvent();
00258 private:
00259
00261
00262 private:
00263 static CEvent::Type s_buttonDownEvent;
00264 static CEvent::Type s_buttonUpEvent;
00265 static CEvent::Type s_motionPrimaryEvent;
00266 static CEvent::Type s_motionSecondaryEvent;
00267 static CEvent::Type s_wheelEvent;
00268 static CEvent::Type s_ssActivatedEvent;
00269 static CEvent::Type s_ssDeactivatedEvent;
00270 static CEvent::Type s_hotKeyDownEvent;
00271 static CEvent::Type s_hotKeyUpEvent;
00272 static CEvent::Type s_fakeInputBegin;
00273 static CEvent::Type s_fakeInputEnd;
00274 static CEvent::Type s_gameButtonsEvent;
00275 static CEvent::Type s_gameSticksEvent;
00276 static CEvent::Type s_gameTriggersEvent;
00277 static CEvent::Type s_gameTimingReqEvent;
00278 };
00279
00280 #endif