176 m_clientListener = p;
199 void getClients(std::vector<std::string> &list)
const;
208 uint32_t getActivePrimarySides()
const;
213 bool isLockedToScreenServer()
const;
217 bool isLockedToScreen()
const;
262 void noSwitch(int32_t
x, int32_t
y);
268 void startSwitchTwoTap();
271 void armSwitchTwoTap(int32_t
x, int32_t
y);
274 void stopSwitchTwoTap();
277 bool isSwitchTwoTapStarted()
const;
280 bool shouldSwitchTwoTap()
const;
283 void startSwitchWait(int32_t
x, int32_t
y);
286 void stopSwitchWait();
289 bool isSwitchWaitStarted()
const;
293 uint32_t getCorner(
const BaseClientProxy *, int32_t
x, int32_t
y, int32_t size)
const;
296 void stopRelativeMoves();
302 void processOptions();
308 void handleKeyDownEvent(
const Event &event);
309 void handleKeyUpEvent(
const Event &event);
310 void handleKeyRepeatEvent(
const Event &event);
311 void handleButtonDownEvent(
const Event &event);
312 void handleButtonUpEvent(
const Event &event);
313 void handleMotionPrimaryEvent(
const Event &event);
314 void handleMotionSecondaryEvent(
const Event &event);
315 void handleWheelEvent(
const Event &event);
316 void handleSwitchWaitTimeout();
319 void handleSwitchToScreenEvent(
const Event &event);
320 void handleSwitchInDirectionEvent(
const Event &event);
321 void handleToggleScreenEvent(
const Event &);
322 void handleKeyboardBroadcastEvent(
const Event &event);
323 void handleLockCursorToScreenEvent(
const Event &event);
327 void onScreensaver(
bool activated);
333 bool onMouseMovePrimary(int32_t
x, int32_t
y);
334 void onMouseMoveSecondary(int32_t dx, int32_t dy);
335 void onMouseWheel(int32_t xDelta, int32_t yDelta);
351 void closeAllClients();
364 ClipboardInfo() =
default;
368 std::string m_clipboardData;
369 std::string m_clipboardOwner;
370 uint32_t m_clipboardSeqNum = 0;
375 PrimaryClient *m_primaryClient =
nullptr;
378 BaseClientProxy *m_active =
nullptr;
381 ServerConfig *m_config =
nullptr;
384 InputFilter *m_inputFilter =
nullptr;
387 BaseClientProxy *m_activeSaver =
nullptr;
389 BaseClientProxy *m_switchScreen =
nullptr;
390 double m_switchWaitDelay = 0.0;
391 EventQueueTimer *m_switchWaitTimer =
nullptr;
394 double m_switchTwoTapDelay = 0.0;
397 deskflow::Screen *m_screen;
399 IEventQueue *m_events =
nullptr;
400 size_t m_maximumClipboardSize = INT_MAX;
401 ClientListener *m_clientListener =
nullptr;
402 Stopwatch m_switchTwoTapTimer;
405 std::string m_keyboardBroadcastingScreens;
408 using ClientList = std::map<std::string, BaseClientProxy *>;
409 using ClientSet = std::set<BaseClientProxy *>;
410 ClientList m_clients;
411 ClientSet m_clientSet;
414 using OldClients = std::map<BaseClientProxy *, EventQueueTimer *>;
415 OldClients m_oldClients;
424 uint32_t m_seqNum = 0;
435 int32_t m_xDelta = 0;
436 int32_t m_yDelta = 0;
437 int32_t m_xDelta2 = 0;
438 int32_t m_yDelta2 = 0;
444 int32_t m_switchWaitX;
445 int32_t m_switchWaitY;
447 int32_t m_switchTwoTapZone = 3;
453 bool m_switchTwoTapEngaged =
false;
454 bool m_switchTwoTapArmed =
false;
457 bool m_switchNeedsShift =
false;
458 bool m_switchNeedsControl =
false;
459 bool m_switchNeedsAlt =
false;
462 bool m_relativeMoves =
false;
466 bool m_keyboardBroadcasting =
false;
469 bool m_lockedToScreen =
false;
471 bool m_defaultLockToScreenState =
false;
472 bool m_disableLockToScreen =
false;
473 bool m_enableClipboard =
true;
static const ClipboardID kClipboardEnd
Definition ClipboardTypes.h:30
uint8_t ClipboardID
Clipboard ID.
Definition ClipboardTypes.h:16
Direction
Computer edge directions for mouse movement.
Definition DirectionTypes.h:22
@ NoDirection
No specific direction.
Definition DirectionTypes.h:23
uint32_t KeyID
Key ID.
Definition KeyTypes.h:21
uint16_t KeyButton
Key Code.
Definition KeyTypes.h:34
uint32_t KeyModifierMask
Modifier key mask.
Definition KeyTypes.h:44
uint8_t ButtonID
Mouse button ID.
Definition MouseTypes.h:16
NetworkProtocol
Definition NetworkProtocol.h:14
@ Barrier
Definition NetworkProtocol.h:17
int y
Definition ServerConfig.cpp:25
int x
Definition ServerConfig.cpp:24
Generic proxy for client or primary.
Definition BaseClientProxy.h:18
Definition ClientListener.h:28
Memory buffer clipboard.
Definition Clipboard.h:17
Definition EventQueueTimer.h:12
Event.
Definition Event.h:29
Event queue interface.
Definition IEventQueue.h:29
Primary screen as pseudo-client.
Definition PrimaryClient.h:23
Definition ServerConfig.h:35
State m_state
Definition Server.h:129
~KeyboardBroadcastInfo() override=default
KeyboardBroadcastInfo(State state, const std::string &screens)
Definition Server.h:122
KeyboardBroadcastInfo(State state=kToggle)
Definition Server.h:118
std::string m_screens
Definition Server.h:130
State
Definition Server.h:112
@ kOff
Definition Server.h:113
@ kOn
Definition Server.h:114
@ kToggle
Definition Server.h:115
State
Definition Server.h:50
@ kOn
Definition Server.h:52
@ kToggle
Definition Server.h:53
@ kOff
Definition Server.h:51
LockCursorToScreenInfo(State state=kToggle)
Definition Server.h:56
~LockCursorToScreenInfo() override=default
State m_state
Definition Server.h:63
std::string m_screen
Definition Server.h:104
ScreenConnectedInfo(std::string screen)
Definition Server.h:98
SwitchInDirectionInfo(Direction direction)
Definition Server.h:84
Direction m_direction
Definition Server.h:91
~SwitchInDirectionInfo() override=default
SwitchToScreenInfo(const std::string &screen)
Definition Server.h:70
std::string m_screen
Definition Server.h:77
~SwitchToScreenInfo() override=default
Server & operator=(Server const &)=delete
Server(ServerConfig &config, PrimaryClient *primaryClient, deskflow::Screen *screen, IEventQueue *events)
Definition Server.cpp:42
Server & operator=(Server &&)=delete
~Server()
Definition Server.cpp:143
void adoptClient(BaseClientProxy *client)
Add a client.
Definition Server.cpp:225
std::string protocolString() const
Get the network protocol.
Definition Server.cpp:274
bool setConfig(const ServerConfig &)
Set configuration.
Definition Server.cpp:185
void getClients(std::vector< std::string > &list) const
Get the list of connected clients.
Definition Server.cpp:286
void setListener(ClientListener *p)
Store ClientListener pointer.
Definition Server.h:174
uint32_t getNumClients() const
Get number of connected clients.
Definition Server.cpp:281
Server(Server const &)=delete
void disconnect()
Disconnect clients.
Definition Server.cpp:263
Thread handle.
Definition Thread.h:33
Platform independent screen.
Definition Screen.h:30
Server configuration.
Definition Config.h:52
Definition DaemonApp.h:20