diff --git a/src/stage/gtk-lumiera.cpp b/src/stage/gtk-lumiera.cpp index 5bfeb1c37..c95fcb5d5 100644 --- a/src/stage/gtk-lumiera.cpp +++ b/src/stage/gtk-lumiera.cpp @@ -128,7 +128,7 @@ namespace stage { void - runGUI (Subsys::SigTerm reportOnTermination) + runGUI (Subsys::SigTerm reportOnTermination) ///< this is the UI-Thread { string shutdownLog = GtkLumiera{}.run(); diff --git a/src/stage/interact/cmd-context.hpp b/src/stage/interact/cmd-context.hpp index 6de996619..a1be57284 100644 --- a/src/stage/interact/cmd-context.hpp +++ b/src/stage/interact/cmd-context.hpp @@ -65,7 +65,9 @@ //#include #include - +namespace Gtk { + class Widget; +} namespace stage { namespace interact { @@ -90,6 +92,9 @@ namespace interact { { protected: virtual ~Subject(); ///< this is an interface + + public: + virtual Gtk::Widget& exposeWidget() =0; }; diff --git a/src/stage/interact/drag-relocate-controller.hpp b/src/stage/interact/drag-relocate-controller.hpp index 6518938fe..3a768b314 100644 --- a/src/stage/interact/drag-relocate-controller.hpp +++ b/src/stage/interact/drag-relocate-controller.hpp @@ -47,12 +47,12 @@ #define STAGE_INTERACT_DRAG_RELOCATE_CONTROLLER_H -#include "lib/error.hpp" -#include "lib/nocopy.hpp" +#include "stage/gtk-base.hpp" #include "stage/interact/interaction-state.hpp" #include "stage/interact/cmd-context.hpp" //#include "lib/idi/entry-id.hpp" //#include "lib/symbol.hpp" +#include "lib/nocopy.hpp" #include "lib/util.hpp" //#include @@ -66,6 +66,24 @@ namespace interact { // using std::string; using util::isnil; + +#define ON_EXCEPTION_RETURN(_VAL_,_OP_DESCR_) \ + catch (std::exception& problem) \ + { \ + const char* errID = lumiera_error(); \ + WARN (stage, "%s (Signal Handler) failed: %s",\ + _OP_DESCR_, problem.what()); \ + TRACE (debugging, "Error flag was: %s", errID); \ + return (_VAL_); \ + } \ + catch (...) \ + { \ + const char* errID = lumiera_error(); \ + ERROR (stage, "(Signal Handler) %s failed with " \ + "unknown exception; error flag is: %s" \ + , _OP_DESCR_, errID); \ + return (_VAL_); \ + } /** * Abstract foundation context dependent UI interactions. @@ -85,14 +103,27 @@ namespace interact { class DragRelocateController : public InteractionState { - void linkTrigger (Subject& subject, Symbol cmdID) override { REQUIRE (not isnil (cmdID)); - UNIMPLEMENTED ("use the Subject interface to hook up a trigger signal"); + subject.exposeWidget().signal_button_press_event().connect( + [&](GdkEventButton* button) -> bool + { + try{ return detectActivation(subject, button); } + ON_EXCEPTION_RETURN (false, "activate dragging gesture") + } + ); } + bool + detectActivation (Subject& subject, GdkEventButton* button_event) + { + throw lumiera::error::Fatal("UNIMPLEMENTED Maybe DRAG-start?????"); + //return false; + } + + public: DragRelocateController() // : diff --git a/src/stage/interact/gesture-state.cpp b/src/stage/interact/gesture-state.cpp index 66533bbc9..e10aec884 100644 --- a/src/stage/interact/gesture-state.cpp +++ b/src/stage/interact/gesture-state.cpp @@ -37,13 +37,12 @@ */ -#include "lib/error.hpp" -//#include "lib/util.hpp" -//#include "lib/symbol.hpp" -//#include "include/logging.h" -#include "lib/format-string.hpp" +#include "stage/gtk-base.hpp" #include "stage/interact/gesture-state.hpp" #include "stage/interact/drag-relocate-controller.hpp" +#include "lib/format-string.hpp" +//#include "lib/symbol.hpp" +//#include "lib/util.hpp" //#include //#include diff --git a/src/stage/timeline/clip-presenter.hpp b/src/stage/timeline/clip-presenter.hpp index fedef51eb..b0dbcca6c 100644 --- a/src/stage/timeline/clip-presenter.hpp +++ b/src/stage/timeline/clip-presenter.hpp @@ -83,6 +83,11 @@ namespace timeline { /** * A View-Model entity to represent a clip within the timeline-UI. + * @remarks + * - by means of implementing \ref interact::Subject, "the Clip", as represented + * through the ClipPresenter, can be subject to dragging gestures; the wiring + * to trigger the detection of such gestures is provided by #establishAppearance(), + * more specifically, this wiring happens whenever a new clip-widget is established. * @todo WIP-WIP as of 12/2016 */ class ClipPresenter @@ -212,6 +217,14 @@ namespace timeline { } + private:/* ===== Subject-Interface ===== */ + Gtk::Widget& + exposeWidget() override + { + return ClipDelegate::expect_and_expose_Widget (widget_); + } + + private:/* ===== Internals ===== */ /** * reevaluate desired presentation mode and available data, diff --git a/src/stage/timeline/clip-widget.cpp b/src/stage/timeline/clip-widget.cpp index a98f594a7..a4582bc16 100644 --- a/src/stage/timeline/clip-widget.cpp +++ b/src/stage/timeline/clip-widget.cpp @@ -94,7 +94,7 @@ #include "stage/timeline/clip-widget.hpp" //#include "stage/ui-bus.hpp" -//#include "lib/format-string.hpp" +#include "lib/format-string.hpp" //#include "lib/format-cout.hpp" #include "lib/util.hpp" @@ -105,7 +105,7 @@ -//using util::_Fmt; +using util::_Fmt; //using util::contains; //using Gtk::Widget; //using sigc::mem_fun; @@ -118,7 +118,9 @@ using std::optional; namespace stage { + LUMIERA_ERROR_DEFINE (UIWIRING, "GUI state contradicts assumptions in signal wiring"); namespace timeline { + namespace error = lumiera::error; const int ClipDelegate::defaultOffsetY{0}; const string ClipDelegate::defaultName{_("clip")}; @@ -477,4 +479,21 @@ namespace timeline { } + Gtk::Widget& + ClipDelegate::expect_and_expose_Widget (PDelegate& manager) + { + if (manager and manager->currentAppearance() >= ClipDelegate::ABRIDGED) + return static_cast (*manager); + + else + throw error::State (_Fmt{"Attempt to access the Widget for clip('%s') in presentation state %d. " + "This implies an error in the signal wiring logic and state handling."} + % string{manager? manager->getClipName() : ""} + % int {manager? manager->currentAppearance() : -1} + ,LERR_(UIWIRING) + ); + } + + + }}// namespace stage::timeline diff --git a/src/stage/timeline/clip-widget.hpp b/src/stage/timeline/clip-widget.hpp index 32bd61c5e..7778d1f32 100644 --- a/src/stage/timeline/clip-widget.hpp +++ b/src/stage/timeline/clip-widget.hpp @@ -230,6 +230,15 @@ namespace timeline { WidgetHook* newView =nullptr, optional const& timing =nullopt); + /** + * Wrapper to safely expose the actual clip implementation widget. + * @throws error::State if the current presentation / appearance style + * does not actually use a dedicated clip widget. + * @remark the assumption is for the caller to arrange the calling context + * such that existence of an actual widget can safely be assumed. + */ + static Gtk::Widget& expect_and_expose_Widget (PDelegate& manager); + private:/* ===== Internals ===== */ diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index dd79445c8..8ad59f29b 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -644,7 +644,12 @@ - + + + + + + @@ -653,6 +658,18 @@ + + + + + + +

+ verbleibende Probleme sind "marginal" und besser im Subsystem-Runner zu addressieren +

+ +
+
@@ -660,17 +677,17 @@ - + - + - + @@ -678,6 +695,7 @@ + @@ -726,7 +744,7 @@ - + @@ -772,7 +790,7 @@ - + @@ -795,7 +813,7 @@ - + @@ -820,8 +838,8 @@ - - + + @@ -871,7 +889,7 @@ - + @@ -927,7 +945,7 @@ - + @@ -21895,13 +21913,26 @@ + + + + + + +

+ erst mal nur mit einem Button, und die Layout-Logik ehr "geschätzt" den präzise verstanden und umgesetzt. Immerhinn läuft der DisplayEvaluationPass nun, und auch die Buttons erscheinen an der Stelle, an der ich das erwarten würde... +

+ +
+ +
- + @@ -29114,7 +29145,7 @@ - + @@ -29347,6 +29378,9 @@ + + +
@@ -29714,7 +29748,7 @@ - +
@@ -31601,6 +31635,7 @@ + @@ -31975,6 +32010,10 @@ + + + + @@ -32177,8 +32216,12 @@ + + - + + + @@ -32418,19 +32461,80 @@ - + + + + + + + + + + + + + + +

+ ...und dadurch ensteht hier ein "linke-Tasche-rechte-Tasche-Spiel". +

+

+ Wir müssen annehmen... +

+
    +
  • + daß der ClipPresenter das Wiring nur dann einrichtet, wenn tatsächlich ein Clip-Widget erzeugt wurde +
  • +
  • + und daß ein deaktiviertes oder aus dem Display herausgenommenes Widget auch keine Signale mehr sendet +
  • +
+ +
+
+ + + + + + +
+
+ + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + @@ -54730,7 +54834,47 @@ - + + + + + + +
+
+ struct bar : public sigc::trackable {}; +
+
+ sigc::signal<void()> some_signal; +
+
+ void foo(bar&); +
+
+ { +
+
+ bar some_bar; +
+
+ some_signal.connect([&some_bar](){ foo(some_bar); }); +
+
+ // NOT disconnected automatically when some_bar goes out of scope +
+
+ some_signal.connect(sigc::track_obj([&some_bar](){ foo(some_bar); }, some_bar); +
+
+ // disconnected automatically when some_bar goes out of scope +
+
+ } +
+
+ +
+