Synergy server. More...
#include <CServer.h>
Inherits INode.
Inherited by CMockServer.
Classes | |
| class | CClipboardInfo |
| class | CKeyboardBroadcastInfo |
| Keyboard broadcast data. More... | |
| class | CLockCursorToScreenInfo |
| Lock cursor to screen data. More... | |
| class | CScreenConnectedInfo |
| Screen connected data. More... | |
| class | CSwitchInDirectionInfo |
| Switch in direction data. More... | |
| class | CSwitchToScreenInfo |
| Switch to screen data. More... | |
Public Member Functions | |
| CServer (const CConfig &config, CPrimaryClient *primaryClient, CScreen *screen) | |
manipulators | |
| bool | setConfig (const CConfig &) |
| Set configuration. | |
| void | adoptClient (CBaseClientProxy *client) |
| Add a client. | |
| void | disconnect () |
| Disconnect clients. | |
| void | gameDeviceTimingResp (UInt16 freq) |
| Notify of game device timing response. | |
| void | gameDeviceFeedback (GameDeviceID id, UInt16 m1, UInt16 m2) |
| Notify of game device feedback. | |
Public Attributes | |
| bool | m_mock |
accessors | |
|
| |
| UInt32 | getNumClients () const |
| Get number of connected clients. | |
| void | getClients (std::vector< CString > &list) const |
| Get the list of connected clients. | |
| static CEvent::Type | getErrorEvent () |
| Get error event type. | |
| static CEvent::Type | getConnectedEvent () |
| Get connected event type. | |
| static CEvent::Type | getDisconnectedEvent () |
| Get disconnected event type. | |
| static CEvent::Type | getSwitchToScreenEvent () |
| Get switch to screen event type. | |
| static CEvent::Type | getSwitchInDirectionEvent () |
| Get switch in direction event type. | |
| static CEvent::Type | getKeyboardBroadcastEvent () |
| Get keyboard broadcast event type. | |
| static CEvent::Type | getLockCursorToScreenEvent () |
| Get lock cursor event type. | |
| static CEvent::Type | getScreenSwitchedEvent () |
| Get screen switched event type. | |
Synergy server.
This class implements the top-level server algorithms for synergy.
Definition at line 44 of file CServer.h.
| CServer::CServer | ( | const CConfig & | config, | |
| CPrimaryClient * | primaryClient, | |||
| CScreen * | screen | |||
| ) |
Start the server with the configuration config and the primary client (local screen) primaryClient. The client retains ownership of primaryClient.
Definition at line 53 of file CServer.cpp.
References IPrimaryScreen::getButtonDownEvent(), IPrimaryScreen::getButtonUpEvent(), CPrimaryClient::getEventTarget(), IPrimaryScreen::getFakeInputBeginEvent(), IPrimaryScreen::getFakeInputEndEvent(), IPrimaryScreen::getGameDeviceButtonsEvent(), IPrimaryScreen::getGameDeviceSticksEvent(), IPrimaryScreen::getGameDeviceTimingReqEvent(), IPrimaryScreen::getGameDeviceTriggersEvent(), getKeyboardBroadcastEvent(), IKeyState::getKeyDownEvent(), IKeyState::getKeyRepeatEvent(), IKeyState::getKeyUpEvent(), getLockCursorToScreenEvent(), IPrimaryScreen::getMotionOnPrimaryEvent(), IPrimaryScreen::getMotionOnSecondaryEvent(), CBaseClientProxy::getName(), IPrimaryScreen::getScreensaverActivatedEvent(), IPrimaryScreen::getScreensaverDeactivatedEvent(), getSwitchInDirectionEvent(), getSwitchToScreenEvent(), CPrimaryClient::getToggleMask(), IPrimaryScreen::getWheelEvent(), CConfig::isScreen(), CEvent::kTimer, and setConfig().
| void CServer::adoptClient | ( | CBaseClientProxy * | client | ) |
Add a client.
Adds client to the server. The client is adopted and will be destroyed when the client disconnects or is disconnected.
Definition at line 302 of file CServer.cpp.
References getConnectedEvent(), CClientProxy::getDisconnectedEvent(), CPrimaryClient::getEventTarget(), CBaseClientProxy::getName(), CConfig::isScreen(), and CBaseClientProxy::screensaver().
| void CServer::disconnect | ( | ) |
Disconnect clients.
Disconnect clients. This tells them to disconnect but does not wait for them to actually do so. The server sends the disconnected event when they're all disconnected (or immediately if none are connected). The caller can also just destroy this object to force the disconnection.
Definition at line 343 of file CServer.cpp.
References getDisconnectedEvent().
| void CServer::getClients | ( | std::vector< CString > & | list | ) | const |
Get the list of connected clients.
Set the list to the names of the currently connected clients.
Definition at line 374 of file CServer.cpp.
Referenced by CServerTaskBarReceiver::updateStatus().
| CEvent::Type CServer::getConnectedEvent | ( | ) | [static] |
Get connected event type.
Returns the connected event type. This is sent when a client screen has connected. The event data is a CScreenConnectedInfo* that indicates the connected screen.
Definition at line 391 of file CServer.cpp.
Referenced by adoptClient().
| CEvent::Type CServer::getDisconnectedEvent | ( | ) | [static] |
Get disconnected event type.
Returns the disconnected event type. This is sent when all the clients have disconnected.
Definition at line 398 of file CServer.cpp.
Referenced by disconnect().
| CEvent::Type CServer::getErrorEvent | ( | ) | [static] |
Get error event type.
Returns the error event type. This is sent when the server fails for some reason.
Definition at line 384 of file CServer.cpp.
| CEvent::Type CServer::getKeyboardBroadcastEvent | ( | ) | [static] |
Get keyboard broadcast event type.
Returns the keyboard broadcast event type. The server responds to this by turning on keyboard broadcasting or turning it off. The event data is a CKeyboardBroadcastInfo*.
Definition at line 419 of file CServer.cpp.
Referenced by CServer().
| CEvent::Type CServer::getLockCursorToScreenEvent | ( | ) | [static] |
Get lock cursor event type.
Returns the lock cursor event type. The server responds to this by locking the cursor to the active screen or unlocking it. The event data is a CLockCursorToScreenInfo*.
Definition at line 426 of file CServer.cpp.
Referenced by CServer().
| UInt32 CServer::getNumClients | ( | ) | const |
Get number of connected clients.
Returns the number of connected clients, including the server itself.
Definition at line 368 of file CServer.cpp.
| CEvent::Type CServer::getScreenSwitchedEvent | ( | ) | [static] |
Get screen switched event type.
Returns the screen switched event type. This is raised when the screen has been switched to a client.
Definition at line 433 of file CServer.cpp.
| CEvent::Type CServer::getSwitchInDirectionEvent | ( | ) | [static] |
Get switch in direction event type.
Returns the switch in direction event type. The server responds to this by switching screens. The event data is a CSwitchInDirectionInfo* that indicates the target direction.
Definition at line 412 of file CServer.cpp.
Referenced by CServer().
| CEvent::Type CServer::getSwitchToScreenEvent | ( | ) | [static] |
Get switch to screen event type.
Returns the switch to screen event type. The server responds to this by switching screens. The event data is a CSwitchToScreenInfo* that indicates the target screen.
Definition at line 405 of file CServer.cpp.
Referenced by CServer().
| bool CServer::setConfig | ( | const CConfig & | config | ) |
Set configuration.
Change the server's configuration. Returns true iff the new configuration was accepted (it must include the server's name). This will disconnect any clients no longer in the configuration.
Definition at line 258 of file CServer.cpp.
References CBaseClientProxy::getName(), CConfig::hasLockToScreenAction(), CConfig::isScreen(), and CPrimaryClient::reconfigure().
Referenced by CServer().
1.7.1