From f7967a674f37ae31f1a7d4aa57d35025181ff0ae Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 22 Dec 2019 01:43:56 +0100 Subject: [PATCH] Structure-Change: complete refactoring of the DisplayFrame --- src/stage/timeline/body-canvas-widget.cpp | 24 ++-- src/stage/timeline/body-canvas-widget.hpp | 1 + src/stage/timeline/timeline-layout.cpp | 22 ++-- src/stage/timeline/track-presenter.hpp | 15 +-- wiki/thinkPad.ichthyo.mm | 134 ++++++++++++++++------ 5 files changed, 136 insertions(+), 60 deletions(-) diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp index 1eae7a32c..08688d123 100644 --- a/src/stage/timeline/body-canvas-widget.cpp +++ b/src/stage/timeline/body-canvas-widget.cpp @@ -537,30 +537,40 @@ namespace timeline { } /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1201 : test/code... remove this + TimelineCanvas& + BodyCanvasWidget::getCanvas (int yPos) + { + return mainCanvas_; /////////////////////////////////////////////TICKET #1199 : TODO any need for a more elaborate Impl here? + } + + /* ==== Interface: ViewHook ===== */ void - BodyCanvasWidget::hook (Gtk::Widget& head, int xPos, int yPos) + BodyCanvasWidget::hook (Gtk::Widget& widget, int xPos, int yPos) { - UNIMPLEMENTED ("find the relevant canvas and attach the widget at given pos"); + /////////////////////////////////////////////////////////////////TICKET #1199 : need to adjust y-coord?? + getCanvas(yPos).put (widget, xPos, yPos); } void - BodyCanvasWidget::remove (Gtk::Widget& head) + BodyCanvasWidget::remove (Gtk::Widget& widget) { - UNIMPLEMENTED ("find the relevant canvas and search and attach the widget"); + /////////////////////////////////////////////////////////////////TICKET #1199 : TODO any need to care for the overview canvas?? + getCanvas(0).remove (widget); } void BodyCanvasWidget::rehook (model::ViewHooked&) noexcept { - UNIMPLEMENTED ("find the relevant canvas and attach the widget anew"); + /* NOOP */ } void - BodyCanvasWidget::move (Gtk::Widget& head, int xPos, int yPos) + BodyCanvasWidget::move (Gtk::Widget& widget, int xPos, int yPos) { - UNIMPLEMENTED ("find the relevant canvas and reposition the widget"); + /////////////////////////////////////////////////////////////////TICKET #1199 : need to adjust y-coord?? + getCanvas(yPos).move (widget, xPos, yPos); } diff --git a/src/stage/timeline/body-canvas-widget.hpp b/src/stage/timeline/body-canvas-widget.hpp index e15072da5..01079ef62 100644 --- a/src/stage/timeline/body-canvas-widget.hpp +++ b/src/stage/timeline/body-canvas-widget.hpp @@ -147,6 +147,7 @@ namespace timeline { private:/* ===== Internals ===== */ + TimelineCanvas& getCanvas(int yPos); void slotStructureChange() noexcept; void maybeRebuildLayout(); void adjustCanvasSize(int canvasWidth, int totalHeight, int rulerHeight); diff --git a/src/stage/timeline/timeline-layout.cpp b/src/stage/timeline/timeline-layout.cpp index 61420b053..abc974842 100644 --- a/src/stage/timeline/timeline-layout.cpp +++ b/src/stage/timeline/timeline-layout.cpp @@ -22,10 +22,10 @@ /** @file timeline-layout.cpp - ** Implementation details of global timeline layout management. + ** Implementation details of global timeline layout management. ** - ** @todo WIP-WIP-WIP as of 12/2016 ** @todo as of 10/2018 timeline display in the UI is rebuilt to match the architecture + ** @todo WIP-WIP-WIP as of 12/2019 ** */ @@ -129,32 +129,34 @@ namespace timeline { void TimelineLayout::hook (TrackHeadWidget& head, int xPos, int yPos) { + REQUIRE (xPos==0 && yPos==0, "arbitrary positioning of sub-Tracks contradicts the concept of track-profile."); ///TODO remove that API headerPane_.installForkRoot (head); } void TimelineLayout::hook (TrackBody& body, int xPos, int yPos) { + REQUIRE (xPos==0 && yPos==0, "arbitrary positioning of sub-Tracks contradicts the concept of track-profile."); ///TODO remove that API bodyCanvas_.installForkRoot (body); // detect changes of the track structure body.signalStructureChange_ = signalStructureChange_; signalStructureChange_(); // this _is_ such a change } - + void - TimelineLayout::remove (TrackHeadWidget& head) + TimelineLayout::remove (TrackHeadWidget&) { headerPane_.disable(); } void - TimelineLayout::remove (TrackBody& body) + TimelineLayout::remove (TrackBody&) { bodyCanvas_.disable(); } - + void TimelineLayout::rehook (model::ViewHooked&) noexcept @@ -167,21 +169,19 @@ namespace timeline { { NOTREACHED ("TimelineLayout: top-Level must not be re-ordered"); } - + void TimelineLayout::move (TrackHeadWidget& head, int xPos, int yPos) { - UNIMPLEMENTED ("ViewHooked: not supported -- refactor?"); + NOTREACHED ("ViewHooked: not supported -- refactor?"); } void TimelineLayout::move (TrackBody& body, int xPos, int yPos) { - UNIMPLEMENTED ("ViewHooked: not supported -- refactor?"); + NOTREACHED ("ViewHooked: not supported -- refactor?"); } - - diff --git a/src/stage/timeline/track-presenter.hpp b/src/stage/timeline/track-presenter.hpp index ca386e678..c9e6b32cc 100644 --- a/src/stage/timeline/track-presenter.hpp +++ b/src/stage/timeline/track-presenter.hpp @@ -77,34 +77,35 @@ namespace timeline { * ViewHook decorator to apply a (dynamic) offset * when attaching or moving Widgets on the shared canvas. */ + template class CanvasOffsetHook - : public model::ViewHook + : public model::ViewHook { - model::ViewHook& refHook_; + model::ViewHook& refHook_; /* ==== Interface: ViewHook ===== */ void - hook (Gtk::Widget& widget, int xPos=0, int yPos=0) override + hook (WID& widget, int xPos=0, int yPos=0) override { refHook_.hook (widget, hookAdjX (xPos), hookAdjY (yPos)); } void - move (Gtk::Widget& widget, int xPos, int yPos) override + move (WID& widget, int xPos, int yPos) override { refHook_.move (widget, hookAdjX (xPos), hookAdjY (yPos)); } void - remove (Gtk::Widget& widget) override + remove (WID& widget) override { refHook_.remove (widget); } void - rehook (ViewHooked& hookedWidget) noexcept override + rehook (ViewHooked& hookedWidget) noexcept override { refHook_.rehook (hookedWidget); } @@ -129,7 +130,7 @@ namespace timeline { class DisplayFrame : util::NonCopyable , public DisplayViewHooks - , public CanvasOffsetHook + , public CanvasOffsetHook { ViewHooked head_; ViewHooked body_; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index f50a082e8..568a7c44a 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -19146,13 +19146,16 @@ + + + - + @@ -19281,14 +19284,14 @@ - + - + - + - + @@ -21668,8 +21671,8 @@ - - + + @@ -21709,9 +21712,9 @@ - - - + + + @@ -21729,7 +21732,8 @@ - + + @@ -21757,9 +21761,12 @@ + + - - + + + @@ -21767,14 +21774,14 @@ - - - + + + - - + + @@ -21804,15 +21811,17 @@ - + - + + - + + @@ -21857,7 +21866,7 @@ - + @@ -21919,10 +21928,11 @@ - + - - + + + @@ -21938,8 +21948,12 @@ - - + + + + + + @@ -21947,6 +21961,46 @@ + + + + + + + + +

+ weil dieses nämlich keine Koordinaten bekommt, und daher nicht weiß, in welchem Canvas das zu entfernde Widget steckt +

+ + +
+ +
+ + + + + +
+ + + + + + + + + + + + + + + + + +
@@ -22388,7 +22442,8 @@ - + + @@ -22437,7 +22492,7 @@ - + @@ -23184,7 +23239,7 @@ - + @@ -23304,7 +23359,7 @@ - + @@ -24023,8 +24078,10 @@ - - + + + + @@ -24037,7 +24094,8 @@ - + + @@ -26330,6 +26388,10 @@ + + + + @@ -26462,7 +26524,9 @@ - + + +