From 8cb6f64820b4bf39c64803db21a58e135465ff4f Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Mon, 13 Apr 2020 21:34:47 +0300 Subject: Move smolbote headers to include/smolbote Headers will be installed to include/smolbote/ --- include/filterinterface.h | 36 ------------------------------- include/meson.build | 6 +++++- include/plugininterface.h | 29 ------------------------- include/session.hpp | 41 ------------------------------------ include/smolbote/filterinterface.hpp | 38 +++++++++++++++++++++++++++++++++ include/smolbote/plugininterface.h | 29 +++++++++++++++++++++++++ include/smolbote/session.hpp | 41 ++++++++++++++++++++++++++++++++++++ include/version.h.in | 8 ------- 8 files changed, 113 insertions(+), 115 deletions(-) delete mode 100644 include/filterinterface.h delete mode 100644 include/plugininterface.h delete mode 100644 include/session.hpp create mode 100644 include/smolbote/filterinterface.hpp create mode 100644 include/smolbote/plugininterface.h create mode 100644 include/smolbote/session.hpp delete mode 100644 include/version.h.in (limited to 'include') diff --git a/include/filterinterface.h b/include/filterinterface.h deleted file mode 100644 index fb04e25..0000000 --- a/include/filterinterface.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of smolbote. It's copyrighted by the contributors recorded - * in the version control history of the file, available from its original - * location: https://library.iserlohn-fortress.net/aqua/smolbote.git - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include -#include - -class Filter -{ -public: - virtual ~Filter() = default; - - virtual void filter(QWebEngineUrlRequestInfo &info) const = 0; - - virtual bool isUpToDate() const = 0; -}; - -// A class to provide filter interfaces -class QIODevice; -class FilterPlugin -{ -public: - virtual ~FilterPlugin() = default; - - virtual Filter* load(QIODevice* from) const = 0; -}; - -#define FilterPluginIid "net.iserlohn-fortress.smolbote.FilterPlugin" -Q_DECLARE_INTERFACE(FilterPlugin, FilterPluginIid) - diff --git a/include/meson.build b/include/meson.build index 70d995a..82ab510 100644 --- a/include/meson.build +++ b/include/meson.build @@ -1,2 +1,6 @@ -plugininterface_include = include_directories('.') +smolbote_interfaces = include_directories('.') + +install_headers('smolbote/plugininterface.h', 'smolbote/filterinterface.hpp', 'smolbote/session.hpp', + subdir: 'smolbote' +) diff --git a/include/plugininterface.h b/include/plugininterface.h deleted file mode 100644 index 4c36d8a..0000000 --- a/include/plugininterface.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of smolbote. It's copyrighted by the contributors recorded - * in the version control history of the file, available from its original - * location: https://library.iserlohn-fortress.net/aqua/smolbote.git - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include -#include -#include -#include -#include - -typedef QHash> CommandHash_t; - -class QDialog; -class PluginInterface -{ -public: - virtual ~PluginInterface() = default; - virtual CommandHash_t commands() = 0; - virtual QDialog *createWidget(QWidget *parent = nullptr) const = 0; -}; - -#define PluginInterfaceIid "net.iserlohn-fortress.smolbote.PluginInterface" -Q_DECLARE_INTERFACE(PluginInterface, PluginInterfaceIid) diff --git a/include/session.hpp b/include/session.hpp deleted file mode 100644 index 0146802..0000000 --- a/include/session.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This file is part of smolbote. It's copyrighted by the contributors recorded - * in the version control history of the file, available from its original - * location: https://library.iserlohn-fortress.net/aqua/smolbote.git - * - * SPDX-License-Identifier: MIT - */ - -#ifndef SMOLBOTE_SESSION_HPP -#define SMOLBOTE_SESSION_HPP - -#include -#include -#include -#include - -class [[nodiscard]] Session -{ -public: - struct WebView { - QString profile; - QString url; - QByteArray history; - }; - - struct SubWindow { - QString profile; - QVector tabs; - }; - - struct MainWindow { - QVector subwindows; - }; - - virtual ~Session() = default; - - [[nodiscard]] virtual QByteArray serialize() const = 0; - [[nodiscard]] virtual QVector get() const = 0; -}; - -#endif // SMOLBOTE_SESSION_HPP diff --git a/include/smolbote/filterinterface.hpp b/include/smolbote/filterinterface.hpp new file mode 100644 index 0000000..9c78c97 --- /dev/null +++ b/include/smolbote/filterinterface.hpp @@ -0,0 +1,38 @@ +/* + * This file is part of smolbote. It's copyrighted by the contributors recorded + * in the version control history of the file, available from its original + * location: https://library.iserlohn-fortress.net/aqua/smolbote.git + * + * SPDX-License-Identifier: MIT + */ + +#ifndef SMOLBOTE_FILTER_HPP +#define SMOLBOTE_FILTER_HPP + +#include +#include + +class Filter +{ +public: + virtual ~Filter() = default; + + virtual void filter(QWebEngineUrlRequestInfo &info) const = 0; + virtual bool isUpToDate() const = 0; +}; + +// A class to provide filter interfaces +class QIODevice; +class FilterPlugin +{ +public: + virtual ~FilterPlugin() = default; + + virtual Filter* load(QIODevice* from) const = 0; +}; + +#define FilterPluginIid "net.iserlohn-fortress.smolbote.FilterPlugin" +Q_DECLARE_INTERFACE(FilterPlugin, FilterPluginIid) + +#endif // SMOLBOTE_FILTER_HPP + diff --git a/include/smolbote/plugininterface.h b/include/smolbote/plugininterface.h new file mode 100644 index 0000000..4c36d8a --- /dev/null +++ b/include/smolbote/plugininterface.h @@ -0,0 +1,29 @@ +/* + * This file is part of smolbote. It's copyrighted by the contributors recorded + * in the version control history of the file, available from its original + * location: https://library.iserlohn-fortress.net/aqua/smolbote.git + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include +#include +#include +#include +#include + +typedef QHash> CommandHash_t; + +class QDialog; +class PluginInterface +{ +public: + virtual ~PluginInterface() = default; + virtual CommandHash_t commands() = 0; + virtual QDialog *createWidget(QWidget *parent = nullptr) const = 0; +}; + +#define PluginInterfaceIid "net.iserlohn-fortress.smolbote.PluginInterface" +Q_DECLARE_INTERFACE(PluginInterface, PluginInterfaceIid) diff --git a/include/smolbote/session.hpp b/include/smolbote/session.hpp new file mode 100644 index 0000000..0146802 --- /dev/null +++ b/include/smolbote/session.hpp @@ -0,0 +1,41 @@ +/* + * This file is part of smolbote. It's copyrighted by the contributors recorded + * in the version control history of the file, available from its original + * location: https://library.iserlohn-fortress.net/aqua/smolbote.git + * + * SPDX-License-Identifier: MIT + */ + +#ifndef SMOLBOTE_SESSION_HPP +#define SMOLBOTE_SESSION_HPP + +#include +#include +#include +#include + +class [[nodiscard]] Session +{ +public: + struct WebView { + QString profile; + QString url; + QByteArray history; + }; + + struct SubWindow { + QString profile; + QVector tabs; + }; + + struct MainWindow { + QVector subwindows; + }; + + virtual ~Session() = default; + + [[nodiscard]] virtual QByteArray serialize() const = 0; + [[nodiscard]] virtual QVector get() const = 0; +}; + +#endif // SMOLBOTE_SESSION_HPP diff --git a/include/version.h.in b/include/version.h.in deleted file mode 100644 index 44f10d9..0000000 --- a/include/version.h.in +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef SMOLBOTE_VERSION_H -#define SMOLBOTE_VERSION_H - -// output of 'git describe --long --abbrev=40': -// x.y.z-0-g0123456789012345678901234567890123456789 -#define poi_Version "@VCS_TAG@" - -#endif // SMOLBOTE_VERSION_H -- cgit v1.2.1