From 1187a819434c4cf74fd8137ade11a34bd4298076 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 2 Apr 2021 17:32:33 +0200 Subject: [PATCH] Clip-Drag: hook up the access point to the gesture definition thus far my implementation concept seems to work as intended.... note: when populating the timeline with actual Clips, the not-yet implemented linkSubject()-Function of the DragRelocateController gets invoked (as it should), thereby killing Lumiera --- src/stage/interact/cmd-context.cpp | 18 +++++-- src/stage/interact/cmd-context.hpp | 27 +++++++--- .../interact/drag-relocate-controller.hpp | 4 +- src/stage/timeline/clip-presenter.hpp | 7 ++- wiki/thinkPad.ichthyo.mm | 53 ++++++++++++++++--- 5 files changed, 86 insertions(+), 23 deletions(-) diff --git a/src/stage/interact/cmd-context.cpp b/src/stage/interact/cmd-context.cpp index bd91b640d..e25065a5a 100644 --- a/src/stage/interact/cmd-context.cpp +++ b/src/stage/interact/cmd-context.cpp @@ -58,7 +58,7 @@ namespace interact { lib::Depend gestures; inline InteractionState& - selectStateImplementation (string ctxID) + selectStateImplementation (Symbol ctxID) { if ( GESTURE_dragReolcate == ctxID) return gestures().getStateFor (GestureState::DRAG, GestureState::ON_TIMELINE); @@ -74,15 +74,23 @@ namespace interact { * @remarks the implementation of this function taps into the UI-Backbone * to access the InteractionDirector for the context interaction state */ - CmdContext& - CmdContext::of (Symbol cmdID, string ctxID) + CmdContext + CmdContext::of (Symbol cmdID, Symbol ctxID) { - InteractionState& state = selectStateImplementation (ctxID); - UNIMPLEMENTED ("context-bound commands: build a suitable CmdContext builder for further outfitting this state"); + return CmdContext {selectStateImplementation(ctxID), cmdID}; } + void + CmdContext::setupRelocateDrag() + { + REQUIRE (subject_); + iState_.linkTrigger (*subject_, cmdID_); + } + + + /** * @remarks this service is used to resolve command arguments * based on the current state of UI interaction. This can be used diff --git a/src/stage/interact/cmd-context.hpp b/src/stage/interact/cmd-context.hpp index fdbac751f..6de996619 100644 --- a/src/stage/interact/cmd-context.hpp +++ b/src/stage/interact/cmd-context.hpp @@ -62,7 +62,8 @@ #include "lib/symbol.hpp" //#include "lib/util.hpp" -#include +//#include +#include namespace stage { @@ -72,7 +73,9 @@ namespace interact { using lib::hash::LuidH; using lib::Symbol; // using util::isnil; - using std::string; +// using std::string; + + class InteractionState; @@ -97,20 +100,28 @@ namespace interact { * @todo write type comment... */ class CmdContext - : util::NonCopyable + : util::MoveOnly { + InteractionState& iState_; + Symbol cmdID_; + + /* ===== Builder State ===== */ Subject* subject_{nullptr}; + CmdContext (InteractionState& iState, Symbol cmdID) + : iState_{iState} + , cmdID_{cmdID} + { } public: + // using the default move-ctor + /* === access front-end === */ - static CmdContext& of (Symbol cmdID, string ctxID); + static CmdContext of (Symbol cmdID, Symbol ctxID); struct Resolver; - /** Builder operation: define the subject to use - * for the following interaction bindings. - */ - CmdContext& linkSubect (Subject&); + /** Builder operation: define the subject to use for the following interaction bindings. */ + CmdContext&& linkSubject (Subject& subj) { this->subject_ = &subj; return std::move (*this); } /** Terminal builder operation: establish the infrastructure * for the already defined participants to be involved into a diff --git a/src/stage/interact/drag-relocate-controller.hpp b/src/stage/interact/drag-relocate-controller.hpp index a0671ee2c..6518938fe 100644 --- a/src/stage/interact/drag-relocate-controller.hpp +++ b/src/stage/interact/drag-relocate-controller.hpp @@ -53,7 +53,7 @@ #include "stage/interact/cmd-context.hpp" //#include "lib/idi/entry-id.hpp" //#include "lib/symbol.hpp" -//#include "lib/util.hpp" +#include "lib/util.hpp" //#include @@ -64,6 +64,7 @@ namespace interact { // using lib::HashVal; // using util::isnil; // using std::string; + using util::isnil; /** @@ -88,6 +89,7 @@ namespace interact { void linkTrigger (Subject& subject, Symbol cmdID) override { + REQUIRE (not isnil (cmdID)); UNIMPLEMENTED ("use the Subject interface to hook up a trigger signal"); } diff --git a/src/stage/timeline/clip-presenter.hpp b/src/stage/timeline/clip-presenter.hpp index 38fab55f8..fedef51eb 100644 --- a/src/stage/timeline/clip-presenter.hpp +++ b/src/stage/timeline/clip-presenter.hpp @@ -59,6 +59,7 @@ #include "stage/timeline/marker-widget.hpp" #include "stage/interact/cmd-context.hpp" #include "lib/time/timevalue.hpp" +#include "steam/cmd.hpp" //#include "lib/util.hpp" @@ -74,10 +75,10 @@ namespace timeline { using std::vector; using std::optional; using std::unique_ptr; + using std::make_unique; using lib::time::TimeSpan; using lib::diff::TreeMutator; using lib::diff::collection; - using std::make_unique; /** @@ -233,7 +234,9 @@ namespace timeline { if (prevDelegate != widget_.get() and newAppearance > ClipDelegate::DEGRADED) {// a new dedicated clip widget has been created... - WARN (stage, "configure clip-dragging"); + interact::CmdContext::of (steam::cmd::scope_moveRelocateClip, GESTURE_dragReolcate) + .linkSubject (*this) + .setupRelocateDrag(); } } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 5ba2d01f2..dd79445c8 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -32331,8 +32331,8 @@ - - + + @@ -32360,6 +32360,7 @@ + @@ -32372,12 +32373,16 @@ - - + + - - + + + + + + @@ -32391,9 +32396,43 @@ - + + + + + + + + + + + +

+ Maus, Tastenkürzel, Stift, Hardware.... +

+ +
+ +
+ + + +
+ + + + + + + + + + + + +