summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-10-29 01:09:49 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-10-29 01:09:49 +0100
commite29f9b9b1ede2967031255a7bd23625aedc493c3 (patch)
treedfb9ce531ec84db3b251d15bfa800d05abfef272
parenta084a26275c1b5b0ddc5547ed230fa0b244598d6 (diff)
work around global 'ptr' symbol clash with opencv
Issue: #89 Reported-by: @runningman84
-rw-r--r--facetracknoir/ui.cpp4
-rw-r--r--facetracknoir/ui.h18
-rw-r--r--opentrack/plugin-support.cpp14
-rw-r--r--opentrack/plugin-support.h14
-rw-r--r--opentrack/shortcuts.h6
-rw-r--r--opentrack/state.hpp20
-rw-r--r--opentrack/work.hpp4
7 files changed, 40 insertions, 40 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp
index f340b1ff..66e7c80f 100644
--- a/facetracknoir/ui.cpp
+++ b/facetracknoir/ui.cpp
@@ -330,11 +330,11 @@ void MainWindow::showHeadPose()
}
template<typename t>
-ptr<t> mk_dialog(ptr<dylib> lib)
+mem<t> mk_dialog(mem<dylib> lib)
{
if (lib)
{
- auto dialog = ptr<t>(reinterpret_cast<t*>(lib->Dialog()));
+ auto dialog = mem<t>(reinterpret_cast<t*>(lib->Dialog()));
dialog->setWindowFlags(Qt::Dialog);
dialog->setFixedSize(dialog->size());
return dialog;
diff --git a/facetracknoir/ui.h b/facetracknoir/ui.h
index 4158e29e..3f607726 100644
--- a/facetracknoir/ui.h
+++ b/facetracknoir/ui.h
@@ -62,25 +62,25 @@ class MainWindow : public QMainWindow, private State
Q_OBJECT
Ui::OpentrackUI ui;
- ptr<QSystemTrayIcon> tray;
+ mem<QSystemTrayIcon> tray;
QTimer pose_update_timer;
- ptr<KeyboardShortcutDialog> shortcuts_widget;
- ptr<MapWidget> mapping_widget;
+ mem<KeyboardShortcutDialog> shortcuts_widget;
+ mem<MapWidget> mapping_widget;
QShortcut kbd_quit;
QPixmap no_feed_pixmap;
- ptr<IFilterDialog> pFilterDialog;
- ptr<IProtocolDialog> pProtocolDialog;
- ptr<ITrackerDialog> pTrackerDialog;
+ mem<IFilterDialog> pFilterDialog;
+ mem<IProtocolDialog> pProtocolDialog;
+ mem<ITrackerDialog> pTrackerDialog;
- ptr<dylib> current_tracker()
+ mem<dylib> current_tracker()
{
return modules.trackers().value(ui.iconcomboTrackerSource->currentIndex(), nullptr);
}
- ptr<dylib> current_protocol()
+ mem<dylib> current_protocol()
{
return modules.protocols().value(ui.iconcomboProtocol->currentIndex(), nullptr);
}
- ptr<dylib> current_filter()
+ mem<dylib> current_filter()
{
return modules.filters().value(ui.iconcomboFilter->currentIndex(), nullptr);
}
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) :