From df0fdf362347495531bc3a5d19233220721d846b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 11 May 2021 13:45:26 -0400 Subject: Refactor most functionality around actions and settings This moves more code into general places, and completely eliminates dependencies on the Patchage "god object". --- src/Action.hpp | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src/Action.hpp') diff --git a/src/Action.hpp b/src/Action.hpp index f843a14..0a13216 100644 --- a/src/Action.hpp +++ b/src/Action.hpp @@ -19,6 +19,7 @@ #include "ClientID.hpp" #include "PortID.hpp" +#include "Setting.hpp" #include "SignalDirection.hpp" #include @@ -26,11 +27,17 @@ namespace patchage { namespace action { +struct ChangeSetting { + Setting setting; +}; + struct ConnectPorts { PortID tail; PortID head; }; +struct DecreaseFontSize {}; + struct DisconnectClient { ClientID client; SignalDirection direction; @@ -45,6 +52,8 @@ struct DisconnectPorts { PortID head; }; +struct IncreaseFontSize {}; + struct MoveModule { ClientID client; SignalDirection direction; @@ -52,6 +61,10 @@ struct MoveModule { double y; }; +struct Refresh {}; + +struct ResetFontSize {}; + struct SplitModule { ClientID client; }; @@ -60,16 +73,30 @@ struct UnsplitModule { ClientID client; }; +struct ZoomFull {}; +struct ZoomIn {}; +struct ZoomNormal {}; +struct ZoomOut {}; + } // namespace action /// A high-level action from the user -using Action = boost::variant; + action::UnsplitModule, + action::ZoomFull, + action::ZoomIn, + action::ZoomNormal, + action::ZoomOut>; } // namespace patchage -- cgit v1.2.1