diff options
Diffstat (limited to 'opentrack')
-rw-r--r-- | opentrack/plugin-support.cpp | 14 | ||||
-rw-r--r-- | opentrack/plugin-support.h | 14 | ||||
-rw-r--r-- | opentrack/shortcuts.h | 6 | ||||
-rw-r--r-- | opentrack/state.hpp | 20 | ||||
-rw-r--r-- | opentrack/work.hpp | 4 |
5 files changed, 29 insertions, 29 deletions
diff --git a/opentrack/plugin-support.cpp b/opentrack/plugin-support.cpp index d058c755..c572ada6 100644 --- a/opentrack/plugin-support.cpp +++ b/opentrack/plugin-support.cpp @@ -16,14 +16,14 @@ SelectedLibraries::~SelectedLibraries() } template<typename t> -static ptr<t> make_instance(ptr<dylib> lib) +static mem<t> make_instance(mem<dylib> lib) { - ptr<t> ret; + mem<t> ret; if (lib != nullptr && lib->Constructor) { qDebug() << "dylib" << (lib ? lib->filename : "<null>") << "ptr" << (intptr_t) lib->Constructor; std::cout.flush(); - ret = ptr<t>(reinterpret_cast<t*>(reinterpret_cast<CTOR_FUNPTR>(lib->Constructor)())); + ret = mem<t>(reinterpret_cast<t*>(reinterpret_cast<CTOR_FUNPTR>(lib->Constructor)())); } return ret; } @@ -74,7 +74,7 @@ SelectedLibraries::SelectedLibraries(QFrame* frame, dylibptr t, dylibptr p, dyli # define LIB_PREFIX "lib" #endif -static bool get_metadata(ptr<dylib> lib, QString& name, QIcon& icon) +static bool get_metadata(mem<dylib> lib, QString& name, QIcon& icon) { Metadata* meta; if (!lib->Meta || ((meta = lib->Meta()), !meta)) @@ -85,7 +85,7 @@ static bool get_metadata(ptr<dylib> lib, QString& name, QIcon& icon) return true; } -QList<ptr<dylib>> dylib::enum_libraries() +QList<mem<dylib>> dylib::enum_libraries() { #define BASE "opentrack-" #define SUFF "-*." @@ -96,7 +96,7 @@ QList<ptr<dylib>> dylib::enum_libraries() QDir settingsDir( QCoreApplication::applicationDirPath() ); - QList<ptr<dylib>> ret; + QList<mem<dylib>> ret; for (int i = 0; i < 3; i++) { @@ -207,7 +207,7 @@ dylib::dylib(const QString& filename, Type t) : } #endif - auto m = ptr<Metadata>(Meta()); + auto m = mem<Metadata>(Meta()); icon = m->icon(); name = m->name(); diff --git a/opentrack/plugin-support.h b/opentrack/plugin-support.h index 2c66f1d5..ad3f2af8 100644 --- a/opentrack/plugin-support.h +++ b/opentrack/plugin-support.h @@ -10,7 +10,7 @@ #include <QList> #include <memory> -template<typename t> using ptr = std::shared_ptr<t>; +template<typename t> using mem = std::shared_ptr<t>; extern "C" typedef void* (*CTOR_FUNPTR)(void); extern "C" typedef Metadata* (*METADATA_FUNPTR)(void); @@ -20,7 +20,7 @@ struct dylib { dylib(const QString& filename, Type t); ~dylib(); - static QList<ptr<dylib>> enum_libraries(); + static QList<mem<dylib>> enum_libraries(); Type type; QString filename; @@ -40,12 +40,12 @@ private: }; struct SelectedLibraries { - using dylibptr = ptr<dylib>; - ptr<ITracker> pTracker; - ptr<IFilter> pFilter; - ptr<IProtocol> pProtocol; + using dylibptr = mem<dylib>; + mem<ITracker> pTracker; + mem<IFilter> pFilter; + mem<IProtocol> pProtocol; SelectedLibraries(QFrame* frame, dylibptr t, dylibptr p, dylibptr f); SelectedLibraries() : pTracker(nullptr), pFilter(nullptr), pProtocol(nullptr), correct(false) {} ~SelectedLibraries(); bool correct; -};
\ No newline at end of file +}; diff --git a/opentrack/shortcuts.h b/opentrack/shortcuts.h index 523bc7b2..a588b482 100644 --- a/opentrack/shortcuts.h +++ b/opentrack/shortcuts.h @@ -79,7 +79,7 @@ signals: struct Shortcuts { using K = #ifndef _WIN32 - ptr<QxtGlobalShortcut> + mem<QxtGlobalShortcut> #else Key #endif @@ -90,7 +90,7 @@ struct Shortcuts { WId handle; #ifdef _WIN32 - ptr<KeybindingWorker> keybindingWorker; + mem<KeybindingWorker> keybindingWorker; #endif struct settings { @@ -120,7 +120,7 @@ public: private: Ui::UICKeyboardShortcutDialog ui; Shortcuts::settings s; - ptr<Shortcuts> sc; + mem<Shortcuts> sc; signals: void reload(); private slots: diff --git a/opentrack/state.hpp b/opentrack/state.hpp index 7fde64dc..c8d97d16 100644 --- a/opentrack/state.hpp +++ b/opentrack/state.hpp @@ -12,18 +12,18 @@ struct Modules { tracker_modules(filter(dylib::Tracker)), protocol_modules(filter(dylib::Protocol)) {} - QList<ptr<dylib>>& filters() { return filter_modules; } - QList<ptr<dylib>>& trackers() { return tracker_modules; } - QList<ptr<dylib>>& protocols() { return protocol_modules; } + QList<mem<dylib>>& filters() { return filter_modules; } + QList<mem<dylib>>& trackers() { return tracker_modules; } + QList<mem<dylib>>& protocols() { return protocol_modules; } private: - QList<ptr<dylib>> module_list; - QList<ptr<dylib>> filter_modules; - QList<ptr<dylib>> tracker_modules; - QList<ptr<dylib>> protocol_modules; + QList<mem<dylib>> module_list; + QList<mem<dylib>> filter_modules; + QList<mem<dylib>> tracker_modules; + QList<mem<dylib>> protocol_modules; - QList<ptr<dylib>> filter(dylib::Type t) + QList<mem<dylib>> filter(dylib::Type t) { - QList<ptr<dylib>> ret; + QList<mem<dylib>> ret; for (auto x : module_list) if (x->type == t) ret.push_back(x); @@ -44,5 +44,5 @@ struct State { pbundle b; main_settings s; Mappings pose; - ptr<Work> work; + mem<Work> work; }; diff --git a/opentrack/work.hpp b/opentrack/work.hpp index 510232db..bb9a4534 100644 --- a/opentrack/work.hpp +++ b/opentrack/work.hpp @@ -13,8 +13,8 @@ struct Work { main_settings& s; SelectedLibraries libs; - ptr<Tracker> tracker; - ptr<Shortcuts> sc; + mem<Tracker> tracker; + mem<Shortcuts> sc; WId handle; Work(main_settings& s, Mappings& m, SelectedLibraries& libs, QObject* recv, WId handle) : |