164 m_clientListener = p;
187 void getClients(std::vector<std::string> &list)
const;
196 uint32_t getActivePrimarySides()
const;
201 bool isLockedToScreenServer()
const;
205 bool isLockedToScreen()
const;
250 void noSwitch(int32_t
x, int32_t
y);
256 void startSwitchTwoTap();
259 void armSwitchTwoTap(int32_t
x, int32_t
y);
262 void stopSwitchTwoTap();
265 bool isSwitchTwoTapStarted()
const;
268 bool shouldSwitchTwoTap()
const;
271 void startSwitchWait(int32_t
x, int32_t
y);
274 void stopSwitchWait();
277 bool isSwitchWaitStarted()
const;
281 uint32_t getCorner(
const BaseClientProxy *, int32_t
x, int32_t
y, int32_t size)
const;
284 void stopRelativeMoves();
290 void processOptions();
296 void handleKeyDownEvent(
const Event &event);
297 void handleKeyUpEvent(
const Event &event);
298 void handleKeyRepeatEvent(
const Event &event);
299 void handleButtonDownEvent(
const Event &event);
300 void handleButtonUpEvent(
const Event &event);
301 void handleMotionPrimaryEvent(
const Event &event);
302 void handleMotionSecondaryEvent(
const Event &event);
303 void handleWheelEvent(
const Event &event);
304 void handleSwitchWaitTimeout();
307 void handleSwitchToScreenEvent(
const Event &event);
308 void handleSwitchInDirectionEvent(
const Event &event);
309 void handleKeyboardBroadcastEvent(
const Event &event);
310 void handleLockCursorToScreenEvent(
const Event &event);
314 void onScreensaver(
bool activated);
320 bool onMouseMovePrimary(int32_t
x, int32_t
y);
321 void onMouseMoveSecondary(int32_t dx, int32_t dy);
322 void onMouseWheel(int32_t xDelta, int32_t yDelta);
338 void closeAllClients();
351 ClipboardInfo() =
default;
355 std::string m_clipboardData;
356 std::string m_clipboardOwner;
357 uint32_t m_clipboardSeqNum = 0;
364 PrimaryClient *m_primaryClient;
367 using ClientList = std::map<std::string, BaseClientProxy *>;
368 using ClientSet = std::set<BaseClientProxy *>;
369 ClientList m_clients;
370 ClientSet m_clientSet;
373 using OldClients = std::map<BaseClientProxy *, EventQueueTimer *>;
374 OldClients m_oldClients;
377 BaseClientProxy *m_active;
380 uint32_t m_seqNum = 0;
391 int32_t m_xDelta = 0;
392 int32_t m_yDelta = 0;
393 int32_t m_xDelta2 = 0;
394 int32_t m_yDelta2 = 0;
397 ServerConfig *m_config;
400 InputFilter *m_inputFilter;
406 BaseClientProxy *m_activeSaver =
nullptr;
413 BaseClientProxy *m_switchScreen =
nullptr;
416 double m_switchWaitDelay = 0.0;
417 EventQueueTimer *m_switchWaitTimer =
nullptr;
418 int32_t m_switchWaitX;
419 int32_t m_switchWaitY;
422 double m_switchTwoTapDelay = 0.0;
423 Stopwatch m_switchTwoTapTimer;
424 bool m_switchTwoTapEngaged =
false;
425 bool m_switchTwoTapArmed =
false;
426 int32_t m_switchTwoTapZone = 3;
429 bool m_switchNeedsShift =
false;
430 bool m_switchNeedsControl =
false;
431 bool m_switchNeedsAlt =
false;
434 bool m_relativeMoves =
false;
438 bool m_keyboardBroadcasting =
false;
439 std::string m_keyboardBroadcastingScreens;
442 bool m_lockedToScreen =
false;
445 deskflow::Screen *m_screen;
447 IEventQueue *m_events;
449 bool m_disableLockToScreen =
false;
450 bool m_enableClipboard =
true;
451 size_t m_maximumClipboardSize = INT_MAX;
453 ClientListener *m_clientListener;
454 deskflow::ServerArgs m_args;
static const ClipboardID kClipboardEnd
Definition ClipboardTypes.h:30
uint8_t ClipboardID
Clipboard ID.
Definition ClipboardTypes.h:16
Direction
Screen edge directions for mouse movement.
Definition DirectionTypes.h:21
@ NoDirection
No specific direction.
Definition DirectionTypes.h:22
@ Server
Definition FingerprintDialog.h:18
uint32_t KeyID
Key ID.
Definition KeyTypes.h:22
uint16_t KeyButton
Key Code.
Definition KeyTypes.h:35
uint32_t KeyModifierMask
Modifier key mask.
Definition KeyTypes.h:45
uint8_t ButtonID
Mouse button ID.
Definition MouseTypes.h:16
ENetworkProtocol
Definition OptionTypes.h:95
int y
Definition ServerConfig.cpp:27
int x
Definition ServerConfig.cpp:26
Generic proxy for client or primary.
Definition BaseClientProxy.h:18
Definition ClientListener.h:30
Memory buffer clipboard.
Definition Clipboard.h:17
Definition SimpleEventQueueBuffer.cpp:13
Event.
Definition Event.h:27
Event queue interface.
Definition IEventQueue.h:32
Primary screen as pseudo-client.
Definition PrimaryClient.h:24
Definition ServerConfig.h:41
Keyboard broadcast data.
Definition Server.h:101
State m_state
Definition Server.h:114
static KeyboardBroadcastInfo * alloc(State state=kToggle)
Definition Server.cpp:2068
char m_screens[1]
Definition Server.h:115
State
Definition Server.h:104
@ kOff
Definition Server.h:105
@ kOn
Definition Server.h:106
@ kToggle
Definition Server.h:107
Lock cursor to screen data.
Definition Server.h:50
State
Definition Server.h:53
@ kOn
Definition Server.h:55
@ kToggle
Definition Server.h:56
@ kOff
Definition Server.h:54
static LockCursorToScreenInfo * alloc(State state=kToggle)
Definition Server.cpp:2035
State m_state
Definition Server.h:62
std::string m_screen
Definition Server.h:96
ScreenConnectedInfo(std::string screen)
Definition Server.h:90
Switch in direction data.
Definition Server.h:78
Direction m_direction
Definition Server.h:83
static SwitchInDirectionInfo * alloc(Direction direction)
Definition Server.cpp:2057
Switch to screen data.
Definition Server.h:67
char m_screen[1]
Definition Server.h:73
static SwitchToScreenInfo * alloc(const std::string &screen)
Definition Server.cpp:2046
Server & operator=(Server const &)=delete
Server(ServerConfig &config, PrimaryClient *primaryClient, deskflow::Screen *screen, IEventQueue *events, deskflow::ServerArgs const &args)
Definition Server.cpp:46
Server & operator=(Server &&)=delete
void adoptClient(BaseClientProxy *client)
Add a client.
Definition Server.cpp:227
std::string protocolString() const
Get the network protocol.
Definition Server.cpp:276
bool setConfig(const ServerConfig &)
Set configuration.
Definition Server.cpp:187
void getClients(std::vector< std::string > &list) const
Get the list of connected clients.
Definition Server.cpp:292
void setListener(ClientListener *p)
Store ClientListener pointer.
Definition Server.h:162
uint32_t getNumClients() const
Get number of connected clients.
Definition Server.cpp:287
Server(Server const &)=delete
void disconnect()
Disconnect clients.
Definition Server.cpp:265
~Server() override
Definition Server.cpp:145
Thread handle.
Definition Thread.h:33
Platform independent screen.
Definition Screen.h:30
Definition ServerArgs.h:17
Server configuration.
Definition Config.h:53
Definition EventTypes.h:11