Indentation changes.

This commit is contained in:
crs
2002-04-29 14:40:01 +00:00
parent 3ca72b35f3
commit ea6b347b18
72 changed files with 428 additions and 428 deletions

View File

@@ -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;
}
}

View File

@@ -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;

View File

@@ -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,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<CString, CCell> CCellMap;

View File

@@ -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)

View File

@@ -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<CThread*> CThreadList;
typedef std::map<CString, CScreenInfo*> CScreenList;
class CClipboardInfo {

View File

@@ -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;

View File

@@ -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();

View File

@@ -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 {

View File

@@ -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);

View File

@@ -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;