summaryrefslogtreecommitdiffhomepage
path: root/opentrack-compat/options.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-07-06 11:42:34 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-07-06 12:07:49 +0200
commit4707750a1578edf8afa6ed4a2a48b379cda5d01c (patch)
tree10b5df2dffe4f5bf9cb989b628a695286696dc08 /opentrack-compat/options.hpp
parent38c0f0d5bce4db4cdbbcef14ffb60c66e8a52372 (diff)
compat/options: split too long header
Diffstat (limited to 'opentrack-compat/options.hpp')
-rw-r--r--opentrack-compat/options.hpp52
1 files changed, 1 insertions, 51 deletions
diff --git a/opentrack-compat/options.hpp b/opentrack-compat/options.hpp
index 86c699d6..53249746 100644
--- a/opentrack-compat/options.hpp
+++ b/opentrack-compat/options.hpp
@@ -5,8 +5,6 @@
* copyright notice and this permission notice appear in all copies.
*/
-// XXX TODO this header is too long
-
#pragma once
#include <memory>
@@ -43,6 +41,7 @@
#include <QDebug>
#include "export.hpp"
+#include "slider.hpp"
template<typename t> using mem = std::shared_ptr<t>;
@@ -50,55 +49,6 @@ template<typename t> using mem = std::shared_ptr<t>;
#define OPENTRACK_DEFAULT_CONFIG "default.ini"
#define OPENTRACK_ORG "opentrack-2.3"
-namespace options
-{
- class OPENTRACK_COMPAT_EXPORT slider_value final
- {
- double cur_, min_, max_;
- public:
- slider_value(double cur, double min, double max);
- slider_value(const slider_value& v);
- slider_value();
- slider_value& operator=(const slider_value& v);
- bool operator==(const slider_value& v) const;
- operator double() const { return cur_; }
- double cur() const { return cur_; }
- double min() const { return min_; }
- double max() const { return max_; }
- slider_value update_from_slider(int pos, int q_min, int q_max) const;
- int to_slider_pos(int q_min, int q_max) const;
- };
-}
-
-QT_BEGIN_NAMESPACE
-
-inline QDebug operator << (QDebug dbg, const options::slider_value& val)
-{
- return dbg << val.cur();
-}
-
-inline QDataStream& operator << (QDataStream& out, const options::slider_value& v)
-{
- out << v.cur()
- << v.min()
- << v.max();
- return out;
-}
-
-inline QDataStream& operator >> (QDataStream& in, options::slider_value& v)
-{
- double cur, min, max;
- in >> cur;
- in >> min;
- in >> max;
- v = options::slider_value(cur, min, max);
- return in;
-}
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(options::slider_value)
-
namespace options {
namespace {
class custom_type_initializer