summaryrefslogtreecommitdiffhomepage
path: root/options
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-03-28 11:00:31 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-03-28 11:08:56 +0200
commit7337f89f4d69cc0e5fe3a72f9f6773ecf9b24cc5 (patch)
treed24194237167fa7a1e5303b78c8bc2b2017475b7 /options
parent783739a2f3599e00869f907ed1747491b35486b1 (diff)
start renaming internal macros as OPENTRACK_* to OTR_*
Diffstat (limited to 'options')
-rw-r--r--options/bundle.cpp4
-rw-r--r--options/bundle.hpp12
-rw-r--r--options/export.hpp28
-rw-r--r--options/group.hpp2
-rw-r--r--options/scoped.hpp2
-rw-r--r--options/slider.hpp2
-rw-r--r--options/tie.cpp20
-rw-r--r--options/tie.hpp20
-rw-r--r--options/value.hpp2
9 files changed, 38 insertions, 54 deletions
diff --git a/options/bundle.cpp b/options/bundle.cpp
index 48833266..43f4a8e3 100644
--- a/options/bundle.cpp
+++ b/options/bundle.cpp
@@ -193,7 +193,7 @@ std::shared_ptr<bundler::v> bundler::make_bundle(const bundler::k& key)
return shr;
}
-OPENTRACK_OPTIONS_EXPORT bundler& singleton()
+OTR_OPTIONS_EXPORT bundler& singleton()
{
static bundler ret;
return ret;
@@ -203,7 +203,7 @@ QMutex* bundle::get_mtx() const { return mtx; }
} // end options::detail
-OPENTRACK_OPTIONS_EXPORT std::shared_ptr<bundle_> make_bundle(const QString& name)
+OTR_OPTIONS_EXPORT std::shared_ptr<bundle_> make_bundle(const QString& name)
{
if (name.size())
return detail::singleton().make_bundle(name);
diff --git a/options/bundle.hpp b/options/bundle.hpp
index 64210d33..f05999a7 100644
--- a/options/bundle.hpp
+++ b/options/bundle.hpp
@@ -36,11 +36,11 @@ void set_base_value_to_default(base_value* val);
struct bundler;
-class OPENTRACK_OPTIONS_EXPORT bundle final : public QObject, public connector
+class OTR_OPTIONS_EXPORT bundle final : public QObject, public connector
{
Q_OBJECT
- class OPENTRACK_OPTIONS_EXPORT mutex final : public QMutex
+ class OTR_OPTIONS_EXPORT mutex final : public QMutex
{
public:
mutex(QMutex::RecursionMode mode) : QMutex(mode) {}
@@ -86,9 +86,9 @@ public slots:
void set_all_to_default();
};
-OPENTRACK_OPTIONS_EXPORT bundler& singleton();
+OTR_OPTIONS_EXPORT bundler& singleton();
-struct OPENTRACK_OPTIONS_EXPORT bundler
+struct OTR_OPTIONS_EXPORT bundler
{
public:
using k = QString;
@@ -106,12 +106,12 @@ public:
static void refresh_all_bundles();
};
-OPENTRACK_OPTIONS_EXPORT bundler& singleton();
+OTR_OPTIONS_EXPORT bundler& singleton();
}
using bundle_ = detail::bundle;
using bundle = std::shared_ptr<bundle_>;
-OPENTRACK_OPTIONS_EXPORT std::shared_ptr<bundle_> make_bundle(const QString& name);
+OTR_OPTIONS_EXPORT std::shared_ptr<bundle_> make_bundle(const QString& name);
}
diff --git a/options/export.hpp b/options/export.hpp
index c430540f..6cce27fa 100644
--- a/options/export.hpp
+++ b/options/export.hpp
@@ -1,27 +1,11 @@
+// generates export.hpp for each module from compat/linkage.hpp
+
#pragma once
-#ifdef BUILD_options
-# ifdef _WIN32
-# define OPENTRACK_OPTIONS_LINKAGE __declspec(dllexport)
-# else
-# define OPENTRACK_OPTIONS_LINKAGE
-# endif
+#include "compat/linkage-macros.hpp"
-# ifndef _MSC_VER
-# define OPENTRACK_OPTIONS_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_OPTIONS_LINKAGE
-# else
-# define OPENTRACK_OPTIONS_EXPORT OPENTRACK_OPTIONS_LINKAGE
-# endif
+#ifdef BUILD_OPTIONS
+# define OTR_OPTIONS_EXPORT OTR_GENERIC_EXPORT
#else
- #ifdef _WIN32
- # define OPENTRACK_OPTIONS_LINKAGE __declspec(dllimport)
- #else
- # define OPENTRACK_OPTIONS_LINKAGE
- #endif
-
- #ifndef _MSC_VER
- # define OPENTRACK_OPTIONS_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_OPTIONS_LINKAGE
- #else
- # define OPENTRACK_OPTIONS_EXPORT OPENTRACK_OPTIONS_LINKAGE
- #endif
+# define OTR_OPTIONS_EXPORT OTR_GENERIC_IMPORT
#endif
diff --git a/options/group.hpp b/options/group.hpp
index 82b508af..e2a8058c 100644
--- a/options/group.hpp
+++ b/options/group.hpp
@@ -12,7 +12,7 @@
namespace options {
// snapshot of qsettings group at given time
-class OPENTRACK_OPTIONS_EXPORT group final
+class OTR_OPTIONS_EXPORT group final
{
QString name;
public:
diff --git a/options/scoped.hpp b/options/scoped.hpp
index fd797219..8652bfff 100644
--- a/options/scoped.hpp
+++ b/options/scoped.hpp
@@ -9,7 +9,7 @@
namespace options {
-struct OPENTRACK_OPTIONS_EXPORT opts
+struct OTR_OPTIONS_EXPORT opts
{
bundle b;
opts(const QString& name);
diff --git a/options/slider.hpp b/options/slider.hpp
index 1ae63d10..48b690d2 100644
--- a/options/slider.hpp
+++ b/options/slider.hpp
@@ -14,7 +14,7 @@
namespace options
{
- class OPENTRACK_OPTIONS_EXPORT slider_value final
+ class OTR_OPTIONS_EXPORT slider_value final
{
double cur_, min_, max_;
public:
diff --git a/options/tie.cpp b/options/tie.cpp
index 873c7087..7a78237f 100644
--- a/options/tie.cpp
+++ b/options/tie.cpp
@@ -10,7 +10,7 @@
namespace options {
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QComboBox* cb)
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QComboBox* cb)
{
cb->setCurrentIndex(v);
v = cb->currentIndex();
@@ -18,7 +18,7 @@ OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QComboBox* cb)
base_value::connect(&v, SIGNAL(valueChanged(int)), cb, SLOT(setCurrentIndex(int)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QComboBox* cb)
+OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QComboBox* cb)
{
cb->setCurrentText(v);
v = cb->currentText();
@@ -26,28 +26,28 @@ OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QComboBox* cb)
base_value::connect(&v, SIGNAL(valueChanged(QString)), cb, SLOT(setCurrentText(QString)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<bool>& v, QCheckBox* cb)
+OTR_OPTIONS_EXPORT void tie_setting(value<bool>& v, QCheckBox* cb)
{
cb->setChecked(v);
base_value::connect(cb, SIGNAL(toggled(bool)), &v, SLOT(setValue(bool)), v.DIRECT_CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(bool)), cb, SLOT(setChecked(bool)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<double>& v, QDoubleSpinBox* dsb)
+OTR_OPTIONS_EXPORT void tie_setting(value<double>& v, QDoubleSpinBox* dsb)
{
dsb->setValue(v);
base_value::connect(dsb, SIGNAL(valueChanged(double)), &v, SLOT(setValue(double)), v.DIRECT_CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(double)), dsb, SLOT(setValue(double)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QSpinBox* sb)
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QSpinBox* sb)
{
sb->setValue(v);
base_value::connect(sb, SIGNAL(valueChanged(int)), &v, SLOT(setValue(int)), v.DIRECT_CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(int)), sb, SLOT(setValue(int)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QSlider* sl)
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QSlider* sl)
{
sl->setValue(v);
v = sl->value();
@@ -55,27 +55,27 @@ OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QSlider* sl)
base_value::connect(&v, SIGNAL(valueChanged(int)), sl, SLOT(setValue(int)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLineEdit* le)
+OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLineEdit* le)
{
le->setText(v);
base_value::connect(le, SIGNAL(textChanged(QString)), &v, SLOT(setValue(QString)), v.DIRECT_CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(QString)),le, SLOT(setText(QString)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLabel* lb)
+OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLabel* lb)
{
lb->setText(v);
base_value::connect(&v, SIGNAL(valueChanged(QString)), lb, SLOT(setText(QString)), v.DIRECT_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QTabWidget* t)
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QTabWidget* t)
{
t->setCurrentIndex(v);
base_value::connect(t, SIGNAL(currentChanged(int)), &v, SLOT(setValue(int)), v.DIRECT_CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(int)), t, SLOT(setCurrentIndex(int)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<slider_value>& v, QSlider* w)
+OTR_OPTIONS_EXPORT void tie_setting(value<slider_value>& v, QSlider* w)
{
{
const int q_min = w->minimum();
diff --git a/options/tie.hpp b/options/tie.hpp
index 74817a1f..1745438f 100644
--- a/options/tie.hpp
+++ b/options/tie.hpp
@@ -47,15 +47,15 @@ tie_setting(value<t>& v, QComboBox* cb)
v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QComboBox* cb);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QComboBox* cb);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<bool>& v, QCheckBox* cb);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<double>& v, QDoubleSpinBox* dsb);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QSpinBox* sb);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QSlider* sl);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLineEdit* le);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLabel* lb);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QTabWidget* t);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<slider_value>& v, QSlider* w);
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QComboBox* cb);
+OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QComboBox* cb);
+OTR_OPTIONS_EXPORT void tie_setting(value<bool>& v, QCheckBox* cb);
+OTR_OPTIONS_EXPORT void tie_setting(value<double>& v, QDoubleSpinBox* dsb);
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QSpinBox* sb);
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QSlider* sl);
+OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLineEdit* le);
+OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLabel* lb);
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QTabWidget* t);
+OTR_OPTIONS_EXPORT void tie_setting(value<slider_value>& v, QSlider* w);
} // ns options
diff --git a/options/value.hpp b/options/value.hpp
index 204fa15a..83529262 100644
--- a/options/value.hpp
+++ b/options/value.hpp
@@ -37,7 +37,7 @@ template<typename u> struct value_type_traits<QList<u>>
template<typename t> using value_type_t = typename value_type_traits<t>::type;
}
-class OPENTRACK_OPTIONS_EXPORT base_value : public QObject
+class OTR_OPTIONS_EXPORT base_value : public QObject
{
Q_OBJECT
friend class ::options::detail::connector;