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/runtime-libraries.cpp | |
parent | b09f2c2d699dff8c61eb0a83143c5930c005703f (diff) |
logic: split extension handling to own file
Diffstat (limited to 'logic/runtime-libraries.cpp')
-rw-r--r-- | logic/runtime-libraries.cpp | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/logic/runtime-libraries.cpp b/logic/runtime-libraries.cpp index fbe30fef..eb5f02cc 100644 --- a/logic/runtime-libraries.cpp +++ b/logic/runtime-libraries.cpp @@ -1,25 +1,7 @@ -#include "selected-libraries.hpp" +#include "runtime-libraries.hpp" #include "options/scoped.hpp" #include <QDebug> -using ext_ord = IExtension::event_ordinal; -using ext_mask = IExtension::event_mask; -using ext_fun_type = void(IExtension::*)(Pose&); - -static constexpr struct event_type_mapping -{ - ext_fun_type ptr; - ext_mask m; - ext_ord idx; -} ordinal_to_function[] = { - { &IExtension::process_raw, ext_mask::on_raw, ext_ord::ev_raw, }, - { &IExtension::process_after_center, ext_mask::on_after_center, ext_ord::ev_after_center, }, - { &IExtension::process_before_filter, ext_mask::on_before_filter, ext_ord::ev_before_filter, }, - { &IExtension::process_before_transform, ext_mask::on_before_transform, ext_ord::ev_before_transform, }, - { &IExtension::process_before_mapping, ext_mask::on_before_mapping, ext_ord::ev_before_mapping, }, - { &IExtension::process_finished, ext_mask::on_finished, ext_ord::ev_finished, }, -}; - runtime_libraries::runtime_libraries(QFrame* frame, dylibptr t, dylibptr p, dylibptr f) : pTracker(nullptr), pFilter(nullptr), @@ -63,14 +45,3 @@ end: opts::set_teardown_flag(prev_teardown_flag); } -void runtime_event_handler::run_events(ext_event_ordinal k, Pose& pose) -{ - auto fun = std::mem_fn(ordinal_to_function[k].ptr); - - for (ext& x : extension_events[k]) - { - if (x == nullptr) - break; - fun(x, pose); - } -} |