158 m_clientListener = p;
181 void getClients(std::vector<std::string> &list)
const;
190 uint32_t getActivePrimarySides()
const;
195 bool isLockedToScreenServer()
const;
199 bool isLockedToScreen()
const;
244 void noSwitch(int32_t
x, int32_t
y);
250 void startSwitchTwoTap();
253 void armSwitchTwoTap(int32_t
x, int32_t
y);
256 void stopSwitchTwoTap();
259 bool isSwitchTwoTapStarted()
const;
262 bool shouldSwitchTwoTap()
const;
265 void startSwitchWait(int32_t
x, int32_t
y);
268 void stopSwitchWait();
271 bool isSwitchWaitStarted()
const;
275 uint32_t getCorner(
const BaseClientProxy *, int32_t
x, int32_t
y, int32_t size)
const;
278 void stopRelativeMoves();
284 void processOptions();
290 void handleKeyDownEvent(
const Event &event);
291 void handleKeyUpEvent(
const Event &event);
292 void handleKeyRepeatEvent(
const Event &event);
293 void handleButtonDownEvent(
const Event &event);
294 void handleButtonUpEvent(
const Event &event);
295 void handleMotionPrimaryEvent(
const Event &event);
296 void handleMotionSecondaryEvent(
const Event &event);
297 void handleWheelEvent(
const Event &event);
298 void handleSwitchWaitTimeout();
301 void handleSwitchToScreenEvent(
const Event &event);
302 void handleSwitchInDirectionEvent(
const Event &event);
303 void handleToggleScreenEvent(
const Event &);
304 void handleKeyboardBroadcastEvent(
const Event &event);
305 void handleLockCursorToScreenEvent(
const Event &event);
309 void onScreensaver(
bool activated);
315 bool onMouseMovePrimary(int32_t
x, int32_t
y);
316 void onMouseMoveSecondary(int32_t dx, int32_t dy);
317 void onMouseWheel(int32_t xDelta, int32_t yDelta);
333 void closeAllClients();
346 ClipboardInfo() =
default;
350 std::string m_clipboardData;
351 std::string m_clipboardOwner;
352 uint32_t m_clipboardSeqNum = 0;
357 PrimaryClient *m_primaryClient =
nullptr;
360 BaseClientProxy *m_active =
nullptr;
363 ServerConfig *m_config =
nullptr;
366 InputFilter *m_inputFilter =
nullptr;
369 BaseClientProxy *m_activeSaver =
nullptr;
371 BaseClientProxy *m_switchScreen =
nullptr;
372 double m_switchWaitDelay = 0.0;
373 EventQueueTimer *m_switchWaitTimer =
nullptr;
376 double m_switchTwoTapDelay = 0.0;
379 deskflow::Screen *m_screen;
381 IEventQueue *m_events =
nullptr;
382 size_t m_maximumClipboardSize = INT_MAX;
383 ClientListener *m_clientListener =
nullptr;
384 Stopwatch m_switchTwoTapTimer;
387 std::string m_keyboardBroadcastingScreens;
390 using ClientList = std::map<std::string, BaseClientProxy *>;
391 using ClientSet = std::set<BaseClientProxy *>;
392 ClientList m_clients;
393 ClientSet m_clientSet;
396 using OldClients = std::map<BaseClientProxy *, EventQueueTimer *>;
397 OldClients m_oldClients;
406 uint32_t m_seqNum = 0;
417 int32_t m_xDelta = 0;
418 int32_t m_yDelta = 0;
419 int32_t m_xDelta2 = 0;
420 int32_t m_yDelta2 = 0;
426 int32_t m_switchWaitX;
427 int32_t m_switchWaitY;
429 int32_t m_switchTwoTapZone = 3;
435 bool m_switchTwoTapEngaged =
false;
436 bool m_switchTwoTapArmed =
false;
439 bool m_switchNeedsShift =
false;
440 bool m_switchNeedsControl =
false;
441 bool m_switchNeedsAlt =
false;
444 bool m_relativeMoves =
false;
448 bool m_keyboardBroadcasting =
false;
451 bool m_lockedToScreen =
false;
453 bool m_disableLockToScreen =
false;
454 bool m_enableClipboard =
true;
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: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:10
@ Barrier
Definition NetworkProtocol.h:12
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
Keyboard broadcast data.
Definition Server.h:98
State m_state
Definition Server.h:111
static KeyboardBroadcastInfo * alloc(State state=kToggle)
Definition Server.cpp:2095
char m_screens[1]
Definition Server.h:112
State
Definition Server.h:101
@ kOff
Definition Server.h:102
@ kOn
Definition Server.h:103
@ kToggle
Definition Server.h:104
Lock cursor to screen data.
Definition Server.h:47
State
Definition Server.h:50
@ kOn
Definition Server.h:52
@ kToggle
Definition Server.h:53
@ kOff
Definition Server.h:51
static LockCursorToScreenInfo * alloc(State state=kToggle)
Definition Server.cpp:2062
State m_state
Definition Server.h:59
std::string m_screen
Definition Server.h:93
ScreenConnectedInfo(std::string screen)
Definition Server.h:87
Switch in direction data.
Definition Server.h:75
Direction m_direction
Definition Server.h:80
static SwitchInDirectionInfo * alloc(Direction direction)
Definition Server.cpp:2084
Switch to screen data.
Definition Server.h:64
char m_screen[1]
Definition Server.h:70
static SwitchToScreenInfo * alloc(const std::string &screen)
Definition Server.cpp:2073
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:140
void adoptClient(BaseClientProxy *client)
Add a client.
Definition Server.cpp:222
std::string protocolString() const
Get the network protocol.
Definition Server.cpp:271
bool setConfig(const ServerConfig &)
Set configuration.
Definition Server.cpp:182
void getClients(std::vector< std::string > &list) const
Get the list of connected clients.
Definition Server.cpp:287
void setListener(ClientListener *p)
Store ClientListener pointer.
Definition Server.h:156
uint32_t getNumClients() const
Get number of connected clients.
Definition Server.cpp:282
Server(Server const &)=delete
void disconnect()
Disconnect clients.
Definition Server.cpp:260
Thread handle.
Definition Thread.h:33
Platform independent screen.
Definition Screen.h:30
Server configuration.
Definition Config.h:52
Definition EventTypes.h:11