00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "CPrimaryClient.h"
00020 #include "CScreen.h"
00021 #include "CClipboard.h"
00022 #include "CLog.h"
00023
00024
00025
00026
00027
00028 CPrimaryClient::CPrimaryClient(const CString& name, CScreen* screen) :
00029 CBaseClientProxy(name),
00030 m_screen(screen),
00031 m_fakeInputCount(0)
00032 {
00033
00034 for (UInt32 i = 0; i < kClipboardEnd; ++i) {
00035 m_clipboardDirty[i] = false;
00036 }
00037 }
00038
00039 CPrimaryClient::~CPrimaryClient()
00040 {
00041
00042 }
00043
00044 void
00045 CPrimaryClient::reconfigure(UInt32 activeSides)
00046 {
00047 m_screen->reconfigure(activeSides);
00048 }
00049
00050 UInt32
00051 CPrimaryClient::registerHotKey(KeyID key, KeyModifierMask mask)
00052 {
00053 return m_screen->registerHotKey(key, mask);
00054 }
00055
00056 void
00057 CPrimaryClient::unregisterHotKey(UInt32 id)
00058 {
00059 m_screen->unregisterHotKey(id);
00060 }
00061
00062 void
00063 CPrimaryClient::fakeInputBegin()
00064 {
00065 if (++m_fakeInputCount == 1) {
00066 m_screen->fakeInputBegin();
00067 }
00068 }
00069
00070 void
00071 CPrimaryClient::fakeInputEnd()
00072 {
00073 if (--m_fakeInputCount == 0) {
00074 m_screen->fakeInputEnd();
00075 }
00076 }
00077
00078 SInt32
00079 CPrimaryClient::getJumpZoneSize() const
00080 {
00081 return m_screen->getJumpZoneSize();
00082 }
00083
00084 void
00085 CPrimaryClient::getCursorCenter(SInt32& x, SInt32& y) const
00086 {
00087 m_screen->getCursorCenter(x, y);
00088 }
00089
00090 KeyModifierMask
00091 CPrimaryClient::getToggleMask() const
00092 {
00093 return m_screen->pollActiveModifiers();
00094 }
00095
00096 bool
00097 CPrimaryClient::isLockedToScreen() const
00098 {
00099 return m_screen->isLockedToScreen();
00100 }
00101
00102 void*
00103 CPrimaryClient::getEventTarget() const
00104 {
00105 return m_screen->getEventTarget();
00106 }
00107
00108 bool
00109 CPrimaryClient::getClipboard(ClipboardID id, IClipboard* clipboard) const
00110 {
00111 return m_screen->getClipboard(id, clipboard);
00112 }
00113
00114 void
00115 CPrimaryClient::getShape(SInt32& x, SInt32& y,
00116 SInt32& width, SInt32& height) const
00117 {
00118 m_screen->getShape(x, y, width, height);
00119 }
00120
00121 void
00122 CPrimaryClient::getCursorPos(SInt32& x, SInt32& y) const
00123 {
00124 m_screen->getCursorPos(x, y);
00125 }
00126
00127 void
00128 CPrimaryClient::enable()
00129 {
00130 m_screen->enable();
00131 }
00132
00133 void
00134 CPrimaryClient::disable()
00135 {
00136 m_screen->disable();
00137 }
00138
00139 void
00140 CPrimaryClient::enter(SInt32 xAbs, SInt32 yAbs,
00141 UInt32 seqNum, KeyModifierMask mask, bool screensaver)
00142 {
00143 m_screen->setSequenceNumber(seqNum);
00144 if (!screensaver) {
00145 m_screen->warpCursor(xAbs, yAbs);
00146 }
00147 m_screen->enter(mask);
00148 }
00149
00150 bool
00151 CPrimaryClient::leave()
00152 {
00153 return m_screen->leave();
00154 }
00155
00156 void
00157 CPrimaryClient::setClipboard(ClipboardID id, const IClipboard* clipboard)
00158 {
00159
00160 if (m_clipboardDirty[id]) {
00161
00162 m_clipboardDirty[id] = false;
00163
00164
00165 m_screen->setClipboard(id, clipboard);
00166 }
00167 }
00168
00169 void
00170 CPrimaryClient::grabClipboard(ClipboardID id)
00171 {
00172
00173 m_screen->grabClipboard(id);
00174
00175
00176 m_clipboardDirty[id] = true;
00177 }
00178
00179 void
00180 CPrimaryClient::setClipboardDirty(ClipboardID id, bool dirty)
00181 {
00182 m_clipboardDirty[id] = dirty;
00183 }
00184
00185 void
00186 CPrimaryClient::keyDown(KeyID key, KeyModifierMask mask, KeyButton button)
00187 {
00188 if (m_fakeInputCount > 0) {
00189
00190 (void)key;
00191 (void)mask;
00192 (void)button;
00193
00194 }
00195 }
00196
00197 void
00198 CPrimaryClient::keyRepeat(KeyID, KeyModifierMask, SInt32, KeyButton)
00199 {
00200
00201 }
00202
00203 void
00204 CPrimaryClient::keyUp(KeyID key, KeyModifierMask mask, KeyButton button)
00205 {
00206 if (m_fakeInputCount > 0) {
00207
00208 (void)key;
00209 (void)mask;
00210 (void)button;
00211
00212 }
00213 }
00214
00215 void
00216 CPrimaryClient::mouseDown(ButtonID)
00217 {
00218
00219 }
00220
00221 void
00222 CPrimaryClient::mouseUp(ButtonID)
00223 {
00224
00225 }
00226
00227 void
00228 CPrimaryClient::mouseMove(SInt32 x, SInt32 y)
00229 {
00230 m_screen->warpCursor(x, y);
00231 }
00232
00233 void
00234 CPrimaryClient::mouseRelativeMove(SInt32, SInt32)
00235 {
00236
00237 }
00238
00239 void
00240 CPrimaryClient::mouseWheel(SInt32, SInt32)
00241 {
00242
00243 }
00244
00245 void
00246 CPrimaryClient::gameDeviceButtons(GameDeviceID, GameDeviceButton)
00247 {
00248
00249 }
00250
00251 void
00252 CPrimaryClient::gameDeviceSticks(GameDeviceID, SInt16, SInt16, SInt16, SInt16)
00253 {
00254
00255 }
00256
00257 void
00258 CPrimaryClient::gameDeviceTriggers(GameDeviceID, UInt8, UInt8)
00259 {
00260
00261 }
00262
00263 void
00264 CPrimaryClient::gameDeviceTimingReq()
00265 {
00266
00267 }
00268
00269 void
00270 CPrimaryClient::screensaver(bool)
00271 {
00272
00273 }
00274
00275 void
00276 CPrimaryClient::resetOptions()
00277 {
00278 m_screen->resetOptions();
00279 }
00280
00281 void
00282 CPrimaryClient::setOptions(const COptionsList& options)
00283 {
00284 m_screen->setOptions(options);
00285 }