diff options
Diffstat (limited to 'api/plugin-api.hpp')
-rw-r--r-- | api/plugin-api.hpp | 58 |
1 files changed, 10 insertions, 48 deletions
diff --git a/api/plugin-api.hpp b/api/plugin-api.hpp index 263ee475..2d77bdf4 100644 --- a/api/plugin-api.hpp +++ b/api/plugin-api.hpp @@ -42,6 +42,10 @@ protected: BaseDialog(); public: void closeEvent(QCloseEvent *) override; + virtual bool embeddable() noexcept; + virtual void set_buttons_visible(bool x); // XXX TODO remove it once all modules are converted + virtual void save(); // XXX HACK should be pure virtual + virtual void reload(); // XXX HACK should be pure virtual -sh 20211214 signals: void closing(); private slots: @@ -55,15 +59,18 @@ private slots: #define OPENTRACK_DECLARE_PLUGIN_INTERNAL(ctor_class, ctor_ret_class, metadata_class, dialog_class, dialog_ret_class) \ extern "C" \ { \ - OTR_PLUGIN_EXPORT ctor_ret_class* GetConstructor(void) \ + OTR_PLUGIN_EXPORT ctor_ret_class* GetConstructor(void); \ + ctor_ret_class* GetConstructor(void) \ { \ return new ctor_class; \ } \ - OTR_PLUGIN_EXPORT Metadata_* GetMetadata(void) \ + OTR_PLUGIN_EXPORT Metadata_* GetMetadata(void); \ + Metadata_* GetMetadata(void) \ { \ return new metadata_class; \ } \ - OTR_PLUGIN_EXPORT dialog_ret_class* GetDialog(void) \ + OTR_PLUGIN_EXPORT dialog_ret_class* GetDialog(void); \ + dialog_ret_class* GetDialog(void) \ { \ return new dialog_class; \ } \ @@ -221,48 +228,3 @@ struct OTR_API_EXPORT ITrackerDialog : public plugin_api::detail::BaseDialog #define OPENTRACK_DECLARE_TRACKER(tracker_class, dialog_class, metadata_class) \ OPENTRACK_DECLARE_PLUGIN_INTERNAL(tracker_class, ITracker, metadata_class, dialog_class, ITrackerDialog) -struct OTR_API_EXPORT IExtension : module_status_mixin -{ - enum event_mask : unsigned - { - none = 0u, - on_raw = 1 << 0, - on_before_filter = 1 << 1, - on_before_mapping = 1 << 2, - on_finished = 1 << 3, - }; - - enum event_ordinal : unsigned - { - ev_raw = 0, - ev_before_filter = 1, - ev_before_mapping = 2, - ev_finished = 3, - - event_count = 4, - }; - - IExtension() = default; - ~IExtension() override; - - virtual event_mask hook_types() = 0; - - virtual void process_raw(Pose&) {} - virtual void process_before_filter(Pose&) {} - virtual void process_before_mapping(Pose&) {} - virtual void process_finished(Pose&) {} - - IExtension(const IExtension&) = delete; - IExtension& operator=(const IExtension&) = delete; -}; - -struct OTR_API_EXPORT IExtensionDialog : public plugin_api::detail::BaseDialog -{ - ~IExtensionDialog() override; - - virtual void register_extension(IExtension& ext) = 0; - virtual void unregister_extension() = 0; -}; - -#define OPENTRACK_DECLARE_EXTENSION(ext_class, dialog_class, metadata_class) \ - OPENTRACK_DECLARE_PLUGIN_INTERNAL(ext_class, IExtension, metadata_class, dialog_class, IExtensionDialog) |