Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
PrimaryClient Class Reference

Primary screen as pseudo-client. More...

#include <PrimaryClient.h>

Inheritance diagram for PrimaryClient:
Collaboration diagram for PrimaryClient:

Public Member Functions

 PrimaryClient (const std::string &name, deskflow::Screen *screen)
 ~PrimaryClient () override=default
manipulators
virtual void reconfigure (uint32_t activeSides)
 Update configuration.
virtual uint32_t registerHotKey (KeyID key, KeyModifierMask mask)
 Register a system hotkey.
virtual void unregisterHotKey (uint32_t id)
 Unregister a system hotkey.
void fakeInputBegin ()
 Prepare to synthesize input on primary screen.
void fakeInputEnd ()
 Done synthesizing input on primary screen.
Public Member Functions inherited from BaseClientProxy
 BaseClientProxy (const std::string &name)
 ~BaseClientProxy () override=default
void setJumpCursorPos (int32_t x, int32_t y)
 Save cursor position.
void getJumpCursorPos (int32_t &x, int32_t &y) const
 Get cursor position.
std::string getName () const override
 Get client name.
Public Member Functions inherited from IClient
Public Member Functions inherited from IScreen
Public Member Functions inherited from IInterface
virtual ~IInterface ()=default
 Interface destructor does nothing.

accessors

int32_t getJumpZoneSize () const
 Get jump zone size.
void getCursorCenter (int32_t &x, int32_t &y) const
 Get cursor center position.
virtual KeyModifierMask getToggleMask () const
 Get toggle key state.
bool isLockedToScreen () const
 Get screen lock state.
virtual void enable ()
virtual void disable ()
void * getEventTarget () const override
 Get event target.
bool getClipboard (ClipboardID id, IClipboard *) const override
 Get clipboard.
void getShape (int32_t &x, int32_t &y, int32_t &width, int32_t &height) const override
 Get screen shape.
void getCursorPos (int32_t &x, int32_t &y) const override
 Get cursor position.
void enter (int32_t xAbs, int32_t yAbs, uint32_t seqNum, KeyModifierMask mask, bool forScreensaver) override
 Enter screen.
bool leave () override
 Leave screen.
void setClipboard (ClipboardID, const IClipboard *) override
 Set clipboard.
void grabClipboard (ClipboardID) override
 Grab clipboard.
void setClipboardDirty (ClipboardID, bool) override
 Mark clipboard dirty.
void keyDown (KeyID, KeyModifierMask, KeyButton, const std::string &) override
 Notify of key press.
void keyRepeat (KeyID, KeyModifierMask, int32_t count, KeyButton, const std::string &) override
 Notify of key repeat.
void keyUp (KeyID, KeyModifierMask, KeyButton) override
 Notify of key release.
void mouseDown (ButtonID) override
 Notify of mouse press.
void mouseUp (ButtonID) override
 Notify of mouse release.
void mouseMove (int32_t xAbs, int32_t yAbs) override
 Notify of mouse motion.
void mouseRelativeMove (int32_t xRel, int32_t yRel) override
 Notify of mouse motion.
void mouseWheel (int32_t xDelta, int32_t yDelta) override
 Notify of mouse wheel motion.
void screensaver (bool activate) override
 Notify of screen saver change.
void resetOptions () override
 Notify of options changes.
void setOptions (const OptionsList &options) override
 Notify of options changes.
void sendDragInfo (uint32_t fileCount, const char *info, size_t size) override
void fileChunkSending (uint8_t mark, char *data, size_t dataSize) override
std::string getSecureInputApp () const override
void secureInputNotification (const std::string &app) const override
deskflow::IStreamgetStream () const override
bool isPrimary () const override
 Get cursor position.

Detailed Description

Primary screen as pseudo-client.

The primary screen does not have a client associated with it. This class provides a pseudo-client to allow the primary screen to be treated as if it was a client.

Constructor & Destructor Documentation

◆ PrimaryClient()

PrimaryClient::PrimaryClient ( const std::string & name,
deskflow::Screen * screen )

name is the name of the server and screen is primary screen.

◆ ~PrimaryClient()

PrimaryClient::~PrimaryClient ( )
overridedefault

Member Function Documentation

◆ disable()

void PrimaryClient::disable ( )
virtual

◆ enable()

void PrimaryClient::enable ( )
virtual

◆ enter()

void PrimaryClient::enter ( int32_t xAbs,
int32_t yAbs,
uint32_t seqNum,
KeyModifierMask mask,
bool forScreensaver )
overridevirtual

Enter screen.

Enter the screen. The cursor should be warped to xAbs,yAbs. mask is the expected toggle button state and the client should update its state to match. forScreensaver is true iff the screen is being entered because the screen saver is starting. Subsequent clipboard events should report seqNum.

Implements BaseClientProxy.

◆ fakeInputBegin()

void PrimaryClient::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() and fakeInputEnd() may be nested; only the outermost have an effect.

◆ fakeInputEnd()

void PrimaryClient::fakeInputEnd ( )

Done synthesizing input on primary screen.

Undoes whatever fakeInputBegin() did.

◆ fileChunkSending()

void PrimaryClient::fileChunkSending ( uint8_t mark,
char * data,
size_t dataSize )
overridevirtual

Implements BaseClientProxy.

◆ getClipboard()

bool PrimaryClient::getClipboard ( ClipboardID id,
IClipboard *  ) const
overridevirtual

Get clipboard.

Save the contents of the clipboard indicated by id and return true iff successful.

Implements BaseClientProxy.

◆ getCursorCenter()

void PrimaryClient::getCursorCenter ( int32_t & x,
int32_t & 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.

◆ getCursorPos()

void PrimaryClient::getCursorPos ( int32_t & x,
int32_t & y ) const
overridevirtual

Get cursor position.

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

Implements BaseClientProxy.

◆ getEventTarget()

void * PrimaryClient::getEventTarget ( ) const
overridevirtual

Get event target.

Returns the target used for events created by this object.

Implements BaseClientProxy.

◆ getJumpZoneSize()

int32_t PrimaryClient::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.

◆ getSecureInputApp()

std::string PrimaryClient::getSecureInputApp ( ) const
overridevirtual

Implements BaseClientProxy.

◆ getShape()

void PrimaryClient::getShape ( int32_t & x,
int32_t & y,
int32_t & width,
int32_t & height ) const
overridevirtual

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 BaseClientProxy.

◆ getStream()

deskflow::IStream * PrimaryClient::getStream ( ) const
inlineoverridevirtual

Implements BaseClientProxy.

◆ getToggleMask()

KeyModifierMask PrimaryClient::getToggleMask ( ) const
virtual

Get toggle key state.

Returns the primary screen's current toggle modifier key state.

◆ grabClipboard()

void PrimaryClient::grabClipboard ( ClipboardID )
overridevirtual

Grab clipboard.

Grab (i.e. take ownership of) the client's clipboard. Since this is called when another client takes ownership of the clipboard it implies that the client's clipboard is out of date.

Implements BaseClientProxy.

◆ isLockedToScreen()

bool PrimaryClient::isLockedToScreen ( ) const

Get screen lock state.

Returns true if the user is locked to the screen.

◆ isPrimary()

bool PrimaryClient::isPrimary ( ) const
inlineoverridevirtual

Get cursor position.

Return if this proxy is for client or primary.

Reimplemented from BaseClientProxy.

◆ keyDown()

void PrimaryClient::keyDown ( KeyID id,
KeyModifierMask ,
KeyButton ,
const std::string &  )
overridevirtual

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().

Implements BaseClientProxy.

◆ keyRepeat()

void PrimaryClient::keyRepeat ( KeyID id,
KeyModifierMask ,
int32_t count,
KeyButton ,
const std::string & lang )
overridevirtual

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.

Implements BaseClientProxy.

◆ keyUp()

void PrimaryClient::keyUp ( KeyID id,
KeyModifierMask ,
KeyButton  )
overridevirtual

Notify of key release.

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

Implements BaseClientProxy.

◆ leave()

bool PrimaryClient::leave ( )
overridevirtual

Leave screen.

Leave the screen. Return false iff the user may not leave the client's screen (because, for example, a button is down).

Implements BaseClientProxy.

◆ mouseDown()

void PrimaryClient::mouseDown ( ButtonID id)
overridevirtual

Notify of mouse press.

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

Implements BaseClientProxy.

◆ mouseMove()

void PrimaryClient::mouseMove ( int32_t xAbs,
int32_t yAbs )
overridevirtual

Notify of mouse motion.

Synthesize mouse events to generate mouse motion to the absolute screen position xAbs,yAbs.

Implements BaseClientProxy.

◆ mouseRelativeMove()

void PrimaryClient::mouseRelativeMove ( int32_t xRel,
int32_t yRel )
overridevirtual

Notify of mouse motion.

Synthesize mouse events to generate mouse motion by the relative amount xRel,yRel.

Implements BaseClientProxy.

◆ mouseUp()

void PrimaryClient::mouseUp ( ButtonID id)
overridevirtual

Notify of mouse release.

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

Implements BaseClientProxy.

◆ mouseWheel()

void PrimaryClient::mouseWheel ( int32_t xDelta,
int32_t yDelta )
overridevirtual

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.

Implements BaseClientProxy.

◆ reconfigure()

void PrimaryClient::reconfigure ( uint32_t activeSides)
virtual

Update configuration.

Handles reconfiguration of jump zones.

◆ registerHotKey()

uint32_t PrimaryClient::registerHotKey ( KeyID key,
KeyModifierMask mask )
virtual

Register a system hotkey.

Registers a system-wide hotkey for key key with modifiers mask. Returns an id used to unregister the hotkey.

◆ resetOptions()

void PrimaryClient::resetOptions ( )
overridevirtual

Notify of options changes.

Reset all options to their default values.

Implements BaseClientProxy.

◆ screensaver()

void PrimaryClient::screensaver ( bool activate)
overridevirtual

Notify of screen saver change.

Implements BaseClientProxy.

◆ secureInputNotification()

void PrimaryClient::secureInputNotification ( const std::string & app) const
overridevirtual

Implements BaseClientProxy.

◆ sendDragInfo()

void PrimaryClient::sendDragInfo ( uint32_t fileCount,
const char * info,
size_t size )
overridevirtual

Implements BaseClientProxy.

◆ setClipboard()

void PrimaryClient::setClipboard ( ClipboardID ,
const IClipboard *  )
overridevirtual

Set clipboard.

Update the client's clipboard. This implies that the client's clipboard is now up to date. If the client's clipboard was already known to be up to date then this may do nothing. data has marshalled clipboard data.

Implements BaseClientProxy.

◆ setClipboardDirty()

void PrimaryClient::setClipboardDirty ( ClipboardID ,
bool dirty )
overridevirtual

Mark clipboard dirty.

Mark the client's clipboard as dirty (out of date) or clean (up to date).

Implements BaseClientProxy.

◆ setOptions()

void PrimaryClient::setOptions ( const OptionsList & options)
overridevirtual

Notify of options changes.

Set options to given values. Ignore unknown options and don't modify our options that aren't given in options.

Implements BaseClientProxy.

◆ unregisterHotKey()

void PrimaryClient::unregisterHotKey ( uint32_t id)
virtual

Unregister a system hotkey.

Unregisters a previously registered hot key.


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