176 m_clientListener = p;
199 void getClients(std::vector<std::string> &list)
const;
210 uint32_t getActivePrimarySides()
const;
215 bool isLockedToScreenServer()
const;
219 bool isLockedToScreen()
const;
264 void noSwitch(int32_t
x, int32_t
y);
270 void startSwitchTwoTap();
273 void armSwitchTwoTap(int32_t
x, int32_t
y);
276 void stopSwitchTwoTap();
279 bool isSwitchTwoTapStarted()
const;
282 bool shouldSwitchTwoTap()
const;
285 void startSwitchWait(int32_t
x, int32_t
y);
288 void stopSwitchWait();
291 bool isSwitchWaitStarted()
const;
295 uint32_t getCorner(
const BaseClientProxy *, int32_t
x, int32_t
y, int32_t size)
const;
298 void stopRelativeMoves();
304 void processOptions();
310 void handleKeyDownEvent(
const Event &event);
311 void handleKeyUpEvent(
const Event &event);
312 void handleKeyRepeatEvent(
const Event &event);
313 void handleButtonDownEvent(
const Event &event);
314 void handleButtonUpEvent(
const Event &event);
315 void handleMotionPrimaryEvent(
const Event &event);
316 void handleMotionSecondaryEvent(
const Event &event);
317 void handleWheelEvent(
const Event &event);
318 void handleSwitchWaitTimeout();
321 void handleSwitchToScreenEvent(
const Event &event);
322 void handleSwitchInDirectionEvent(
const Event &event);
323 void handleToggleScreenEvent(
const Event &);
324 void handleKeyboardBroadcastEvent(
const Event &event);
325 void handleLockCursorToScreenEvent(
const Event &event);
329 void onScreensaver(
bool activated);
335 bool onMouseMovePrimary(int32_t
x, int32_t
y);
336 void onMouseMoveSecondary(int32_t dx, int32_t dy);
337 void onMouseWheel(int32_t xDelta, int32_t yDelta);
353 void closeAllClients();
366 ClipboardInfo() =
default;
370 std::string m_clipboardData;
371 std::string m_clipboardOwner;
372 uint32_t m_clipboardSeqNum = 0;
377 PrimaryClient *m_primaryClient =
nullptr;
380 BaseClientProxy *m_active =
nullptr;
383 ServerConfig *m_config =
nullptr;
386 InputFilter *m_inputFilter =
nullptr;
389 BaseClientProxy *m_activeSaver =
nullptr;
391 BaseClientProxy *m_switchScreen =
nullptr;
392 double m_switchWaitDelay = 0.0;
393 EventQueueTimer *m_switchWaitTimer =
nullptr;
396 double m_switchTwoTapDelay = 0.0;
399 deskflow::Screen *m_screen;
401 IEventQueue *m_events =
nullptr;
402 size_t m_maximumClipboardSize = INT_MAX;
403 ClientListener *m_clientListener =
nullptr;
404 Stopwatch m_switchTwoTapTimer;
407 std::string m_keyboardBroadcastingScreens;
410 using ClientList = std::map<std::string, BaseClientProxy *>;
411 using ClientSet = std::set<BaseClientProxy *>;
412 ClientList m_clients;
413 ClientSet m_clientSet;
416 using OldClients = std::map<BaseClientProxy *, EventQueueTimer *>;
417 OldClients m_oldClients;
426 uint32_t m_seqNum = 0;
437 int32_t m_xDelta = 0;
438 int32_t m_yDelta = 0;
439 int32_t m_xDelta2 = 0;
440 int32_t m_yDelta2 = 0;
446 int32_t m_switchWaitX;
447 int32_t m_switchWaitY;
449 int32_t m_switchTwoTapZone = 3;
455 bool m_switchTwoTapEngaged =
false;
456 bool m_switchTwoTapArmed =
false;
459 bool m_relativeMoves =
false;
463 bool m_keyboardBroadcasting =
false;
466 bool m_lockedToScreen =
false;
468 bool m_defaultLockToScreenState =
false;
469 bool m_disableLockToScreen =
false;
470 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:15
@ Barrier
Definition NetworkProtocol.h:18
int y
Definition ServerConfig.cpp:24
int x
Definition ServerConfig.cpp:23
Generic proxy for client or primary.
Definition BaseClientProxy.h:18
Definition ClientListener.h:28
Memory buffer clipboard.
Definition Clipboard.h:19
Definition EventQueueTimer.h:12
Event.
Definition Event.h:43
Event queue interface.
Definition IEventQueue.h:29
Primary screen as pseudo-client.
Definition PrimaryClient.h:23
Definition ServerConfig.h:25
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
void sendConnectedClientsIpc() const
Definition Server.cpp:303
Server & operator=(Server const &)=delete
size_t getMaximumClipboardSizeBytes() const
Definition Server.cpp:186
Server(ServerConfig &config, PrimaryClient *primaryClient, deskflow::Screen *screen, IEventQueue *events)
Definition Server.cpp:43
Server & operator=(Server &&)=delete
~Server()
Definition Server.cpp:144
void adoptClient(BaseClientProxy *client)
Add a client.
Definition Server.cpp:231
std::string protocolString() const
Get the network protocol.
Definition Server.cpp:283
bool setConfig(const ServerConfig &)
Set configuration.
Definition Server.cpp:191
void getClients(std::vector< std::string > &list) const
Get the list of connected clients.
Definition Server.cpp:295
void setListener(ClientListener *p)
Store ClientListener pointer.
Definition Server.h:174
uint32_t getNumClients() const
Get number of connected clients.
Definition Server.cpp:290
Server(Server const &)=delete
void disconnect()
Disconnect clients.
Definition Server.cpp:272
Thread handle.
Definition Thread.h:33
Platform independent screen.
Definition Screen.h:30
Server configuration.
Definition Config.h:53
Definition DaemonApp.h:18