summaryrefslogtreecommitdiffhomepage
path: root/spline
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-06-26 22:55:45 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-06-26 23:05:21 +0200
commit831add67832939fe065da380461beda635fbb70f (patch)
treed49bcc9b076189337a1c34edd7a705d4c480dac5 /spline
parentcf57e64fab562b23d40df4d98e25dc9a0cf6aa9b (diff)
spline: split up spline API
Diffstat (limited to 'spline')
-rw-r--r--spline/spline.hpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/spline/spline.hpp b/spline/spline.hpp
index 5a93c50b..b7b3ce5b 100644
--- a/spline/spline.hpp
+++ b/spline/spline.hpp
@@ -10,7 +10,6 @@
#include "compat/copyable-mutex.hpp"
#include "options/options.hpp"
-using namespace options;
#include "axis-opts.hpp"
@@ -29,6 +28,8 @@ using namespace options;
namespace spline_detail {
+using namespace options;
+
class OTR_SPLINE_EXPORT base_settings : public QObject
{
Q_OBJECT
@@ -47,8 +48,6 @@ public:
~settings() override;
};
-} // ns spline_detail
-
struct OTR_SPLINE_EXPORT base_spline_
{
virtual inline ~base_spline_();
@@ -66,9 +65,16 @@ struct OTR_SPLINE_EXPORT base_spline_
virtual points_t const& get_points() const = 0;
virtual int get_point_count() const = 0;
+};
+
+struct OTR_SPLINE_EXPORT spline_settings_mixin
+{
+ using base_settings = spline_detail::base_settings;
virtual std::shared_ptr<spline_detail::base_settings> get_settings() = 0;
virtual std::shared_ptr<const spline_detail::base_settings> get_settings() const = 0;
+
+ virtual inline ~spline_settings_mixin();
};
struct OTR_SPLINE_EXPORT spline_modify_mixin
@@ -82,10 +88,8 @@ struct OTR_SPLINE_EXPORT spline_modify_mixin
virtual inline ~spline_modify_mixin();
};
-class OTR_SPLINE_EXPORT base_spline : public base_spline_, public spline_modify_mixin
+struct OTR_SPLINE_EXPORT base_spline : base_spline_, spline_modify_mixin, spline_settings_mixin
{
-public:
- using base_settings = spline_detail::base_settings;
};
class OTR_SPLINE_EXPORT spline : public base_spline
@@ -159,3 +163,8 @@ public:
inline base_spline_::~base_spline_() {}
inline spline_modify_mixin::~spline_modify_mixin() {}
+inline spline_settings_mixin::~spline_settings_mixin() {}
+
+} // ns spline_detail
+
+using spline = spline_detail::spline;