From 81253cb152c85632d2dad6fcc7a0706f815c6680 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 8 Aug 2019 19:07:45 +0200 Subject: [PATCH] Timeline: some analysis and planning regarding space allocation --- src/stage/timeline/body-canvas-widget.cpp | 24 +- src/stage/timeline/body-canvas-widget.hpp | 1 + src/stage/timeline/display-manager.hpp | 3 + src/stage/timeline/timeline-layout.cpp | 10 + src/stage/timeline/timeline-layout.hpp | 1 + wiki/thinkPad.ichthyo.mm | 434 ++++++++++++++++++++-- 6 files changed, 430 insertions(+), 43 deletions(-) diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp index b4f2c6753..b797b3757 100644 --- a/src/stage/timeline/body-canvas-widget.cpp +++ b/src/stage/timeline/body-canvas-widget.cpp @@ -348,8 +348,8 @@ namespace timeline { , profile_{} , rootBody_{nullptr} , contentArea_{} - , rulerCanvas_{makeRenderer(layout_,getProfile), makeRenderer(layout_,getProfile)} - , mainCanvas_ {makeRenderer(layout_,getProfile), makeRenderer(layout_,getProfile)} + , rulerCanvas_{makeRenderer(layout_,getProfile), makeRenderer(layout_,getProfile)} + , mainCanvas_ {makeRenderer (layout_,getProfile), makeRenderer (layout_,getProfile)} { get_style_context()->add_class(CLASS_timeline); get_style_context()->add_class(CLASS_timeline_body); @@ -360,8 +360,7 @@ namespace timeline { // access and possible (re)establish the current "profile" of the tracks on demand... getProfile = [this]() -> TrackProfile& { - if (rootBody_ and isnil (profile_)) - rootBody_->establishTrackSpace (profile_); + maybeRebuildLayout(); return profile_; }; @@ -411,6 +410,23 @@ namespace timeline { } + /** + * Possibly (re)build the allocation and distribution of layout space. + * Check the internal trigger flag and recalculate the extension of relevant parts. + * @remark this function will be called on demand right before actual drawing. + */ + void + BodyCanvasWidget::maybeRebuildLayout() + { + if (rootBody_ and isnil (profile_)) + { + layout_.triggerDisplayEvaluation(); + rootBody_->establishTrackSpace (profile_); + } + } + + + TimelineCanvas::TimelineCanvas (_Renderer groundingFac, _Renderer overlayFac) diff --git a/src/stage/timeline/body-canvas-widget.hpp b/src/stage/timeline/body-canvas-widget.hpp index b40908051..d592094f1 100644 --- a/src/stage/timeline/body-canvas-widget.hpp +++ b/src/stage/timeline/body-canvas-widget.hpp @@ -135,6 +135,7 @@ namespace timeline { private:/* ===== Internals ===== */ void slotStructureChange() noexcept; + void maybeRebuildLayout(); }; diff --git a/src/stage/timeline/display-manager.hpp b/src/stage/timeline/display-manager.hpp index f61e959ac..95e95b2b8 100644 --- a/src/stage/timeline/display-manager.hpp +++ b/src/stage/timeline/display-manager.hpp @@ -115,6 +115,9 @@ namespace timeline { /** the overall horizontal pixel span to cover by this timeline */ virtual PixSpan getPixSpan() =0; + /** cause a re-allocation of the complete layout */ + virtual void triggerDisplayEvaluation() =0; + using SignalStructureChange = sigc::signal; /** diff --git a/src/stage/timeline/timeline-layout.cpp b/src/stage/timeline/timeline-layout.cpp index 097f52ea4..dadc28c1d 100644 --- a/src/stage/timeline/timeline-layout.cpp +++ b/src/stage/timeline/timeline-layout.cpp @@ -111,6 +111,16 @@ namespace timeline { } + /** + * Perform a complete recursive pass over all elements relevant for layout, + * reestablish size allocation and negotiate distribution of available space. + * @remark this is the entry point to the so called *display evaluation pass*. + */ + void + TimelineLayout::triggerDisplayEvaluation() + { + TODO ("actually visit all parts and negotiate the Layout"); + } diff --git a/src/stage/timeline/timeline-layout.hpp b/src/stage/timeline/timeline-layout.hpp index 7ad186864..73488c71c 100644 --- a/src/stage/timeline/timeline-layout.hpp +++ b/src/stage/timeline/timeline-layout.hpp @@ -130,6 +130,7 @@ namespace timeline { protected:/* ==== Interface: LayoutManager===== */ PixSpan getPixSpan() override; + void triggerDisplayEvaluation() override; private:/* ===== Internals ===== */ diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 11c045521..dcb92b637 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -16730,7 +16730,7 @@ - + @@ -19390,9 +19390,10 @@ - + + @@ -19401,12 +19402,207 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ Es ist sinnvoll, die Feststellung einer Änderung vom Berechnen der neuen Werte zu trennen. +

+

+ Die Notwendigkeit einer Neuberechnung wird also systematisch festgestellt, +

+

+ aber die tatsächliche Neuberechnung erfolgt erst spät, und bei Bedarf +

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

+ muß nach GTK's Behandlung gemacht werden +

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

+ Grundlagen müssen vor GTK's Behandlung erfolgen +

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

+ die Teilelements speichern ihren Wert +

+ + +
+
+ + + + + + +

+ Zeichencode verwendet diesen +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -19685,7 +19881,9 @@ - + + + @@ -21212,18 +21410,52 @@ - + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + - - + + + + + + @@ -21697,7 +21929,7 @@ - + @@ -21715,7 +21947,7 @@ - + @@ -21763,7 +21995,8 @@ - + + @@ -21795,9 +22028,15 @@ - - - + + + + + + + + + @@ -21813,8 +22052,8 @@ - - + + @@ -21992,8 +22231,8 @@ - - + + @@ -22130,8 +22369,8 @@ - - + + @@ -22155,10 +22394,21 @@ + + - + + + + + + + + + + @@ -22283,7 +22533,8 @@ - + + @@ -22554,12 +22805,12 @@ - - - + + + - - + + @@ -22578,9 +22829,55 @@ + + + + + + + +

+ falls inset, wird er nur innerhalb der border und über den Hintergrund gezeichnet +

+
    +
  • + nicht über die border selber +
  • +
  • + nicht über den Content +
  • +
+ + +
+ + +
+ + + + + + + + +

+ der GTK-Zeichencode achtet sogar explizit darauf, einen CSS-Effekt mit dem korrekten Mischmodus über den bereits auf den CairoCanvas gezeichneten Content zu legen +

+ + +
+
+
+ + + + + +
- + @@ -22707,7 +23004,7 @@ - + @@ -22794,7 +23091,7 @@
- + @@ -22838,14 +23135,14 @@ - - + + - + @@ -22861,7 +23158,7 @@ - + @@ -22927,7 +23224,7 @@ - + @@ -23153,11 +23450,58 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43894,7 +44238,7 @@ - + @@ -44791,7 +45135,8 @@ - + + @@ -46049,7 +46394,18 @@ - + + + + + + +

+ This function is only used by Gtk::Container subclasses, to assign a size, position and (optionally) baseline to their child widgets. +

+ + +