Indentation changes.
This commit is contained in:
parent
3ca72b35f3
commit
ea6b347b18
|
@ -4,13 +4,13 @@
|
|||
#include "IJob.h"
|
||||
|
||||
class CFunctionJob : public IJob {
|
||||
public:
|
||||
public:
|
||||
CFunctionJob(void (*func)(void*), void* arg = NULL);
|
||||
|
||||
// IJob overrides
|
||||
virtual void run();
|
||||
|
||||
private:
|
||||
private:
|
||||
void (*m_func)(void*);
|
||||
void* m_arg;
|
||||
};
|
||||
|
|
|
@ -4,19 +4,19 @@
|
|||
#include <stdarg.h>
|
||||
|
||||
class CLog {
|
||||
public:
|
||||
public:
|
||||
typedef void (*Outputter)(const char*);
|
||||
|
||||
static void print(const char*, ...);
|
||||
static void printt(const char* file, int line, const char*, ...);
|
||||
static void setOutputter(Outputter);
|
||||
|
||||
private:
|
||||
private:
|
||||
static void output(int priority, char* msg);
|
||||
static char* vsprint(int pad, char*, int len, const char*, va_list);
|
||||
static int nprint(const char*, va_list);
|
||||
|
||||
private:
|
||||
private:
|
||||
static Outputter s_outputter;
|
||||
};
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ static PTimeGetTime s_tgt = NULL;
|
|||
//
|
||||
|
||||
class CStopwatchInit {
|
||||
public:
|
||||
public:
|
||||
CStopwatchInit();
|
||||
~CStopwatchInit();
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "common.h"
|
||||
|
||||
class CStopwatch {
|
||||
public:
|
||||
public:
|
||||
// the default constructor does an implicit reset() or setTrigger().
|
||||
// if triggered == false then the clock starts ticking.
|
||||
CStopwatch(bool triggered = false);
|
||||
|
@ -45,10 +45,10 @@ class CStopwatch {
|
|||
double getTime() const;
|
||||
operator double() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
double getClock() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
double m_mark;
|
||||
bool m_triggered;
|
||||
bool m_stopped;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#define _CS(_x) _x
|
||||
|
||||
class CString : public std::string {
|
||||
public:
|
||||
public:
|
||||
typedef char _e;
|
||||
typedef _e CharT;
|
||||
typedef std::allocator<_e> _a;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "common.h"
|
||||
|
||||
class IInterface {
|
||||
public:
|
||||
public:
|
||||
virtual ~IInterface() { }
|
||||
};
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "IInterface.h"
|
||||
|
||||
class IJob : public IInterface {
|
||||
public:
|
||||
public:
|
||||
virtual void run() = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
|
||||
template <class T>
|
||||
class TMethodJob : public IJob {
|
||||
public:
|
||||
public:
|
||||
TMethodJob(T* object, void (T::*method)(void*), void* arg = NULL);
|
||||
|
||||
// IJob overrides
|
||||
virtual void run();
|
||||
|
||||
private:
|
||||
private:
|
||||
T* m_object;
|
||||
void (T::*m_method)(void*);
|
||||
void* m_arg;
|
||||
|
|
10
base/XBase.h
10
base/XBase.h
|
@ -5,7 +5,7 @@
|
|||
#include <exception>
|
||||
|
||||
class XBase : public std::exception {
|
||||
public:
|
||||
public:
|
||||
XBase();
|
||||
XBase(const CString& msg);
|
||||
virtual ~XBase();
|
||||
|
@ -13,7 +13,7 @@ class XBase : public std::exception {
|
|||
// std::exception overrides
|
||||
virtual const char* what() const;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// returns a human readable string describing the exception
|
||||
virtual CString getWhat() const throw() = 0;
|
||||
|
||||
|
@ -21,12 +21,12 @@ class XBase : public std::exception {
|
|||
virtual CString format(const char* id,
|
||||
const char* defaultFormat, ...) const throw();
|
||||
|
||||
private:
|
||||
private:
|
||||
mutable CString m_what;
|
||||
};
|
||||
|
||||
class MXErrno {
|
||||
public:
|
||||
public:
|
||||
MXErrno();
|
||||
MXErrno(int);
|
||||
|
||||
|
@ -37,7 +37,7 @@ class MXErrno {
|
|||
int getErrno() const;
|
||||
const char* getErrstr() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
int m_errno;
|
||||
};
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class IOutputStream;
|
|||
class ISecondaryScreen;
|
||||
|
||||
class CClient {
|
||||
public:
|
||||
public:
|
||||
CClient(const CString& clientName);
|
||||
~CClient();
|
||||
|
||||
|
@ -27,7 +27,7 @@ class CClient {
|
|||
// accessors
|
||||
|
||||
|
||||
private:
|
||||
private:
|
||||
void runSession(void*);
|
||||
|
||||
// open/close the primary screen
|
||||
|
@ -49,7 +49,7 @@ class CClient {
|
|||
void onMouseMove();
|
||||
void onMouseWheel();
|
||||
|
||||
private:
|
||||
private:
|
||||
CMutex m_mutex;
|
||||
CString m_name;
|
||||
IInputStream* m_input;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "ISecondaryScreen.h"
|
||||
|
||||
class CMSWindowsSecondaryScreen : public CMSWindowsScreen, public ISecondaryScreen {
|
||||
public:
|
||||
public:
|
||||
CMSWindowsSecondaryScreen();
|
||||
virtual ~CMSWindowsSecondaryScreen();
|
||||
|
||||
|
@ -29,17 +29,17 @@ class CMSWindowsSecondaryScreen : public CMSWindowsScreen, public ISecondaryScre
|
|||
virtual SInt32 getJumpZoneSize() const;
|
||||
virtual void getClipboard(IClipboard*) const;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// CMSWindowsScreen overrides
|
||||
virtual bool onPreTranslate(MSG*);
|
||||
virtual LRESULT onEvent(HWND, UINT, WPARAM, LPARAM);
|
||||
virtual void onOpenDisplay();
|
||||
virtual void onCloseDisplay();
|
||||
|
||||
private:
|
||||
private:
|
||||
UINT mapKey(KeyID, KeyModifierMask) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
CClient* m_client;
|
||||
HWND m_window;
|
||||
HWND m_nextClipboardWindow;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <vector>
|
||||
|
||||
class CXWindowsSecondaryScreen : public CXWindowsScreen, public ISecondaryScreen {
|
||||
public:
|
||||
public:
|
||||
CXWindowsSecondaryScreen();
|
||||
virtual ~CXWindowsSecondaryScreen();
|
||||
|
||||
|
@ -30,13 +30,13 @@ class CXWindowsSecondaryScreen : public CXWindowsScreen, public ISecondaryScreen
|
|||
virtual SInt32 getJumpZoneSize() const;
|
||||
virtual void getClipboard(ClipboardID, IClipboard*) const;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// CXWindowsScreen overrides
|
||||
virtual void onOpenDisplay();
|
||||
virtual void onCloseDisplay();
|
||||
virtual long getEventMask(Window) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
struct KeyCodeMask {
|
||||
public:
|
||||
KeyCode keycode;
|
||||
|
@ -64,7 +64,7 @@ class CXWindowsSecondaryScreen : public CXWindowsScreen, public ISecondaryScreen
|
|||
void updateModifierMap(Display* display);
|
||||
static bool isToggleKeysym(KeySym);
|
||||
|
||||
private:
|
||||
private:
|
||||
CClient* m_client;
|
||||
Window m_window;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ class CMutex;
|
|||
class IJob;
|
||||
|
||||
class CBufferedInputStream : public IInputStream {
|
||||
public:
|
||||
public:
|
||||
CBufferedInputStream(CMutex*, IJob* adoptedCloseCB);
|
||||
~CBufferedInputStream();
|
||||
|
||||
|
@ -39,7 +39,7 @@ class CBufferedInputStream : public IInputStream {
|
|||
virtual UInt32 read(void*, UInt32 count);
|
||||
virtual UInt32 getSize() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
CMutex* m_mutex;
|
||||
CCondVar<bool> m_empty;
|
||||
IJob* m_closeCB;
|
||||
|
|
|
@ -8,7 +8,7 @@ class CMutex;
|
|||
class IJob;
|
||||
|
||||
class CBufferedOutputStream : public IOutputStream {
|
||||
public:
|
||||
public:
|
||||
CBufferedOutputStream(CMutex*, IJob* adoptedCloseCB);
|
||||
~CBufferedOutputStream();
|
||||
|
||||
|
@ -33,10 +33,10 @@ class CBufferedOutputStream : public IOutputStream {
|
|||
virtual UInt32 write(const void*, UInt32 count);
|
||||
virtual void flush();
|
||||
|
||||
private:
|
||||
private:
|
||||
UInt32 getSizeWithLock() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
CMutex* m_mutex;
|
||||
IJob* m_closeCB;
|
||||
CStreamBuffer m_buffer;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "IInputStream.h"
|
||||
|
||||
class CInputStreamFilter : public IInputStream {
|
||||
public:
|
||||
public:
|
||||
CInputStreamFilter(IInputStream*, bool adoptStream = true);
|
||||
~CInputStreamFilter();
|
||||
|
||||
|
@ -17,10 +17,10 @@ class CInputStreamFilter : public IInputStream {
|
|||
virtual UInt32 read(void*, UInt32 maxCount) = 0;
|
||||
virtual UInt32 getSize() const = 0;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
IInputStream* getStream() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
IInputStream* m_stream;
|
||||
bool m_adopted;
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "IOutputStream.h"
|
||||
|
||||
class COutputStreamFilter : public IOutputStream {
|
||||
public:
|
||||
public:
|
||||
COutputStreamFilter(IOutputStream*, bool adoptStream = true);
|
||||
~COutputStreamFilter();
|
||||
|
||||
|
@ -17,10 +17,10 @@ class COutputStreamFilter : public IOutputStream {
|
|||
virtual UInt32 write(const void*, UInt32 count) = 0;
|
||||
virtual void flush() = 0;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
IOutputStream* getStream() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
IOutputStream* m_stream;
|
||||
bool m_adopted;
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <vector>
|
||||
|
||||
class CStreamBuffer {
|
||||
public:
|
||||
public:
|
||||
CStreamBuffer();
|
||||
~CStreamBuffer();
|
||||
|
||||
|
@ -25,7 +25,7 @@ class CStreamBuffer {
|
|||
// return the number of bytes in the buffer
|
||||
UInt32 getSize() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
static const UInt32 kChunkSize;
|
||||
|
||||
typedef std::vector<UInt8> Chunk;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "XIO.h"
|
||||
|
||||
class IInputStream : public IInterface {
|
||||
public:
|
||||
public:
|
||||
// manipulators
|
||||
|
||||
// close the stream
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "XIO.h"
|
||||
|
||||
class IOutputStream : public IInterface {
|
||||
public:
|
||||
public:
|
||||
// manipulators
|
||||
|
||||
// close the stream
|
||||
|
|
8
io/XIO.h
8
io/XIO.h
|
@ -7,25 +7,25 @@
|
|||
class XIO : public XBase { };
|
||||
|
||||
class XIOErrno : public XIO, public MXErrno {
|
||||
public:
|
||||
public:
|
||||
XIOErrno();
|
||||
XIOErrno(int);
|
||||
};
|
||||
|
||||
class XIOClose: public XIOErrno {
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
||||
class XIOClosed : public XIO {
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
||||
class XIOEndOfStream : public XIO {
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
class CStopwatch;
|
||||
|
||||
class CCondVarBase {
|
||||
public:
|
||||
public:
|
||||
// mutex must be supplied. all condition variables have an
|
||||
// associated mutex. the copy c'tor uses the same mutex as the
|
||||
// argument and is otherwise like the default c'tor.
|
||||
|
@ -45,7 +45,7 @@ class CCondVarBase {
|
|||
// get the mutex passed to the c'tor
|
||||
CMutex* getMutex() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
void init();
|
||||
void fini();
|
||||
|
||||
|
@ -53,7 +53,7 @@ class CCondVarBase {
|
|||
CCondVarBase(const CCondVarBase&);
|
||||
CCondVarBase& operator=(const CCondVarBase&);
|
||||
|
||||
private:
|
||||
private:
|
||||
CMutex* m_mutex;
|
||||
void* m_cond;
|
||||
|
||||
|
@ -66,7 +66,7 @@ class CCondVarBase {
|
|||
|
||||
template <class T>
|
||||
class CCondVar : public CCondVarBase {
|
||||
public:
|
||||
public:
|
||||
CCondVar(CMutex* mutex, const T&);
|
||||
CCondVar(const CCondVar&);
|
||||
~CCondVar();
|
||||
|
@ -85,7 +85,7 @@ class CCondVar : public CCondVarBase {
|
|||
// calling this method.
|
||||
operator const T&() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
T m_data;
|
||||
};
|
||||
|
||||
|
|
|
@ -7,17 +7,17 @@ class CMutex;
|
|||
class CCondVarBase;
|
||||
|
||||
class CLock {
|
||||
public:
|
||||
public:
|
||||
CLock(const CMutex* mutex);
|
||||
CLock(const CCondVarBase* cv);
|
||||
~CLock();
|
||||
|
||||
private:
|
||||
private:
|
||||
// not implemented
|
||||
CLock(const CLock&);
|
||||
CLock& operator=(const CLock&);
|
||||
|
||||
private:
|
||||
private:
|
||||
const CMutex* m_mutex;
|
||||
};
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
// recursive mutex class
|
||||
class CMutex {
|
||||
public:
|
||||
public:
|
||||
// copy c'tor is equivalent to default c'tor. it's here to
|
||||
// allow copying of objects that have mutexes.
|
||||
CMutex();
|
||||
|
@ -23,11 +23,11 @@ class CMutex {
|
|||
void lock() const;
|
||||
void unlock() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
void init();
|
||||
void fini();
|
||||
|
||||
private:
|
||||
private:
|
||||
friend class CCondVarBase;
|
||||
void* m_mutex;
|
||||
};
|
||||
|
|
10
mt/CThread.h
10
mt/CThread.h
|
@ -8,7 +8,7 @@ class CThreadRep;
|
|||
|
||||
// note -- do not derive from this class
|
||||
class CThread {
|
||||
public:
|
||||
public:
|
||||
// create and start a new thread executing the job.
|
||||
// the user data can be retrieved with getUserData().
|
||||
CThread(IJob* adopted, void* userData = 0);
|
||||
|
@ -115,20 +115,20 @@ class CThread {
|
|||
bool operator==(const CThread&) const;
|
||||
bool operator!=(const CThread&) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
CThread(CThreadRep*);
|
||||
|
||||
private:
|
||||
private:
|
||||
CThreadRep* m_rep;
|
||||
};
|
||||
|
||||
// disables cancellation in the c'tor and enables it in the d'tor.
|
||||
class CThreadMaskCancel {
|
||||
public:
|
||||
public:
|
||||
CThreadMaskCancel() : m_old(CThread::enableCancel(false)) { }
|
||||
~CThreadMaskCancel() { CThread::enableCancel(m_old); }
|
||||
|
||||
private:
|
||||
private:
|
||||
bool m_old;
|
||||
};
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class CMutex;
|
|||
class IJob;
|
||||
|
||||
class CThreadRep {
|
||||
public:
|
||||
public:
|
||||
CThreadRep(IJob*, void* userData);
|
||||
|
||||
// manipulators
|
||||
|
@ -67,10 +67,10 @@ class CThreadRep {
|
|||
// rep has been ref()'d.
|
||||
static CThreadRep* getCurrentThreadRep();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
virtual ~CThreadRep();
|
||||
|
||||
private:
|
||||
private:
|
||||
// internal constructor
|
||||
CThreadRep();
|
||||
|
||||
|
@ -94,7 +94,7 @@ class CThreadRep {
|
|||
CThreadRep(const CThreadRep&);
|
||||
CThreadRep& operator=(const CThreadRep&);
|
||||
|
||||
private:
|
||||
private:
|
||||
static CMutex* s_mutex;
|
||||
static CThreadRep* s_head;
|
||||
|
||||
|
@ -127,18 +127,18 @@ class CThreadRep {
|
|||
//
|
||||
|
||||
class CThreadPtr {
|
||||
public:
|
||||
public:
|
||||
CThreadPtr(CThreadRep* rep) : m_rep(rep) { }
|
||||
~CThreadPtr() { m_rep->unref(); }
|
||||
|
||||
CThreadRep* operator->() const { return m_rep; }
|
||||
|
||||
private:
|
||||
private:
|
||||
// not implemented
|
||||
CThreadPtr(const CThreadPtr&);
|
||||
CThreadPtr& operator=(const CThreadPtr&);
|
||||
|
||||
private:
|
||||
private:
|
||||
CThreadRep* m_rep;
|
||||
};
|
||||
|
||||
|
|
|
@ -6,18 +6,18 @@
|
|||
class CThread;
|
||||
|
||||
class CTimerThread {
|
||||
public:
|
||||
public:
|
||||
CTimerThread(double timeout);
|
||||
~CTimerThread();
|
||||
|
||||
private:
|
||||
private:
|
||||
void timer(void*);
|
||||
|
||||
// not implemented
|
||||
CTimerThread(const CTimerThread&);
|
||||
CTimerThread& operator=(const CTimerThread&);
|
||||
|
||||
private:
|
||||
private:
|
||||
double m_timeout;
|
||||
CThread* m_callingThread;
|
||||
CThread* m_timingThread;
|
||||
|
|
|
@ -10,11 +10,11 @@ class XThread { };
|
|||
// must not throw this type but must rethrow it if caught (by
|
||||
// XThreadExit, XThread, or ...).
|
||||
class XThreadExit : public XThread {
|
||||
public:
|
||||
public:
|
||||
XThreadExit(void* result) : m_result(result) { }
|
||||
~XThreadExit() { }
|
||||
|
||||
public:
|
||||
public:
|
||||
void* m_result;
|
||||
};
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ typedef int ssize_t;
|
|||
// FIXME -- must handle htonl and ilk when defined as macros
|
||||
|
||||
class CNetwork {
|
||||
public:
|
||||
public:
|
||||
#if defined(CONFIG_PLATFORM_WIN32)
|
||||
typedef SOCKET Socket;
|
||||
typedef struct sockaddr Address;
|
||||
|
@ -129,7 +129,7 @@ class CNetwork {
|
|||
static int (PASCAL FAR *gethosterror)(void);
|
||||
|
||||
#if defined(CONFIG_PLATFORM_WIN32)
|
||||
private:
|
||||
private:
|
||||
static void init2(HMODULE);
|
||||
static int PASCAL FAR poll2(PollEntry[], int nfds, int timeout);
|
||||
static ssize_t PASCAL FAR read2(Socket s, void FAR * buf, size_t len);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
class CString;
|
||||
|
||||
class CNetworkAddress {
|
||||
public:
|
||||
public:
|
||||
CNetworkAddress(UInt16 port);
|
||||
CNetworkAddress(const CString& hostname, UInt16 port);
|
||||
~CNetworkAddress();
|
||||
|
@ -20,7 +20,7 @@ class CNetworkAddress {
|
|||
const CNetwork::Address* getAddress() const;
|
||||
CNetwork::AddressLength getAddressLength() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
CNetwork::Address m_address;
|
||||
};
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ class CMutex;
|
|||
class IJob;
|
||||
|
||||
class CSocketInputStream : public IInputStream {
|
||||
public:
|
||||
public:
|
||||
CSocketInputStream(CMutex*, IJob* adoptedCloseCB);
|
||||
~CSocketInputStream();
|
||||
|
||||
|
@ -30,7 +30,7 @@ class CSocketInputStream : public IInputStream {
|
|||
virtual UInt32 read(void*, UInt32 count);
|
||||
virtual UInt32 getSize() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
CMutex* m_mutex;
|
||||
CCondVar<bool> m_empty;
|
||||
IJob* m_closeCB;
|
||||
|
|
|
@ -8,7 +8,7 @@ class CMutex;
|
|||
class IJob;
|
||||
|
||||
class CSocketOutputStream : public IOutputStream {
|
||||
public:
|
||||
public:
|
||||
CSocketOutputStream(CMutex*, IJob* adoptedCloseCB);
|
||||
~CSocketOutputStream();
|
||||
|
||||
|
@ -30,10 +30,10 @@ class CSocketOutputStream : public IOutputStream {
|
|||
virtual UInt32 write(const void*, UInt32 count);
|
||||
virtual void flush();
|
||||
|
||||
private:
|
||||
private:
|
||||
UInt32 getSizeWithLock() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
CMutex* m_mutex;
|
||||
IJob* m_closeCB;
|
||||
CSocketStreamBuffer m_buffer;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <vector>
|
||||
|
||||
class CSocketStreamBuffer {
|
||||
public:
|
||||
public:
|
||||
CSocketStreamBuffer();
|
||||
~CSocketStreamBuffer();
|
||||
|
||||
|
@ -25,7 +25,7 @@ class CSocketStreamBuffer {
|
|||
// return the number of bytes in the buffer
|
||||
UInt32 getSize() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
static const UInt32 kChunkSize;
|
||||
|
||||
typedef std::vector<UInt8> Chunk;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "CNetwork.h"
|
||||
|
||||
class CTCPListenSocket : public IListenSocket {
|
||||
public:
|
||||
public:
|
||||
CTCPListenSocket();
|
||||
~CTCPListenSocket();
|
||||
|
||||
|
@ -18,7 +18,7 @@ class CTCPListenSocket : public IListenSocket {
|
|||
virtual ISocket* accept();
|
||||
virtual void close();
|
||||
|
||||
private:
|
||||
private:
|
||||
CNetwork::Socket m_fd;
|
||||
};
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class CBufferedInputStream;
|
|||
class CBufferedOutputStream;
|
||||
|
||||
class CTCPSocket : public ISocket {
|
||||
public:
|
||||
public:
|
||||
CTCPSocket();
|
||||
CTCPSocket(CNetwork::Socket);
|
||||
~CTCPSocket();
|
||||
|
@ -29,14 +29,14 @@ class CTCPSocket : public ISocket {
|
|||
virtual IInputStream* getInputStream();
|
||||
virtual IOutputStream* getOutputStream();
|
||||
|
||||
private:
|
||||
private:
|
||||
void init();
|
||||
void ioThread(void*);
|
||||
void ioService();
|
||||
void closeInput(void*);
|
||||
void closeOutput(void*);
|
||||
|
||||
private:
|
||||
private:
|
||||
enum { kClosed = 0, kRead = 1, kWrite = 2, kReadWrite = 3 };
|
||||
|
||||
CNetwork::Socket m_fd;
|
||||
|
|
|
@ -9,7 +9,7 @@ class CNetworkAddress;
|
|||
class ISocket;
|
||||
|
||||
class IListenSocket : public IInterface {
|
||||
public:
|
||||
public:
|
||||
// manipulators
|
||||
|
||||
// bind the socket to a particular address
|
||||
|
|
|
@ -11,7 +11,7 @@ class IInputStream;
|
|||
class IOutputStream;
|
||||
|
||||
class ISocket : public IInterface {
|
||||
public:
|
||||
public:
|
||||
// manipulators
|
||||
|
||||
// bind the socket to a particular address
|
||||
|
|
|
@ -8,19 +8,19 @@
|
|||
class XNetwork : public XBase { };
|
||||
|
||||
class XNetworkUnavailable : public XNetwork {
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
||||
class XNetworkFailed : public XNetwork {
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
||||
class XNetworkVersion : public XNetwork {
|
||||
public:
|
||||
public:
|
||||
XNetworkVersion(int major, int minor) throw();
|
||||
|
||||
// accessors
|
||||
|
@ -28,24 +28,24 @@ class XNetworkVersion : public XNetwork {
|
|||
int getMajor() const throw();
|
||||
int getMinor() const throw();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
|
||||
private:
|
||||
private:
|
||||
int m_major;
|
||||
int m_minor;
|
||||
};
|
||||
|
||||
class XNetworkFunctionUnavailable : public XNetwork {
|
||||
public:
|
||||
public:
|
||||
XNetworkFunctionUnavailable(const char* name) throw();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
|
||||
private:
|
||||
private:
|
||||
CString m_name;
|
||||
};
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
class XSocket : public XBase { };
|
||||
|
||||
class XSocketAddress : public XSocket {
|
||||
public:
|
||||
public:
|
||||
enum Error { kUnknown, kNotFound, kNoAddress, kBadPort };
|
||||
|
||||
XSocketAddress(Error, const CString& hostname, SInt16 port) throw();
|
||||
|
@ -19,24 +19,24 @@ class XSocketAddress : public XSocket {
|
|||
virtual CString getHostname() const throw();
|
||||
virtual SInt16 getPort() const throw();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
|
||||
private:
|
||||
private:
|
||||
Error m_error;
|
||||
CString m_hostname;
|
||||
SInt16 m_port;
|
||||
};
|
||||
|
||||
class XSocketErrno : public XSocket, public MXErrno {
|
||||
public:
|
||||
public:
|
||||
XSocketErrno();
|
||||
XSocketErrno(int);
|
||||
};
|
||||
|
||||
class XSocketBind : public XSocketErrno {
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
@ -44,13 +44,13 @@ class XSocketBind : public XSocketErrno {
|
|||
class XSocketAddressInUse : public XSocketBind { };
|
||||
|
||||
class XSocketConnect : public XSocketErrno {
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
||||
class XSocketCreate : public XSocketErrno {
|
||||
protected:
|
||||
protected:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "IPrimaryScreen.h"
|
||||
|
||||
class CMSWindowsPrimaryScreen : public CMSWindowsScreen, public IPrimaryScreen {
|
||||
public:
|
||||
public:
|
||||
typedef bool (CMSWindowsPrimaryScreen::*HookMethod)(int, WPARAM, LPARAM);
|
||||
|
||||
CMSWindowsPrimaryScreen();
|
||||
|
@ -27,14 +27,14 @@ class CMSWindowsPrimaryScreen : public CMSWindowsScreen, public IPrimaryScreen {
|
|||
virtual SInt32 getJumpZoneSize() const;
|
||||
virtual void getClipboard(IClipboard*) const;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// CMSWindowsScreen overrides
|
||||
virtual bool onPreTranslate(MSG*);
|
||||
virtual LRESULT onEvent(HWND, UINT, WPARAM, LPARAM);
|
||||
virtual void onOpenDisplay();
|
||||
virtual void onCloseDisplay();
|
||||
|
||||
private:
|
||||
private:
|
||||
void doEnter();
|
||||
|
||||
void nextMark();
|
||||
|
@ -43,7 +43,7 @@ class CMSWindowsPrimaryScreen : public CMSWindowsScreen, public IPrimaryScreen {
|
|||
KeyModifierMask* maskOut) const;
|
||||
ButtonID mapButton(WPARAM button) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
CServer* m_server;
|
||||
bool m_active;
|
||||
HWND m_window;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <map>
|
||||
|
||||
class CScreenMap {
|
||||
public:
|
||||
public:
|
||||
enum EDirection { kLeft, kRight, kTop, kBottom,
|
||||
kFirstDirection = kLeft, kLastDirection = kBottom };
|
||||
enum EDirectionMask { kLeftMask = 1, kRightMask = 2,
|
||||
|
@ -38,7 +38,7 @@ class CScreenMap {
|
|||
// get the name of a direction (for debugging)
|
||||
static const char* dirName(EDirection);
|
||||
|
||||
private:
|
||||
private:
|
||||
class CCell {
|
||||
public:
|
||||
CString m_neighbor[kLastDirection - kFirstDirection + 1];
|
||||
|
|
|
@ -19,7 +19,7 @@ class ISecurityFactory;
|
|||
class IPrimaryScreen;
|
||||
|
||||
class CServer {
|
||||
public:
|
||||
public:
|
||||
CServer();
|
||||
~CServer();
|
||||
|
||||
|
@ -64,10 +64,10 @@ class CServer {
|
|||
// get the sides of the primary screen that have neighbors
|
||||
UInt32 getActivePrimarySides() const;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
bool onCommandKey(KeyID, KeyModifierMask, bool down);
|
||||
|
||||
private:
|
||||
private:
|
||||
class CCleanupNote {
|
||||
public:
|
||||
CCleanupNote(CServer*);
|
||||
|
@ -155,7 +155,7 @@ class CServer {
|
|||
CScreenInfo* addConnection(const CString& name, IServerProtocol*);
|
||||
void removeConnection(const CString& name);
|
||||
|
||||
private:
|
||||
private:
|
||||
typedef std::list<CThread*> CThreadList;
|
||||
typedef std::map<CString, CScreenInfo*> CScreenList;
|
||||
class CClipboardInfo {
|
||||
|
|
|
@ -9,7 +9,7 @@ class IInputStream;
|
|||
class IOutputStream;
|
||||
|
||||
class CServerProtocol : public IServerProtocol {
|
||||
public:
|
||||
public:
|
||||
CServerProtocol(CServer*, const CString& clientName,
|
||||
IInputStream*, IOutputStream*);
|
||||
~CServerProtocol();
|
||||
|
@ -44,13 +44,13 @@ class CServerProtocol : public IServerProtocol {
|
|||
virtual void sendMouseMove(SInt32 xAbs, SInt32 yAbs) = 0;
|
||||
virtual void sendMouseWheel(SInt32 delta) = 0;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
//IServerProtocol overrides
|
||||
virtual void recvInfo() = 0;
|
||||
virtual void recvClipboard() = 0;
|
||||
virtual void recvGrabClipboard() = 0;
|
||||
|
||||
private:
|
||||
private:
|
||||
CServer* m_server;
|
||||
CString m_client;
|
||||
IInputStream* m_input;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "CServerProtocol.h"
|
||||
|
||||
class CServerProtocol1_0 : public CServerProtocol {
|
||||
public:
|
||||
public:
|
||||
CServerProtocol1_0(CServer*, const CString&, IInputStream*, IOutputStream*);
|
||||
~CServerProtocol1_0();
|
||||
|
||||
|
@ -29,7 +29,7 @@ class CServerProtocol1_0 : public CServerProtocol {
|
|||
virtual void sendMouseMove(SInt32 xAbs, SInt32 yAbs);
|
||||
virtual void sendMouseWheel(SInt32 delta);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// IServerProtocol overrides
|
||||
virtual void recvInfo();
|
||||
virtual void recvClipboard();
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "IPrimaryScreen.h"
|
||||
|
||||
class CXWindowsPrimaryScreen : public CXWindowsScreen, public IPrimaryScreen {
|
||||
public:
|
||||
public:
|
||||
CXWindowsPrimaryScreen();
|
||||
virtual ~CXWindowsPrimaryScreen();
|
||||
|
||||
|
@ -25,13 +25,13 @@ class CXWindowsPrimaryScreen : public CXWindowsScreen, public IPrimaryScreen {
|
|||
virtual SInt32 getJumpZoneSize() const;
|
||||
virtual void getClipboard(ClipboardID, IClipboard*) const;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// CXWindowsScreen overrides
|
||||
virtual void onOpenDisplay();
|
||||
virtual void onCloseDisplay();
|
||||
virtual long getEventMask(Window) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
void selectEvents(Display*, Window) const;
|
||||
void warpCursorNoLock(Display*,
|
||||
SInt32 xAbsolute, SInt32 yAbsolute);
|
||||
|
@ -40,7 +40,7 @@ class CXWindowsPrimaryScreen : public CXWindowsScreen, public IPrimaryScreen {
|
|||
KeyID mapKey(XKeyEvent*) const;
|
||||
ButtonID mapButton(unsigned int button) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
CServer* m_server;
|
||||
bool m_active;
|
||||
Window m_window;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "CString.h"
|
||||
|
||||
class CClipboard : public IClipboard {
|
||||
public:
|
||||
public:
|
||||
CClipboard();
|
||||
virtual ~CClipboard();
|
||||
|
||||
|
@ -40,11 +40,11 @@ class CClipboard : public IClipboard {
|
|||
static void copy(IClipboard* dst, const IClipboard* src);
|
||||
static void copy(IClipboard* dst, const IClipboard* src, Time);
|
||||
|
||||
private:
|
||||
private:
|
||||
UInt32 readUInt32(const char*) const;
|
||||
void writeUInt32(CString*, UInt32) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
Time m_time;
|
||||
bool m_added[kNumFormats];
|
||||
CString m_data[kNumFormats];
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "CMutex.h"
|
||||
|
||||
class CInputPacketStream : public CInputStreamFilter {
|
||||
public:
|
||||
public:
|
||||
CInputPacketStream(IInputStream*, bool adoptStream = true);
|
||||
~CInputPacketStream();
|
||||
|
||||
|
@ -19,11 +19,11 @@ class CInputPacketStream : public CInputStreamFilter {
|
|||
virtual UInt32 read(void*, UInt32 maxCount);
|
||||
virtual UInt32 getSize() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
UInt32 getSizeNoLock() const;
|
||||
bool hasFullMessage() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
CMutex m_mutex;
|
||||
mutable UInt32 m_size;
|
||||
mutable CBufferedInputStream m_buffer;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <windows.h>
|
||||
|
||||
class CMSWindowsClipboard : public IClipboard {
|
||||
public:
|
||||
public:
|
||||
CMSWindowsClipboard(HWND window);
|
||||
virtual ~CMSWindowsClipboard();
|
||||
|
||||
|
@ -16,12 +16,12 @@ class CMSWindowsClipboard : public IClipboard {
|
|||
virtual bool has(EFormat) const;
|
||||
virtual CString get(EFormat) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
UINT convertFormatToWin32(EFormat) const;
|
||||
HANDLE convertTextToWin32(const CString& data) const;
|
||||
CString convertTextFromWin32(HANDLE) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
HWND m_window;
|
||||
};
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ class CString;
|
|||
class CThread;
|
||||
|
||||
class CMSWindowsScreen {
|
||||
public:
|
||||
public:
|
||||
CMSWindowsScreen();
|
||||
virtual ~CMSWindowsScreen();
|
||||
|
||||
|
@ -18,7 +18,7 @@ class CMSWindowsScreen {
|
|||
|
||||
static void init(HINSTANCE);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// runs an event loop and returns when WM_QUIT is received
|
||||
void doRun();
|
||||
|
||||
|
@ -62,10 +62,10 @@ class CMSWindowsScreen {
|
|||
// called by closeDisplay() to
|
||||
virtual void onCloseDisplay() = 0;
|
||||
|
||||
private:
|
||||
private:
|
||||
static LRESULT CALLBACK wndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
private:
|
||||
private:
|
||||
static HINSTANCE s_instance;
|
||||
ATOM m_class;
|
||||
HICON m_icon;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "COutputStreamFilter.h"
|
||||
|
||||
class COutputPacketStream : public COutputStreamFilter {
|
||||
public:
|
||||
public:
|
||||
COutputPacketStream(IOutputStream*, bool adoptStream = true);
|
||||
~COutputPacketStream();
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ class IInputStream;
|
|||
class IOutputStream;
|
||||
|
||||
class CProtocolUtil {
|
||||
public:
|
||||
public:
|
||||
// write formatted binary data to a stream. fmt consists of
|
||||
// regular characters and format specifiers. format specifiers
|
||||
// begin with %. all characters not part of a format specifier
|
||||
|
@ -37,7 +37,7 @@ class CProtocolUtil {
|
|||
static void readf(IInputStream*,
|
||||
const char* fmt, ...);
|
||||
|
||||
private:
|
||||
private:
|
||||
static UInt32 getLength(const char* fmt, va_list);
|
||||
static void writef(void*, const char* fmt, va_list);
|
||||
static UInt32 eatLength(const char** fmt);
|
||||
|
@ -45,7 +45,7 @@ class CProtocolUtil {
|
|||
};
|
||||
|
||||
class XIOReadMismatch : public XIO {
|
||||
public:
|
||||
public:
|
||||
// XBase overrides
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "ISocketFactory.h"
|
||||
|
||||
class CTCPSocketFactory : public ISocketFactory {
|
||||
public:
|
||||
public:
|
||||
CTCPSocketFactory();
|
||||
virtual ~CTCPSocketFactory();
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "IClipboard.h"
|
||||
|
||||
class CXWindowsClipboard : public IClipboard {
|
||||
public:
|
||||
public:
|
||||
CXWindowsClipboard();
|
||||
virtual ~CXWindowsClipboard();
|
||||
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
class CString;
|
||||
|
||||
class CXWindowsScreen {
|
||||
public:
|
||||
public:
|
||||
CXWindowsScreen();
|
||||
virtual ~CXWindowsScreen();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
class CDisplayLock {
|
||||
public:
|
||||
CDisplayLock(const CXWindowsScreen*);
|
||||
|
@ -104,7 +104,7 @@ class CXWindowsScreen {
|
|||
// get the X event mask required by the subclass for the given window
|
||||
virtual long getEventMask(Window) const = 0;
|
||||
|
||||
private:
|
||||
private:
|
||||
struct CPropertyNotifyInfo {
|
||||
public:
|
||||
Window m_window;
|
||||
|
@ -147,7 +147,7 @@ class CXWindowsScreen {
|
|||
bool wasOwnedAtTime(ClipboardID, Window, Time) const;
|
||||
Time getCurrentTimeNoLock(Window) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
class CClipboardInfo {
|
||||
public:
|
||||
CClipboardInfo();
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
class CString;
|
||||
|
||||
class IClipboard : public IInterface {
|
||||
public:
|
||||
public:
|
||||
// timestamp type. timestamps are in milliseconds from some
|
||||
// arbitrary starting time. timestamps will wrap around to 0
|
||||
// after about 49 3/4 days.
|
||||
|
|
|
@ -9,7 +9,7 @@ class CServer;
|
|||
class IClipboard;
|
||||
|
||||
class IPrimaryScreen : public IInterface {
|
||||
public:
|
||||
public:
|
||||
// manipulators
|
||||
|
||||
// enter the screen's message loop. this returns when it detects
|
||||
|
|
|
@ -11,7 +11,7 @@ class CClient;
|
|||
class IClipboard;
|
||||
|
||||
class ISecondaryScreen : public IInterface {
|
||||
public:
|
||||
public:
|
||||
// manipulators
|
||||
|
||||
// enter the screen's message loop. this returns when it detects
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
class IClipboard;
|
||||
|
||||
class IServerProtocol : public IInterface {
|
||||
public:
|
||||
public:
|
||||
// manipulators
|
||||
|
||||
// process messages from the client and insert the appropriate
|
||||
|
@ -39,7 +39,7 @@ class IServerProtocol : public IInterface {
|
|||
|
||||
// accessors
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// manipulators
|
||||
|
||||
virtual void recvInfo() = 0;
|
||||
|
|
|
@ -8,7 +8,7 @@ class ISocket;
|
|||
class IListenSocket;
|
||||
|
||||
class ISocketFactory : public IInterface {
|
||||
public:
|
||||
public:
|
||||
// manipulators
|
||||
|
||||
// accessors
|
||||
|
|
|
@ -7,13 +7,13 @@ class XSynergy : public XBase { };
|
|||
|
||||
// client is misbehaving
|
||||
class XBadClient : public XSynergy {
|
||||
protected:
|
||||
protected:
|
||||
virtual CString getWhat() const throw();
|
||||
};
|
||||
|
||||
// client has incompatible version
|
||||
class XIncompatibleClient : public XSynergy {
|
||||
public:
|
||||
public:
|
||||
XIncompatibleClient(int major, int minor);
|
||||
|
||||
// manipulators
|
||||
|
@ -23,10 +23,10 @@ class XIncompatibleClient : public XSynergy {
|
|||
int getMajor() const throw();
|
||||
int getMinor() const throw();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
virtual CString getWhat() const throw();
|
||||
|
||||
private:
|
||||
private:
|
||||
int m_major;
|
||||
int m_minor;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue