- made unit testing easier by (mostly) removing the event queue singleton.

- fixed code style in many places (mostly indentation).
This commit is contained in:
Nick Bolton 2013-06-29 14:17:49 +00:00
parent 13b2649fa0
commit 608074c041
143 changed files with 2220 additions and 2163 deletions

View file

@ -30,18 +30,20 @@
#include "stdset.h"
#include "stdvector.h"
#include "INode.h"
#include "CEventTypes.h"
class CBaseClientProxy;
class CEventQueueTimer;
class CPrimaryClient;
class CInputFilter;
class CScreen;
class IEventQueue;
//! Synergy server
/*!
This class implements the top-level server algorithms for synergy.
*/
class CServer : public INode {
class CServer : public INode {
public:
//! Lock cursor to screen data
class CLockCursorToScreenInfo {
@ -101,11 +103,11 @@ public:
client (local screen) \p primaryClient. The client retains
ownership of \p primaryClient.
*/
CServer(const CConfig& config, CPrimaryClient* primaryClient, CScreen* screen);
CServer(const CConfig& config, CPrimaryClient* primaryClient, CScreen* screen, IEventQueue* events);
~CServer();
#ifdef TEST_ENV
CServer() { }
CServer() : m_mock(true), m_events(NULL), m_config(NULL) { }
#endif
//! @name manipulators
@ -157,67 +159,6 @@ public:
*/
void getClients(std::vector<CString>& list) const;
//! Get error event type
/*!
Returns the error event type. This is sent when the server fails
for some reason.
*/
static CEvent::Type getErrorEvent();
//! Get connected event type
/*!
Returns the connected event type. This is sent when a client screen
has connected. The event data is a \c CScreenConnectedInfo* that
indicates the connected screen.
*/
static CEvent::Type getConnectedEvent();
//! Get disconnected event type
/*!
Returns the disconnected event type. This is sent when all the
clients have disconnected.
*/
static CEvent::Type getDisconnectedEvent();
//! 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 \c CSwitchToScreenInfo*
that indicates the target screen.
*/
static CEvent::Type getSwitchToScreenEvent();
//! 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 \c CSwitchInDirectionInfo*
that indicates the target direction.
*/
static CEvent::Type getSwitchInDirectionEvent();
//! 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 \c CKeyboardBroadcastInfo*.
*/
static CEvent::Type getKeyboardBroadcastEvent();
//! 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 \c CLockCursorToScreenInfo*.
*/
static CEvent::Type getLockCursorToScreenEvent();
//! Get screen switched event type
/*!
Returns the screen switched event type. This is raised when the
screen has been switched to a client.
*/
static CEvent::Type getScreenSwitchedEvent();
//@}
private:
@ -493,14 +434,7 @@ private:
// server screen
CScreen* m_screen;
static CEvent::Type s_errorEvent;
static CEvent::Type s_connectedEvent;
static CEvent::Type s_disconnectedEvent;
static CEvent::Type s_switchToScreen;
static CEvent::Type s_switchInDirection;
static CEvent::Type s_keyboardBroadcast;
static CEvent::Type s_lockCursorToScreen;
static CEvent::Type s_screenSwitched;
IEventQueue* m_events;
};
#endif