summaryrefslogtreecommitdiffhomepage
path: root/main-window
diff options
context:
space:
mode:
Diffstat (limited to 'main-window')
-rw-r--r--main-window/CMakeLists.txt6
-rw-r--r--main-window/export.hpp11
-rw-r--r--main-window/lang/nl_NL.ts4
-rw-r--r--main-window/lang/ru_RU.ts4
-rw-r--r--main-window/lang/stub.ts4
-rw-r--r--main-window/lang/zh_CN.ts4
-rw-r--r--main-window/mixin-traits.cpp62
-rw-r--r--main-window/mixin-traits.hpp42
-rw-r--r--main-window/mixins.hpp13
-rw-r--r--main-window/module-mixin.cpp126
-rw-r--r--main-window/module-mixin.hpp52
11 files changed, 0 insertions, 328 deletions
diff --git a/main-window/CMakeLists.txt b/main-window/CMakeLists.txt
deleted file mode 100644
index c9228536..00000000
--- a/main-window/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-if(opentrack_maintainer-mode)
- otr_module(main-window BIN NO-INSTALL)
- foreach(k user-interface logic pose-widget migration spline)
- target_link_libraries(${self} opentrack-${k})
- endforeach()
-endif()
diff --git a/main-window/export.hpp b/main-window/export.hpp
deleted file mode 100644
index 184cf035..00000000
--- a/main-window/export.hpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// generates export.hpp for each module from compat/linkage.hpp
-
-#pragma once
-
-#include "compat/linkage-macros.hpp"
-
-#ifdef BUILD_MAIN_WINDOW
-# define OTR_MAIN_EXPORT OTR_GENERIC_EXPORT
-#else
-# define OTR_MAIN_EXPORT OTR_GENERIC_IMPORT
-#endif
diff --git a/main-window/lang/nl_NL.ts b/main-window/lang/nl_NL.ts
deleted file mode 100644
index 6401616d..00000000
--- a/main-window/lang/nl_NL.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.1">
-</TS>
diff --git a/main-window/lang/ru_RU.ts b/main-window/lang/ru_RU.ts
deleted file mode 100644
index 6401616d..00000000
--- a/main-window/lang/ru_RU.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.1">
-</TS>
diff --git a/main-window/lang/stub.ts b/main-window/lang/stub.ts
deleted file mode 100644
index 6401616d..00000000
--- a/main-window/lang/stub.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.1">
-</TS>
diff --git a/main-window/lang/zh_CN.ts b/main-window/lang/zh_CN.ts
deleted file mode 100644
index 6401616d..00000000
--- a/main-window/lang/zh_CN.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.1">
-</TS>
diff --git a/main-window/mixin-traits.cpp b/main-window/mixin-traits.cpp
deleted file mode 100644
index b74a6f7a..00000000
--- a/main-window/mixin-traits.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#define MIXIN_TRAIT_TESTS
-
-#ifdef MIXIN_TRAIT_TESTS
-# include "mixin-traits.hpp"
-
-// the `impl' class provides a cast template through the CRTP pattern.
-// mixins don't do direct inheritance on themselves,
-// that's what mixin_traits::depends is for.
-
-namespace mixins::traits_detail {
-
-struct A {};
-struct B {};
-struct C {};
-struct D {};
-
-template<> struct mixin_traits<A>
-{
- using depends = tuple<>;
-};
-
-template<> struct mixin_traits<B>
-{
- using depends = tuple<A>;
-};
-
-template<> struct mixin_traits<C>
-{
- using depends = tuple<A>;
-};
-
-template<> struct mixin_traits<D>
-{
- using depends = tuple<C>;
-};
-
-extern void test1();
-
-void test1()
-{
- struct U : B, A {};
- struct V : D {};
- struct W : C, A {};
- struct Q : virtual W, virtual D {};
-
-//#define SHOULD_NOT_COMPILE
-#ifdef SHOULD_NOT_COMPILE
- (void)impl<Q, W>{}; // W not a mixin
- (void)impl<V, A>{}; // A
- (void)impl<V, D>{}; // D => C => A
- (void)impl<V, D>{}; // D => C => A
- (void)impl<W, C, B>{}; // B
-#else
- (void)impl<U, B>{};
- (void)impl<W, C>{};
- (void)impl<Q, D, A>{};
-#endif
-}
-
-} // ns mixins::traits_detail
-
-#endif
diff --git a/main-window/mixin-traits.hpp b/main-window/mixin-traits.hpp
deleted file mode 100644
index 45df7fdb..00000000
--- a/main-window/mixin-traits.hpp
+++ /dev/null
@@ -1,42 +0,0 @@
-#pragma once
-
-#include "compat/meta.hpp"
-
-#include <type_traits>
-
-namespace mixins::traits_detail {
-
- using namespace meta;
-
- template<typename... xs> using tuple = tuple_<xs...>;
-
- template<typename t>
- struct mixin_traits {
- // implement this!
- //using depends = tuple<>;
- };
-
- template<typename klass, typename...> struct check_depends_;
-
- template<typename klass>
- struct check_depends_<klass> : std::true_type
- {
- };
-
- template<typename klass, typename x, typename... xs>
- struct check_depends_<klass, x, xs...> :
- std::bool_constant<
- std::is_base_of_v<x, klass> &&
- lift_v<check_depends_, cons<klass, typename mixin_traits<x>::depends>> &&
- check_depends_<klass, xs...>::value
- >
- {
- };
-
- template<typename klass, typename... xs>
- struct impl
- {
- static_assert(lift<check_depends_, tuple<klass, xs...>>::value,
- "class must inherit dependent mixins");
- };
-} // ns mixins::traits_detail
diff --git a/main-window/mixins.hpp b/main-window/mixins.hpp
deleted file mode 100644
index b85e6498..00000000
--- a/main-window/mixins.hpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#pragma once
-
-#include "export.hpp"
-
-// XXX TODO add is_base_of and void_t stuff
-
-#define OTR_MIXIN_NS(name) \
- mixins :: detail :: name
-
-#define OTR_DECLARE_MIXIN(name) \
- namespace mixins { \
- using name = :: OTR_MIXIN_NS(name) :: name; \
- }
diff --git a/main-window/module-mixin.cpp b/main-window/module-mixin.cpp
deleted file mode 100644
index 5c4c3234..00000000
--- a/main-window/module-mixin.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-#include "module-mixin.hpp"
-
-#include <algorithm>
-
-namespace OTR_MIXIN_NS(module_mixin) {
-
-std::tuple<dylib_ptr, int>
-module_mixin::module_by_name(const QString& name, const dylib_list& list) const
-{
- auto it = std::find_if(list.cbegin(), list.cend(), [&name](const dylib_ptr& lib) {
- if (!lib)
- return name.isEmpty();
- else
- return name == lib->module_name;
- });
-
- if (it == list.cend())
- return { nullptr, -1 };
- else
- return { *it, int(std::distance(list.cbegin(), it)) };
-}
-
-//static
-void show_window(QWidget& d, bool fresh)
-{
- if (fresh)
- {
- d.setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | d.windowFlags());
- d.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
-
- d.show();
- d.adjustSize();
- d.raise();
- }
- else
- {
- d.show();
- d.raise();
- }
-}
-
-template<typename t, typename F>
-static bool mk_window_common(std::unique_ptr<t>& d, F&& fun)
-{
- bool fresh = false;
-
- if (!d)
- d = fun(), fresh = !!d;
-
- if (d)
- show_window(*d, fresh);
-
- return fresh;
-}
-
-template<typename t>
-static bool mk_dialog(std::unique_ptr<t>& place, const std::shared_ptr<dylib>& lib)
-{
- using u = std::unique_ptr<t>;
-
- return mk_window_common(place, [&] {
- if (lib && lib->Dialog)
- return u{ (t*)lib->Dialog() };
- else
- return u{};
- });
-}
-
-dylib_ptr module_mixin::current_tracker()
-{
- auto [ptr, idx] = module_by_name(s.tracker_dll, modules.trackers());
- return ptr;
-}
-
-dylib_ptr module_mixin::current_protocol()
-{
- auto [ptr, idx] = module_by_name(s.protocol_dll, modules.protocols());
- return ptr;
-}
-
-dylib_ptr module_mixin::current_filter()
-{
- auto [ptr, idx] = module_by_name(s.filter_dll, modules.filters());
- return ptr;
-}
-
-void module_mixin::show_tracker_settings_()
-{
- if (mk_dialog(tracker_dialog, current_tracker()) && state.work && state.work->libs.pTracker)
- tracker_dialog->register_tracker(&*state.work->libs.pTracker);
- if (tracker_dialog)
- QObject::connect(&*tracker_dialog, &ITrackerDialog::closing,
- &fuzz, [this] { tracker_dialog = nullptr; });
-}
-
-void module_mixin::show_proto_settings_()
-{
- if (mk_dialog(proto_dialog, current_protocol()) && state.work && state.work->libs.pProtocol)
- proto_dialog->register_protocol(&*state.work->libs.pProtocol);
- if (proto_dialog)
- QObject::connect(&*proto_dialog, &IProtocolDialog::closing,
- &fuzz, [this] { proto_dialog = nullptr; });
-}
-
-void module_mixin::show_filter_settings_()
-{
- if (mk_dialog(filter_dialog, current_filter()) && state.work && state.work->libs.pFilter)
- filter_dialog->register_filter(&*state.work->libs.pFilter);
- if (filter_dialog)
- QObject::connect(&*filter_dialog, &IFilterDialog::closing,
- &fuzz, [this] { filter_dialog = nullptr; });
-}
-
-// this template function must go to a separate function like "options_mixin".
-template<typename t, typename... Args>
-static bool mk_window(std::unique_ptr<t>& place, Args&&... params)
-{
- return mk_window_common(place, [&] {
- return std::make_unique<t>(params...);
- });
-}
-
-module_mixin::module_mixin() = default;
-module_mixin::~module_mixin() = default;
-
-} // ns
diff --git a/main-window/module-mixin.hpp b/main-window/module-mixin.hpp
deleted file mode 100644
index cde0484c..00000000
--- a/main-window/module-mixin.hpp
+++ /dev/null
@@ -1,52 +0,0 @@
-#pragma once
-
-#include "mixins.hpp"
-#include "compat/library-path.hpp"
-#include "api/plugin-api.hpp"
-#include "logic/extensions.hpp"
-#include "logic/state.hpp"
-#include "logic/main-settings.hpp"
-
-#include <memory>
-#include <utility>
-
-#include <QObject>
-
-namespace OTR_MIXIN_NS(module_mixin) {
-
-using namespace options;
-
-using dylib_ptr = Modules::dylib_ptr;
-using dylib_list = Modules::dylib_list;
-
-struct OTR_MAIN_EXPORT module_mixin
-{
- module_mixin();
- virtual ~module_mixin();
-
- std::unique_ptr<ITrackerDialog> tracker_dialog;
- std::unique_ptr<IProtocolDialog> proto_dialog;
- std::unique_ptr<IFilterDialog> filter_dialog;
-
- std::tuple<dylib_ptr, int> module_by_name(const QString& name, const dylib_list& list) const;
-
- dylib_ptr current_tracker();
- dylib_ptr current_protocol();
- dylib_ptr current_filter();
-
- void show_tracker_settings_();
- void show_proto_settings_();
- void show_filter_settings_();
-
-private:
- Modules modules { OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH };
- event_handler ev { modules.extensions() };
- module_settings s;
- State state { OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH };
-
- QObject fuzz;
-};
-
-}
-
-OTR_DECLARE_MIXIN(module_mixin)