From 00a82f4917ddc37abf27fbec8c795e6d5646f366 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 16 Jan 2018 03:01:01 +0100 Subject: proto/mouse: must move settings to separate file Otherwise the UI file isn't slurped when #including this header. --- proto-mouse/ftnoir_protocol_mouse.h | 20 +++++--------------- proto-mouse/mouse-settings.hpp | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 proto-mouse/mouse-settings.hpp diff --git a/proto-mouse/ftnoir_protocol_mouse.h b/proto-mouse/ftnoir_protocol_mouse.h index 7b55e3a0..55b26fe5 100644 --- a/proto-mouse/ftnoir_protocol_mouse.h +++ b/proto-mouse/ftnoir_protocol_mouse.h @@ -8,23 +8,13 @@ #pragma once #include "ui_ftnoir_mousecontrols.h" + +#include "mouse-settings.hpp" + #include #include "api/plugin-api.hpp" -#include "options/options.hpp" using namespace options; -struct settings : opts { - value Mouse_X, Mouse_Y; - value sensitivity_x, sensitivity_y; - settings() : - opts("mouse-proto"), - Mouse_X(b, "mouse-x", 0), - Mouse_Y(b, "mouse-y", 0), - sensitivity_x(b, "mouse-sensitivity-x", slider_value(200, 25, 500)), - sensitivity_y(b, "mouse-sensitivity-y", slider_value(200, 25, 500)) - {} -}; - class mouse : public IProtocol { public: @@ -38,7 +28,7 @@ private: static int get_delta(int val, int prev); static int get_value(double val, double sensitivity, bool is_rotation); - struct settings s; + struct mouse_settings s; }; class MOUSEControls: public IProtocolDialog @@ -50,7 +40,7 @@ public: void unregister_protocol() {} private: Ui::UICMOUSEControls ui; - settings s; + mouse_settings s; private slots: void doOK(); void doCancel(); diff --git a/proto-mouse/mouse-settings.hpp b/proto-mouse/mouse-settings.hpp new file mode 100644 index 00000000..c29024ac --- /dev/null +++ b/proto-mouse/mouse-settings.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include "options/options.hpp" + +namespace mouse_impl { + +using namespace options; + +struct mouse_settings : opts { + value Mouse_X, Mouse_Y; + value sensitivity_x, sensitivity_y; + mouse_settings() : + opts("mouse-proto"), + Mouse_X(b, "mouse-x", 0), + Mouse_Y(b, "mouse-y", 0), + sensitivity_x(b, "mouse-sensitivity-x", slider_value(200, 25, 500)), + sensitivity_y(b, "mouse-sensitivity-y", slider_value(200, 25, 500)) + {} +}; + +} // ns mouse_impl + +using mouse_impl::mouse_settings; -- cgit v1.2.3