refactor: remove IInterface class, that only adds a virtual construcor

This commit is contained in:
sithlord48
2025-08-17 12:28:39 -04:00
committed by Nick Bolton
parent 6c6e5fc4d2
commit 4eec183598
30 changed files with 106 additions and 77 deletions

View File

@ -9,7 +9,6 @@
#pragma once
#include "common/Common.h"
#include "common/IInterface.h"
#include <stdarg.h>
@ -18,13 +17,13 @@
This interface defines the string operations required by
deskflow. Each architecture must implement this interface.
*/
class ArchString : public IInterface
class ArchString
{
public:
ArchString() = default;
ArchString(const ArchString &) = delete;
ArchString(ArchString &&) = delete;
~ArchString() override = default;
virtual ~ArchString() = default;
ArchString &operator=(const ArchString &) = delete;
ArchString &operator=(ArchString &&) = delete;

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -7,7 +8,7 @@
#pragma once
#include "common/IInterface.h"
#include "common/Common.h"
#include <functional>
#include <string>
@ -18,11 +19,12 @@ This interface defines the operations required by deskflow for installing
uninstalling daeamons and daemonizing a process. Each architecture must
implement this interface.
*/
class IArchDaemon : public IInterface
class IArchDaemon
{
public:
using DaemonFunc = std::function<int(int, const char **)>;
virtual ~IArchDaemon() = default;
//! @name manipulators
//@{

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -8,16 +9,17 @@
#pragma once
#include "base/LogLevel.h"
#include "common/IInterface.h"
#include "common/Common.h"
//! Interface for architecture dependent logging
/*!
This interface defines the logging operations required by
deskflow. Each architecture must implement this interface.
*/
class IArchLog : public IInterface
class IArchLog
{
public:
virtual ~IArchLog() = default;
//! @name manipulators
//@{

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -7,7 +8,7 @@
#pragma once
#include "common/IInterface.h"
#include "common/Common.h"
/*!
\class ArchCondImpl
@ -57,13 +58,15 @@ using ArchThread = ArchThreadImpl *;
This interface defines the multithreading operations required by
deskflow. Each architecture must implement this interface.
*/
class IArchMultithread : public IInterface
class IArchMultithread
{
public:
//! Type of thread entry point
using ThreadFunc = void *(*)(void *);
//! Type of thread identifier
using ThreadID = unsigned int;
virtual ~IArchMultithread() = default;
//! Types of signals
/*!
Not all platforms support all signals. Unsupported signals are

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -7,7 +8,7 @@
#pragma once
#include "common/IInterface.h"
#include "common/Common.h"
#include <string>
#include <vector>
@ -49,9 +50,10 @@ using ArchNetAddress = ArchNetAddressImpl *;
This interface defines the networking operations required by
deskflow. Each architecture must implement this interface.
*/
class IArchNetwork : public IInterface
class IArchNetwork
{
public:
virtual ~IArchNetwork() = default;
//! Supported address families
enum class AddressFamily : uint8_t
{

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2004 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -7,7 +8,7 @@
#pragma once
#include "common/IInterface.h"
#include "common/Common.h"
class Event;
@ -15,9 +16,10 @@ class Event;
/*!
An event job is an interface for executing a event handler.
*/
class IEventJob : public IInterface
class IEventJob
{
public:
virtual ~IEventJob() = default;
//! Run the job
virtual void run(const Event &) = 0;
};

View File

@ -10,7 +10,7 @@
#include "base/Event.h"
#include "base/EventTypes.h"
#include "common/IInterface.h"
#include "common/Common.h"
#include <functional>
#include <string>
@ -28,10 +28,12 @@ on any event becoming available at the head of the queue and can place
new events at the end of the queue. Clients can also add and remove
timers which generate events periodically.
*/
class IEventQueue : public IInterface
class IEventQueue
{
public:
using EventHandler = std::function<void(const Event &)>;
virtual ~IEventQueue() = default;
class TimerEvent
{
public:

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2004 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -8,7 +9,6 @@
#pragma once
#include "common/Common.h"
#include "common/IInterface.h"
class Event;
class EventQueueTimer;
@ -17,9 +17,10 @@ class EventQueueTimer;
/*!
An event queue buffer provides a queue of events for an IEventQueue.
*/
class IEventQueueBuffer : public IInterface
class IEventQueueBuffer
{
public:
virtual ~IEventQueueBuffer() = default;
enum class Type : uint8_t
{
Unknown, //!< No event is available

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -7,15 +8,16 @@
#pragma once
#include "common/IInterface.h"
#include "common/Common.h"
//! Job interface
/*!
A job is an interface for executing some function.
*/
class IJob : public IInterface
class IJob
{
public:
virtual ~IJob() = default;
//! Run the job
virtual void run() = 0;
};

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -9,7 +10,7 @@
#include "base/Log.h"
#include "base/LogLevel.h"
#include "common/IInterface.h"
#include "common/Common.h"
//! Outputter interface
/*!
@ -17,9 +18,11 @@ Type of outputter interface. The logger performs all output through
outputters. ILogOutputter overrides must not call any log functions
directly or indirectly.
*/
class ILogOutputter : public IInterface
class ILogOutputter
{
public:
virtual ~ILogOutputter() = default;
//! @name manipulators
//@{

View File

@ -5,7 +5,6 @@ configure_file(Constants.h.in Constants.h @ONLY)
add_library(common STATIC
Common.h
IInterface.h
Settings.h
Settings.cpp
QSettingsProxy.cpp

View File

@ -1,22 +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
*/
#pragma once
#include "Common.h"
//! Base class of interfaces
/*!
This is the base class of all interface classes. An interface class has
only pure virtual methods.
*/
class IInterface
{
public:
//! Interface destructor does nothing
virtual ~IInterface() = default;
};

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2012 Nick Bolton
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -7,7 +8,7 @@
#pragma once
#include "common/IInterface.h"
#include "common/Common.h"
using StartupFunc = int (*)(int, char **);
@ -18,9 +19,10 @@ class Screen;
class IEventQueue;
class IApp : public IInterface
class IApp
{
public:
virtual ~IApp() = default;
virtual void setByeFunc(void (*bye)(int)) = 0;
virtual deskflow::ArgsBase &argsBase() const = 0;
virtual int standardStartup(int argc, char **argv) = 0;

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -7,15 +8,16 @@
#pragma once
#include "common/IInterface.h"
#include "common/Common.h"
#include "deskflow/IApp.h"
#include <string>
#include <vector>
class IAppUtil : public IInterface
class IAppUtil
{
public:
virtual ~IAppUtil() = default;
virtual void adoptApp(IApp *app) = 0;
virtual IApp &app() const = 0;
virtual int run(int argc, char **argv) = 0;

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -8,7 +9,7 @@
#pragma once
#include "base/EventTypes.h"
#include "common/IInterface.h"
#include "common/Common.h"
#include <string>
@ -16,9 +17,10 @@
/*!
This interface defines the methods common to all clipboards.
*/
class IClipboard : public IInterface
class IClipboard
{
public:
virtual ~IClipboard() = default;
//! Timestamp type
/*!
Timestamp type. Timestamps are in milliseconds from some

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2003 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -10,7 +11,7 @@
#include "base/Event.h"
#include "base/EventTypes.h"
#include "base/IEventQueue.h"
#include "common/IInterface.h"
#include "common/Common.h"
#include "deskflow/KeyTypes.h"
#include <set>
@ -20,10 +21,11 @@
This interface provides access to set and query the keyboard state and
to synthesize key events.
*/
class IKeyState : public IInterface
class IKeyState
{
public:
explicit IKeyState(const IEventQueue *events);
virtual ~IKeyState() = default;
inline static const auto s_numButtons = 0x200;
//! Key event data

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -7,8 +8,10 @@
#pragma once
#include "common/IInterface.h"
#include "common/Common.h"
class INode : public IInterface
class INode
{
public:
virtual ~INode() = default;
};

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2003 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -9,7 +10,7 @@
#include "base/Event.h"
#include "base/EventTypes.h"
#include "common/IInterface.h"
#include "common/Common.h"
#include "deskflow/KeyTypes.h"
#include "deskflow/MouseTypes.h"
@ -18,9 +19,10 @@
This interface defines the methods common to all platform dependent
primary screen implementations.
*/
class IPrimaryScreen : public IInterface
class IPrimaryScreen
{
public:
virtual ~IPrimaryScreen() = default;
//! Button event data
class ButtonInfo
{

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2003 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -9,7 +10,7 @@
#include "base/Event.h"
#include "base/EventTypes.h"
#include "common/IInterface.h"
#include "common/Common.h"
#include "deskflow/ClipboardTypes.h"
class IClipboard;
@ -18,9 +19,10 @@ class IClipboard;
/*!
This interface defines the methods common to all screens.
*/
class IScreen : public IInterface
class IScreen
{
public:
virtual ~IScreen() = default;
struct ClipboardInfo
{
public:

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -8,15 +9,16 @@
#pragma once
#include "base/Event.h"
#include "common/IInterface.h"
#include "common/Common.h"
//! Screen saver interface
/*!
This interface defines the methods common to all screen savers.
*/
class IScreenSaver : public IInterface
class IScreenSaver
{
public:
virtual ~IScreenSaver() = default;
// note -- the c'tor/d'tor must *not* enable/disable the screen saver
//! @name manipulators

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2003 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -9,7 +10,7 @@
#include "base/Event.h"
#include "base/EventTypes.h"
#include "common/IInterface.h"
#include "common/Common.h"
#include "deskflow/MouseTypes.h"
//! Secondary screen interface
@ -17,9 +18,10 @@
This interface defines the methods common to all platform dependent
secondary screen implementations.
*/
class ISecondaryScreen : public IInterface
class ISecondaryScreen
{
public:
virtual ~ISecondaryScreen() = default;
//! @name accessors
//@{

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2004 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -10,7 +11,7 @@
#include "base/Event.h"
#include "base/EventTypes.h"
#include "base/IEventQueue.h"
#include "common/IInterface.h"
#include "common/Common.h"
class IEventQueue;
@ -20,11 +21,11 @@ namespace deskflow {
/*!
Defines the interface for all streams.
*/
class IStream : public IInterface
class IStream
{
public:
IStream() = default;
virtual ~IStream() = default;
//! @name manipulators
//@{

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -9,7 +10,7 @@
#include "base/Event.h"
#include "base/EventTypes.h"
#include "common/IInterface.h"
#include "common/Common.h"
class NetworkAddress;
@ -18,9 +19,10 @@ class NetworkAddress;
This interface defines the methods common to all network sockets.
Generated events use \c this as the target.
*/
class ISocket : public IInterface
class ISocket
{
public:
virtual ~ISocket() = default;
//! @name manipulators
//@{

View File

@ -9,7 +9,7 @@
#pragma once
#include "arch/IArchNetwork.h"
#include "common/IInterface.h"
#include "common/Common.h"
#include "net/SecurityLevel.h"
class IDataSocket;
@ -20,9 +20,10 @@ class IListenSocket;
This interface defines the methods common to all factories used to
create sockets.
*/
class ISocketFactory : public IInterface
class ISocketFactory
{
public:
virtual ~ISocketFactory() = default;
//! @name accessors
//@{

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -8,15 +9,16 @@
#pragma once
#include "arch/IArchNetwork.h"
#include "common/IInterface.h"
#include "common/Common.h"
//! Socket multiplexer job
/*!
A socket multiplexer job handles events on a socket.
*/
class ISocketMultiplexerJob : public IInterface
class ISocketMultiplexerJob
{
public:
virtual ~ISocketMultiplexerJob() = default;
//! @name manipulators
//@{

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -7,14 +8,14 @@
#pragma once
#include "common/IInterface.h"
#include "common/Common.h"
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
class IMSWindowsClipboardConverter;
class IMSWindowsClipboardFacade : public IInterface
class IMSWindowsClipboardFacade
{
public:
virtual void write(HANDLE win32Data, UINT win32Format) = 0;

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2016 Symless Ltd.
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
*/
@ -8,9 +9,10 @@
#include "deskflow/KeyState.h"
class IOSXKeyResource : public IInterface
class IOSXKeyResource
{
public:
virtual ~IOSXKeyResource() = default;
virtual bool isValid() const = 0;
virtual uint32_t getNumModifierCombinations() const = 0;
virtual uint32_t getNumTables() const = 0;

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -80,9 +81,10 @@ private:
This interface defines the methods common to all win32 clipboard format
converters.
*/
class IMSWindowsClipboardConverter : public IInterface
class IMSWindowsClipboardConverter
{
public:
virtual ~IMSWindowsClipboardConverter() = default;
// accessors
// return the clipboard format this object converts from/to

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2004 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -50,9 +51,10 @@ private:
/*!
This interface defines the methods common to all Scrap book format
*/
class IOSXClipboardConverter : public IInterface
class IOSXClipboardConverter
{
public:
virtual ~IOSXClipboardConverter() = default;
//! @name accessors
//@{

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -326,9 +327,10 @@ private:
This interface defines the methods common to all X11 clipboard format
converters.
*/
class IXWindowsClipboardConverter : public IInterface
class IXWindowsClipboardConverter
{
public:
virtual ~IXWindowsClipboardConverter() = default;
//! @name accessors
//@{