diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-02 06:28:18 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-02 06:28:18 +0200 |
commit | 04ff6af035a2e1064cce2b3189c13f7a45fdca4a (patch) | |
tree | 7f1b33342159de089436259ad79e94306ecf2422 /logic/extensions.hpp | |
parent | b09f2c2d699dff8c61eb0a83143c5930c005703f (diff) |
logic: split extension handling to own file
Diffstat (limited to 'logic/extensions.hpp')
-rw-r--r-- | logic/extensions.hpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/logic/extensions.hpp b/logic/extensions.hpp new file mode 100644 index 00000000..8cb4a989 --- /dev/null +++ b/logic/extensions.hpp @@ -0,0 +1,36 @@ +#pragma once + +#include "api/plugin-support.hpp" +#include "options/options.hpp" + +#include <vector> +#include <array> + +struct event_handler final +{ + using event_ordinal = IExtension::event_ordinal; + + struct extension + { + using ext = std::shared_ptr<IExtension>; + using dlg = std::shared_ptr<IExtensionDialog>; + using m = std::shared_ptr<Metadata>; + + ext logic; + dlg dialog; + m metadata; + }; + + void run_events(event_ordinal k, Pose& pose); + event_handler(Modules::dylib_list const& extensions); + +private: + using ext_list = std::vector<extension>; + std::array<ext_list, IExtension::event_count> extension_events; +}; + +struct ext_settings final +{ + static bool is_enabled(const QString& name); + ext_settings() = delete; +}; |