Platform independent screen. More...
#include <CScreen.h>
Inherits IScreen.
Public Member Functions | |
| CScreen (IPlatformScreen *platformScreen) | |
| virtual void * | getEventTarget () const |
| Get event target. | |
| virtual bool | getClipboard (ClipboardID id, IClipboard *) const |
| Get clipboard. | |
| virtual void | getShape (SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const |
| Get screen shape. | |
| virtual void | getCursorPos (SInt32 &x, SInt32 &y) const |
| Get cursor position. | |
manipulators | |
| void | enable () |
| Activate screen. | |
| void | disable () |
| Deactivate screen. | |
| void | enter (KeyModifierMask toggleMask) |
| Enter screen. | |
| bool | leave () |
| Leave screen. | |
| void | reconfigure (UInt32 activeSides) |
| Update configuration. | |
| void | warpCursor (SInt32 x, SInt32 y) |
| Warp cursor. | |
| void | setClipboard (ClipboardID, const IClipboard *) |
| Set clipboard. | |
| void | grabClipboard (ClipboardID) |
| Grab clipboard. | |
| void | screensaver (bool activate) |
| Activate/deactivate screen saver. | |
| void | keyDown (KeyID id, KeyModifierMask, KeyButton) |
| Notify of key press. | |
| void | keyRepeat (KeyID id, KeyModifierMask, SInt32 count, KeyButton) |
| Notify of key repeat. | |
| void | keyUp (KeyID id, KeyModifierMask, KeyButton) |
| Notify of key release. | |
| void | mouseDown (ButtonID id) |
| Notify of mouse press. | |
| void | mouseUp (ButtonID id) |
| Notify of mouse release. | |
| void | mouseMove (SInt32 xAbs, SInt32 yAbs) |
| Notify of mouse motion. | |
| void | mouseRelativeMove (SInt32 xRel, SInt32 yRel) |
| Notify of mouse motion. | |
| void | mouseWheel (SInt32 xDelta, SInt32 yDelta) |
| Notify of mouse wheel motion. | |
| virtual void | gameDeviceButtons (GameDeviceID id, GameDeviceButton buttons) |
| Notify of game device buttons changed. | |
| virtual void | gameDeviceSticks (GameDeviceID id, SInt16 x1, SInt16 y1, SInt16 x2, SInt16 y2) |
| Notify of game device sticks changed. | |
| virtual void | gameDeviceTriggers (GameDeviceID id, UInt8 t1, UInt8 t2) |
| Notify of game device trigger changes. | |
| virtual void | gameDeviceTimingReq () |
| Notify of game device timing request. | |
| virtual void | gameDeviceTimingResp (UInt16 freq) |
| Notify of game device timing response. | |
| virtual void | gameDeviceFeedback (GameDeviceID id, UInt16 m1, UInt16 m2) |
| Notify of game device feedback changes. | |
| void | resetOptions () |
| Notify of options changes. | |
| void | setOptions (const COptionsList &options) |
| Notify of options changes. | |
| void | setSequenceNumber (UInt32) |
| Set clipboard sequence number. | |
| UInt32 | registerHotKey (KeyID key, KeyModifierMask mask) |
| Register a system hotkey. | |
| void | unregisterHotKey (UInt32 id) |
| Unregister a system hotkey. | |
| void | fakeInputBegin () |
| Prepare to synthesize input on primary screen. | |
| void | fakeInputEnd () |
| Done synthesizing input on primary screen. | |
accessors | |
| bool | isOnScreen () const |
| Test if cursor on screen. | |
| bool | isLockedToScreen () const |
| Get screen lock state. | |
| SInt32 | getJumpZoneSize () const |
| Get jump zone size. | |
| void | getCursorCenter (SInt32 &x, SInt32 &y) const |
| Get cursor center position. | |
| KeyModifierMask | getActiveModifiers () const |
| Get the active modifiers. | |
| KeyModifierMask | pollActiveModifiers () const |
| Get the active modifiers from OS. | |
Protected Member Functions | |
| void | enablePrimary () |
| void | enableSecondary () |
| void | disablePrimary () |
| void | disableSecondary () |
| void | enterPrimary () |
| void | enterSecondary (KeyModifierMask toggleMask) |
| void | leavePrimary () |
| void | leaveSecondary () |
Platform independent screen.
This is a platform independent screen. It can work as either a primary or secondary screen.
Definition at line 37 of file CScreen.h.
| void CScreen::disable | ( | ) |
Deactivate screen.
Undoes the operations in activate() and events are no longer reported. It also releases keys that are logically pressed.
Definition at line 78 of file CScreen.cpp.
References IPlatformScreen::disable(), enter(), and leave().
| void CScreen::enable | ( | ) |
Activate screen.
Activate the screen, preparing it to report system and user events. For a secondary screen it also means disabling the screen saver if synchronizing it and preparing to synthesize events.
Definition at line 59 of file CScreen.cpp.
References IPlatformScreen::enable(), IPlatformScreen::updateKeyMap(), and IPlatformScreen::updateKeyState().
Referenced by CClient::handshakeComplete().
| void CScreen::enter | ( | KeyModifierMask | toggleMask | ) |
Enter screen.
Called when the user navigates to this screen. toggleMask has the toggle keys that should be turned on on the secondary screen.
Definition at line 101 of file CScreen.cpp.
References IPlatformScreen::enter().
Referenced by disable(), and CPrimaryClient::enter().
| void CScreen::fakeInputBegin | ( | ) |
Prepare to synthesize input on primary screen.
Prepares the primary screen to receive synthesized input. We do not want to receive this synthesized input as user input so this method ensures that we ignore it. Calls to fakeInputBegin() may not be nested.
Definition at line 369 of file CScreen.cpp.
Referenced by CPrimaryClient::fakeInputBegin().
| void CScreen::fakeInputEnd | ( | ) |
Done synthesizing input on primary screen.
Undoes whatever fakeInputBegin() did.
Definition at line 378 of file CScreen.cpp.
Referenced by CPrimaryClient::fakeInputEnd().
| void CScreen::gameDeviceButtons | ( | GameDeviceID | id, | |
| GameDeviceButton | buttons | |||
| ) | [virtual] |
Notify of game device buttons changed.
Synthesize game device button states.
Definition at line 248 of file CScreen.cpp.
| void CScreen::gameDeviceFeedback | ( | GameDeviceID | id, | |
| UInt16 | m1, | |||
| UInt16 | m2 | |||
| ) | [virtual] |
Notify of game device feedback changes.
Sets the game device state with new feedback values.
Definition at line 531 of file CScreen.cpp.
Referenced by CServer::gameDeviceFeedback().
| void CScreen::gameDeviceSticks | ( | GameDeviceID | id, | |
| SInt16 | x1, | |||
| SInt16 | y1, | |||
| SInt16 | x2, | |||
| SInt16 | y2 | |||
| ) | [virtual] |
Notify of game device sticks changed.
Synthesize game device stick states.
Definition at line 255 of file CScreen.cpp.
| void CScreen::gameDeviceTimingReq | ( | ) | [virtual] |
Notify of game device timing request.
Causes a game device timing response when state is next faked.
Definition at line 269 of file CScreen.cpp.
| void CScreen::gameDeviceTimingResp | ( | UInt16 | freq | ) | [virtual] |
Notify of game device timing response.
Handles a game device timing response coming back from the client.
Definition at line 525 of file CScreen.cpp.
Referenced by CServer::gameDeviceTimingResp().
| void CScreen::gameDeviceTriggers | ( | GameDeviceID | id, | |
| UInt8 | t1, | |||
| UInt8 | t2 | |||
| ) | [virtual] |
Notify of game device trigger changes.
Synthesize game device trigger states.
Definition at line 262 of file CScreen.cpp.
| KeyModifierMask CScreen::getActiveModifiers | ( | ) | const |
Get the active modifiers.
Returns the modifiers that are currently active according to our shadowed state.
Definition at line 423 of file CScreen.cpp.
References IPlatformScreen::getActiveModifiers().
| bool CScreen::getClipboard | ( | ClipboardID | id, | |
| IClipboard * | ||||
| ) | const [virtual] |
Get clipboard.
Save the contents of the clipboard indicated by id and return true iff successful.
Implements IScreen.
Definition at line 441 of file CScreen.cpp.
Referenced by CPrimaryClient::getClipboard().
| void CScreen::getCursorCenter | ( | SInt32 & | x, | |
| SInt32 & | y | |||
| ) | const |
Get cursor center position.
Return the cursor center position which is where we park the cursor to compute cursor motion deltas and should be far from the edges of the screen, typically the center.
Definition at line 417 of file CScreen.cpp.
Referenced by CPrimaryClient::getCursorCenter().
| void CScreen::getCursorPos | ( | SInt32 & | x, | |
| SInt32 & | y | |||
| ) | const [virtual] |
Get cursor position.
Return the current position of the cursor in x and y.
Implements IScreen.
Definition at line 453 of file CScreen.cpp.
Referenced by CPrimaryClient::getCursorPos().
| void * CScreen::getEventTarget | ( | ) | const [virtual] |
Get event target.
Returns the target used for events created by this object.
Implements IScreen.
Definition at line 435 of file CScreen.cpp.
Referenced by CPrimaryClient::getEventTarget().
| SInt32 CScreen::getJumpZoneSize | ( | ) | const |
Get jump zone size.
Return the jump zone size, the size of the regions on the edges of the screen that cause the cursor to jump to another screen.
Definition at line 406 of file CScreen.cpp.
Referenced by CPrimaryClient::getJumpZoneSize().
| void CScreen::getShape | ( | SInt32 & | x, | |
| SInt32 & | y, | |||
| SInt32 & | width, | |||
| SInt32 & | height | |||
| ) | const [virtual] |
Get screen shape.
Return the position of the upper-left corner of the screen in x and y and the size of the screen in width and height.
Implements IScreen.
Definition at line 447 of file CScreen.cpp.
Referenced by CPrimaryClient::getShape().
| void CScreen::grabClipboard | ( | ClipboardID | id | ) |
Grab clipboard.
Grabs (i.e. take ownership of) the system clipboard.
Definition at line 164 of file CScreen.cpp.
References IPlatformScreen::setClipboard().
Referenced by CPrimaryClient::grabClipboard().
| bool CScreen::isLockedToScreen | ( | ) | const |
Get screen lock state.
Returns true if there's any reason that the user should not be allowed to leave the screen (usually because a button or key is pressed). If this method returns true it logs a message as to why at the CLOG_DEBUG level.
Definition at line 393 of file CScreen.cpp.
Referenced by CPrimaryClient::isLockedToScreen().
| bool CScreen::isOnScreen | ( | ) | const |
Test if cursor on screen.
Returns true iff the cursor is on the screen.
Definition at line 387 of file CScreen.cpp.
| void CScreen::keyDown | ( | KeyID | id, | |
| KeyModifierMask | mask, | |||
| KeyButton | button | |||
| ) |
Notify of key press.
Synthesize key events to generate a press of key id. If possible match the given modifier mask. The KeyButton identifies the physical key on the server that generated this key down. The client must ensure that a key up or key repeat that uses the same KeyButton will synthesize an up or repeat for the same client key synthesized by keyDown().
Definition at line 181 of file CScreen.cpp.
References IPlatformScreen::fakeCtrlAltDel(), and IPlatformScreen::fakeKeyDown().
| void CScreen::keyRepeat | ( | KeyID | id, | |
| KeyModifierMask | mask, | |||
| SInt32 | count, | |||
| KeyButton | button | |||
| ) |
Notify of key repeat.
Synthesize key events to generate a press and release of key id count times. If possible match the given modifier mask.
Definition at line 198 of file CScreen.cpp.
References IPlatformScreen::fakeKeyRepeat().
| void CScreen::keyUp | ( | KeyID | id, | |
| KeyModifierMask | , | |||
| KeyButton | button | |||
| ) |
Notify of key release.
Synthesize key events to generate a release of key id. If possible match the given modifier mask.
Definition at line 206 of file CScreen.cpp.
References IPlatformScreen::fakeKeyUp().
| bool CScreen::leave | ( | ) |
Leave screen.
Called when the user navigates off this screen.
Definition at line 119 of file CScreen.cpp.
References IPlatformScreen::checkClipboards(), and IPlatformScreen::leave().
Referenced by disable(), and CPrimaryClient::leave().
| void CScreen::mouseDown | ( | ButtonID | id | ) |
Notify of mouse press.
Synthesize mouse events to generate a press of mouse button id.
Definition at line 213 of file CScreen.cpp.
| void CScreen::mouseMove | ( | SInt32 | xAbs, | |
| SInt32 | yAbs | |||
| ) |
Notify of mouse motion.
Synthesize mouse events to generate mouse motion to the absolute screen position xAbs,yAbs.
Definition at line 227 of file CScreen.cpp.
| void CScreen::mouseRelativeMove | ( | SInt32 | xRel, | |
| SInt32 | yRel | |||
| ) |
Notify of mouse motion.
Synthesize mouse events to generate mouse motion by the relative amount xRel,yRel.
Definition at line 234 of file CScreen.cpp.
| void CScreen::mouseUp | ( | ButtonID | id | ) |
Notify of mouse release.
Synthesize mouse events to generate a release of mouse button id.
Definition at line 220 of file CScreen.cpp.
| void CScreen::mouseWheel | ( | SInt32 | xDelta, | |
| SInt32 | yDelta | |||
| ) |
Notify of mouse wheel motion.
Synthesize mouse events to generate mouse wheel motion of xDelta and yDelta. Deltas are positive for motion away from the user or to the right and negative for motion towards the user or to the left. Each wheel click should generate a delta of +/-120.
Definition at line 241 of file CScreen.cpp.
| KeyModifierMask CScreen::pollActiveModifiers | ( | ) | const |
Get the active modifiers from OS.
Returns the modifiers that are currently active according to the operating system.
Definition at line 429 of file CScreen.cpp.
References IPlatformScreen::pollActiveModifiers().
Referenced by CPrimaryClient::getToggleMask().
| void CScreen::reconfigure | ( | UInt32 | activeSides | ) |
Update configuration.
This is called when the configuration has changed. activeSides is a bitmask of EDirectionMask indicating which sides of the primary screen are linked to clients.
Definition at line 144 of file CScreen.cpp.
Referenced by CPrimaryClient::reconfigure().
| UInt32 CScreen::registerHotKey | ( | KeyID | key, | |
| KeyModifierMask | mask | |||
| ) |
Register a system hotkey.
Registers a system-wide hotkey for key key with modifiers mask. Returns an id used to unregister the hotkey.
Definition at line 357 of file CScreen.cpp.
Referenced by CPrimaryClient::registerHotKey().
| void CScreen::resetOptions | ( | ) |
Notify of options changes.
Resets all options to their default values.
Definition at line 276 of file CScreen.cpp.
References IPlatformScreen::openScreensaver(), and IPlatformScreen::resetOptions().
Referenced by CPrimaryClient::resetOptions().
| void CScreen::screensaver | ( | bool | activate | ) |
Activate/deactivate screen saver.
Forcibly activates the screen saver if activate is true otherwise forcibly deactivates it.
Definition at line 170 of file CScreen.cpp.
References IPlatformScreen::screensaver().
| void CScreen::setClipboard | ( | ClipboardID | id, | |
| const IClipboard * | clipboard | |||
| ) |
Set clipboard.
Sets the system's clipboard contents. This is usually called soon after an enter().
Definition at line 158 of file CScreen.cpp.
References IPlatformScreen::setClipboard().
Referenced by CPrimaryClient::setClipboard().
| void CScreen::setOptions | ( | const COptionsList & | options | ) |
Notify of options changes.
Set options to given values. Ignores unknown options and doesn't modify options that aren't given in options.
Definition at line 295 of file CScreen.cpp.
References IPlatformScreen::closeScreensaver(), IPlatformScreen::openScreensaver(), IPlatformScreen::setHalfDuplexMask(), and IPlatformScreen::setOptions().
Referenced by CPrimaryClient::setOptions().
| void CScreen::setSequenceNumber | ( | UInt32 | seqNum | ) |
Set clipboard sequence number.
Sets the sequence number to use in subsequent clipboard events.
Definition at line 351 of file CScreen.cpp.
References IPlatformScreen::setSequenceNumber().
Referenced by CPrimaryClient::enter().
| void CScreen::unregisterHotKey | ( | UInt32 | id | ) |
Unregister a system hotkey.
Unregisters a previously registered hot key.
Definition at line 363 of file CScreen.cpp.
Referenced by CPrimaryClient::unregisterHotKey().
| void CScreen::warpCursor | ( | SInt32 | x, | |
| SInt32 | y | |||
| ) |
Warp cursor.
Warps the cursor to the absolute coordinates x,y. Also discards input events up to and including the warp before returning.
Definition at line 151 of file CScreen.cpp.
Referenced by CPrimaryClient::enter(), and CPrimaryClient::mouseMove().
1.7.1