refactor: remove IAppUtil. AppUtil is the base class now
This commit is contained in:
@ -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,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "deskflow/DeskflowException.h"
|
||||
#include "deskflow/IAppUtil.h"
|
||||
#include "deskflow/IApp.h"
|
||||
|
||||
class AppUtil : public IAppUtil
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class AppUtil
|
||||
{
|
||||
public:
|
||||
AppUtil();
|
||||
~AppUtil() override = default;
|
||||
virtual ~AppUtil() = default;
|
||||
|
||||
void adoptApp(IApp *app) override;
|
||||
IApp &app() const override;
|
||||
void adoptApp(IApp *app);
|
||||
IApp &app() const;
|
||||
virtual void exitApp(int code)
|
||||
{
|
||||
throw ExitAppException(code);
|
||||
@ -29,6 +33,12 @@ public:
|
||||
instance().exitApp(code);
|
||||
}
|
||||
|
||||
// Virtual Methods subclasses can impliment
|
||||
virtual int run(int argc, char **argv) = 0;
|
||||
virtual void startNode() = 0;
|
||||
virtual std::vector<std::string> getKeyboardLayoutList() = 0;
|
||||
virtual std::string getCurrentLanguageCode() = 0;
|
||||
|
||||
private:
|
||||
IApp *m_app = nullptr;
|
||||
static AppUtil *s_instance;
|
||||
|
||||
@ -89,7 +89,6 @@ add_library(${lib_name} STATIC ${PLATFORM_CODE}
|
||||
DeskflowException.h
|
||||
DisplayInvalidException.h
|
||||
IApp.h
|
||||
IAppUtil.h
|
||||
IClient.h
|
||||
IClipboard.cpp
|
||||
IClipboard.h
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "deskflow/IApp.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
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;
|
||||
virtual void startNode() = 0;
|
||||
virtual std::vector<std::string> getKeyboardLayoutList() = 0;
|
||||
virtual std::string getCurrentLanguageCode() = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user