diff --git a/base/CFunctionJob.h b/base/CFunctionJob.h index 346d28e5..f3b5272d 100644 --- a/base/CFunctionJob.h +++ b/base/CFunctionJob.h @@ -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; }; diff --git a/base/CLog.h b/base/CLog.h index 2775df16..ae8fdc10 100644 --- a/base/CLog.h +++ b/base/CLog.h @@ -4,19 +4,19 @@ #include 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; }; diff --git a/base/CStopwatch.cpp b/base/CStopwatch.cpp index f7adac6b..6a346a7f 100644 --- a/base/CStopwatch.cpp +++ b/base/CStopwatch.cpp @@ -135,7 +135,7 @@ static PTimeGetTime s_tgt = NULL; // class CStopwatchInit { - public: +public: CStopwatchInit(); ~CStopwatchInit(); }; diff --git a/base/CStopwatch.h b/base/CStopwatch.h index da0c1ab5..791729f2 100644 --- a/base/CStopwatch.h +++ b/base/CStopwatch.h @@ -4,54 +4,54 @@ #include "common.h" class CStopwatch { - public: - // the default constructor does an implicit reset() or setTrigger(). - // if triggered == false then the clock starts ticking. - CStopwatch(bool triggered = false); - ~CStopwatch(); +public: + // the default constructor does an implicit reset() or setTrigger(). + // if triggered == false then the clock starts ticking. + CStopwatch(bool triggered = false); + ~CStopwatch(); - // manipulators + // manipulators - // set the start time to the current time, returning the time since - // the last reset. this does not remove the trigger if it's set nor - // does it start a stopped clock. if the clock is stopped then - // subsequent reset()'s will return 0. - double reset(); + // set the start time to the current time, returning the time since + // the last reset. this does not remove the trigger if it's set nor + // does it start a stopped clock. if the clock is stopped then + // subsequent reset()'s will return 0. + double reset(); - // stop and start the stopwatch. while stopped, no time elapses. - // stop() does not remove the trigger but start() does, even if - // the clock was already started. - void stop(); - void start(); + // stop and start the stopwatch. while stopped, no time elapses. + // stop() does not remove the trigger but start() does, even if + // the clock was already started. + void stop(); + void start(); - // setTrigger() stops the clock like stop() except there's an - // implicit start() the next time (non-const) getTime() is called. - // this is useful when you want the clock to start the first time - // you check it. - void setTrigger(); + // setTrigger() stops the clock like stop() except there's an + // implicit start() the next time (non-const) getTime() is called. + // this is useful when you want the clock to start the first time + // you check it. + void setTrigger(); - // return the time since the last reset() (or call reset() and - // return zero if the trigger is set). - double getTime(); + // return the time since the last reset() (or call reset() and + // return zero if the trigger is set). + double getTime(); operator double(); - // accessors + // accessors - // returns true if the watch is stopped - bool isStopped() const; + // returns true if the watch is stopped + bool isStopped() const; - // return the time since the last reset(). these cannot trigger - // the clock to start so if the trigger is set it's as if it wasn't. - double getTime() const; + // return the time since the last reset(). these cannot trigger + // the clock to start so if the trigger is set it's as if it wasn't. + double getTime() const; operator double() const; - private: - double getClock() const; +private: + double getClock() const; - private: - double m_mark; - bool m_triggered; - bool m_stopped; +private: + double m_mark; + bool m_triggered; + bool m_stopped; }; #endif diff --git a/base/CString.h b/base/CString.h index 88041939..547152e3 100644 --- a/base/CString.h +++ b/base/CString.h @@ -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; diff --git a/base/IInterface.h b/base/IInterface.h index bb3676bc..52b4bde4 100644 --- a/base/IInterface.h +++ b/base/IInterface.h @@ -4,7 +4,7 @@ #include "common.h" class IInterface { - public: +public: virtual ~IInterface() { } }; diff --git a/base/IJob.h b/base/IJob.h index 3efb1b51..f13a359c 100644 --- a/base/IJob.h +++ b/base/IJob.h @@ -4,7 +4,7 @@ #include "IInterface.h" class IJob : public IInterface { - public: +public: virtual void run() = 0; }; diff --git a/base/TMethodJob.h b/base/TMethodJob.h index 8e889b3d..f9514bf2 100644 --- a/base/TMethodJob.h +++ b/base/TMethodJob.h @@ -5,13 +5,13 @@ template 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; diff --git a/base/XBase.h b/base/XBase.h index 196f2122..8ab63b5f 100644 --- a/base/XBase.h +++ b/base/XBase.h @@ -5,7 +5,7 @@ #include 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; }; diff --git a/client/CClient.h b/client/CClient.h index f2cf0628..ac471ecd 100644 --- a/client/CClient.h +++ b/client/CClient.h @@ -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; diff --git a/client/CMSWindowsSecondaryScreen.cpp b/client/CMSWindowsSecondaryScreen.cpp index 94507e4e..74ce2874 100644 --- a/client/CMSWindowsSecondaryScreen.cpp +++ b/client/CMSWindowsSecondaryScreen.cpp @@ -31,14 +31,14 @@ static DWORD s_thread = 0; static BOOL CALLBACK WINAPI debugProc(HWND, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { - case WM_INITDIALOG: + case WM_INITDIALOG: return TRUE; - case WM_CLOSE: + case WM_CLOSE: PostQuitMessage(0); return TRUE; - case WM_APP: + case WM_APP: if (!s_logMore.empty()) { if (s_log.size() > 20000) s_log = s_logMore; @@ -194,19 +194,19 @@ void CMSWindowsSecondaryScreen::mouseDown(ButtonID button) // map button id to button flag DWORD flags; switch (button) { - case kButtonLeft: + case kButtonLeft: flags = MOUSEEVENTF_LEFTDOWN; break; - case kButtonMiddle: + case kButtonMiddle: flags = MOUSEEVENTF_MIDDLEDOWN; break; - case kButtonRight: + case kButtonRight: flags = MOUSEEVENTF_RIGHTDOWN; break; - default: + default: return; } @@ -219,19 +219,19 @@ void CMSWindowsSecondaryScreen::mouseUp(ButtonID button) // map button id to button flag DWORD flags; switch (button) { - case kButtonLeft: + case kButtonLeft: flags = MOUSEEVENTF_LEFTUP; break; - case kButtonMiddle: + case kButtonMiddle: flags = MOUSEEVENTF_MIDDLEUP; break; - case kButtonRight: + case kButtonRight: flags = MOUSEEVENTF_RIGHTUP; break; - default: + default: return; } @@ -361,12 +361,12 @@ LRESULT CMSWindowsSecondaryScreen::onEvent( WPARAM wParam, LPARAM lParam) { switch (msg) { - // FIXME -- handle display changes - case WM_PAINT: + // FIXME -- handle display changes + case WM_PAINT: ValidateRect(hwnd, NULL); return 0; - case WM_ACTIVATEAPP: + case WM_ACTIVATEAPP: if (wParam == FALSE) { // some other app activated. hide the hider window. log((CLOG_INFO "show cursor")); @@ -374,7 +374,7 @@ LRESULT CMSWindowsSecondaryScreen::onEvent( } break; - case WM_DRAWCLIPBOARD: + case WM_DRAWCLIPBOARD: log((CLOG_DEBUG "clipboard was taken")); // first pass it on @@ -389,7 +389,7 @@ LRESULT CMSWindowsSecondaryScreen::onEvent( } return 0; - case WM_CHANGECBCHAIN: + case WM_CHANGECBCHAIN: if (m_nextClipboardWindow == (HWND)wParam) m_nextClipboardWindow = (HWND)lParam; else diff --git a/client/CMSWindowsSecondaryScreen.h b/client/CMSWindowsSecondaryScreen.h index 12763e60..196817af 100644 --- a/client/CMSWindowsSecondaryScreen.h +++ b/client/CMSWindowsSecondaryScreen.h @@ -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; diff --git a/client/CXWindowsSecondaryScreen.cpp b/client/CXWindowsSecondaryScreen.cpp index d4d1c912..cc935285 100644 --- a/client/CXWindowsSecondaryScreen.cpp +++ b/client/CXWindowsSecondaryScreen.cpp @@ -38,7 +38,7 @@ void CXWindowsSecondaryScreen::run() // handle event switch (xevent.type) { - case MappingNotify: { + case MappingNotify: { // keyboard mapping changed CDisplayLock display(this); XRefreshKeyboardMapping(&xevent.xmapping); @@ -47,17 +47,17 @@ void CXWindowsSecondaryScreen::run() updateModifierMap(display); updateModifiers(display); break; - } + } - case LeaveNotify: { + case LeaveNotify: { // mouse moved out of hider window somehow. hide the window. assert(m_window != None); CDisplayLock display(this); XUnmapWindow(display, m_window); break; - } + } - case SelectionClear: + case SelectionClear: // we just lost the selection. that means someone else // grabbed the selection so this screen is now the // selection owner. report that to the server. @@ -68,7 +68,7 @@ void CXWindowsSecondaryScreen::run() } break; - case SelectionNotify: + case SelectionNotify: // notification of selection transferred. we shouldn't // get this here because we handle them in the selection // retrieval methods. we'll just delete the property @@ -79,7 +79,7 @@ void CXWindowsSecondaryScreen::run() } break; - case SelectionRequest: + case SelectionRequest: // somebody is asking for clipboard data if (xevent.xselectionrequest.owner == m_window) { addClipboardRequest(m_window, @@ -105,7 +105,7 @@ void CXWindowsSecondaryScreen::run() } break; - case PropertyNotify: + case PropertyNotify: // clipboard transfers involve property changes so forward // the event to the superclass. we only care about the // deletion of properties. @@ -116,7 +116,7 @@ void CXWindowsSecondaryScreen::run() } break; - case DestroyNotify: + case DestroyNotify: // looks like one of the windows that requested a clipboard // transfer has gone bye-bye. destroyClipboardRequest(xevent.xdestroywindow.window); diff --git a/client/CXWindowsSecondaryScreen.h b/client/CXWindowsSecondaryScreen.h index 29809de6..4e0f8c2e 100644 --- a/client/CXWindowsSecondaryScreen.h +++ b/client/CXWindowsSecondaryScreen.h @@ -6,7 +6,7 @@ #include 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; diff --git a/io/CBufferedInputStream.h b/io/CBufferedInputStream.h index 28fbdd27..d1abfea2 100644 --- a/io/CBufferedInputStream.h +++ b/io/CBufferedInputStream.h @@ -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 m_empty; IJob* m_closeCB; diff --git a/io/CBufferedOutputStream.h b/io/CBufferedOutputStream.h index a88e2357..1afbc118 100644 --- a/io/CBufferedOutputStream.h +++ b/io/CBufferedOutputStream.h @@ -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; diff --git a/io/CInputStreamFilter.h b/io/CInputStreamFilter.h index 0e4dd41b..85487226 100644 --- a/io/CInputStreamFilter.h +++ b/io/CInputStreamFilter.h @@ -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; }; diff --git a/io/COutputStreamFilter.h b/io/COutputStreamFilter.h index c6b02a46..781fa2d4 100644 --- a/io/COutputStreamFilter.h +++ b/io/COutputStreamFilter.h @@ -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; }; diff --git a/io/CStreamBuffer.h b/io/CStreamBuffer.h index 7333de90..2338b8da 100644 --- a/io/CStreamBuffer.h +++ b/io/CStreamBuffer.h @@ -6,7 +6,7 @@ #include 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 Chunk; diff --git a/io/IInputStream.h b/io/IInputStream.h index 3650dfd4..700e11a0 100644 --- a/io/IInputStream.h +++ b/io/IInputStream.h @@ -6,7 +6,7 @@ #include "XIO.h" class IInputStream : public IInterface { - public: +public: // manipulators // close the stream diff --git a/io/IOutputStream.h b/io/IOutputStream.h index ca1a196c..688f5af7 100644 --- a/io/IOutputStream.h +++ b/io/IOutputStream.h @@ -6,7 +6,7 @@ #include "XIO.h" class IOutputStream : public IInterface { - public: +public: // manipulators // close the stream diff --git a/io/XIO.h b/io/XIO.h index b468e764..743c0aaa 100644 --- a/io/XIO.h +++ b/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(); }; diff --git a/mt/CCondVar.cpp b/mt/CCondVar.cpp index 7e39e7f4..9aeb7d8f 100644 --- a/mt/CCondVar.cpp +++ b/mt/CCondVar.cpp @@ -148,14 +148,14 @@ bool CCondVarBase::wait( } switch (status) { - case 0: + case 0: // success return true; - case ETIMEDOUT: + case ETIMEDOUT: return false; - default: + default: assert(0 && "condition variable wait error"); return false; } @@ -183,8 +183,8 @@ void CCondVarBase::init() { // prepare events HANDLE* events = new HANDLE[2]; - events[kSignal] = CreateEvent(NULL, FALSE, FALSE, NULL); - events[kBroadcast] = CreateEvent(NULL, TRUE, FALSE, NULL); + events[kSignal] = CreateEvent(NULL, FALSE, FALSE, NULL); + events[kBroadcast] = CreateEvent(NULL, TRUE, FALSE, NULL); // prepare members m_cond = reinterpret_cast(events); @@ -194,8 +194,8 @@ void CCondVarBase::init() void CCondVarBase::fini() { HANDLE* events = reinterpret_cast(m_cond); - CloseHandle(events[kSignal]); - CloseHandle(events[kBroadcast]); + CloseHandle(events[kSignal]); + CloseHandle(events[kBroadcast]); delete[] events; } @@ -210,7 +210,7 @@ void CCondVarBase::signal() // wake one thread if anybody is waiting if (hasWaiter) - SetEvent(reinterpret_cast(m_cond)[kSignal]); + SetEvent(reinterpret_cast(m_cond)[kSignal]); } void CCondVarBase::broadcast() @@ -224,7 +224,7 @@ void CCondVarBase::broadcast() // wake all threads if anybody is waiting if (hasWaiter) - SetEvent(reinterpret_cast(m_cond)[kBroadcast]); + SetEvent(reinterpret_cast(m_cond)[kBroadcast]); } bool CCondVarBase::wait( diff --git a/mt/CCondVar.h b/mt/CCondVar.h index 083962ab..b0663db8 100644 --- a/mt/CCondVar.h +++ b/mt/CCondVar.h @@ -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 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; }; diff --git a/mt/CLock.h b/mt/CLock.h index 9ab933ce..d554733f 100644 --- a/mt/CLock.h +++ b/mt/CLock.h @@ -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; }; diff --git a/mt/CMutex.cpp b/mt/CMutex.cpp index b9ceb5d5..2d092b8d 100644 --- a/mt/CMutex.cpp +++ b/mt/CMutex.cpp @@ -60,19 +60,19 @@ void CMutex::lock() const int status = pthread_mutex_lock(mutex); switch (status) { - case 0: + case 0: // success return; - case EDEADLK: + case EDEADLK: assert(0 && "lock already owned"); break; - case EAGAIN: + case EAGAIN: assert(0 && "too many recursive locks"); break; - default: + default: log((CLOG_ERR "pthread_mutex_lock status %d", status)); assert(0 && "unexpected error"); } @@ -84,15 +84,15 @@ void CMutex::unlock() const int status = pthread_mutex_unlock(mutex); switch (status) { - case 0: + case 0: // success return; - case EPERM: + case EPERM: assert(0 && "thread doesn't own a lock"); break; - default: + default: log((CLOG_ERR "pthread_mutex_unlock status %d", status)); assert(0 && "unexpected error"); } diff --git a/mt/CMutex.h b/mt/CMutex.h index 77612366..cf43ea70 100644 --- a/mt/CMutex.h +++ b/mt/CMutex.h @@ -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(); @@ -14,22 +14,22 @@ class CMutex { // manipulators - // this has no effect. it's only here to allow assignment of + // this has no effect. it's only here to allow assignment of // objects that have mutexes. - CMutex& operator=(const CMutex&); + CMutex& operator=(const CMutex&); // accessors void lock() const; void unlock() const; - private: +private: void init(); void fini(); - private: +private: friend class CCondVarBase; - void* m_mutex; + void* m_mutex; }; #endif diff --git a/mt/CThread.h b/mt/CThread.h index f505ad00..982a1912 100644 --- a/mt/CThread.h +++ b/mt/CThread.h @@ -8,44 +8,44 @@ class CThreadRep; // note -- do not derive from this class class CThread { - public: - // create and start a new thread executing the job. +public: + // create and start a new thread executing the job. // the user data can be retrieved with getUserData(). - CThread(IJob* adopted, void* userData = 0); + CThread(IJob* adopted, void* userData = 0); - // make a new thread object that refers to an existing thread. + // make a new thread object that refers to an existing thread. // this does *not* start a new thread. - CThread(const CThread&); + CThread(const CThread&); - // release thread. this does not terminate the thread. a thread - // will keep running until the job completes or calls exit(). - ~CThread(); + // release thread. this does not terminate the thread. a thread + // will keep running until the job completes or calls exit(). + ~CThread(); - // manipulators + // manipulators - // assign thread. this has no effect on the threads. it simply - // makes this thread object refer to another thread. it does *not* + // assign thread. this has no effect on the threads. it simply + // makes this thread object refer to another thread. it does *not* // start a new thread. - CThread& operator=(const CThread&); + CThread& operator=(const CThread&); // initialize the thread library. this must be called before // any other thread methods or creating a thread object. it // is harmless to call init() multiple times. static void init(); - // the calling thread sleeps for the given number of seconds. if - // timeout <= 0.0 then the call returns immediately. if timeout + // the calling thread sleeps for the given number of seconds. if + // timeout <= 0.0 then the call returns immediately. if timeout // == 0.0 then the calling thread yields the CPU. // (cancellation point) - static void sleep(double timeout); + static void sleep(double timeout); - // terminate the calling thread. this function does not return but - // the stack is unwound and automatic objects are destroyed, as if - // exit() threw an exception (which is, in fact, what it does). the - // argument is saved as the result returned by getResult(). if you - // have a catch(...) block then you should add the following before - // it to avoid catching the exit: catch(CThreadExit&) { throw; } - static void exit(void*); + // terminate the calling thread. this function does not return but + // the stack is unwound and automatic objects are destroyed, as if + // exit() threw an exception (which is, in fact, what it does). the + // argument is saved as the result returned by getResult(). if you + // have a catch(...) block then you should add the following before + // it to avoid catching the exit: catch(CThreadExit&) { throw; } + static void exit(void*); // enable/disable cancellation. default is enabled. this is not // a cancellation point so if you enabled cancellation and want to @@ -76,26 +76,26 @@ class CThread { // exception. clients that catch(...) must either rethrow the // exception or include a catch (XThreadCancel) handler that // rethrows. - void cancel(); + void cancel(); - // change the priority of the thread. normal priority is 0, 1 is + // change the priority of the thread. normal priority is 0, 1 is // the next lower, etc. -1 is the next higher, etc. but boosting // the priority may not be available. - void setPriority(int n); + void setPriority(int n); - // accessors + // accessors - // return a thread object representing the calling thread - static CThread getCurrentThread(); + // return a thread object representing the calling thread + static CThread getCurrentThread(); - // get the user data passed to the constructor for the current + // get the user data passed to the constructor for the current // thread. - static void* getUserData(); + static void* getUserData(); - // testCancel() does nothing but is a cancellation point. call + // testCancel() does nothing but is a cancellation point. call // this to make a function itself a cancellation point. // (cancellation point) - static void testCancel(); + static void testCancel(); // waits for the thread to terminate (by exit() or cancel() or // by returning from the thread job). returns immediately if @@ -105,30 +105,30 @@ class CThread { // (cancellation point) bool wait(double timeout = -1.0) const; - // get the exit result. does an implicit wait(). returns NULL + // get the exit result. does an implicit wait(). returns NULL // immediately if called by a thread on itself. returns NULL for // threads that were cancelled. // (cancellation point) void* getResult() const; - // compare threads for (in)equality - bool operator==(const CThread&) const; - bool operator!=(const CThread&) const; + // compare threads for (in)equality + bool operator==(const CThread&) const; + bool operator!=(const CThread&) const; - private: - CThread(CThreadRep*); +private: + CThread(CThreadRep*); - private: - CThreadRep* m_rep; +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; }; diff --git a/mt/CThreadRep.cpp b/mt/CThreadRep.cpp index e40df753..4b2de42a 100644 --- a/mt/CThreadRep.cpp +++ b/mt/CThreadRep.cpp @@ -518,15 +518,15 @@ bool CThreadRep::wait(CThreadRep* target, double timeout) // handle result switch (result) { - case WAIT_OBJECT_0 + 0: + case WAIT_OBJECT_0 + 0: // target thread terminated return true; - case WAIT_OBJECT_0 + 1: + case WAIT_OBJECT_0 + 1: // this thread was cancelled. does not return. testCancel(); - default: + default: // error return false; } @@ -536,16 +536,16 @@ void CThreadRep::setPriority(int n) { if (n < 0) { switch (-n) { - case 1: n = THREAD_PRIORITY_ABOVE_NORMAL; break; - default: n = THREAD_PRIORITY_HIGHEST; break; + case 1: n = THREAD_PRIORITY_ABOVE_NORMAL; break; + default: n = THREAD_PRIORITY_HIGHEST; break; } } else { switch (n) { - case 0: n = THREAD_PRIORITY_NORMAL; break; - case 1: n = THREAD_PRIORITY_BELOW_NORMAL; break; - case 2: n = THREAD_PRIORITY_LOWEST; break; - default: n = THREAD_PRIORITY_IDLE; break; + case 0: n = THREAD_PRIORITY_NORMAL; break; + case 1: n = THREAD_PRIORITY_BELOW_NORMAL; break; + case 2: n = THREAD_PRIORITY_LOWEST; break; + default: n = THREAD_PRIORITY_IDLE; break; } } SetThreadPriority(m_thread, n); diff --git a/mt/CThreadRep.h b/mt/CThreadRep.h index 3a14ba09..c0c7b9a0 100644 --- a/mt/CThreadRep.h +++ b/mt/CThreadRep.h @@ -13,7 +13,7 @@ class CMutex; class IJob; class CThreadRep { - public: +public: CThreadRep(IJob*, void* userData); // manipulators @@ -25,9 +25,9 @@ class CThreadRep { void ref(); void unref(); - // the calling thread sleeps for t seconds. if t == 0.0 then - // the thread yields the CPU. - void sleep(double timeout); + // the calling thread sleeps for t seconds. if t == 0.0 then + // the thread yields the CPU. + void sleep(double timeout); // cancel the thread void cancel(); @@ -42,16 +42,16 @@ class CThreadRep { // wait for thread to exit or for current thread to cancel bool wait(CThreadRep*, double timeout); - // set the priority - void setPriority(int n); + // set the priority + void setPriority(int n); - // accessors + // accessors - // get the exit result for this thread. thread must be terminated. - void* getResult() const; + // get the exit result for this thread. thread must be terminated. + void* getResult() const; - // get the user data passed to the constructor - void* getUserData() const; + // get the user data passed to the constructor + void* getUserData() const; // get the current cancellable state bool isCancellable() const; @@ -63,14 +63,14 @@ class CThreadRep { HANDLE getCancelEvent() const; #endif - // return the thread rep for the calling thread. the returned - // rep has been ref()'d. - static CThreadRep* getCurrentThreadRep(); + // return the thread rep for the calling thread. the returned + // 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; }; diff --git a/mt/CTimerThread.h b/mt/CTimerThread.h index 48ca64cb..817642d3 100644 --- a/mt/CTimerThread.h +++ b/mt/CTimerThread.h @@ -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; diff --git a/mt/XThread.h b/mt/XThread.h index 3fd7441f..bc56a44c 100644 --- a/mt/XThread.h +++ b/mt/XThread.h @@ -10,12 +10,12 @@ class XThread { }; // must not throw this type but must rethrow it if caught (by // XThreadExit, XThread, or ...). class XThreadExit : public XThread { - public: - XThreadExit(void* result) : m_result(result) { } - ~XThreadExit() { } +public: + XThreadExit(void* result) : m_result(result) { } + ~XThreadExit() { } - public: - void* m_result; +public: + void* m_result; }; // thrown to cancel a thread. clients must not throw this type, but diff --git a/net/CNetwork.h b/net/CNetwork.h index fdbb2ae2..fcc65e40 100644 --- a/net/CNetwork.h +++ b/net/CNetwork.h @@ -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); diff --git a/net/CNetworkAddress.cpp b/net/CNetworkAddress.cpp index a07d5ac7..1d832475 100644 --- a/net/CNetworkAddress.cpp +++ b/net/CNetworkAddress.cpp @@ -24,15 +24,15 @@ CNetworkAddress::CNetworkAddress(const CString& hostname, UInt16 port) struct hostent* hent = CNetwork::gethostbyname(hostname.c_str()); if (hent == NULL) { switch (CNetwork::gethosterror()) { - case CNetwork::kHOST_NOT_FOUND: + case CNetwork::kHOST_NOT_FOUND: throw XSocketAddress(XSocketAddress::kNotFound, hostname, port); - case CNetwork::kNO_DATA: + case CNetwork::kNO_DATA: throw XSocketAddress(XSocketAddress::kNoAddress, hostname, port); - case CNetwork::kNO_RECOVERY: - case CNetwork::kTRY_AGAIN: - default: + case CNetwork::kNO_RECOVERY: + case CNetwork::kTRY_AGAIN: + default: throw XSocketAddress(XSocketAddress::kUnknown, hostname, port); } } diff --git a/net/CNetworkAddress.h b/net/CNetworkAddress.h index 18d69812..6b1729d5 100644 --- a/net/CNetworkAddress.h +++ b/net/CNetworkAddress.h @@ -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; }; diff --git a/net/CSocketInputStream.h b/net/CSocketInputStream.h index 38096538..3e686df3 100644 --- a/net/CSocketInputStream.h +++ b/net/CSocketInputStream.h @@ -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 m_empty; IJob* m_closeCB; diff --git a/net/CSocketOutputStream.h b/net/CSocketOutputStream.h index c959c140..4f65b5c1 100644 --- a/net/CSocketOutputStream.h +++ b/net/CSocketOutputStream.h @@ -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; diff --git a/net/CSocketStreamBuffer.h b/net/CSocketStreamBuffer.h index 545fd25f..cf6f2344 100644 --- a/net/CSocketStreamBuffer.h +++ b/net/CSocketStreamBuffer.h @@ -6,7 +6,7 @@ #include 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 Chunk; diff --git a/net/CTCPListenSocket.h b/net/CTCPListenSocket.h index 20031d17..3120d00b 100644 --- a/net/CTCPListenSocket.h +++ b/net/CTCPListenSocket.h @@ -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; }; diff --git a/net/CTCPSocket.h b/net/CTCPSocket.h index 56da71b4..70fe9770 100644 --- a/net/CTCPSocket.h +++ b/net/CTCPSocket.h @@ -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; diff --git a/net/IListenSocket.h b/net/IListenSocket.h index f411412e..f62f2239 100644 --- a/net/IListenSocket.h +++ b/net/IListenSocket.h @@ -9,7 +9,7 @@ class CNetworkAddress; class ISocket; class IListenSocket : public IInterface { - public: +public: // manipulators // bind the socket to a particular address diff --git a/net/ISocket.h b/net/ISocket.h index 2c86e561..0a28ccc7 100644 --- a/net/ISocket.h +++ b/net/ISocket.h @@ -11,7 +11,7 @@ class IInputStream; class IOutputStream; class ISocket : public IInterface { - public: +public: // manipulators // bind the socket to a particular address diff --git a/net/XNetwork.h b/net/XNetwork.h index 21e91574..a971d423 100644 --- a/net/XNetwork.h +++ b/net/XNetwork.h @@ -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; }; diff --git a/net/XSocket.h b/net/XSocket.h index 578009fa..7a5cc6f5 100644 --- a/net/XSocket.h +++ b/net/XSocket.h @@ -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(); }; diff --git a/server/CMSWindowsPrimaryScreen.cpp b/server/CMSWindowsPrimaryScreen.cpp index d2775577..f7ef900e 100644 --- a/server/CMSWindowsPrimaryScreen.cpp +++ b/server/CMSWindowsPrimaryScreen.cpp @@ -38,14 +38,14 @@ static DWORD s_thread = 0; static BOOL CALLBACK WINAPI debugProc(HWND, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { - case WM_INITDIALOG: + case WM_INITDIALOG: return TRUE; - case WM_CLOSE: + case WM_CLOSE: PostQuitMessage(0); return TRUE; - case WM_APP: + case WM_APP: if (!s_logMore.empty()) { if (s_log.size() > 20000) s_log = s_logMore; @@ -340,11 +340,11 @@ if (IsDialogMessage(s_debug, msg)) { // handle event switch (msg->message) { - case SYNERGY_MSG_MARK: + case SYNERGY_MSG_MARK: m_markReceived = msg->wParam; return true; - case SYNERGY_MSG_KEY: + case SYNERGY_MSG_KEY: // ignore if not at current mark if (m_mark == m_markReceived) { KeyModifierMask mask; @@ -373,23 +373,23 @@ log((CLOG_DEBUG "event: key event vk=%d info=0x%08x", msg->wParam, msg->lParam)) } return true; - case SYNERGY_MSG_MOUSE_BUTTON: + case SYNERGY_MSG_MOUSE_BUTTON: // ignore if not at current mark if (m_mark == m_markReceived) { const ButtonID button = mapButton(msg->wParam); switch (msg->wParam) { - case WM_LBUTTONDOWN: - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: + case WM_LBUTTONDOWN: + case WM_MBUTTONDOWN: + case WM_RBUTTONDOWN: log((CLOG_DEBUG "event: button press button=%d", button)); if (button != kButtonNone) { m_server->onMouseDown(button); } break; - case WM_LBUTTONUP: - case WM_MBUTTONUP: - case WM_RBUTTONUP: + case WM_LBUTTONUP: + case WM_MBUTTONUP: + case WM_RBUTTONUP: log((CLOG_DEBUG "event: button release button=%d", button)); if (button != kButtonNone) { m_server->onMouseUp(button); @@ -399,7 +399,7 @@ log((CLOG_DEBUG "event: key event vk=%d info=0x%08x", msg->wParam, msg->lParam)) } return true; - case SYNERGY_MSG_MOUSE_MOVE: + case SYNERGY_MSG_MOUSE_MOVE: // ignore if not at current mark if (m_mark == m_markReceived) { SInt32 x = (SInt32)msg->wParam; @@ -445,12 +445,12 @@ LRESULT CMSWindowsPrimaryScreen::onEvent( WPARAM wParam, LPARAM lParam) { switch (msg) { - // FIXME -- handle display changes - case WM_PAINT: + // FIXME -- handle display changes + case WM_PAINT: ValidateRect(hwnd, NULL); return 0; - case WM_DRAWCLIPBOARD: + case WM_DRAWCLIPBOARD: log((CLOG_DEBUG "clipboard was taken")); // first pass it on @@ -470,7 +470,7 @@ LRESULT CMSWindowsPrimaryScreen::onEvent( } return 0; - case WM_CHANGECBCHAIN: + case WM_CHANGECBCHAIN: if (m_nextClipboardWindow == (HWND)wParam) m_nextClipboardWindow = (HWND)lParam; else @@ -818,19 +818,19 @@ ButtonID CMSWindowsPrimaryScreen::mapButton( WPARAM button) const { switch (button) { - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: + case WM_LBUTTONDOWN: + case WM_LBUTTONUP: return kButtonLeft; - case WM_MBUTTONDOWN: - case WM_MBUTTONUP: + case WM_MBUTTONDOWN: + case WM_MBUTTONUP: return kButtonMiddle; - case WM_RBUTTONDOWN: - case WM_RBUTTONUP: + case WM_RBUTTONDOWN: + case WM_RBUTTONUP: return kButtonRight; - default: + default: return kButtonNone; } } diff --git a/server/CMSWindowsPrimaryScreen.h b/server/CMSWindowsPrimaryScreen.h index fd96d5d5..bfa1eb56 100644 --- a/server/CMSWindowsPrimaryScreen.h +++ b/server/CMSWindowsPrimaryScreen.h @@ -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; diff --git a/server/CScreenMap.h b/server/CScreenMap.h index e86a61d8..f677b679 100644 --- a/server/CScreenMap.h +++ b/server/CScreenMap.h @@ -6,7 +6,7 @@ #include class CScreenMap { - public: +public: enum EDirection { kLeft, kRight, kTop, kBottom, kFirstDirection = kLeft, kLastDirection = kBottom }; enum EDirectionMask { kLeftMask = 1, kRightMask = 2, @@ -38,9 +38,9 @@ class CScreenMap { // get the name of a direction (for debugging) static const char* dirName(EDirection); - private: +private: class CCell { - public: + public: CString m_neighbor[kLastDirection - kFirstDirection + 1]; }; typedef std::map CCellMap; diff --git a/server/CServer.cpp b/server/CServer.cpp index 99fcca5f..4e82f043 100644 --- a/server/CServer.cpp +++ b/server/CServer.cpp @@ -606,7 +606,7 @@ CServer::CScreenInfo* CServer::getNeighbor(CScreenInfo* src, // find destination screen, adjusting x or y (but not both) switch (srcSide) { - case CScreenMap::kLeft: + case CScreenMap::kLeft: while (dst != NULL) { lastGoodScreen = dst; w = lastGoodScreen->m_width; @@ -620,7 +620,7 @@ CServer::CScreenInfo* CServer::getNeighbor(CScreenInfo* src, } break; - case CScreenMap::kRight: + case CScreenMap::kRight: while (dst != NULL) { lastGoodScreen = dst; x -= w; @@ -634,7 +634,7 @@ CServer::CScreenInfo* CServer::getNeighbor(CScreenInfo* src, } break; - case CScreenMap::kTop: + case CScreenMap::kTop: while (dst != NULL) { lastGoodScreen = dst; w = lastGoodScreen->m_width; @@ -648,7 +648,7 @@ CServer::CScreenInfo* CServer::getNeighbor(CScreenInfo* src, } break; - case CScreenMap::kBottom: + case CScreenMap::kBottom: while (dst != NULL) { lastGoodScreen = dst; y -= h; @@ -675,25 +675,25 @@ CServer::CScreenInfo* CServer::getNeighbor(CScreenInfo* src, if (lastGoodScreen->m_protocol == NULL) { const CString dstName(lastGoodScreen->m_name); switch (srcSide) { - case CScreenMap::kLeft: + case CScreenMap::kLeft: if (!m_screenMap.getNeighbor(dstName, CScreenMap::kRight).empty() && x > w - 1 - lastGoodScreen->m_zoneSize) x = w - 1 - lastGoodScreen->m_zoneSize; break; - case CScreenMap::kRight: + case CScreenMap::kRight: if (!m_screenMap.getNeighbor(dstName, CScreenMap::kLeft).empty() && x < lastGoodScreen->m_zoneSize) x = lastGoodScreen->m_zoneSize; break; - case CScreenMap::kTop: + case CScreenMap::kTop: if (!m_screenMap.getNeighbor(dstName, CScreenMap::kBottom).empty() && y > h - 1 - lastGoodScreen->m_zoneSize) y = h - 1 - lastGoodScreen->m_zoneSize; break; - case CScreenMap::kBottom: + case CScreenMap::kBottom: if (!m_screenMap.getNeighbor(dstName, CScreenMap::kTop).empty() && y < lastGoodScreen->m_zoneSize) y = lastGoodScreen->m_zoneSize; @@ -715,8 +715,8 @@ void CServer::mapPosition(CScreenInfo* src, srcSide <= CScreenMap::kLastDirection); switch (srcSide) { - case CScreenMap::kLeft: - case CScreenMap::kRight: + case CScreenMap::kLeft: + case CScreenMap::kRight: if (y < 0) y = 0; else if (y >= src->m_height) @@ -727,8 +727,8 @@ void CServer::mapPosition(CScreenInfo* src, (src->m_height - 1)); break; - case CScreenMap::kTop: - case CScreenMap::kBottom: + case CScreenMap::kTop: + case CScreenMap::kBottom: if (x < 0) x = 0; else if (x >= src->m_width) diff --git a/server/CServer.h b/server/CServer.h index 1f0ab721..321017ce 100644 --- a/server/CServer.h +++ b/server/CServer.h @@ -19,7 +19,7 @@ class ISecurityFactory; class IPrimaryScreen; class CServer { - public: +public: CServer(); ~CServer(); @@ -64,36 +64,36 @@ 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: + public: CCleanupNote(CServer*); ~CCleanupNote(); - private: + private: CServer* m_server; }; class CConnectionNote { - public: + public: CConnectionNote(CServer*, const CString&, IServerProtocol*); ~CConnectionNote(); - private: + private: bool m_pending; CServer* m_server; CString m_name; }; class CScreenInfo { - public: + public: CScreenInfo(const CString& name, IServerProtocol*); ~CScreenInfo(); - public: + public: CString m_name; IServerProtocol* m_protocol; SInt32 m_width, m_height; @@ -155,7 +155,7 @@ class CServer { CScreenInfo* addConnection(const CString& name, IServerProtocol*); void removeConnection(const CString& name); - private: +private: typedef std::list CThreadList; typedef std::map CScreenList; class CClipboardInfo { diff --git a/server/CServerProtocol.h b/server/CServerProtocol.h index e605049f..d2cb2d80 100644 --- a/server/CServerProtocol.h +++ b/server/CServerProtocol.h @@ -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; diff --git a/server/CServerProtocol1_0.h b/server/CServerProtocol1_0.h index e2cacd8d..f992bec8 100644 --- a/server/CServerProtocol1_0.h +++ b/server/CServerProtocol1_0.h @@ -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(); diff --git a/server/CSynergyHook.cpp b/server/CSynergyHook.cpp index 92eb5803..5609f44a 100644 --- a/server/CSynergyHook.cpp +++ b/server/CSynergyHook.cpp @@ -70,16 +70,16 @@ static LRESULT CALLBACK mouseHook(int code, WPARAM wParam, LPARAM lParam) if (code >= 0) { if (g_relay) { switch (wParam) { - case WM_LBUTTONDOWN: - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MBUTTONUP: - case WM_RBUTTONUP: + case WM_LBUTTONDOWN: + case WM_MBUTTONDOWN: + case WM_RBUTTONDOWN: + case WM_LBUTTONUP: + case WM_MBUTTONUP: + case WM_RBUTTONUP: PostMessage(g_hwnd, SYNERGY_MSG_MOUSE_BUTTON, wParam, 0); return 1; - case WM_MOUSEMOVE: { + case WM_MOUSEMOVE: { const MOUSEHOOKSTRUCT* info = (const MOUSEHOOKSTRUCT*)lParam; SInt32 x = (SInt32)info->pt.x; SInt32 y = (SInt32)info->pt.y; @@ -100,7 +100,7 @@ static LRESULT CALLBACK mouseHook(int code, WPARAM wParam, LPARAM lParam) // relay the motion PostMessage(g_hwnd, SYNERGY_MSG_MOUSE_MOVE, x, y); return 1; - } + } } } else { diff --git a/server/CXWindowsPrimaryScreen.cpp b/server/CXWindowsPrimaryScreen.cpp index 0ce318cc..bafcbd02 100644 --- a/server/CXWindowsPrimaryScreen.cpp +++ b/server/CXWindowsPrimaryScreen.cpp @@ -36,21 +36,21 @@ void CXWindowsPrimaryScreen::run() // handle event switch (xevent.type) { - case CreateNotify: { + case CreateNotify: { // select events on new window CDisplayLock display(this); selectEvents(display, xevent.xcreatewindow.window); break; - } + } - case MappingNotify: { + case MappingNotify: { // keyboard mapping changed CDisplayLock display(this); XRefreshKeyboardMapping(&xevent.xmapping); break; - } + } - case KeyPress: { + case KeyPress: { log((CLOG_DEBUG1 "event: KeyPress code=%d, state=0x%04x", xevent.xkey.keycode, xevent.xkey.state)); const KeyModifierMask mask = mapModifier(xevent.xkey.state); const KeyID key = mapKey(&xevent.xkey); @@ -60,11 +60,11 @@ void CXWindowsPrimaryScreen::run() m_server->onKeyUp(key, mask | KeyModifierCapsLock); } break; - } + } - // FIXME -- simulate key repeat. X sends press/release for - // repeat. must detect auto repeat and use kKeyRepeat. - case KeyRelease: { + // FIXME -- simulate key repeat. X sends press/release for + // repeat. must detect auto repeat and use kKeyRepeat. + case KeyRelease: { log((CLOG_DEBUG1 "event: KeyRelease code=%d, state=0x%04x", xevent.xkey.keycode, xevent.xkey.state)); const KeyModifierMask mask = mapModifier(xevent.xkey.state); const KeyID key = mapKey(&xevent.xkey); @@ -74,27 +74,27 @@ void CXWindowsPrimaryScreen::run() m_server->onKeyUp(key, mask); } break; - } + } - case ButtonPress: { + case ButtonPress: { log((CLOG_DEBUG1 "event: ButtonPress button=%d", xevent.xbutton.button)); const ButtonID button = mapButton(xevent.xbutton.button); if (button != kButtonNone) { m_server->onMouseDown(button); } break; - } + } - case ButtonRelease: { + case ButtonRelease: { log((CLOG_DEBUG1 "event: ButtonRelease button=%d", xevent.xbutton.button)); const ButtonID button = mapButton(xevent.xbutton.button); if (button != kButtonNone) { m_server->onMouseUp(button); } break; - } + } - case MotionNotify: { + case MotionNotify: { log((CLOG_DEBUG2 "event: MotionNotify %d,%d", xevent.xmotion.x_root, xevent.xmotion.y_root)); SInt32 x, y; if (!m_active) { @@ -129,9 +129,9 @@ void CXWindowsPrimaryScreen::run() m_server->onMouseMoveSecondary(x, y); } break; - } + } - case SelectionClear: + case SelectionClear: // we just lost the selection. that means someone else // grabbed the selection so this screen is now the // selection owner. report that to the server. @@ -142,7 +142,7 @@ void CXWindowsPrimaryScreen::run() } break; - case SelectionNotify: + case SelectionNotify: // notification of selection transferred. we shouldn't // get this here because we handle them in the selection // retrieval methods. we'll just delete the property @@ -153,7 +153,7 @@ void CXWindowsPrimaryScreen::run() } break; - case SelectionRequest: + case SelectionRequest: // somebody is asking for clipboard data if (xevent.xselectionrequest.owner == m_window) { addClipboardRequest(m_window, @@ -179,7 +179,7 @@ void CXWindowsPrimaryScreen::run() } break; - case PropertyNotify: + case PropertyNotify: // clipboard transfers involve property changes so forward // the event to the superclass. we only care about the // deletion of properties. @@ -190,7 +190,7 @@ void CXWindowsPrimaryScreen::run() } break; - case DestroyNotify: + case DestroyNotify: // looks like one of the windows that requested a clipboard // transfer has gone bye-bye. destroyClipboardRequest(xevent.xdestroywindow.window); diff --git a/server/CXWindowsPrimaryScreen.h b/server/CXWindowsPrimaryScreen.h index f6ab7a63..ba1b4584 100644 --- a/server/CXWindowsPrimaryScreen.h +++ b/server/CXWindowsPrimaryScreen.h @@ -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; diff --git a/synergy/CClipboard.h b/synergy/CClipboard.h index 8fcf5cc0..734631f6 100644 --- a/synergy/CClipboard.h +++ b/synergy/CClipboard.h @@ -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]; diff --git a/synergy/CInputPacketStream.h b/synergy/CInputPacketStream.h index 50be260c..11d41703 100644 --- a/synergy/CInputPacketStream.h +++ b/synergy/CInputPacketStream.h @@ -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; diff --git a/synergy/CMSWindowsClipboard.cpp b/synergy/CMSWindowsClipboard.cpp index ecf8ae65..4b0049cf 100644 --- a/synergy/CMSWindowsClipboard.cpp +++ b/synergy/CMSWindowsClipboard.cpp @@ -53,11 +53,11 @@ void CMSWindowsClipboard::add( const UINT win32Format = convertFormatToWin32(format); HANDLE win32Data; switch (win32Format) { - case CF_TEXT: + case CF_TEXT: win32Data = convertTextToWin32(data); break; - default: + default: win32Data = NULL; break; } @@ -95,7 +95,7 @@ CString CMSWindowsClipboard::get(EFormat format) const if (win32Data != NULL) { // convert the data switch (win32Format) { - case CF_TEXT: + case CF_TEXT: data = convertTextFromWin32(win32Data); } } @@ -110,10 +110,10 @@ UINT CMSWindowsClipboard::convertFormatToWin32( EFormat format) const { switch (format) { - case kText: + case kText: return CF_TEXT; - default: + default: return 0; } } diff --git a/synergy/CMSWindowsClipboard.h b/synergy/CMSWindowsClipboard.h index afc8f52c..8fae59c0 100644 --- a/synergy/CMSWindowsClipboard.h +++ b/synergy/CMSWindowsClipboard.h @@ -5,7 +5,7 @@ #include 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; }; diff --git a/synergy/CMSWindowsScreen.h b/synergy/CMSWindowsScreen.h index 2cfa9964..9e1590a8 100644 --- a/synergy/CMSWindowsScreen.h +++ b/synergy/CMSWindowsScreen.h @@ -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; diff --git a/synergy/COutputPacketStream.h b/synergy/COutputPacketStream.h index a41d63e7..07ee40a5 100644 --- a/synergy/COutputPacketStream.h +++ b/synergy/COutputPacketStream.h @@ -4,7 +4,7 @@ #include "COutputStreamFilter.h" class COutputPacketStream : public COutputStreamFilter { - public: +public: COutputPacketStream(IOutputStream*, bool adoptStream = true); ~COutputPacketStream(); diff --git a/synergy/CProtocolUtil.cpp b/synergy/CProtocolUtil.cpp index aa0c41b4..5c736efa 100644 --- a/synergy/CProtocolUtil.cpp +++ b/synergy/CProtocolUtil.cpp @@ -64,7 +64,7 @@ void CProtocolUtil::readf(IInputStream* stream, ++fmt; UInt32 len = eatLength(&fmt); switch (*fmt) { - case 'i': { + case 'i': { // check for valid length assert(len == 1 || len == 2 || len == 4); @@ -75,13 +75,13 @@ void CProtocolUtil::readf(IInputStream* stream, // convert it void* v = va_arg(args, void*); switch (len) { - case 1: + case 1: // 1 byte integer *reinterpret_cast(v) = buffer[0]; log((CLOG_DEBUG2 "readf: read %d byte integer: %d (0x%x)", len, *reinterpret_cast(v), *reinterpret_cast(v))); break; - case 2: + case 2: // 2 byte integer *reinterpret_cast(v) = (static_cast(buffer[0]) << 8) | @@ -89,7 +89,7 @@ void CProtocolUtil::readf(IInputStream* stream, log((CLOG_DEBUG2 "readf: read %d byte integer: %d (0x%x)", len, *reinterpret_cast(v), *reinterpret_cast(v))); break; - case 4: + case 4: // 4 byte integer *reinterpret_cast(v) = (static_cast(buffer[0]) << 24) | @@ -100,9 +100,9 @@ void CProtocolUtil::readf(IInputStream* stream, break; } break; - } + } - case 's': { + case 's': { assert(len == 0); // read the string length @@ -146,13 +146,13 @@ void CProtocolUtil::readf(IInputStream* stream, delete[] sBuffer; } break; - } + } - case '%': + case '%': assert(len == 0); break; - default: + default: assert(0 && "invalid format specifier"); } @@ -188,29 +188,29 @@ UInt32 CProtocolUtil::getLength( ++fmt; UInt32 len = eatLength(&fmt); switch (*fmt) { - case 'i': + case 'i': assert(len == 1 || len == 2 || len == 4); (void)va_arg(args, UInt32); break; - case 's': + case 's': assert(len == 0); len = (va_arg(args, CString*))->size() + 4; (void)va_arg(args, UInt8*); break; - case 'S': + case 'S': assert(len == 0); len = va_arg(args, UInt32) + 4; (void)va_arg(args, UInt8*); break; - case '%': + case '%': assert(len == 0); len = 1; break; - default: + default: assert(0 && "invalid format specifier"); } @@ -238,21 +238,21 @@ void CProtocolUtil::writef(void* buffer, ++fmt; UInt32 len = eatLength(&fmt); switch (*fmt) { - case 'i': { + case 'i': { const UInt32 v = va_arg(args, UInt32); switch (len) { - case 1: + case 1: // 1 byte integer *dst++ = static_cast(v & 0xff); break; - case 2: + case 2: // 2 byte integer *dst++ = static_cast((v >> 8) & 0xff); *dst++ = static_cast( v & 0xff); break; - case 4: + case 4: // 4 byte integer *dst++ = static_cast((v >> 24) & 0xff); *dst++ = static_cast((v >> 16) & 0xff); @@ -260,14 +260,14 @@ void CProtocolUtil::writef(void* buffer, *dst++ = static_cast( v & 0xff); break; - default: + default: assert(0 && "invalid integer format length"); return; } break; - } + } - case 's': { + case 's': { assert(len == 0); const CString* src = va_arg(args, CString*); const UInt32 len = (src != NULL) ? src->size() : 0; @@ -280,9 +280,9 @@ void CProtocolUtil::writef(void* buffer, dst += len; } break; - } + } - case 'S': { + case 'S': { assert(len == 0); const UInt32 len = va_arg(args, UInt32); const UInt8* src = va_arg(args, UInt8*); @@ -293,14 +293,14 @@ void CProtocolUtil::writef(void* buffer, memcpy(dst, src, len); dst += len; break; - } + } - case '%': + case '%': assert(len == 0); *dst++ = '%'; break; - default: + default: assert(0 && "invalid format specifier"); } @@ -321,17 +321,17 @@ UInt32 CProtocolUtil::eatLength(const char** pfmt) for (;;) { UInt32 d; switch (*fmt) { - case '0': d = 0; break; - case '1': d = 1; break; - case '2': d = 2; break; - case '3': d = 3; break; - case '4': d = 4; break; - case '5': d = 5; break; - case '6': d = 6; break; - case '7': d = 7; break; - case '8': d = 8; break; - case '9': d = 9; break; - default: *pfmt = fmt; return n; + case '0': d = 0; break; + case '1': d = 1; break; + case '2': d = 2; break; + case '3': d = 3; break; + case '4': d = 4; break; + case '5': d = 5; break; + case '6': d = 6; break; + case '7': d = 7; break; + case '8': d = 8; break; + case '9': d = 9; break; + default: *pfmt = fmt; return n; } n = 10 * n + d; ++fmt; diff --git a/synergy/CProtocolUtil.h b/synergy/CProtocolUtil.h index d85d26f1..63a4376b 100644 --- a/synergy/CProtocolUtil.h +++ b/synergy/CProtocolUtil.h @@ -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(); }; diff --git a/synergy/CTCPSocketFactory.h b/synergy/CTCPSocketFactory.h index d5d689e7..a320f9ae 100644 --- a/synergy/CTCPSocketFactory.h +++ b/synergy/CTCPSocketFactory.h @@ -4,7 +4,7 @@ #include "ISocketFactory.h" class CTCPSocketFactory : public ISocketFactory { - public: +public: CTCPSocketFactory(); virtual ~CTCPSocketFactory(); diff --git a/synergy/CXWindowsClipboard.h b/synergy/CXWindowsClipboard.h index b025536d..7bdfb08c 100644 --- a/synergy/CXWindowsClipboard.h +++ b/synergy/CXWindowsClipboard.h @@ -4,7 +4,7 @@ #include "IClipboard.h" class CXWindowsClipboard : public IClipboard { - public: +public: CXWindowsClipboard(); virtual ~CXWindowsClipboard(); diff --git a/synergy/CXWindowsScreen.cpp b/synergy/CXWindowsScreen.cpp index c82cb36c..b3dd2bf2 100644 --- a/synergy/CXWindowsScreen.cpp +++ b/synergy/CXWindowsScreen.cpp @@ -403,19 +403,19 @@ bool CXWindowsScreen::getDisplayClipboard( // transferred. use it as a hint to size our buffer. UInt32 size; switch (datumSize) { - case 8: + case 8: size = *(reinterpret_cast(data.data())); break; - case 16: + case 16: size = *(reinterpret_cast(data.data())); break; - case 32: + case 32: size = *(reinterpret_cast(data.data())); break; - default: + default: assert(0 && "invalid datum size"); } diff --git a/synergy/CXWindowsScreen.h b/synergy/CXWindowsScreen.h index 21e8d639..66df2968 100644 --- a/synergy/CXWindowsScreen.h +++ b/synergy/CXWindowsScreen.h @@ -12,19 +12,19 @@ class CString; class CXWindowsScreen { - public: +public: CXWindowsScreen(); virtual ~CXWindowsScreen(); - protected: +protected: class CDisplayLock { - public: + public: CDisplayLock(const CXWindowsScreen*); ~CDisplayLock(); operator Display*() const; - private: + private: const CMutex* m_mutex; Display* m_display; }; @@ -104,14 +104,14 @@ 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: + public: Window m_window; Atom m_property; }; struct CClipboardRequest { - public: + public: CString m_data; UInt32 m_sent; Window m_requestor; @@ -147,7 +147,7 @@ class CXWindowsScreen { bool wasOwnedAtTime(ClipboardID, Window, Time) const; Time getCurrentTimeNoLock(Window) const; - private: +private: class CClipboardInfo { public: CClipboardInfo(); diff --git a/synergy/IClipboard.h b/synergy/IClipboard.h index a75ec70a..32856c1b 100644 --- a/synergy/IClipboard.h +++ b/synergy/IClipboard.h @@ -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. diff --git a/synergy/IPrimaryScreen.h b/synergy/IPrimaryScreen.h index 91a698bd..198c917a 100644 --- a/synergy/IPrimaryScreen.h +++ b/synergy/IPrimaryScreen.h @@ -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 diff --git a/synergy/ISecondaryScreen.h b/synergy/ISecondaryScreen.h index 9599d25c..11752c2b 100644 --- a/synergy/ISecondaryScreen.h +++ b/synergy/ISecondaryScreen.h @@ -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 diff --git a/synergy/IServerProtocol.h b/synergy/IServerProtocol.h index 84ed10ef..1bf4a9df 100644 --- a/synergy/IServerProtocol.h +++ b/synergy/IServerProtocol.h @@ -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; diff --git a/synergy/ISocketFactory.h b/synergy/ISocketFactory.h index 2bb8ce2f..287e4302 100644 --- a/synergy/ISocketFactory.h +++ b/synergy/ISocketFactory.h @@ -8,7 +8,7 @@ class ISocket; class IListenSocket; class ISocketFactory : public IInterface { - public: +public: // manipulators // accessors diff --git a/synergy/XSynergy.h b/synergy/XSynergy.h index da54af49..e88b1c56 100644 --- a/synergy/XSynergy.h +++ b/synergy/XSynergy.h @@ -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; };