176 m_clientListener = p;
199 void getClients(std::vector<std::string> &list)
const;
209 uint32_t getActivePrimarySides()
const;
214 bool isLockedToScreenServer()
const;
218 bool isLockedToScreen()
const;
263 void noSwitch(int32_t
x, int32_t
y);
269 void startSwitchTwoTap();
272 void armSwitchTwoTap(int32_t
x, int32_t
y);
275 void stopSwitchTwoTap();
278 bool isSwitchTwoTapStarted()
const;
281 bool shouldSwitchTwoTap()
const;
284 void startSwitchWait(int32_t
x, int32_t
y);
287 void stopSwitchWait();
290 bool isSwitchWaitStarted()
const;
294 uint32_t getCorner(
const BaseClientProxy *, int32_t
x, int32_t
y, int32_t size)
const;
297 void stopRelativeMoves();
303 void processOptions();
309 void handleKeyDownEvent(
const Event &event);
310 void handleKeyUpEvent(
const Event &event);
311 void handleKeyRepeatEvent(
const Event &event);
312 void handleButtonDownEvent(
const Event &event);
313 void handleButtonUpEvent(
const Event &event);
314 void handleMotionPrimaryEvent(
const Event &event);
315 void handleMotionSecondaryEvent(
const Event &event);
316 void handleWheelEvent(
const Event &event);
317 void handleSwitchWaitTimeout();
320 void handleSwitchToScreenEvent(
const Event &event);
321 void handleSwitchInDirectionEvent(
const Event &event);
322 void handleToggleScreenEvent(
const Event &);
323 void handleKeyboardBroadcastEvent(
const Event &event);
324 void handleLockCursorToScreenEvent(
const Event &event);
328 void onScreensaver(
bool activated);
334 bool onMouseMovePrimary(int32_t
x, int32_t
y);
335 void onMouseMoveSecondary(int32_t dx, int32_t dy);
336 void onMouseWheel(int32_t xDelta, int32_t yDelta);
352 void closeAllClients();
365 ClipboardInfo() =
default;
369 std::string m_clipboardData;
370 std::string m_clipboardOwner;
371 uint32_t m_clipboardSeqNum = 0;
376 PrimaryClient *m_primaryClient =
nullptr;
379 BaseClientProxy *m_active =
nullptr;
382 ServerConfig *m_config =
nullptr;
385 InputFilter *m_inputFilter =
nullptr;
388 BaseClientProxy *m_activeSaver =
nullptr;
390 BaseClientProxy *m_switchScreen =
nullptr;
391 double m_switchWaitDelay = 0.0;
392 EventQueueTimer *m_switchWaitTimer =
nullptr;
395 double m_switchTwoTapDelay = 0.0;
398 deskflow::Screen *m_screen;
400 IEventQueue *m_events =
nullptr;
401 size_t m_maximumClipboardSize = INT_MAX;
402 ClientListener *m_clientListener =
nullptr;
403 Stopwatch m_switchTwoTapTimer;
406 std::string m_keyboardBroadcastingScreens;
409 using ClientList = std::map<std::string, BaseClientProxy *>;
410 using ClientSet = std::set<BaseClientProxy *>;
411 ClientList m_clients;
412 ClientSet m_clientSet;
415 using OldClients = std::map<BaseClientProxy *, EventQueueTimer *>;
416 OldClients m_oldClients;
425 uint32_t m_seqNum = 0;
436 int32_t m_xDelta = 0;
437 int32_t m_yDelta = 0;
438 int32_t m_xDelta2 = 0;
439 int32_t m_yDelta2 = 0;
445 int32_t m_switchWaitX;
446 int32_t m_switchWaitY;
448 int32_t m_switchTwoTapZone = 3;
454 bool m_switchTwoTapEngaged =
false;
455 bool m_switchTwoTapArmed =
false;
458 bool m_switchNeedsShift =
false;
459 bool m_switchNeedsControl =
false;
460 bool m_switchNeedsAlt =
false;
463 bool m_relativeMoves =
false;
467 bool m_keyboardBroadcasting =
false;
470 bool m_lockedToScreen =
false;
472 bool m_defaultLockToScreenState =
false;
473 bool m_disableLockToScreen =
false;
474 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: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: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:34
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:298
Server & operator=(Server const &)=delete
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:226
std::string protocolString() const
Get the network protocol.
Definition Server.cpp:278
bool setConfig(const ServerConfig &)
Set configuration.
Definition Server.cpp:186
void getClients(std::vector< std::string > &list) const
Get the list of connected clients.
Definition Server.cpp:290
void setListener(ClientListener *p)
Store ClientListener pointer.
Definition Server.h:174
uint32_t getNumClients() const
Get number of connected clients.
Definition Server.cpp:285
Server(Server const &)=delete
void disconnect()
Disconnect clients.
Definition Server.cpp:267
Thread handle.
Definition Thread.h:33
Platform independent screen.
Definition Screen.h:30
Server configuration.
Definition Config.h:52
Definition DaemonApp.h:20