CScreen Class Reference

Platform independent screen. More...

#include <CScreen.h>

Inherits IScreen.

Inheritance diagram for CScreen:

Inheritance graph
[legend]
Collaboration diagram for CScreen:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CScreen (IPlatformScreen *platformScreen)
virtual ~CScreen ()
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.
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 ()

Detailed Description

Platform independent screen.

This is a platform independent screen. It can work as either a primary or secondary screen.

Definition at line 32 of file CScreen.h.


Member Function Documentation

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 72 of file CScreen.cpp.

References IPlatformScreen::disable(), disablePrimary(), disableSecondary(), enter(), and leave().

Referenced by CPrimaryClient::disable(), and ~CScreen().

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 53 of file CScreen.cpp.

References IPlatformScreen::enable(), enablePrimary(), enableSecondary(), IPlatformScreen::updateKeyMap(), and IPlatformScreen::updateKeyState().

Referenced by CPrimaryClient::enable(), and 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 95 of file CScreen.cpp.

References IPlatformScreen::enter(), enterPrimary(), and enterSecondary().

Referenced by disable(), CPrimaryClient::enter(), and CClient::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 335 of file CScreen.cpp.

References IPlatformScreen::fakeInputBegin().

Referenced by CPrimaryClient::fakeInputBegin().

void CScreen::fakeInputEnd (  ) 

Done synthesizing input on primary screen.

Undoes whatever fakeInputBegin() did.

Definition at line 344 of file CScreen.cpp.

References IPlatformScreen::fakeInputEnd().

Referenced by CPrimaryClient::fakeInputEnd().

KeyModifierMask CScreen::getActiveModifiers (  )  const

Get the active modifiers.

Returns the modifiers that are currently active according to our shadowed state.

Definition at line 389 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 407 of file CScreen.cpp.

References IPlatformScreen::getClipboard().

Referenced by CPrimaryClient::getClipboard(), and CClient::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 383 of file CScreen.cpp.

References IPlatformScreen::getCursorCenter().

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 419 of file CScreen.cpp.

References IPlatformScreen::getCursorPos().

Referenced by CPrimaryClient::getCursorPos(), and CClient::getCursorPos().

void * CScreen::getEventTarget (  )  const [virtual]

Get event target.

Returns the target used for events created by this object.

Implements IScreen.

Definition at line 401 of file CScreen.cpp.

Referenced by enablePrimary(), CPrimaryClient::getEventTarget(), and CClient::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 372 of file CScreen.cpp.

References IPlatformScreen::getJumpZoneSize().

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 413 of file CScreen.cpp.

References IPlatformScreen::getShape().

Referenced by CPrimaryClient::getShape(), and CClient::getShape().

void CScreen::grabClipboard ( ClipboardID   ) 

Grab clipboard.

Grabs (i.e. take ownership of) the system clipboard.

Definition at line 158 of file CScreen.cpp.

References IPlatformScreen::setClipboard().

Referenced by enableSecondary(), CPrimaryClient::grabClipboard(), and CClient::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 359 of file CScreen.cpp.

References IPlatformScreen::isAnyMouseButtonDown().

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 353 of file CScreen.cpp.

void CScreen::keyDown ( KeyID  id,
KeyModifierMask  ,
KeyButton   
)

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 175 of file CScreen.cpp.

References IPlatformScreen::fakeCtrlAltDel(), and IPlatformScreen::fakeKeyDown().

Referenced by CClient::keyDown().

void CScreen::keyRepeat ( KeyID  id,
KeyModifierMask  ,
SInt32  count,
KeyButton   
)

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 192 of file CScreen.cpp.

References IPlatformScreen::fakeKeyRepeat().

Referenced by CClient::keyRepeat().

void CScreen::keyUp ( KeyID  id,
KeyModifierMask  ,
KeyButton   
)

Notify of key release.

Synthesize key events to generate a release of key id. If possible match the given modifier mask.

Definition at line 200 of file CScreen.cpp.

References IPlatformScreen::fakeKeyUp().

Referenced by CClient::keyUp().

bool CScreen::leave (  ) 

Leave screen.

Called when the user navigates off this screen.

Definition at line 113 of file CScreen.cpp.

References IPlatformScreen::checkClipboards(), IPlatformScreen::leave(), leavePrimary(), and leaveSecondary().

Referenced by disable(), CPrimaryClient::leave(), and CClient::leave().

void CScreen::mouseDown ( ButtonID  id  ) 

Notify of mouse press.

Synthesize mouse events to generate a press of mouse button id.

Definition at line 207 of file CScreen.cpp.

References IPlatformScreen::fakeMouseButton().

Referenced by CClient::mouseDown().

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 221 of file CScreen.cpp.

References IPlatformScreen::fakeMouseMove().

Referenced by CClient::enter(), and CClient::mouseMove().

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 228 of file CScreen.cpp.

References IPlatformScreen::fakeMouseRelativeMove().

Referenced by CClient::mouseRelativeMove().

void CScreen::mouseUp ( ButtonID  id  ) 

Notify of mouse release.

Synthesize mouse events to generate a release of mouse button id.

Definition at line 214 of file CScreen.cpp.

References IPlatformScreen::fakeMouseButton().

Referenced by CClient::mouseUp().

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 235 of file CScreen.cpp.

References IPlatformScreen::fakeMouseWheel().

Referenced by CClient::mouseWheel().

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 395 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 138 of file CScreen.cpp.

References IPlatformScreen::reconfigure().

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 323 of file CScreen.cpp.

References IPlatformScreen::registerHotKey().

Referenced by CPrimaryClient::registerHotKey().

void CScreen::resetOptions (  ) 

Notify of options changes.

Resets all options to their default values.

Definition at line 242 of file CScreen.cpp.

References IPlatformScreen::openScreensaver(), and IPlatformScreen::resetOptions().

Referenced by CScreen(), CPrimaryClient::resetOptions(), and CClient::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 164 of file CScreen.cpp.

References IPlatformScreen::screensaver().

Referenced by CClient::screensaver().

void CScreen::setClipboard ( ClipboardID  ,
const IClipboard  
)

Set clipboard.

Sets the system's clipboard contents. This is usually called soon after an enter().

Definition at line 152 of file CScreen.cpp.

References IPlatformScreen::setClipboard().

Referenced by CPrimaryClient::setClipboard(), and CClient::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 261 of file CScreen.cpp.

References IPlatformScreen::closeScreensaver(), IPlatformScreen::openScreensaver(), IPlatformScreen::setHalfDuplexMask(), and IPlatformScreen::setOptions().

Referenced by CPrimaryClient::setOptions(), and CClient::setOptions().

void CScreen::setSequenceNumber ( UInt32   ) 

Set clipboard sequence number.

Sets the sequence number to use in subsequent clipboard events.

Definition at line 317 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 329 of file CScreen.cpp.

References IPlatformScreen::unregisterHotKey().

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 145 of file CScreen.cpp.

References IPlatformScreen::warpCursor().

Referenced by CPrimaryClient::enter(), and CPrimaryClient::mouseMove().


The documentation for this class was generated from the following files:
Generated on Fri Nov 6 00:19:10 2009 for synergy-plus by  doxygen 1.4.7