Classes | Public Member Functions

CMSWindowsDesks Class Reference

Microsoft Windows desk handling. More...

#include <CMSWindowsDesks.h>

List of all members.

Classes

class  CDesk

Public Member Functions

 CMSWindowsDesks (bool isPrimary, bool noHooks, HINSTANCE hookLibrary, const IScreenSaver *screensaver, IEventQueue &eventQueue, IJob *updateKeys, bool stopOnDeskSwitch)
 Constructor.
manipulators

void enable ()
 Enable desk tracking.
void disable ()
 Disable desk tracking.
void enter ()
 Notify of entering a desk.
void leave (HKL keyLayout)
 Notify of leaving a desk.
void resetOptions ()
 Notify of options changes.
void setOptions (const COptionsList &options)
 Notify of options changes.
void updateKeys ()
 Update the key state.
void setShape (SInt32 x, SInt32 y, SInt32 width, SInt32 height, SInt32 xCenter, SInt32 yCenter, bool isMultimon)
 Tell desk about new size.
void installScreensaverHooks (bool install)
 Install/uninstall screensaver hooks.
void fakeInputBegin ()
 Start ignoring user input.
void fakeInputEnd ()
 Stop ignoring user input.
accessors

void getCursorPos (SInt32 &x, SInt32 &y) const
 Get cursor position.
void fakeKeyEvent (KeyButton button, UINT virtualKey, bool press, bool isAutoRepeat) const
 Fake key press/release.
void fakeMouseButton (ButtonID id, bool press)
 Fake mouse press/release.
void fakeMouseMove (SInt32 x, SInt32 y) const
 Fake mouse move.
void fakeMouseRelativeMove (SInt32 dx, SInt32 dy) const
 Fake mouse move.
void fakeMouseWheel (SInt32 xDelta, SInt32 yDelta) const
 Fake mouse wheel.

Detailed Description

Microsoft Windows desk handling.

Desks in Microsoft Windows are only remotely like desktops on X11 systems. A desk is another virtual surface for windows but desks impose serious restrictions: a thread can interact with only one desk at a time, you can't switch desks if the thread has any hooks installed or owns any windows, windows cannot exist on multiple desks at once, etc. Basically, they're useless except for running the login window or the screensaver, which is what they're used for. Synergy must deal with them mainly because of the login window and screensaver but users can create their own desks and synergy should work on those too.

This class encapsulates all the desk nastiness. Clients of this object don't have to know anything about desks.

Definition at line 56 of file CMSWindowsDesks.h.


Constructor & Destructor Documentation

CMSWindowsDesks::CMSWindowsDesks ( bool  isPrimary,
bool  noHooks,
HINSTANCE  hookLibrary,
const IScreenSaver screensaver,
IEventQueue eventQueue,
IJob updateKeys,
bool  stopOnDeskSwitch 
)

Constructor.

isPrimary is true iff the desk is for a primary screen. screensaver points to a screensaver object and it's used only to check if the screensaver is active. The updateKeys job is adopted and is called when the key state should be updated in a thread attached to the current desk. hookLibrary must be a handle to the hook library.

Definition at line 93 of file CMSWindowsDesks.cpp.

References resetOptions().


Member Function Documentation

void CMSWindowsDesks::disable (  ) 

Disable desk tracking.

Disables desk tracking.

See also:
enable.

Definition at line 155 of file CMSWindowsDesks.cpp.

References IEventQueue::deleteTimer(), CEvent::kTimer, and IEventQueue::removeHandler().

Referenced by CMSWindowsScreen::disable().

void CMSWindowsDesks::enable (  ) 

Enable desk tracking.

Enables desk tracking. While enabled, this object checks to see if the desk has changed and ensures that the hooks are installed on the new desk. setShape should be called at least once before calling enable.

Definition at line 135 of file CMSWindowsDesks.cpp.

References IEventQueue::adoptHandler(), CEvent::kTimer, IEventQueue::newTimer(), and updateKeys().

Referenced by CMSWindowsScreen::enable().

void CMSWindowsDesks::enter (  ) 

Notify of entering a desk.

Prepares a desk for when the cursor enters it.

Definition at line 171 of file CMSWindowsDesks.cpp.

Referenced by CMSWindowsScreen::enter().

void CMSWindowsDesks::fakeInputBegin (  ) 

Start ignoring user input.

Starts ignoring user input so we don't pick up our own synthesized events.

Definition at line 229 of file CMSWindowsDesks.cpp.

void CMSWindowsDesks::fakeInputEnd (  ) 

Stop ignoring user input.

Undoes whatever fakeInputBegin() did.

Definition at line 235 of file CMSWindowsDesks.cpp.

void CMSWindowsDesks::fakeKeyEvent ( KeyButton  button,
UINT  virtualKey,
bool  press,
bool  isAutoRepeat 
) const

Fake key press/release.

Synthesize a press or release of key button.

Definition at line 250 of file CMSWindowsDesks.cpp.

Referenced by CMSWindowsKeyState::fakeKey().

void CMSWindowsDesks::fakeMouseButton ( ButtonID  id,
bool  press 
)

Fake mouse press/release.

Synthesize a press or release of mouse button id.

Definition at line 288 of file CMSWindowsDesks.cpp.

void CMSWindowsDesks::fakeMouseMove ( SInt32  x,
SInt32  y 
) const

Fake mouse move.

Synthesize a mouse move to the absolute coordinates x,y.

Definition at line 341 of file CMSWindowsDesks.cpp.

void CMSWindowsDesks::fakeMouseRelativeMove ( SInt32  dx,
SInt32  dy 
) const

Fake mouse move.

Synthesize a mouse move to the relative coordinates dx,dy.

Definition at line 349 of file CMSWindowsDesks.cpp.

void CMSWindowsDesks::fakeMouseWheel ( SInt32  xDelta,
SInt32  yDelta 
) const

Fake mouse wheel.

Synthesize a mouse wheel event of amount delta in direction axis.

Definition at line 357 of file CMSWindowsDesks.cpp.

void CMSWindowsDesks::getCursorPos ( SInt32 &  x,
SInt32 &  y 
) const

Get cursor position.

Return the current position of the cursor in x and y.

Definition at line 241 of file CMSWindowsDesks.cpp.

void CMSWindowsDesks::installScreensaverHooks ( bool  install  ) 

Install/uninstall screensaver hooks.

If install is true then the screensaver hooks are installed and, if desk tracking is enabled, updated whenever the desk changes. If install is false then the screensaver hooks are uninstalled.

Definition at line 220 of file CMSWindowsDesks.cpp.

Referenced by CMSWindowsScreen::closeScreensaver(), and CMSWindowsScreen::openScreensaver().

void CMSWindowsDesks::leave ( HKL  keyLayout  ) 

Notify of leaving a desk.

Prepares a desk for when the cursor leaves it.

Definition at line 177 of file CMSWindowsDesks.cpp.

Referenced by CMSWindowsScreen::leave().

void CMSWindowsDesks::resetOptions (  ) 

Notify of options changes.

Resets all options to their default values.

Definition at line 183 of file CMSWindowsDesks.cpp.

Referenced by CMSWindowsDesks(), and CMSWindowsScreen::resetOptions().

void CMSWindowsDesks::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 189 of file CMSWindowsDesks.cpp.

Referenced by CMSWindowsScreen::setOptions().

void CMSWindowsDesks::setShape ( SInt32  x,
SInt32  y,
SInt32  width,
SInt32  height,
SInt32  xCenter,
SInt32  yCenter,
bool  isMultimon 
)

Tell desk about new size.

This tells the desks that the display size has changed.

Definition at line 206 of file CMSWindowsDesks.cpp.

void CMSWindowsDesks::updateKeys (  ) 

Update the key state.

Causes the key state to get updated to reflect the physical keyboard state and current keyboard mapping.

Definition at line 200 of file CMSWindowsDesks.cpp.

Referenced by enable().


The documentation for this class was generated from the following files: