fixed: warnings on mac os x
This commit is contained in:
parent
bdb4c47898
commit
c44971b43d
|
@ -67,6 +67,11 @@ set(libs)
|
||||||
# Depending on the platform, pass in the required defines.
|
# Depending on the platform, pass in the required defines.
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
|
|
||||||
|
# warnings as errors:
|
||||||
|
# we have a problem with people checking in code with warnings.
|
||||||
|
set(CMAKE_CXX_FLAGS "-Werror")
|
||||||
|
|
||||||
|
|
||||||
# For config.h, detect the libraries, functions, etc.
|
# For config.h, detect the libraries, functions, etc.
|
||||||
include(CheckIncludeFiles)
|
include(CheckIncludeFiles)
|
||||||
include(CheckLibraryExists)
|
include(CheckLibraryExists)
|
||||||
|
|
|
@ -137,12 +137,8 @@
|
||||||
// define NULL
|
// define NULL
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
// we don't want to use NULL since it's old and nasty, so replace any
|
// if not c++0x, future proof code by allowing use of nullptr
|
||||||
// usages with nullptr (warning: this could break many things).
|
#ifndef nullptr
|
||||||
// if not c++0x yet, future proof code by allowing use of nullptr
|
|
||||||
#ifdef nullptr
|
|
||||||
#define NULL nullptr
|
|
||||||
#else
|
|
||||||
# define nullptr NULL
|
# define nullptr NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -60,18 +60,10 @@ CCryptoMode::~CCryptoMode()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_encryption) {
|
if (m_encryption) {
|
||||||
switch (m_mode) {
|
|
||||||
case kCfb:
|
|
||||||
delete reinterpret_cast<CCfbModeEnc*>(m_crypto);
|
delete reinterpret_cast<CCfbModeEnc*>(m_crypto);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch (m_mode) {
|
|
||||||
case kCfb:
|
|
||||||
delete reinterpret_cast<CCfbModeDec*>(m_crypto);
|
delete reinterpret_cast<CCfbModeDec*>(m_crypto);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,18 +75,10 @@ CCryptoMode::processData(byte* out, const byte* in, size_t length)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_encryption) {
|
if (m_encryption) {
|
||||||
switch (m_mode) {
|
|
||||||
case kCfb:
|
|
||||||
reinterpret_cast<CCfbModeEnc*>(m_crypto)->ProcessData(out, in, length);
|
reinterpret_cast<CCfbModeEnc*>(m_crypto)->ProcessData(out, in, length);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch (m_mode) {
|
|
||||||
case kCfb:
|
|
||||||
reinterpret_cast<CCfbModeDec*>(m_crypto)->ProcessData(out, in, length);
|
reinterpret_cast<CCfbModeDec*>(m_crypto)->ProcessData(out, in, length);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,17 +91,9 @@ CCryptoMode::setKeyWithIv(const byte* key, size_t length, const byte* iv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_encryption) {
|
if (m_encryption) {
|
||||||
switch (m_mode) {
|
|
||||||
case kCfb:
|
|
||||||
reinterpret_cast<CCfbModeEnc*>(m_crypto)->SetKeyWithIV(key, length, iv);
|
reinterpret_cast<CCfbModeEnc*>(m_crypto)->SetKeyWithIV(key, length, iv);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch (m_mode) {
|
|
||||||
case kCfb:
|
|
||||||
reinterpret_cast<CCfbModeDec*>(m_crypto)->SetKeyWithIV(key, length, iv);
|
reinterpret_cast<CCfbModeDec*>(m_crypto)->SetKeyWithIV(key, length, iv);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,11 +17,17 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "ECryptoMode.h"
|
||||||
|
#include "CString.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wtautological-compare"
|
||||||
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#include <cryptopp562/gcm.h>
|
#include <cryptopp562/gcm.h>
|
||||||
#include <cryptopp562/modes.h>
|
#include <cryptopp562/modes.h>
|
||||||
#include <cryptopp562/aes.h>
|
#include <cryptopp562/aes.h>
|
||||||
#include "ECryptoMode.h"
|
#pragma GCC diagnostic pop
|
||||||
#include "CString.h"
|
|
||||||
|
|
||||||
//! Encapsulation of modes
|
//! Encapsulation of modes
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
CCryptoOptions::CCryptoOptions(
|
CCryptoOptions::CCryptoOptions(
|
||||||
const CString& modeString,
|
const CString& modeString,
|
||||||
const CString& pass) :
|
const CString& pass) :
|
||||||
m_mode(parseMode(modeString)),
|
m_pass(pass),
|
||||||
m_pass(pass)
|
m_mode(parseMode(modeString))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,14 @@
|
||||||
#include "BasicTypes.h"
|
#include "BasicTypes.h"
|
||||||
#include "CStreamFilter.h"
|
#include "CStreamFilter.h"
|
||||||
#include "CCryptoMode.h"
|
#include "CCryptoMode.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wall"
|
||||||
#include <cryptopp562/osrng.h>
|
#include <cryptopp562/osrng.h>
|
||||||
#include <cryptopp562/sha.h>
|
#include <cryptopp562/sha.h>
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
class CCryptoOptions;
|
class CCryptoOptions;
|
||||||
|
|
||||||
#define CRYPTO_IV_SIZE CryptoPP::AES::BLOCKSIZE
|
#define CRYPTO_IV_SIZE CryptoPP::AES::BLOCKSIZE
|
||||||
|
|
|
@ -25,10 +25,9 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
CStreamFilter::CStreamFilter(IEventQueue* events, synergy::IStream* stream, bool adoptStream) :
|
CStreamFilter::CStreamFilter(IEventQueue* events, synergy::IStream* stream, bool adoptStream) :
|
||||||
IStream(events),
|
|
||||||
m_events(events),
|
|
||||||
m_stream(stream),
|
m_stream(stream),
|
||||||
m_adopted(adoptStream)
|
m_adopted(adoptStream),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
// replace handlers for m_stream
|
// replace handlers for m_stream
|
||||||
m_events->removeHandlers(m_stream->getEventTarget());
|
m_events->removeHandlers(m_stream->getEventTarget());
|
||||||
|
|
|
@ -34,7 +34,7 @@ Defines the interface for all streams.
|
||||||
*/
|
*/
|
||||||
class IStream : public IInterface {
|
class IStream : public IInterface {
|
||||||
public:
|
public:
|
||||||
IStream(IEventQueue* events) : m_events(events) { }
|
IStream() { }
|
||||||
|
|
||||||
//! @name manipulators
|
//! @name manipulators
|
||||||
//@{
|
//@{
|
||||||
|
@ -116,9 +116,6 @@ public:
|
||||||
virtual UInt32 getSize() const = 0;
|
virtual UInt32 getSize() const = 0;
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
private:
|
|
||||||
IEventQueue* m_events;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
|
|
||||||
CIpcClient::CIpcClient(IEventQueue* events, CSocketMultiplexer* socketMultiplexer) :
|
CIpcClient::CIpcClient(IEventQueue* events, CSocketMultiplexer* socketMultiplexer) :
|
||||||
m_serverAddress(CNetworkAddress(IPC_HOST, IPC_PORT)),
|
m_serverAddress(CNetworkAddress(IPC_HOST, IPC_PORT)),
|
||||||
m_server(nullptr),
|
|
||||||
m_socket(events, socketMultiplexer),
|
m_socket(events, socketMultiplexer),
|
||||||
|
m_server(nullptr),
|
||||||
m_events(events)
|
m_events(events)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
|
@ -37,8 +37,8 @@ CIpcClient::CIpcClient(IEventQueue* events, CSocketMultiplexer* socketMultiplexe
|
||||||
|
|
||||||
CIpcClient::CIpcClient(IEventQueue* events, CSocketMultiplexer* socketMultiplexer, int port) :
|
CIpcClient::CIpcClient(IEventQueue* events, CSocketMultiplexer* socketMultiplexer, int port) :
|
||||||
m_serverAddress(CNetworkAddress(IPC_HOST, port)),
|
m_serverAddress(CNetworkAddress(IPC_HOST, port)),
|
||||||
m_server(nullptr),
|
|
||||||
m_socket(events, socketMultiplexer),
|
m_socket(events, socketMultiplexer),
|
||||||
|
m_server(nullptr),
|
||||||
m_events(events)
|
m_events(events)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
|
|
|
@ -32,17 +32,17 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
CIpcServer::CIpcServer(IEventQueue* events, CSocketMultiplexer* socketMultiplexer) :
|
CIpcServer::CIpcServer(IEventQueue* events, CSocketMultiplexer* socketMultiplexer) :
|
||||||
m_events(events),
|
|
||||||
m_socket(events, socketMultiplexer),
|
m_socket(events, socketMultiplexer),
|
||||||
m_address(CNetworkAddress(IPC_HOST, IPC_PORT))
|
m_address(CNetworkAddress(IPC_HOST, IPC_PORT)),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
CIpcServer::CIpcServer(IEventQueue* events, CSocketMultiplexer* socketMultiplexer, int port) :
|
CIpcServer::CIpcServer(IEventQueue* events, CSocketMultiplexer* socketMultiplexer, int port) :
|
||||||
m_events(events),
|
|
||||||
m_socket(events, socketMultiplexer),
|
m_socket(events, socketMultiplexer),
|
||||||
m_address(CNetworkAddress(IPC_HOST, port))
|
m_address(CNetworkAddress(IPC_HOST, port)),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,8 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
CIpcServerProxy::CIpcServerProxy(synergy::IStream& stream, IEventQueue* events) :
|
CIpcServerProxy::CIpcServerProxy(synergy::IStream& stream, IEventQueue* events) :
|
||||||
m_events(events),
|
m_stream(stream),
|
||||||
m_stream(stream)
|
m_events(events)
|
||||||
{
|
{
|
||||||
m_events->adoptHandler(m_events->forIStream().inputReady(),
|
m_events->adoptHandler(m_events->forIStream().inputReady(),
|
||||||
stream.getEventTarget(),
|
stream.getEventTarget(),
|
||||||
|
|
|
@ -37,9 +37,9 @@
|
||||||
|
|
||||||
CTCPSocket::CTCPSocket(IEventQueue* events, CSocketMultiplexer* socketMultiplexer) :
|
CTCPSocket::CTCPSocket(IEventQueue* events, CSocketMultiplexer* socketMultiplexer) :
|
||||||
IDataSocket(events),
|
IDataSocket(events),
|
||||||
m_events(events),
|
|
||||||
m_mutex(),
|
m_mutex(),
|
||||||
m_flushed(&m_mutex, true),
|
m_flushed(&m_mutex, true),
|
||||||
|
m_events(events),
|
||||||
m_socketMultiplexer(socketMultiplexer)
|
m_socketMultiplexer(socketMultiplexer)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
@ -54,10 +54,10 @@ CTCPSocket::CTCPSocket(IEventQueue* events, CSocketMultiplexer* socketMultiplexe
|
||||||
|
|
||||||
CTCPSocket::CTCPSocket(IEventQueue* events, CSocketMultiplexer* socketMultiplexer, CArchSocket socket) :
|
CTCPSocket::CTCPSocket(IEventQueue* events, CSocketMultiplexer* socketMultiplexer, CArchSocket socket) :
|
||||||
IDataSocket(events),
|
IDataSocket(events),
|
||||||
m_events(events),
|
|
||||||
m_mutex(),
|
m_mutex(),
|
||||||
m_socket(socket),
|
m_socket(socket),
|
||||||
m_flushed(&m_mutex, true),
|
m_flushed(&m_mutex, true),
|
||||||
|
m_events(events),
|
||||||
m_socketMultiplexer(socketMultiplexer)
|
m_socketMultiplexer(socketMultiplexer)
|
||||||
{
|
{
|
||||||
assert(m_socket != NULL);
|
assert(m_socket != NULL);
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
CString m_what;
|
CString m_what;
|
||||||
};
|
};
|
||||||
|
|
||||||
IDataSocket(IEventQueue* events) : IStream(events) { }
|
IDataSocket(IEventQueue* events) { }
|
||||||
|
|
||||||
//! @name manipulators
|
//! @name manipulators
|
||||||
//@{
|
//@{
|
||||||
|
|
|
@ -21,6 +21,10 @@
|
||||||
|
|
||||||
@implementation COSXDragView
|
@implementation COSXDragView
|
||||||
|
|
||||||
|
@dynamic draggingFormation;
|
||||||
|
@dynamic animatesToDestination;
|
||||||
|
@dynamic numberOfValidItemsForDrop;
|
||||||
|
|
||||||
- (id)
|
- (id)
|
||||||
initWithFrame:(NSRect)frame
|
initWithFrame:(NSRect)frame
|
||||||
{
|
{
|
||||||
|
@ -90,6 +94,63 @@ clearDropTarget
|
||||||
[m_dropTarget setString:@""];
|
[m_dropTarget setString:@""];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSWindow *)
|
||||||
|
draggingDestinationWindow
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSDragOperation)
|
||||||
|
draggingSourceOperationMask
|
||||||
|
{
|
||||||
|
return NSDragOperationNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSPoint)draggingLocation
|
||||||
|
{
|
||||||
|
NSPoint point;
|
||||||
|
return point;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSPoint)draggedImageLocation
|
||||||
|
{
|
||||||
|
NSPoint point;
|
||||||
|
return point;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSImage *)draggedImage
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSPasteboard *)draggingPasteboard
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)draggingSource
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSInteger)draggingSequenceNumber
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)slideDraggedImageTo:(NSPoint)screenPoint
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSDragOperation)draggingSession:(NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context
|
||||||
|
{
|
||||||
|
return NSDragOperationNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)enumerateDraggingItemsWithOptions:(NSDraggingItemEnumerationOptions)enumOpts forView:(NSView *)view classes:(NSArray *)classArray searchOptions:(NSDictionary *)searchOptions usingBlock:(void (^)(NSDraggingItem *draggingItem, NSInteger idx, BOOL *stop))block
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -31,8 +31,8 @@ class CEventQueueTimer { };
|
||||||
//
|
//
|
||||||
|
|
||||||
COSXEventQueueBuffer::COSXEventQueueBuffer(IEventQueue* events) :
|
COSXEventQueueBuffer::COSXEventQueueBuffer(IEventQueue* events) :
|
||||||
m_eventQueue(events),
|
|
||||||
m_event(NULL),
|
m_event(NULL),
|
||||||
|
m_eventQueue(events),
|
||||||
m_carbonEventQueue(NULL)
|
m_carbonEventQueue(NULL)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
|
|
|
@ -70,11 +70,10 @@ bool COSXScreen::s_hasGHOM = false;
|
||||||
|
|
||||||
COSXScreen::COSXScreen(IEventQueue* events, bool isPrimary, bool autoShowHideCursor) :
|
COSXScreen::COSXScreen(IEventQueue* events, bool isPrimary, bool autoShowHideCursor) :
|
||||||
CPlatformScreen(events),
|
CPlatformScreen(events),
|
||||||
m_events(events),
|
|
||||||
MouseButtonEventMap(NumButtonIDs),
|
|
||||||
m_isPrimary(isPrimary),
|
m_isPrimary(isPrimary),
|
||||||
m_isOnScreen(m_isPrimary),
|
m_isOnScreen(m_isPrimary),
|
||||||
m_cursorPosValid(false),
|
m_cursorPosValid(false),
|
||||||
|
MouseButtonEventMap(NumButtonIDs),
|
||||||
m_cursorHidden(false),
|
m_cursorHidden(false),
|
||||||
m_dragNumButtonsDown(0),
|
m_dragNumButtonsDown(0),
|
||||||
m_dragTimer(NULL),
|
m_dragTimer(NULL),
|
||||||
|
@ -90,16 +89,17 @@ COSXScreen::COSXScreen(IEventQueue* events, bool isPrimary, bool autoShowHideCur
|
||||||
m_pmMutex(new CMutex),
|
m_pmMutex(new CMutex),
|
||||||
m_pmWatchThread(NULL),
|
m_pmWatchThread(NULL),
|
||||||
m_pmThreadReady(new CCondVar<bool>(m_pmMutex, false)),
|
m_pmThreadReady(new CCondVar<bool>(m_pmMutex, false)),
|
||||||
|
m_pmRootPort(0),
|
||||||
m_activeModifierHotKey(0),
|
m_activeModifierHotKey(0),
|
||||||
m_activeModifierHotKeyMask(0),
|
m_activeModifierHotKeyMask(0),
|
||||||
|
m_eventTapPort(nullptr),
|
||||||
|
m_eventTapRLSR(nullptr),
|
||||||
m_lastSingleClick(0),
|
m_lastSingleClick(0),
|
||||||
m_lastDoubleClick(0),
|
m_lastDoubleClick(0),
|
||||||
m_lastSingleClickXCursor(0),
|
m_lastSingleClickXCursor(0),
|
||||||
m_lastSingleClickYCursor(0),
|
m_lastSingleClickYCursor(0),
|
||||||
m_autoShowHideCursor(autoShowHideCursor),
|
m_autoShowHideCursor(autoShowHideCursor),
|
||||||
m_eventTapRLSR(nullptr),
|
m_events(events),
|
||||||
m_eventTapPort(nullptr),
|
|
||||||
m_pmRootPort(0),
|
|
||||||
m_getDropTargetThread(NULL)
|
m_getDropTargetThread(NULL)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
@ -444,11 +444,12 @@ void
|
||||||
COSXScreen::constructMouseButtonEventMap()
|
COSXScreen::constructMouseButtonEventMap()
|
||||||
{
|
{
|
||||||
const CGEventType source[NumButtonIDs][3] = {
|
const CGEventType source[NumButtonIDs][3] = {
|
||||||
kCGEventLeftMouseUp,kCGEventLeftMouseDragged,kCGEventLeftMouseDown,
|
{kCGEventLeftMouseUp, kCGEventLeftMouseDragged, kCGEventLeftMouseDown},
|
||||||
kCGEventOtherMouseUp,kCGEventOtherMouseDragged,kCGEventOtherMouseDown,
|
{kCGEventOtherMouseUp, kCGEventOtherMouseDragged, kCGEventOtherMouseDown},
|
||||||
kCGEventRightMouseUp,kCGEventRightMouseDragged,kCGEventRightMouseDown,
|
{kCGEventRightMouseUp, kCGEventRightMouseDragged, kCGEventRightMouseDown},
|
||||||
kCGEventOtherMouseUp,kCGEventOtherMouseDragged,kCGEventOtherMouseDown,
|
{kCGEventOtherMouseUp, kCGEventOtherMouseDragged, kCGEventOtherMouseDown},
|
||||||
kCGEventOtherMouseUp,kCGEventOtherMouseDragged,kCGEventOtherMouseDown};
|
{kCGEventOtherMouseUp, kCGEventOtherMouseDragged, kCGEventOtherMouseDown}
|
||||||
|
};
|
||||||
|
|
||||||
for (UInt16 button = 0; button < NumButtonIDs; button++) {
|
for (UInt16 button = 0; button < NumButtonIDs; button++) {
|
||||||
MouseButtonEventMapType new_map;
|
MouseButtonEventMapType new_map;
|
||||||
|
@ -746,10 +747,16 @@ COSXScreen::showCursor()
|
||||||
// appears to fix "mouse randomly not showing" bug
|
// appears to fix "mouse randomly not showing" bug
|
||||||
CGAssociateMouseAndMouseCursorPosition(true);
|
CGAssociateMouseAndMouseCursorPosition(true);
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
|
||||||
|
// CGCursorIsVisible is probably deprecated because its unreliable.
|
||||||
if (!CGCursorIsVisible()) {
|
if (!CGCursorIsVisible()) {
|
||||||
LOG((CLOG_WARN "cursor may not be visible"));
|
LOG((CLOG_WARN "cursor may not be visible"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
m_cursorHidden = false;
|
m_cursorHidden = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -775,10 +782,16 @@ COSXScreen::hideCursor()
|
||||||
// appears to fix "mouse randomly not hiding" bug
|
// appears to fix "mouse randomly not hiding" bug
|
||||||
CGAssociateMouseAndMouseCursorPosition(true);
|
CGAssociateMouseAndMouseCursorPosition(true);
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
|
||||||
|
// CGCursorIsVisible is probably deprecated because its unreliable.
|
||||||
if (CGCursorIsVisible()) {
|
if (CGCursorIsVisible()) {
|
||||||
LOG((CLOG_WARN "cursor may be still visible"));
|
LOG((CLOG_WARN "cursor may be still visible"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
m_cursorHidden = true;
|
m_cursorHidden = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -871,8 +884,14 @@ COSXScreen::enter()
|
||||||
showCursor();
|
showCursor();
|
||||||
|
|
||||||
if (m_isPrimary) {
|
if (m_isPrimary) {
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
|
||||||
CGSetLocalEventsSuppressionInterval(0.0);
|
CGSetLocalEventsSuppressionInterval(0.0);
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
// enable global hotkeys
|
// enable global hotkeys
|
||||||
//setGlobalHotKeysEnabled(true);
|
//setGlobalHotKeysEnabled(true);
|
||||||
}
|
}
|
||||||
|
@ -891,6 +910,9 @@ COSXScreen::enter()
|
||||||
IOObjectRelease(entry);
|
IOObjectRelease(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
|
||||||
// avoid suppression of local hardware events
|
// avoid suppression of local hardware events
|
||||||
// stkamp@users.sourceforge.net
|
// stkamp@users.sourceforge.net
|
||||||
CGSetLocalEventsFilterDuringSupressionState(
|
CGSetLocalEventsFilterDuringSupressionState(
|
||||||
|
@ -900,6 +922,9 @@ COSXScreen::enter()
|
||||||
(kCGEventFilterMaskPermitLocalKeyboardEvents |
|
(kCGEventFilterMaskPermitLocalKeyboardEvents |
|
||||||
kCGEventFilterMaskPermitSystemDefinedEvents),
|
kCGEventFilterMaskPermitSystemDefinedEvents),
|
||||||
kCGEventSupressionStateRemoteMouseDrag);
|
kCGEventSupressionStateRemoteMouseDrag);
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// now on screen
|
// now on screen
|
||||||
|
@ -941,6 +966,9 @@ COSXScreen::leave()
|
||||||
// warp to center
|
// warp to center
|
||||||
//warpCursor(m_xCenter, m_yCenter);
|
//warpCursor(m_xCenter, m_yCenter);
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
|
||||||
// This used to be necessary to get smooth mouse motion on other screens,
|
// This used to be necessary to get smooth mouse motion on other screens,
|
||||||
// but now is just to avoid a hesitating cursor when transitioning to
|
// but now is just to avoid a hesitating cursor when transitioning to
|
||||||
// the primary (this) screen.
|
// the primary (this) screen.
|
||||||
|
@ -948,6 +976,9 @@ COSXScreen::leave()
|
||||||
|
|
||||||
// disable global hotkeys
|
// disable global hotkeys
|
||||||
//setGlobalHotKeysEnabled(false);
|
//setGlobalHotKeysEnabled(false);
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// warp the mouse to the cursor center
|
// warp the mouse to the cursor center
|
||||||
|
|
|
@ -22,15 +22,22 @@
|
||||||
#import "IEventQueue.h"
|
#import "IEventQueue.h"
|
||||||
#import "IPrimaryScreen.h"
|
#import "IPrimaryScreen.h"
|
||||||
#import <string.h>
|
#import <string.h>
|
||||||
|
#import <sys/sysctl.h>
|
||||||
|
|
||||||
|
void
|
||||||
|
getProcessSerialNumber(const char* name, ProcessSerialNumber& psn);
|
||||||
|
|
||||||
|
bool
|
||||||
|
testProcessName(const char* name, const ProcessSerialNumber& psn);
|
||||||
|
|
||||||
//
|
//
|
||||||
// COSXScreenSaver
|
// COSXScreenSaver
|
||||||
//
|
//
|
||||||
|
|
||||||
COSXScreenSaver::COSXScreenSaver(IEventQueue* events, void* eventTarget) :
|
COSXScreenSaver::COSXScreenSaver(IEventQueue* events, void* eventTarget) :
|
||||||
m_events(events),
|
|
||||||
m_eventTarget(eventTarget),
|
m_eventTarget(eventTarget),
|
||||||
m_enabled(true)
|
m_enabled(true),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
m_autoReleasePool = screenSaverUtilCreatePool();
|
m_autoReleasePool = screenSaverUtilCreatePool();
|
||||||
m_screenSaverController = screenSaverUtilCreateController();
|
m_screenSaverController = screenSaverUtilCreateController();
|
||||||
|
@ -52,28 +59,8 @@ COSXScreenSaver::COSXScreenSaver(IEventQueue* events, void* eventTarget) :
|
||||||
m_screenSaverPSN.highLongOfPSN = 0;
|
m_screenSaverPSN.highLongOfPSN = 0;
|
||||||
m_screenSaverPSN.lowLongOfPSN = 0;
|
m_screenSaverPSN.lowLongOfPSN = 0;
|
||||||
|
|
||||||
// test if screensaver is running and find process number
|
|
||||||
if (isActive()) {
|
if (isActive()) {
|
||||||
ProcessInfoRec procInfo;
|
getProcessSerialNumber("ScreenSaverEngine", m_screenSaverPSN);
|
||||||
Str31 procName; // pascal string. first byte holds length.
|
|
||||||
memset(&procInfo, 0, sizeof(procInfo));
|
|
||||||
procInfo.processName = procName;
|
|
||||||
procInfo.processInfoLength = sizeof(ProcessInfoRec);
|
|
||||||
|
|
||||||
ProcessSerialNumber psn;
|
|
||||||
OSErr err = GetNextProcess(&psn);
|
|
||||||
while (err == 0) {
|
|
||||||
memset(procName, 0, sizeof(procName));
|
|
||||||
err = GetProcessInformation(&psn, &procInfo);
|
|
||||||
if (err != 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (strcmp("ScreenSaverEngine", (const char*)&procName[1]) == 0) {
|
|
||||||
m_screenSaverPSN = psn;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
err = GetNextProcess(&psn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,10 +106,7 @@ COSXScreenSaver::isActive() const
|
||||||
void
|
void
|
||||||
COSXScreenSaver::processLaunched(ProcessSerialNumber psn)
|
COSXScreenSaver::processLaunched(ProcessSerialNumber psn)
|
||||||
{
|
{
|
||||||
CFStringRef processName;
|
if (testProcessName("ScreenSaverEngine", psn)) {
|
||||||
OSStatus err = CopyProcessName(&psn, &processName);
|
|
||||||
|
|
||||||
if (err == 0 && CFEqual(CFSTR("ScreenSaverEngine"), processName)) {
|
|
||||||
m_screenSaverPSN = psn;
|
m_screenSaverPSN = psn;
|
||||||
LOG((CLOG_DEBUG1 "ScreenSaverEngine launched. Enabled=%d", m_enabled));
|
LOG((CLOG_DEBUG1 "ScreenSaverEngine launched. Enabled=%d", m_enabled));
|
||||||
if (m_enabled) {
|
if (m_enabled) {
|
||||||
|
@ -178,3 +162,41 @@ COSXScreenSaver::launchTerminationCallback(
|
||||||
}
|
}
|
||||||
return (CallNextEventHandler(nextHandler, theEvent));
|
return (CallNextEventHandler(nextHandler, theEvent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
|
||||||
|
void
|
||||||
|
getProcessSerialNumber(const char* name, ProcessSerialNumber& psn)
|
||||||
|
{
|
||||||
|
ProcessInfoRec procInfo;
|
||||||
|
Str31 procName; // pascal string. first byte holds length.
|
||||||
|
memset(&procInfo, 0, sizeof(procInfo));
|
||||||
|
procInfo.processName = procName;
|
||||||
|
procInfo.processInfoLength = sizeof(ProcessInfoRec);
|
||||||
|
|
||||||
|
ProcessSerialNumber checkPsn;
|
||||||
|
OSErr err = GetNextProcess(&checkPsn);
|
||||||
|
while (err == 0) {
|
||||||
|
memset(procName, 0, sizeof(procName));
|
||||||
|
err = GetProcessInformation(&checkPsn, &procInfo);
|
||||||
|
if (err != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (strcmp(name, (const char*)&procName[1]) == 0) {
|
||||||
|
psn = checkPsn;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
err = GetNextProcess(&checkPsn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
testProcessName(const char* name, const ProcessSerialNumber& psn)
|
||||||
|
{
|
||||||
|
CFStringRef processName;
|
||||||
|
OSStatus err = CopyProcessName(&psn, &processName);
|
||||||
|
return (err == 0 && CFEqual(CFSTR("ScreenSaverEngine"), processName));
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
|
@ -84,7 +84,6 @@ public:
|
||||||
virtual void screensaver(bool activate) = 0;
|
virtual void screensaver(bool activate) = 0;
|
||||||
virtual void resetOptions() = 0;
|
virtual void resetOptions() = 0;
|
||||||
virtual void setOptions(const COptionsList& options) = 0;
|
virtual void setOptions(const COptionsList& options) = 0;
|
||||||
virtual void cryptoIv(const UInt8* iv) = 0;
|
|
||||||
virtual void draggingInfoSending(UInt32 fileCount, const char* data, size_t dataSize) = 0;
|
virtual void draggingInfoSending(UInt32 fileCount, const char* data, size_t dataSize) = 0;
|
||||||
virtual void fileChunkSending(UInt8 mark, char* data, size_t dataSize) = 0;
|
virtual void fileChunkSending(UInt8 mark, char* data, size_t dataSize) = 0;
|
||||||
|
|
||||||
|
|
|
@ -358,13 +358,6 @@ CClientProxy1_0::mouseWheel(SInt32, SInt32 yDelta)
|
||||||
CProtocolUtil::writef(getStream(), kMsgDMouseWheel1_0, yDelta);
|
CProtocolUtil::writef(getStream(), kMsgDMouseWheel1_0, yDelta);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
CClientProxy1_0::cryptoIv(const UInt8* iv)
|
|
||||||
{
|
|
||||||
// ignore -- not supported in protocol 1.0
|
|
||||||
LOG((CLOG_DEBUG "cryptoIv not supported"));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CClientProxy1_0::draggingInfoSending(UInt32 fileCount, const char* data, size_t dataSize)
|
CClientProxy1_0::draggingInfoSending(UInt32 fileCount, const char* data, size_t dataSize)
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,6 @@ public:
|
||||||
virtual void screensaver(bool activate);
|
virtual void screensaver(bool activate);
|
||||||
virtual void resetOptions();
|
virtual void resetOptions();
|
||||||
virtual void setOptions(const COptionsList& options);
|
virtual void setOptions(const COptionsList& options);
|
||||||
virtual void cryptoIv(const UInt8* iv);
|
|
||||||
virtual void draggingInfoSending(UInt32 fileCount, const char* data, size_t dataSize);
|
virtual void draggingInfoSending(UInt32 fileCount, const char* data, size_t dataSize);
|
||||||
virtual void fileChunkSending(UInt8 mark, char* data, size_t dataSize);
|
virtual void fileChunkSending(UInt8 mark, char* data, size_t dataSize);
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
|
|
||||||
CClientProxy1_3::CClientProxy1_3(const CString& name, synergy::IStream* stream, IEventQueue* events) :
|
CClientProxy1_3::CClientProxy1_3(const CString& name, synergy::IStream* stream, IEventQueue* events) :
|
||||||
CClientProxy1_2(name, stream, events),
|
CClientProxy1_2(name, stream, events),
|
||||||
m_events(events),
|
|
||||||
m_keepAliveRate(kKeepAliveRate),
|
m_keepAliveRate(kKeepAliveRate),
|
||||||
m_keepAliveTimer(NULL)
|
m_keepAliveTimer(NULL),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
setHeartbeatRate(kKeepAliveRate, kKeepAliveRate * kKeepAlivesUntilDeath);
|
setHeartbeatRate(kKeepAliveRate, kKeepAliveRate * kKeepAlivesUntilDeath);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,11 +39,11 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
CClientProxyUnknown::CClientProxyUnknown(synergy::IStream* stream, double timeout, CServer* server, IEventQueue* events) :
|
CClientProxyUnknown::CClientProxyUnknown(synergy::IStream* stream, double timeout, CServer* server, IEventQueue* events) :
|
||||||
m_events(events),
|
|
||||||
m_stream(stream),
|
m_stream(stream),
|
||||||
m_proxy(NULL),
|
m_proxy(NULL),
|
||||||
m_ready(false),
|
m_ready(false),
|
||||||
m_server(server)
|
m_server(server),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
assert(m_server != NULL);
|
assert(m_server != NULL);
|
||||||
|
|
||||||
|
|
|
@ -31,9 +31,9 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
CConfig::CConfig(IEventQueue* events) :
|
CConfig::CConfig(IEventQueue* events) :
|
||||||
m_events(events),
|
m_inputFilter(events),
|
||||||
m_hasLockToScreenAction(false),
|
m_hasLockToScreenAction(false),
|
||||||
m_inputFilter(events)
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,20 +53,20 @@ CInputFilter::CCondition::disablePrimary(CPrimaryClient*)
|
||||||
|
|
||||||
CInputFilter::CKeystrokeCondition::CKeystrokeCondition(
|
CInputFilter::CKeystrokeCondition::CKeystrokeCondition(
|
||||||
IEventQueue* events, IPlatformScreen::CKeyInfo* info) :
|
IEventQueue* events, IPlatformScreen::CKeyInfo* info) :
|
||||||
m_events(events),
|
|
||||||
m_id(0),
|
m_id(0),
|
||||||
m_key(info->m_key),
|
m_key(info->m_key),
|
||||||
m_mask(info->m_mask)
|
m_mask(info->m_mask),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
free(info);
|
free(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
CInputFilter::CKeystrokeCondition::CKeystrokeCondition(
|
CInputFilter::CKeystrokeCondition::CKeystrokeCondition(
|
||||||
IEventQueue* events, KeyID key, KeyModifierMask mask) :
|
IEventQueue* events, KeyID key, KeyModifierMask mask) :
|
||||||
m_events(events),
|
|
||||||
m_id(0),
|
m_id(0),
|
||||||
m_key(key),
|
m_key(key),
|
||||||
m_mask(mask)
|
m_mask(mask),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@ -143,18 +143,18 @@ CInputFilter::CKeystrokeCondition::disablePrimary(CPrimaryClient* primary)
|
||||||
|
|
||||||
CInputFilter::CMouseButtonCondition::CMouseButtonCondition(
|
CInputFilter::CMouseButtonCondition::CMouseButtonCondition(
|
||||||
IEventQueue* events, IPlatformScreen::CButtonInfo* info) :
|
IEventQueue* events, IPlatformScreen::CButtonInfo* info) :
|
||||||
m_events(events),
|
|
||||||
m_button(info->m_button),
|
m_button(info->m_button),
|
||||||
m_mask(info->m_mask)
|
m_mask(info->m_mask),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
free(info);
|
free(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
CInputFilter::CMouseButtonCondition::CMouseButtonCondition(
|
CInputFilter::CMouseButtonCondition::CMouseButtonCondition(
|
||||||
IEventQueue* events, ButtonID button, KeyModifierMask mask) :
|
IEventQueue* events, ButtonID button, KeyModifierMask mask) :
|
||||||
m_events(events),
|
|
||||||
m_button(button),
|
m_button(button),
|
||||||
m_mask(mask)
|
m_mask(mask),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@ -227,8 +227,8 @@ CInputFilter::CMouseButtonCondition::match(const CEvent& event)
|
||||||
|
|
||||||
CInputFilter::CScreenConnectedCondition::CScreenConnectedCondition(
|
CInputFilter::CScreenConnectedCondition::CScreenConnectedCondition(
|
||||||
IEventQueue* events, const CString& screen) :
|
IEventQueue* events, const CString& screen) :
|
||||||
m_events(events),
|
m_screen(screen),
|
||||||
m_screen(screen)
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@ -279,8 +279,8 @@ CInputFilter::CAction::~CAction()
|
||||||
|
|
||||||
CInputFilter::CLockCursorToScreenAction::CLockCursorToScreenAction(
|
CInputFilter::CLockCursorToScreenAction::CLockCursorToScreenAction(
|
||||||
IEventQueue* events, Mode mode) :
|
IEventQueue* events, Mode mode) :
|
||||||
m_events(events),
|
m_mode(mode),
|
||||||
m_mode(mode)
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@ -324,8 +324,8 @@ CInputFilter::CLockCursorToScreenAction::perform(const CEvent& event)
|
||||||
|
|
||||||
CInputFilter::CSwitchToScreenAction::CSwitchToScreenAction(
|
CInputFilter::CSwitchToScreenAction::CSwitchToScreenAction(
|
||||||
IEventQueue* events, const CString& screen) :
|
IEventQueue* events, const CString& screen) :
|
||||||
m_events(events),
|
m_screen(screen),
|
||||||
m_screen(screen)
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@ -370,8 +370,8 @@ CInputFilter::CSwitchToScreenAction::perform(const CEvent& event)
|
||||||
|
|
||||||
CInputFilter::CSwitchInDirectionAction::CSwitchInDirectionAction(
|
CInputFilter::CSwitchInDirectionAction::CSwitchInDirectionAction(
|
||||||
IEventQueue* events, EDirection direction) :
|
IEventQueue* events, EDirection direction) :
|
||||||
m_events(events),
|
m_direction(direction),
|
||||||
m_direction(direction)
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@ -414,8 +414,8 @@ CInputFilter::CSwitchInDirectionAction::perform(const CEvent& event)
|
||||||
|
|
||||||
CInputFilter::CKeyboardBroadcastAction::CKeyboardBroadcastAction(
|
CInputFilter::CKeyboardBroadcastAction::CKeyboardBroadcastAction(
|
||||||
IEventQueue* events, Mode mode) :
|
IEventQueue* events, Mode mode) :
|
||||||
m_events(events),
|
m_mode(mode),
|
||||||
m_mode(mode)
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@ -424,9 +424,9 @@ CInputFilter::CKeyboardBroadcastAction::CKeyboardBroadcastAction(
|
||||||
IEventQueue* events,
|
IEventQueue* events,
|
||||||
Mode mode,
|
Mode mode,
|
||||||
const std::set<CString>& screens) :
|
const std::set<CString>& screens) :
|
||||||
m_events(events),
|
|
||||||
m_mode(mode),
|
m_mode(mode),
|
||||||
m_screens(IKeyState::CKeyInfo::join(screens))
|
m_screens(IKeyState::CKeyInfo::join(screens)),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@ -486,9 +486,9 @@ CInputFilter::CKeyboardBroadcastAction::perform(const CEvent& event)
|
||||||
|
|
||||||
CInputFilter::CKeystrokeAction::CKeystrokeAction(
|
CInputFilter::CKeystrokeAction::CKeystrokeAction(
|
||||||
IEventQueue* events, IPlatformScreen::CKeyInfo* info, bool press) :
|
IEventQueue* events, IPlatformScreen::CKeyInfo* info, bool press) :
|
||||||
m_events(events),
|
|
||||||
m_keyInfo(info),
|
m_keyInfo(info),
|
||||||
m_press(press)
|
m_press(press),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@ -574,9 +574,9 @@ CInputFilter::CKeystrokeAction::formatName() const
|
||||||
|
|
||||||
CInputFilter::CMouseButtonAction::CMouseButtonAction(
|
CInputFilter::CMouseButtonAction::CMouseButtonAction(
|
||||||
IEventQueue* events, IPlatformScreen::CButtonInfo* info, bool press) :
|
IEventQueue* events, IPlatformScreen::CButtonInfo* info, bool press) :
|
||||||
m_events(events),
|
|
||||||
m_buttonInfo(info),
|
m_buttonInfo(info),
|
||||||
m_press(press)
|
m_press(press),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@ -887,16 +887,16 @@ CInputFilter::CRule::getAction(bool onActivation, UInt32 index) const
|
||||||
// Input Filter Class
|
// Input Filter Class
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
CInputFilter::CInputFilter(IEventQueue* events) :
|
CInputFilter::CInputFilter(IEventQueue* events) :
|
||||||
m_events(events),
|
m_primaryClient(NULL),
|
||||||
m_primaryClient(NULL)
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
CInputFilter::CInputFilter(const CInputFilter& x) :
|
CInputFilter::CInputFilter(const CInputFilter& x) :
|
||||||
m_events(x.m_events),
|
|
||||||
m_ruleList(x.m_ruleList),
|
m_ruleList(x.m_ruleList),
|
||||||
m_primaryClient(NULL)
|
m_primaryClient(NULL),
|
||||||
|
m_events(x.m_events)
|
||||||
{
|
{
|
||||||
setPrimaryClient(x.m_primaryClient);
|
setPrimaryClient(x.m_primaryClient);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,7 @@
|
||||||
CPrimaryClient::CPrimaryClient(const CString& name, CScreen* screen) :
|
CPrimaryClient::CPrimaryClient(const CString& name, CScreen* screen) :
|
||||||
CBaseClientProxy(name),
|
CBaseClientProxy(name),
|
||||||
m_screen(screen),
|
m_screen(screen),
|
||||||
m_fakeInputCount(0),
|
m_fakeInputCount(0)
|
||||||
m_mock(false)
|
|
||||||
{
|
{
|
||||||
// all clipboards are clean
|
// all clipboards are clean
|
||||||
for (UInt32 i = 0; i < kClipboardEnd; ++i) {
|
for (UInt32 i = 0; i < kClipboardEnd; ++i) {
|
||||||
|
|
|
@ -39,7 +39,7 @@ public:
|
||||||
~CPrimaryClient();
|
~CPrimaryClient();
|
||||||
|
|
||||||
#ifdef TEST_ENV
|
#ifdef TEST_ENV
|
||||||
CPrimaryClient() : CBaseClientProxy(""), m_mock(true) { }
|
CPrimaryClient() : CBaseClientProxy("") { }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! @name manipulators
|
//! @name manipulators
|
||||||
|
@ -151,7 +151,6 @@ private:
|
||||||
CScreen* m_screen;
|
CScreen* m_screen;
|
||||||
bool m_clipboardDirty[kClipboardEnd];
|
bool m_clipboardDirty[kClipboardEnd];
|
||||||
SInt32 m_fakeInputCount;
|
SInt32 m_fakeInputCount;
|
||||||
bool m_mock;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -48,7 +48,6 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
CServer::CServer(CConfig& config, CPrimaryClient* primaryClient, CScreen* screen, IEventQueue* events, bool enableDragDrop) :
|
CServer::CServer(CConfig& config, CPrimaryClient* primaryClient, CScreen* screen, IEventQueue* events, bool enableDragDrop) :
|
||||||
m_events(events),
|
|
||||||
m_mock(false),
|
m_mock(false),
|
||||||
m_primaryClient(primaryClient),
|
m_primaryClient(primaryClient),
|
||||||
m_active(primaryClient),
|
m_active(primaryClient),
|
||||||
|
@ -75,6 +74,7 @@ CServer::CServer(CConfig& config, CPrimaryClient* primaryClient, CScreen* screen
|
||||||
m_keyboardBroadcasting(false),
|
m_keyboardBroadcasting(false),
|
||||||
m_lockedToScreen(false),
|
m_lockedToScreen(false),
|
||||||
m_screen(screen),
|
m_screen(screen),
|
||||||
|
m_events(events),
|
||||||
m_sendFileThread(NULL),
|
m_sendFileThread(NULL),
|
||||||
m_writeToDropDirThread(NULL),
|
m_writeToDropDirThread(NULL),
|
||||||
m_ignoreFileTransfer(false),
|
m_ignoreFileTransfer(false),
|
||||||
|
@ -190,7 +190,6 @@ CServer::CServer(CConfig& config, CPrimaryClient* primaryClient, CScreen* screen
|
||||||
m_inputFilter->setPrimaryClient(m_primaryClient);
|
m_inputFilter->setPrimaryClient(m_primaryClient);
|
||||||
|
|
||||||
// Determine if scroll lock is already set. If so, lock the cursor to the primary screen
|
// Determine if scroll lock is already set. If so, lock the cursor to the primary screen
|
||||||
int keyValue = m_primaryClient->getToggleMask();
|
|
||||||
if (m_primaryClient->getToggleMask() & KeyModifierScrollLock) {
|
if (m_primaryClient->getToggleMask() & KeyModifierScrollLock) {
|
||||||
LOG((CLOG_DEBUG "scroll lock on initially. locked to screen"));
|
LOG((CLOG_DEBUG "scroll lock on initially. locked to screen"));
|
||||||
m_lockedToScreen = true;
|
m_lockedToScreen = true;
|
||||||
|
|
|
@ -52,14 +52,14 @@
|
||||||
CApp* CApp::s_instance = nullptr;
|
CApp* CApp::s_instance = nullptr;
|
||||||
|
|
||||||
CApp::CApp(IEventQueue* events, CreateTaskBarReceiverFunc createTaskBarReceiver, CArgsBase* args) :
|
CApp::CApp(IEventQueue* events, CreateTaskBarReceiverFunc createTaskBarReceiver, CArgsBase* args) :
|
||||||
m_events(events),
|
|
||||||
m_createTaskBarReceiver(createTaskBarReceiver),
|
|
||||||
m_args(args),
|
|
||||||
m_bye(&exit),
|
m_bye(&exit),
|
||||||
m_taskBarReceiver(NULL),
|
m_taskBarReceiver(NULL),
|
||||||
m_suspended(false),
|
m_suspended(false),
|
||||||
m_ipcClient(nullptr),
|
m_events(events),
|
||||||
m_appUtil(events)
|
m_args(args),
|
||||||
|
m_createTaskBarReceiver(createTaskBarReceiver),
|
||||||
|
m_appUtil(events),
|
||||||
|
m_ipcClient(nullptr)
|
||||||
{
|
{
|
||||||
assert(s_instance == nullptr);
|
assert(s_instance == nullptr);
|
||||||
s_instance = this;
|
s_instance = this;
|
||||||
|
@ -289,7 +289,12 @@ CApp::run(int argc, char** argv)
|
||||||
#if MAC_OS_X_VERSION_10_7
|
#if MAC_OS_X_VERSION_10_7
|
||||||
// dock hide only supported on lion :(
|
// dock hide only supported on lion :(
|
||||||
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
GetCurrentProcess(&psn);
|
GetCurrentProcess(&psn);
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
TransformProcessType(&psn, kProcessTransformToBackgroundApplication);
|
TransformProcessType(&psn, kProcessTransformToBackgroundApplication);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -33,11 +33,11 @@ m_disableXInitThreads(false),
|
||||||
m_backend(false),
|
m_backend(false),
|
||||||
m_restartable(true),
|
m_restartable(true),
|
||||||
m_noHooks(false),
|
m_noHooks(false),
|
||||||
m_disableTray(false),
|
|
||||||
m_pname(NULL),
|
m_pname(NULL),
|
||||||
m_logFilter(NULL),
|
m_logFilter(NULL),
|
||||||
m_logFile(NULL),
|
m_logFile(NULL),
|
||||||
m_display(NULL),
|
m_display(NULL),
|
||||||
|
m_disableTray(false),
|
||||||
m_enableIpc(false),
|
m_enableIpc(false),
|
||||||
m_enableDragDrop(false)
|
m_enableDragDrop(false)
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,8 +29,8 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
CClientTaskBarReceiver::CClientTaskBarReceiver(IEventQueue* events) :
|
CClientTaskBarReceiver::CClientTaskBarReceiver(IEventQueue* events) :
|
||||||
m_events(events),
|
m_state(kNotRunning),
|
||||||
m_state(kNotRunning)
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,12 +78,12 @@ winMainLoopStatic(int, const char**)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CDaemonApp::CDaemonApp() :
|
CDaemonApp::CDaemonApp() :
|
||||||
m_events(nullptr),
|
|
||||||
m_ipcServer(nullptr),
|
m_ipcServer(nullptr),
|
||||||
m_ipcLogOutputter(nullptr)
|
m_ipcLogOutputter(nullptr),
|
||||||
#if SYSAPI_WIN32
|
#if SYSAPI_WIN32
|
||||||
,m_watchdog(nullptr)
|
m_watchdog(nullptr),
|
||||||
#endif
|
#endif
|
||||||
|
m_events(nullptr)
|
||||||
{
|
{
|
||||||
s_instance = this;
|
s_instance = this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ This class provides a keyboard mapping.
|
||||||
class CKeyMap {
|
class CKeyMap {
|
||||||
public:
|
public:
|
||||||
CKeyMap();
|
CKeyMap();
|
||||||
~CKeyMap();
|
virtual ~CKeyMap();
|
||||||
|
|
||||||
//! KeyID synthesis info
|
//! KeyID synthesis info
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -384,20 +384,20 @@ static const KeyID s_numpadTable[] = {
|
||||||
|
|
||||||
CKeyState::CKeyState(IEventQueue* events) :
|
CKeyState::CKeyState(IEventQueue* events) :
|
||||||
IKeyState(events),
|
IKeyState(events),
|
||||||
m_events(events),
|
|
||||||
m_mask(0),
|
|
||||||
m_keyMapPtr(new CKeyMap()),
|
m_keyMapPtr(new CKeyMap()),
|
||||||
m_keyMap(*m_keyMapPtr)
|
m_keyMap(*m_keyMapPtr),
|
||||||
|
m_mask(0),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
CKeyState::CKeyState(IEventQueue* events, CKeyMap& keyMap) :
|
CKeyState::CKeyState(IEventQueue* events, CKeyMap& keyMap) :
|
||||||
IKeyState(events),
|
IKeyState(events),
|
||||||
m_events(events),
|
|
||||||
m_mask(0),
|
|
||||||
m_keyMapPtr(0),
|
m_keyMapPtr(0),
|
||||||
m_keyMap(keyMap)
|
m_keyMap(keyMap),
|
||||||
|
m_mask(0),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,9 +29,9 @@
|
||||||
|
|
||||||
CPacketStreamFilter::CPacketStreamFilter(IEventQueue* events, synergy::IStream* stream, bool adoptStream) :
|
CPacketStreamFilter::CPacketStreamFilter(IEventQueue* events, synergy::IStream* stream, bool adoptStream) :
|
||||||
CStreamFilter(events, stream, adoptStream),
|
CStreamFilter(events, stream, adoptStream),
|
||||||
m_events(events),
|
|
||||||
m_size(0),
|
m_size(0),
|
||||||
m_inputShutdown(false)
|
m_inputShutdown(false),
|
||||||
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
CPortableTaskBarReceiver::CPortableTaskBarReceiver(IEventQueue* events) :
|
CPortableTaskBarReceiver::CPortableTaskBarReceiver(IEventQueue* events) :
|
||||||
m_events(events),
|
m_state(kNotRunning),
|
||||||
m_state(kNotRunning)
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,13 +29,13 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
CScreen::CScreen(IPlatformScreen* platformScreen, IEventQueue* events) :
|
CScreen::CScreen(IPlatformScreen* platformScreen, IEventQueue* events) :
|
||||||
m_events(events),
|
|
||||||
m_screen(platformScreen),
|
m_screen(platformScreen),
|
||||||
m_isPrimary(platformScreen->isPrimary()),
|
m_isPrimary(platformScreen->isPrimary()),
|
||||||
m_enabled(false),
|
m_enabled(false),
|
||||||
m_entered(m_isPrimary),
|
m_entered(m_isPrimary),
|
||||||
m_screenSaverSync(true),
|
m_screenSaverSync(true),
|
||||||
m_fakeInput(false),
|
m_fakeInput(false),
|
||||||
|
m_events(events),
|
||||||
m_mock(false),
|
m_mock(false),
|
||||||
m_enableDragDrop(false)
|
m_enableDragDrop(false)
|
||||||
{
|
{
|
||||||
|
|
|
@ -886,13 +886,6 @@ CServerApp::foregroundStartup(int argc, char** argv)
|
||||||
return mainLoop();
|
return mainLoop();
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
|
||||||
int
|
|
||||||
mainLoopStatic()
|
|
||||||
{
|
|
||||||
return CServerApp::instance().mainLoop();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
CServerApp::daemonName() const
|
CServerApp::daemonName() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,8 +29,8 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
CServerTaskBarReceiver::CServerTaskBarReceiver(IEventQueue* events) :
|
CServerTaskBarReceiver::CServerTaskBarReceiver(IEventQueue* events) :
|
||||||
m_events(events),
|
m_state(kNotRunning),
|
||||||
m_state(kNotRunning)
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,7 @@
|
||||||
// IKeyState
|
// IKeyState
|
||||||
//
|
//
|
||||||
|
|
||||||
IKeyState::IKeyState(IEventQueue* events) :
|
IKeyState::IKeyState(IEventQueue* events)
|
||||||
m_events(events)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -165,9 +165,6 @@ public:
|
||||||
virtual void pollPressedKeys(KeyButtonSet& pressedKeys) const = 0;
|
virtual void pollPressedKeys(KeyButtonSet& pressedKeys) const = 0;
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
private:
|
|
||||||
IEventQueue* m_events;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -26,7 +26,7 @@ class IEventQueue;
|
||||||
class CMockStream : public synergy::IStream
|
class CMockStream : public synergy::IStream
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CMockStream() : synergy::IStream(NULL) { }
|
CMockStream() { }
|
||||||
MOCK_METHOD0(close, void());
|
MOCK_METHOD0(close, void());
|
||||||
MOCK_METHOD2(read, UInt32(void*, UInt32));
|
MOCK_METHOD2(read, UInt32(void*, UInt32));
|
||||||
MOCK_METHOD2(write, void(const void*, UInt32));
|
MOCK_METHOD2(write, void(const void*, UInt32));
|
||||||
|
|
Loading…
Reference in New Issue