summaryrefslogtreecommitdiffhomepage
path: root/logic/extensions.hpp
blob: 8cb4a989ffcae1e76ba27365e7c8699295bde8e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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;
};