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