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.
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.

Public Member Functions

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

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...

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(), IPrimaryScreen::getButtonDownEvent(), IPrimaryScreen::getButtonUpEvent(), CPrimaryClient::getEventTarget(), IPrimaryScreen::getFakeInputBeginEvent(), IPrimaryScreen::getFakeInputEndEvent(), getKeyboardBroadcastEvent(), IKeyState::getKeyDownEvent(), IKeyState::getKeyRepeatEvent(), IKeyState::getKeyUpEvent(), getLockCursorToScreenEvent(), IPrimaryScreen::getMotionOnPrimaryEvent(), IPrimaryScreen::getMotionOnSecondaryEvent(), CBaseClientProxy::getName(), IPrimaryScreen::getScreensaverActivatedEvent(), IPrimaryScreen::getScreensaverDeactivatedEvent(), getSwitchInDirectionEvent(), getSwitchToScreenEvent(), IPrimaryScreen::getWheelEvent(), CConfig::isScreen(), CEvent::kTimer, setConfig(), and CInputFilter::setPrimaryClient().


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 CServer::CScreenConnectedInfo::alloc(), 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 302 of file CServer.cpp.

References getDisconnectedEvent().

Referenced by ~CServer().

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(), CInputFilter::CScreenConnectedCondition::match(), CInputFilter::CSwitchToScreenAction::perform(), and CInputFilter::setPrimaryClient().

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(), and CInputFilter::CKeyboardBroadcastAction::perform().

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(), and CInputFilter::CLockCursorToScreenAction::perform().

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(), and CInputFilter::CSwitchInDirectionAction::perform().

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(), and CInputFilter::CSwitchToScreenAction::perform().

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 CInputFilter::addFilterRule(), CInputFilter::CRule::adoptAction(), 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:19:11 2009 for synergy-plus by  doxygen 1.4.7