Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

CServer Class Reference

Synergy server. More...

#include <CServer.h>

Collaboration diagram for CServer:

Collaboration graph
[legend]
List of all members.

accessors

UInt32 getNumClients () const
 Get number of connected clients.
void getClients (std::vector< CString > &list) const
 Get the list of connected clients.
CEvent::Type getErrorEvent ()
 Get error event type.
CEvent::Type getConnectedEvent ()
 Get connected event type.
CEvent::Type getDisconnectedEvent ()
 Get disconnected event type.
CEvent::Type getSwitchToScreenEvent ()
 Get switch to screen event type.
CEvent::Type getSwitchInDirectionEvent ()
 Get switch in direction event type.
CEvent::Type getKeyboardBroadcastEvent ()
 Get keyboard broadcast event type.
CEvent::Type getLockCursorToScreenEvent ()
 Get lock cursor event type.

Public Member Functions

 CServer (const CConfig &config, CPrimaryClient *primaryClient)
manipulators
bool setConfig (const CConfig &)
 Set configuration.
void adoptClient (CBaseClientProxy *client)
 Add a client.
void disconnect ()
 Disconnect clients.

Detailed Description

Synergy server.

This class implements the top-level server algorithms for synergy.

Definition at line 38 of file CServer.h.


Constructor & Destructor Documentation

CServer::CServer const CConfig config,
CPrimaryClient primaryClient
 

Start the server with the configuration config and the primary client (local screen) primaryClient. The client retains ownership of primaryClient.

Definition at line 46 of file CServer.cpp.

References CPrimaryClient::enable(), CPrimaryClient::getEventTarget(), getKeyboardBroadcastEvent(), getLockCursorToScreenEvent(), CBaseClientProxy::getName(), getSwitchInDirectionEvent(), getSwitchToScreenEvent(), CConfig::isScreen(), and setConfig().


Member Function Documentation

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 261 of file CServer.cpp.

References getConnectedEvent(), 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 302 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 321 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 338 of file CServer.cpp.

References CEvent::registerTypeOnce().

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 345 of file CServer.cpp.

References CEvent::registerTypeOnce().

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 331 of file CServer.cpp.

References CEvent::registerTypeOnce().

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 366 of file CServer.cpp.

References CEvent::registerTypeOnce().

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 373 of file CServer.cpp.

References CEvent::registerTypeOnce().

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 315 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 359 of file CServer.cpp.

References CEvent::registerTypeOnce().

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 352 of file CServer.cpp.

References CEvent::registerTypeOnce().

Referenced by CServer().

bool CServer::setConfig const CConfig  ) 
 

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 217 of file CServer.cpp.

References CBaseClientProxy::getName(), CConfig::hasLockToScreenAction(), CConfig::isScreen(), and CPrimaryClient::reconfigure().

Referenced by CServer().


The documentation for this class was generated from the following files:
Generated on Fri Nov 6 00:21:29 2009 for synergy-plus by  doxygen 1.3.9.1