chore: clean up windows code smells missed by sonarscan
This commit is contained in:
parent
903401796e
commit
e9ccd513f7
42 changed files with 201 additions and 318 deletions
|
|
@ -6,7 +6,6 @@
|
|||
# Platform Specific Code
|
||||
if(WIN32)
|
||||
set(PLATFORM_CODE
|
||||
win32/ArchConsoleWindows.cpp
|
||||
win32/ArchConsoleWindows.h
|
||||
win32/ArchDaemonWindows.cpp
|
||||
win32/ArchDaemonWindows.h
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* Deskflow -- mouse and keyboard sharing utility
|
||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||
*/
|
||||
|
||||
#include "arch/win32/ArchConsoleWindows.h"
|
||||
|
||||
ArchConsoleWindows::ArchConsoleWindows()
|
||||
{
|
||||
}
|
||||
|
||||
ArchConsoleWindows::~ArchConsoleWindows()
|
||||
{
|
||||
}
|
||||
|
|
@ -14,6 +14,6 @@
|
|||
class ArchConsoleWindows : public ArchConsoleStd
|
||||
{
|
||||
public:
|
||||
ArchConsoleWindows();
|
||||
virtual ~ArchConsoleWindows();
|
||||
ArchConsoleWindows() = default;
|
||||
~ArchConsoleWindows() override = default;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,11 +23,6 @@ ArchDaemonWindows::ArchDaemonWindows() : m_daemonThreadID(0)
|
|||
m_quitMessage = RegisterWindowMessage("DeskflowDaemonExit");
|
||||
}
|
||||
|
||||
ArchDaemonWindows::~ArchDaemonWindows()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
int ArchDaemonWindows::runDaemon(RunFunc runFunc)
|
||||
{
|
||||
assert(s_daemon != nullptr);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public:
|
|||
using RunFunc = std::function<int()>;
|
||||
|
||||
ArchDaemonWindows();
|
||||
virtual ~ArchDaemonWindows();
|
||||
~ArchDaemonWindows() override = default;
|
||||
|
||||
//! Run the daemon
|
||||
/*!
|
||||
|
|
@ -68,15 +68,15 @@ public:
|
|||
static UINT getDaemonQuitMessage();
|
||||
|
||||
// IArchDaemon overrides
|
||||
virtual void installDaemon(
|
||||
void installDaemon(
|
||||
const char *name, const char *description, const char *pathname, const char *commandLine, const char *dependencies
|
||||
);
|
||||
virtual void uninstallDaemon(const char *name);
|
||||
virtual void installDaemon();
|
||||
virtual void uninstallDaemon();
|
||||
virtual int daemonize(const char *name, DaemonFunc func);
|
||||
virtual bool canInstallDaemon(const char *name);
|
||||
virtual bool isDaemonInstalled(const char *name);
|
||||
) override;
|
||||
void uninstallDaemon(const char *name) override;
|
||||
void installDaemon() override;
|
||||
void uninstallDaemon() override;
|
||||
int daemonize(const char *name, DaemonFunc func) override;
|
||||
bool canInstallDaemon(const char *name) override;
|
||||
bool isDaemonInstalled(const char *name) override;
|
||||
std::string commandLine() const
|
||||
{
|
||||
return m_commandLine;
|
||||
|
|
|
|||
|
|
@ -19,11 +19,6 @@ ArchLogWindows::ArchLogWindows() : m_eventLog(nullptr)
|
|||
// do nothing
|
||||
}
|
||||
|
||||
ArchLogWindows::~ArchLogWindows()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void ArchLogWindows::openLog(const char *name)
|
||||
{
|
||||
if (m_eventLog == nullptr) {
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@ class ArchLogWindows : public IArchLog
|
|||
{
|
||||
public:
|
||||
ArchLogWindows();
|
||||
virtual ~ArchLogWindows();
|
||||
~ArchLogWindows() override = default;
|
||||
|
||||
// IArchLog overrides
|
||||
virtual void openLog(const char *name);
|
||||
virtual void closeLog();
|
||||
virtual void showLog(bool showIfEmpty);
|
||||
virtual void writeLog(ELevel, const char *);
|
||||
void openLog(const char *name) override;
|
||||
void closeLog() override;
|
||||
void showLog(bool showIfEmpty) override;
|
||||
void writeLog(ELevel, const char *) override;
|
||||
|
||||
private:
|
||||
HANDLE m_eventLog;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class ArchMultithreadWindows : public IArchMultithread
|
|||
{
|
||||
public:
|
||||
ArchMultithreadWindows();
|
||||
virtual ~ArchMultithreadWindows();
|
||||
~ArchMultithreadWindows() override;
|
||||
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
|
@ -61,29 +61,29 @@ public:
|
|||
//@}
|
||||
|
||||
// IArchMultithread overrides
|
||||
virtual ArchCond newCondVar();
|
||||
virtual void closeCondVar(ArchCond);
|
||||
virtual void signalCondVar(ArchCond);
|
||||
virtual void broadcastCondVar(ArchCond);
|
||||
virtual bool waitCondVar(ArchCond, ArchMutex, double timeout);
|
||||
virtual ArchMutex newMutex();
|
||||
virtual void closeMutex(ArchMutex);
|
||||
virtual void lockMutex(ArchMutex);
|
||||
virtual void unlockMutex(ArchMutex);
|
||||
virtual ArchThread newThread(ThreadFunc, void *);
|
||||
virtual ArchThread newCurrentThread();
|
||||
virtual ArchThread copyThread(ArchThread);
|
||||
virtual void closeThread(ArchThread);
|
||||
virtual void cancelThread(ArchThread);
|
||||
virtual void setPriorityOfThread(ArchThread, int n);
|
||||
virtual void testCancelThread();
|
||||
virtual bool wait(ArchThread, double timeout);
|
||||
virtual bool isSameThread(ArchThread, ArchThread);
|
||||
virtual bool isExitedThread(ArchThread);
|
||||
virtual void *getResultOfThread(ArchThread);
|
||||
virtual ThreadID getIDOfThread(ArchThread);
|
||||
virtual void setSignalHandler(ESignal, SignalFunc, void *);
|
||||
virtual void raiseSignal(ESignal);
|
||||
ArchCond newCondVar() override;
|
||||
void closeCondVar(ArchCond) override;
|
||||
void signalCondVar(ArchCond) override;
|
||||
void broadcastCondVar(ArchCond) override;
|
||||
bool waitCondVar(ArchCond, ArchMutex, double timeout) override;
|
||||
ArchMutex newMutex() override;
|
||||
void closeMutex(ArchMutex) override;
|
||||
void lockMutex(ArchMutex) override;
|
||||
void unlockMutex(ArchMutex) override;
|
||||
ArchThread newThread(ThreadFunc, void *) override;
|
||||
ArchThread newCurrentThread() override;
|
||||
ArchThread copyThread(ArchThread) override;
|
||||
void closeThread(ArchThread) override;
|
||||
void cancelThread(ArchThread) override;
|
||||
void setPriorityOfThread(ArchThread, int n) override;
|
||||
void testCancelThread() override;
|
||||
bool wait(ArchThread, double timeout) override;
|
||||
bool isSameThread(ArchThread, ArchThread) override;
|
||||
bool isExitedThread(ArchThread) override;
|
||||
void *getResultOfThread(ArchThread) override;
|
||||
ThreadID getIDOfThread(ArchThread) override;
|
||||
void setSignalHandler(ESignal, SignalFunc, void *) override;
|
||||
void raiseSignal(ESignal) override;
|
||||
|
||||
private:
|
||||
ArchThreadImpl *find(DWORD id);
|
||||
|
|
|
|||
|
|
@ -52,39 +52,39 @@ class ArchNetworkWinsock : public IArchNetwork
|
|||
{
|
||||
public:
|
||||
ArchNetworkWinsock();
|
||||
virtual ~ArchNetworkWinsock();
|
||||
~ArchNetworkWinsock() override;
|
||||
|
||||
virtual void init();
|
||||
void init() override;
|
||||
|
||||
// IArchNetwork overrides
|
||||
virtual ArchSocket newSocket(EAddressFamily, ESocketType);
|
||||
virtual ArchSocket copySocket(ArchSocket s);
|
||||
virtual void closeSocket(ArchSocket s);
|
||||
virtual void closeSocketForRead(ArchSocket s);
|
||||
virtual void closeSocketForWrite(ArchSocket s);
|
||||
virtual void bindSocket(ArchSocket s, ArchNetAddress addr);
|
||||
virtual void listenOnSocket(ArchSocket s);
|
||||
virtual ArchSocket acceptSocket(ArchSocket s, ArchNetAddress *addr);
|
||||
virtual bool connectSocket(ArchSocket s, ArchNetAddress name);
|
||||
virtual int pollSocket(PollEntry[], int num, double timeout);
|
||||
virtual void unblockPollSocket(ArchThread thread);
|
||||
virtual size_t readSocket(ArchSocket s, void *buf, size_t len);
|
||||
virtual size_t writeSocket(ArchSocket s, const void *buf, size_t len);
|
||||
virtual void throwErrorOnSocket(ArchSocket);
|
||||
virtual bool setNoDelayOnSocket(ArchSocket, bool noDelay);
|
||||
virtual bool setReuseAddrOnSocket(ArchSocket, bool reuse);
|
||||
virtual std::string getHostName();
|
||||
virtual ArchNetAddress newAnyAddr(EAddressFamily);
|
||||
virtual ArchNetAddress copyAddr(ArchNetAddress);
|
||||
virtual std::vector<ArchNetAddress> nameToAddr(const std::string &);
|
||||
virtual void closeAddr(ArchNetAddress);
|
||||
virtual std::string addrToName(ArchNetAddress);
|
||||
virtual std::string addrToString(ArchNetAddress);
|
||||
virtual EAddressFamily getAddrFamily(ArchNetAddress);
|
||||
virtual void setAddrPort(ArchNetAddress, int port);
|
||||
virtual int getAddrPort(ArchNetAddress);
|
||||
virtual bool isAnyAddr(ArchNetAddress);
|
||||
virtual bool isEqualAddr(ArchNetAddress, ArchNetAddress);
|
||||
ArchSocket newSocket(EAddressFamily, ESocketType) override;
|
||||
ArchSocket copySocket(ArchSocket s) override;
|
||||
void closeSocket(ArchSocket s) override;
|
||||
void closeSocketForRead(ArchSocket s) override;
|
||||
void closeSocketForWrite(ArchSocket s) override;
|
||||
void bindSocket(ArchSocket s, ArchNetAddress addr) override;
|
||||
void listenOnSocket(ArchSocket s) override;
|
||||
ArchSocket acceptSocket(ArchSocket s, ArchNetAddress *addr) override;
|
||||
bool connectSocket(ArchSocket s, ArchNetAddress name) override;
|
||||
int pollSocket(PollEntry[], int num, double timeout) override;
|
||||
void unblockPollSocket(ArchThread thread) override;
|
||||
size_t readSocket(ArchSocket s, void *buf, size_t len) override;
|
||||
size_t writeSocket(ArchSocket s, const void *buf, size_t len) override;
|
||||
void throwErrorOnSocket(ArchSocket) override;
|
||||
bool setNoDelayOnSocket(ArchSocket, bool noDelay) override;
|
||||
bool setReuseAddrOnSocket(ArchSocket, bool reuse) override;
|
||||
std::string getHostName() override;
|
||||
ArchNetAddress newAnyAddr(EAddressFamily) override;
|
||||
ArchNetAddress copyAddr(ArchNetAddress) override;
|
||||
std::vector<ArchNetAddress> nameToAddr(const std::string &) override;
|
||||
void closeAddr(ArchNetAddress) override;
|
||||
std::string addrToName(ArchNetAddress) override;
|
||||
std::string addrToString(ArchNetAddress) override;
|
||||
EAddressFamily getAddrFamily(ArchNetAddress) override;
|
||||
void setAddrPort(ArchNetAddress, int port) override;
|
||||
int getAddrPort(ArchNetAddress) override;
|
||||
bool isAnyAddr(ArchNetAddress) override;
|
||||
bool isEqualAddr(ArchNetAddress, ArchNetAddress) override;
|
||||
|
||||
private:
|
||||
void initModule(HMODULE);
|
||||
|
|
|
|||
|
|
@ -13,16 +13,6 @@
|
|||
// ArchSleepWindows
|
||||
//
|
||||
|
||||
ArchSleepWindows::ArchSleepWindows()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
ArchSleepWindows::~ArchSleepWindows()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void ArchSleepWindows::sleep(double timeout)
|
||||
{
|
||||
ARCH->testCancelThread();
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@
|
|||
class ArchSleepWindows : public IArchSleep
|
||||
{
|
||||
public:
|
||||
ArchSleepWindows();
|
||||
virtual ~ArchSleepWindows();
|
||||
ArchSleepWindows() = default;
|
||||
~ArchSleepWindows() override = default;
|
||||
|
||||
// IArchSleep overrides
|
||||
virtual void sleep(double timeout);
|
||||
void sleep(double timeout) override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,14 +16,6 @@
|
|||
// ArchStringWindows
|
||||
//
|
||||
|
||||
ArchStringWindows::ArchStringWindows()
|
||||
{
|
||||
}
|
||||
|
||||
ArchStringWindows::~ArchStringWindows()
|
||||
{
|
||||
}
|
||||
|
||||
IArchString::EWideCharEncoding ArchStringWindows::getWideCharEncoding()
|
||||
{
|
||||
return kUTF16;
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@
|
|||
class ArchStringWindows : public IArchString
|
||||
{
|
||||
public:
|
||||
ArchStringWindows();
|
||||
virtual ~ArchStringWindows();
|
||||
ArchStringWindows() = default;
|
||||
~ArchStringWindows() override = default;
|
||||
|
||||
// IArchString overrides
|
||||
virtual EWideCharEncoding getWideCharEncoding();
|
||||
EWideCharEncoding getWideCharEncoding() override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ class ArchTimeWindows : public IArchTime
|
|||
{
|
||||
public:
|
||||
ArchTimeWindows();
|
||||
virtual ~ArchTimeWindows();
|
||||
~ArchTimeWindows() override;
|
||||
|
||||
// IArchTime overrides
|
||||
virtual double time();
|
||||
double time() override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -22,9 +22,7 @@ public:
|
|||
XArchEvalWindows(DWORD error) : m_error(error)
|
||||
{
|
||||
}
|
||||
virtual ~XArchEvalWindows()
|
||||
{
|
||||
}
|
||||
~XArchEvalWindows() override = default;
|
||||
|
||||
virtual std::string eval() const throw();
|
||||
|
||||
|
|
@ -39,9 +37,7 @@ public:
|
|||
XArchEvalWinsock(int error) : m_error(error)
|
||||
{
|
||||
}
|
||||
virtual ~XArchEvalWinsock()
|
||||
{
|
||||
}
|
||||
~XArchEvalWinsock() override = default;
|
||||
|
||||
virtual std::string eval() const throw();
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class AppUtilWindows : public AppUtil
|
|||
{
|
||||
public:
|
||||
AppUtilWindows(IEventQueue *events);
|
||||
virtual ~AppUtilWindows();
|
||||
~AppUtilWindows() override;
|
||||
|
||||
static AppUtilWindows &instance();
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,5 @@ class IMSWindowsClipboardFacade : public IInterface
|
|||
{
|
||||
public:
|
||||
virtual void write(HANDLE win32Data, UINT win32Format) = 0;
|
||||
virtual ~IMSWindowsClipboardFacade()
|
||||
{
|
||||
}
|
||||
virtual ~IMSWindowsClipboardFacade() = default;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class MSWindowsClipboard : public IClipboard
|
|||
public:
|
||||
MSWindowsClipboard(HWND window);
|
||||
MSWindowsClipboard(HWND window, IMSWindowsClipboardFacade &facade);
|
||||
virtual ~MSWindowsClipboard();
|
||||
~MSWindowsClipboard() override;
|
||||
|
||||
//! Empty clipboard without ownership
|
||||
/*!
|
||||
|
|
@ -45,13 +45,13 @@ public:
|
|||
static bool isOwnedByDeskflow();
|
||||
|
||||
// IClipboard overrides
|
||||
virtual bool empty();
|
||||
virtual void add(EFormat, const std::string &data);
|
||||
virtual bool open(Time) const;
|
||||
virtual void close() const;
|
||||
virtual Time getTime() const;
|
||||
virtual bool has(EFormat) const;
|
||||
virtual std::string get(EFormat) const;
|
||||
bool empty() override;
|
||||
void add(EFormat, const std::string &data) override;
|
||||
bool open(Time) const override;
|
||||
void close() const override;
|
||||
Time getTime() const override;
|
||||
bool has(EFormat) const override;
|
||||
std::string get(EFormat) const override;
|
||||
|
||||
void setFacade(IMSWindowsClipboardFacade &facade);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,16 +11,6 @@
|
|||
// MSWindowsClipboardAnyTextConverter
|
||||
//
|
||||
|
||||
MSWindowsClipboardAnyTextConverter::MSWindowsClipboardAnyTextConverter()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
MSWindowsClipboardAnyTextConverter::~MSWindowsClipboardAnyTextConverter()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
IClipboard::EFormat MSWindowsClipboardAnyTextConverter::getFormat() const
|
||||
{
|
||||
return IClipboard::kText;
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@
|
|||
class MSWindowsClipboardAnyTextConverter : public IMSWindowsClipboardConverter
|
||||
{
|
||||
public:
|
||||
MSWindowsClipboardAnyTextConverter();
|
||||
virtual ~MSWindowsClipboardAnyTextConverter();
|
||||
MSWindowsClipboardAnyTextConverter() = default;
|
||||
~MSWindowsClipboardAnyTextConverter() override = default;
|
||||
|
||||
// IMSWindowsClipboardConverter overrides
|
||||
virtual IClipboard::EFormat getFormat() const;
|
||||
virtual UINT getWin32Format() const = 0;
|
||||
virtual HANDLE fromIClipboard(const std::string &) const;
|
||||
virtual std::string toIClipboard(HANDLE) const;
|
||||
IClipboard::EFormat getFormat() const override;
|
||||
UINT getWin32Format() const override = 0;
|
||||
HANDLE fromIClipboard(const std::string &) const override;
|
||||
std::string toIClipboard(HANDLE) const override;
|
||||
|
||||
protected:
|
||||
//! Convert from IClipboard format
|
||||
|
|
|
|||
|
|
@ -13,16 +13,6 @@
|
|||
// MSWindowsClipboardBitmapConverter
|
||||
//
|
||||
|
||||
MSWindowsClipboardBitmapConverter::MSWindowsClipboardBitmapConverter()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
MSWindowsClipboardBitmapConverter::~MSWindowsClipboardBitmapConverter()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
IClipboard::EFormat MSWindowsClipboardBitmapConverter::getFormat() const
|
||||
{
|
||||
return IClipboard::kBitmap;
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@
|
|||
class MSWindowsClipboardBitmapConverter : public IMSWindowsClipboardConverter
|
||||
{
|
||||
public:
|
||||
MSWindowsClipboardBitmapConverter();
|
||||
virtual ~MSWindowsClipboardBitmapConverter();
|
||||
MSWindowsClipboardBitmapConverter() = default;
|
||||
~MSWindowsClipboardBitmapConverter() override = default;
|
||||
|
||||
// IMSWindowsClipboardConverter overrides
|
||||
virtual IClipboard::EFormat getFormat() const;
|
||||
virtual UINT getWin32Format() const;
|
||||
virtual HANDLE fromIClipboard(const std::string &) const;
|
||||
virtual std::string toIClipboard(HANDLE) const;
|
||||
IClipboard::EFormat getFormat() const override;
|
||||
UINT getWin32Format() const override;
|
||||
HANDLE fromIClipboard(const std::string &) const override;
|
||||
std::string toIClipboard(HANDLE) const override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@
|
|||
class MSWindowsClipboardFacade : public IMSWindowsClipboardFacade
|
||||
{
|
||||
public:
|
||||
virtual void write(HANDLE win32Data, UINT win32Format);
|
||||
void write(HANDLE win32Data, UINT win32Format) override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,11 +18,6 @@ MSWindowsClipboardHTMLConverter::MSWindowsClipboardHTMLConverter()
|
|||
m_format = RegisterClipboardFormat("HTML Format");
|
||||
}
|
||||
|
||||
MSWindowsClipboardHTMLConverter::~MSWindowsClipboardHTMLConverter()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
IClipboard::EFormat MSWindowsClipboardHTMLConverter::getFormat() const
|
||||
{
|
||||
return IClipboard::kHTML;
|
||||
|
|
|
|||
|
|
@ -14,16 +14,16 @@ class MSWindowsClipboardHTMLConverter : public MSWindowsClipboardAnyTextConverte
|
|||
{
|
||||
public:
|
||||
MSWindowsClipboardHTMLConverter();
|
||||
virtual ~MSWindowsClipboardHTMLConverter();
|
||||
~MSWindowsClipboardHTMLConverter() override = default;
|
||||
|
||||
// IMSWindowsClipboardConverter overrides
|
||||
virtual IClipboard::EFormat getFormat() const;
|
||||
virtual UINT getWin32Format() const;
|
||||
IClipboard::EFormat getFormat() const override;
|
||||
UINT getWin32Format() const override;
|
||||
|
||||
protected:
|
||||
// MSWindowsClipboardAnyTextConverter overrides
|
||||
virtual std::string doFromIClipboard(const std::string &) const;
|
||||
virtual std::string doToIClipboard(const std::string &) const;
|
||||
std::string doFromIClipboard(const std::string &) const override;
|
||||
std::string doToIClipboard(const std::string &) const override;
|
||||
|
||||
private:
|
||||
std::string findArg(const std::string &data, const std::string &name) const;
|
||||
|
|
|
|||
|
|
@ -13,16 +13,6 @@
|
|||
// MSWindowsClipboardTextConverter
|
||||
//
|
||||
|
||||
MSWindowsClipboardTextConverter::MSWindowsClipboardTextConverter()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
MSWindowsClipboardTextConverter::~MSWindowsClipboardTextConverter()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
UINT MSWindowsClipboardTextConverter::getWin32Format() const
|
||||
{
|
||||
return CF_TEXT;
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@
|
|||
class MSWindowsClipboardTextConverter : public MSWindowsClipboardAnyTextConverter
|
||||
{
|
||||
public:
|
||||
MSWindowsClipboardTextConverter();
|
||||
virtual ~MSWindowsClipboardTextConverter();
|
||||
MSWindowsClipboardTextConverter() = default;
|
||||
~MSWindowsClipboardTextConverter() override = default;
|
||||
|
||||
// IMSWindowsClipboardConverter overrides
|
||||
virtual UINT getWin32Format() const;
|
||||
UINT getWin32Format() const override;
|
||||
|
||||
protected:
|
||||
// MSWindowsClipboardAnyTextConverter overrides
|
||||
virtual std::string doFromIClipboard(const std::string &) const;
|
||||
virtual std::string doToIClipboard(const std::string &) const;
|
||||
std::string doFromIClipboard(const std::string &) const override;
|
||||
std::string doToIClipboard(const std::string &) const override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,16 +13,6 @@
|
|||
// MSWindowsClipboardUTF16Converter
|
||||
//
|
||||
|
||||
MSWindowsClipboardUTF16Converter::MSWindowsClipboardUTF16Converter()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
MSWindowsClipboardUTF16Converter::~MSWindowsClipboardUTF16Converter()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
UINT MSWindowsClipboardUTF16Converter::getWin32Format() const
|
||||
{
|
||||
return CF_UNICODETEXT;
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@
|
|||
class MSWindowsClipboardUTF16Converter : public MSWindowsClipboardAnyTextConverter
|
||||
{
|
||||
public:
|
||||
MSWindowsClipboardUTF16Converter();
|
||||
virtual ~MSWindowsClipboardUTF16Converter();
|
||||
MSWindowsClipboardUTF16Converter() = default;
|
||||
~MSWindowsClipboardUTF16Converter() override = default;
|
||||
|
||||
// IMSWindowsClipboardConverter overrides
|
||||
virtual UINT getWin32Format() const;
|
||||
UINT getWin32Format() const override;
|
||||
|
||||
protected:
|
||||
// MSWindowsClipboardAnyTextConverter overrides
|
||||
virtual std::string doFromIClipboard(const std::string &) const;
|
||||
virtual std::string doToIClipboard(const std::string &) const;
|
||||
std::string doFromIClipboard(const std::string &) const override;
|
||||
std::string doToIClipboard(const std::string &) const override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,24 +11,19 @@
|
|||
#include <Windows.h>
|
||||
#include <string>
|
||||
|
||||
MSWindowsDebugOutputter::MSWindowsDebugOutputter()
|
||||
{
|
||||
}
|
||||
|
||||
MSWindowsDebugOutputter::~MSWindowsDebugOutputter()
|
||||
{
|
||||
}
|
||||
|
||||
void MSWindowsDebugOutputter::open(const char *title)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void MSWindowsDebugOutputter::close()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void MSWindowsDebugOutputter::show(bool showIfEmpty)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
bool MSWindowsDebugOutputter::write(ELevel level, const char *msg)
|
||||
|
|
@ -39,4 +34,5 @@ bool MSWindowsDebugOutputter::write(ELevel level, const char *msg)
|
|||
|
||||
void MSWindowsDebugOutputter::flush()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,13 +17,13 @@ can be seen in the Output window.
|
|||
class MSWindowsDebugOutputter : public ILogOutputter
|
||||
{
|
||||
public:
|
||||
MSWindowsDebugOutputter();
|
||||
virtual ~MSWindowsDebugOutputter();
|
||||
MSWindowsDebugOutputter() = default;
|
||||
~MSWindowsDebugOutputter() override = default;
|
||||
|
||||
// ILogOutputter overrides
|
||||
virtual void open(const char *title);
|
||||
virtual void close();
|
||||
virtual void show(bool showIfEmpty);
|
||||
virtual bool write(ELevel level, const char *message);
|
||||
virtual void flush();
|
||||
void open(const char *title) override;
|
||||
void close() override;
|
||||
void show(bool showIfEmpty) override;
|
||||
bool write(ELevel level, const char *message) override;
|
||||
void flush();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,10 +21,6 @@ MSWindowsDropTarget::MSWindowsDropTarget() : m_refCount(1), m_allowDrop(false)
|
|||
s_instance = this;
|
||||
}
|
||||
|
||||
MSWindowsDropTarget::~MSWindowsDropTarget()
|
||||
{
|
||||
}
|
||||
|
||||
MSWindowsDropTarget &MSWindowsDropTarget::instance()
|
||||
{
|
||||
assert(s_instance != nullptr);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class MSWindowsDropTarget : public IDropTarget
|
|||
{
|
||||
public:
|
||||
MSWindowsDropTarget();
|
||||
~MSWindowsDropTarget();
|
||||
~MSWindowsDropTarget() = default;
|
||||
|
||||
// IUnknown implementation
|
||||
HRESULT __stdcall QueryInterface(REFIID iid, void **object);
|
||||
|
|
|
|||
|
|
@ -39,11 +39,6 @@ MSWindowsEventQueueBuffer::MSWindowsEventQueueBuffer(IEventQueue *events) : m_ev
|
|||
PeekMessage(&dummy, nullptr, WM_USER, WM_USER, PM_NOREMOVE);
|
||||
}
|
||||
|
||||
MSWindowsEventQueueBuffer::~MSWindowsEventQueueBuffer()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void MSWindowsEventQueueBuffer::waitForEvent(double timeout)
|
||||
{
|
||||
// check if messages are available first. if we don't do this then
|
||||
|
|
|
|||
|
|
@ -19,18 +19,18 @@ class MSWindowsEventQueueBuffer : public IEventQueueBuffer
|
|||
{
|
||||
public:
|
||||
MSWindowsEventQueueBuffer(IEventQueue *events);
|
||||
virtual ~MSWindowsEventQueueBuffer();
|
||||
~MSWindowsEventQueueBuffer() override = default;
|
||||
|
||||
// IEventQueueBuffer overrides
|
||||
virtual void init()
|
||||
void init() override
|
||||
{
|
||||
}
|
||||
virtual void waitForEvent(double timeout);
|
||||
virtual Type getEvent(Event &event, uint32_t &dataID);
|
||||
virtual bool addEvent(uint32_t dataID);
|
||||
virtual bool isEmpty() const;
|
||||
virtual EventQueueTimer *newTimer(double duration, bool oneShot) const;
|
||||
virtual void deleteTimer(EventQueueTimer *) const;
|
||||
void waitForEvent(double timeout) override;
|
||||
Type getEvent(Event &event, uint32_t &dataID) override;
|
||||
bool addEvent(uint32_t dataID) override;
|
||||
bool isEmpty() const override;
|
||||
EventQueueTimer *newTimer(double duration, bool oneShot) const override;
|
||||
void deleteTimer(EventQueueTimer *) const override;
|
||||
|
||||
private:
|
||||
DWORD m_thread;
|
||||
|
|
|
|||
|
|
@ -34,10 +34,6 @@ static DWORD g_hookThread = 0;
|
|||
static bool g_fakeServerInput = false;
|
||||
static BOOL g_isPrimary = TRUE;
|
||||
|
||||
MSWindowsHook::MSWindowsHook()
|
||||
{
|
||||
}
|
||||
|
||||
MSWindowsHook::~MSWindowsHook()
|
||||
{
|
||||
cleanup();
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ enum EHookMode
|
|||
class MSWindowsHook
|
||||
{
|
||||
public:
|
||||
MSWindowsHook();
|
||||
virtual ~MSWindowsHook();
|
||||
MSWindowsHook() = default;
|
||||
~MSWindowsHook();
|
||||
|
||||
void loadLibrary();
|
||||
|
||||
|
|
|
|||
|
|
@ -131,18 +131,18 @@ public:
|
|||
//@}
|
||||
|
||||
// IKeyState overrides
|
||||
virtual void fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std::string &lang);
|
||||
virtual bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang);
|
||||
virtual bool fakeCtrlAltDel();
|
||||
virtual KeyModifierMask pollActiveModifiers() const;
|
||||
virtual int32_t pollActiveGroup() const;
|
||||
virtual void pollPressedKeys(KeyButtonSet &pressedKeys) const;
|
||||
void fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std::string &lang) override;
|
||||
bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang) override;
|
||||
bool fakeCtrlAltDel() override;
|
||||
KeyModifierMask pollActiveModifiers() const override;
|
||||
int32_t pollActiveGroup() const override;
|
||||
void pollPressedKeys(KeyButtonSet &pressedKeys) const override;
|
||||
|
||||
// KeyState overrides
|
||||
virtual void onKey(KeyButton button, bool down, KeyModifierMask newState);
|
||||
virtual void sendKeyEvent(
|
||||
void onKey(KeyButton button, bool down, KeyModifierMask newState) override;
|
||||
void sendKeyEvent(
|
||||
void *target, bool press, bool isAutoRepeat, KeyID key, KeyModifierMask mask, int32_t count, KeyButton button
|
||||
);
|
||||
) override;
|
||||
|
||||
// Unit test accessors
|
||||
KeyButton getLastDown() const
|
||||
|
|
@ -164,9 +164,9 @@ public:
|
|||
|
||||
protected:
|
||||
// KeyState overrides
|
||||
virtual void getKeyMap(deskflow::KeyMap &keyMap);
|
||||
virtual void fakeKey(const Keystroke &keystroke);
|
||||
virtual KeyModifierMask &getActiveModifiersRValue();
|
||||
void getKeyMap(deskflow::KeyMap &keyMap) override;
|
||||
void fakeKey(const Keystroke &keystroke) override;
|
||||
KeyModifierMask &getActiveModifiersRValue() override;
|
||||
|
||||
private:
|
||||
using GroupList = std::vector<HKL>;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public:
|
|||
bool isPrimary, bool noHooks, IEventQueue *events, bool enableLangSync = false,
|
||||
deskflow::ClientScrollDirection scrollDirection = deskflow::ClientScrollDirection::SERVER
|
||||
);
|
||||
virtual ~MSWindowsScreen();
|
||||
~MSWindowsScreen() override;
|
||||
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
|
@ -61,10 +61,10 @@ public:
|
|||
//@}
|
||||
|
||||
// IScreen overrides
|
||||
virtual void *getEventTarget() const;
|
||||
virtual bool getClipboard(ClipboardID id, IClipboard *) const;
|
||||
virtual void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const;
|
||||
virtual void getCursorPos(int32_t &x, int32_t &y) const;
|
||||
void *getEventTarget() const override;
|
||||
bool getClipboard(ClipboardID id, IClipboard *) const override;
|
||||
void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const override;
|
||||
void getCursorPos(int32_t &x, int32_t &y) const override;
|
||||
|
||||
/**
|
||||
* \brief Get the position of the cursor on the current machine
|
||||
|
|
@ -87,54 +87,54 @@ public:
|
|||
virtual void updateDesktopThread();
|
||||
|
||||
// IPrimaryScreen overrides
|
||||
virtual void reconfigure(uint32_t activeSides);
|
||||
virtual void warpCursor(int32_t x, int32_t y);
|
||||
virtual uint32_t registerHotKey(KeyID key, KeyModifierMask mask);
|
||||
virtual void unregisterHotKey(uint32_t id);
|
||||
virtual void fakeInputBegin();
|
||||
virtual void fakeInputEnd();
|
||||
virtual int32_t getJumpZoneSize() const;
|
||||
virtual bool isAnyMouseButtonDown(uint32_t &buttonID) const;
|
||||
virtual void getCursorCenter(int32_t &x, int32_t &y) const;
|
||||
void reconfigure(uint32_t activeSides) override;
|
||||
void warpCursor(int32_t x, int32_t y) override;
|
||||
uint32_t registerHotKey(KeyID key, KeyModifierMask mask) override;
|
||||
void unregisterHotKey(uint32_t id) override;
|
||||
void fakeInputBegin() override;
|
||||
void fakeInputEnd() override;
|
||||
int32_t getJumpZoneSize() const override;
|
||||
bool isAnyMouseButtonDown(uint32_t &buttonID) const override;
|
||||
void getCursorCenter(int32_t &x, int32_t &y) const override;
|
||||
|
||||
// ISecondaryScreen overrides
|
||||
virtual void fakeMouseButton(ButtonID id, bool press);
|
||||
virtual void fakeMouseMove(int32_t x, int32_t y);
|
||||
virtual void fakeMouseRelativeMove(int32_t dx, int32_t dy) const;
|
||||
virtual void fakeMouseWheel(int32_t xDelta, int32_t yDelta) const;
|
||||
void fakeMouseButton(ButtonID id, bool press) override;
|
||||
void fakeMouseMove(int32_t x, int32_t y) override;
|
||||
void fakeMouseRelativeMove(int32_t dx, int32_t dy) const override;
|
||||
void fakeMouseWheel(int32_t xDelta, int32_t yDelta) const override;
|
||||
|
||||
// IKeyState overrides
|
||||
virtual void updateKeys();
|
||||
virtual void fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std::string &lang);
|
||||
virtual bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang);
|
||||
virtual bool fakeKeyUp(KeyButton button);
|
||||
virtual void fakeAllKeysUp();
|
||||
void fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std::string &lang) override;
|
||||
bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang) override;
|
||||
bool fakeKeyUp(KeyButton button) override;
|
||||
void fakeAllKeysUp() override;
|
||||
|
||||
// IPlatformScreen overrides
|
||||
virtual void enable();
|
||||
virtual void disable();
|
||||
virtual void enter();
|
||||
virtual bool canLeave();
|
||||
virtual void leave();
|
||||
virtual bool setClipboard(ClipboardID, const IClipboard *);
|
||||
virtual void checkClipboards();
|
||||
virtual void openScreensaver(bool notify);
|
||||
virtual void closeScreensaver();
|
||||
virtual void screensaver(bool activate);
|
||||
virtual void resetOptions();
|
||||
virtual void setOptions(const OptionsList &options);
|
||||
virtual void setSequenceNumber(uint32_t);
|
||||
virtual bool isPrimary() const;
|
||||
virtual void fakeDraggingFiles(DragFileList fileList);
|
||||
virtual std::string &getDraggingFilename();
|
||||
virtual const std::string &getDropTarget() const;
|
||||
void enable() override;
|
||||
void disable() override;
|
||||
void enter() override;
|
||||
bool canLeave() override;
|
||||
void leave() override;
|
||||
bool setClipboard(ClipboardID, const IClipboard *) override;
|
||||
void checkClipboards() override;
|
||||
void openScreensaver(bool notify) override;
|
||||
void closeScreensaver() override;
|
||||
void screensaver(bool activate) override;
|
||||
void resetOptions() override;
|
||||
void setOptions(const OptionsList &options) override;
|
||||
void setSequenceNumber(uint32_t) override;
|
||||
bool isPrimary() const override;
|
||||
void fakeDraggingFiles(DragFileList fileList) override;
|
||||
std::string &getDraggingFilename() override;
|
||||
const std::string &getDropTarget() const override;
|
||||
std::string getSecureInputApp() const override;
|
||||
|
||||
protected:
|
||||
// IPlatformScreen overrides
|
||||
virtual void handleSystemEvent(const Event &, void *);
|
||||
virtual void updateButtons();
|
||||
virtual IKeyState *getKeyState() const;
|
||||
void handleSystemEvent(const Event &, void *) override;
|
||||
void updateButtons() override;
|
||||
IKeyState *getKeyState() const override;
|
||||
|
||||
// simulate a local key to the system directly
|
||||
void fakeLocalKey(KeyButton button, bool press) const;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class MSWindowsScreenSaver : public IScreenSaver
|
|||
{
|
||||
public:
|
||||
MSWindowsScreenSaver();
|
||||
virtual ~MSWindowsScreenSaver();
|
||||
~MSWindowsScreenSaver() override;
|
||||
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
|
@ -36,11 +36,11 @@ public:
|
|||
//@}
|
||||
|
||||
// IScreenSaver overrides
|
||||
virtual void enable();
|
||||
virtual void disable();
|
||||
virtual void activate();
|
||||
virtual void deactivate();
|
||||
virtual bool isActive() const;
|
||||
void enable() override;
|
||||
void disable() override;
|
||||
void activate() override;
|
||||
void deactivate() override;
|
||||
bool isActive() const override;
|
||||
|
||||
private:
|
||||
class FindScreenSaverInfo
|
||||
|
|
|
|||
|
|
@ -16,10 +16,6 @@ MSWindowsSession::MSWindowsSession() : m_activeSessionId(-1)
|
|||
{
|
||||
}
|
||||
|
||||
MSWindowsSession::~MSWindowsSession()
|
||||
{
|
||||
}
|
||||
|
||||
bool MSWindowsSession::isProcessInSession(const char *name, PHANDLE process = nullptr)
|
||||
{
|
||||
// first we need to take a snapshot of the running processes
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class MSWindowsSession
|
|||
{
|
||||
public:
|
||||
MSWindowsSession();
|
||||
~MSWindowsSession();
|
||||
~MSWindowsSession() = default;
|
||||
|
||||
/*!
|
||||
Returns true if the session ID has changed since updateActiveSession was
|
||||
|
|
|
|||
Loading…
Reference in a new issue