diff --git a/src/stage/model/canvas-hook.hpp b/src/stage/model/canvas-hook.hpp index 242d4b206..a082527ac 100644 --- a/src/stage/model/canvas-hook.hpp +++ b/src/stage/model/canvas-hook.hpp @@ -63,6 +63,7 @@ namespace stage { namespace model { using lib::time::Time; + using lib::time::TimeValue; @@ -117,9 +118,8 @@ namespace model { return hookedAt (translateTimeToPixels (start), downshift); } - protected: /** extension point for time axis zoom management. */ - virtual int translateTimeToPixels (Time) const =0; + virtual int translateTimeToPixels (TimeValue) const =0; }; diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp index 2a463403c..6b2c66e4a 100644 --- a/src/stage/timeline/body-canvas-widget.cpp +++ b/src/stage/timeline/body-canvas-widget.cpp @@ -64,6 +64,7 @@ //using util::_Fmt; +using lib::time::Time; using util::max; using util::isnil; //using util::contains; @@ -576,7 +577,7 @@ namespace timeline { } int - BodyCanvasWidget::translateTimeToPixels (Time startTimePoint) const + BodyCanvasWidget::translateTimeToPixels (TimeValue startTimePoint) const { return _raw(startTimePoint) * TODO_px_per_second / Time::SCALE; //////////TICKET #1213 : delegate zoom handling to the display manager (field #layout_) !! } diff --git a/src/stage/timeline/body-canvas-widget.hpp b/src/stage/timeline/body-canvas-widget.hpp index 037786b83..1cdf468ef 100644 --- a/src/stage/timeline/body-canvas-widget.hpp +++ b/src/stage/timeline/body-canvas-widget.hpp @@ -90,7 +90,7 @@ namespace stage { namespace timeline { - using lib::time::Time; + using lib::time::TimeValue; using CairoC = Cairo::RefPtr const&; @@ -177,7 +177,7 @@ namespace timeline { void move (Gtk::Widget&, int xPos, int yPos) override; void remove (Gtk::Widget&) override; - int translateTimeToPixels (Time) const override; + int translateTimeToPixels (TimeValue) const override; protected: /* ==== Interface: LayoutElement ===== */ diff --git a/src/stage/timeline/clip-widget.cpp b/src/stage/timeline/clip-widget.cpp index eecce3027..6c0cd42ba 100644 --- a/src/stage/timeline/clip-widget.cpp +++ b/src/stage/timeline/clip-widget.cpp @@ -152,8 +152,7 @@ namespace timeline { TimeVar start_; TimeVar len_; - /* === Partial implementation of ClipDelegate === */ - + public: /* === Partial implementation of ClipDelegate === */ Time getStartTime() const override { @@ -318,6 +317,13 @@ namespace timeline { return HookedWidget::getCanvas(); } + void + changeTiming (TimeSpan changedTimings) override + { + ClipData::changeTiming (changedTimings); + establishHorizontalExtension(); + } + void updatePosition() override { @@ -325,12 +331,34 @@ namespace timeline { this->moveTo (nominalPos.x, nominalPos.y); } + /* ==== Size and Layout handling ==== */ + + /** */ + void + establishHorizontalExtension() + { + int hSize = getCanvas().translateTimeToPixels (getLen()); + set_size_request (hSize, -1); + queue_resize(); + } + + /** @todo preliminary / draft of a clip widget, just using a Gtk::Button. + * @note Gtk assumes no fixed size, but a size negotiation. + */ + Gtk::SizeRequestMode + get_request_mode_vfunc() const override + { + return Gtk::SizeRequestMode::SIZE_REQUEST_CONSTANT_SIZE; +// return Gtk::SizeRequestMode::SIZE_REQUEST_HEIGHT_FOR_WIDTH; + } + public: ClipWidget(WidgetHook::Pos hookPoint, TimeSpan const& timings, uString clipName) : HookedWidget{hookPoint, clipName} , ClipData{timings} { + establishHorizontalExtension(); show_all(); } @@ -339,6 +367,7 @@ namespace timeline { : HookedWidget{existing.establishHookPoint(newView), existing.getClipName()} , ClipData{std::move (existing)} { + establishHorizontalExtension(); show_all(); } }; diff --git a/src/stage/timeline/display-manager.hpp b/src/stage/timeline/display-manager.hpp index 7eaff13aa..fcb39add0 100644 --- a/src/stage/timeline/display-manager.hpp +++ b/src/stage/timeline/display-manager.hpp @@ -87,7 +87,7 @@ namespace timeline { using util::max; - using lib::time::Time; + using lib::time::TimeValue; class TrackHeadWidget; class TrackBody; @@ -136,9 +136,9 @@ namespace timeline { /** delegating default implementation for timeline zoom */ int - translateTimeToPixels (Time startTimePoint) const override + translateTimeToPixels (TimeValue startTimePoint) const override { - return refHook_.hookedAt(startTimePoint).x; + return refHook_.translateTimeToPixels (startTimePoint); } public: diff --git a/src/steam/mobject/session/dummy-session-connection.cpp b/src/steam/mobject/session/dummy-session-connection.cpp index ef222a503..265449b5b 100644 --- a/src/steam/mobject/session/dummy-session-connection.cpp +++ b/src/steam/mobject/session/dummy-session-connection.cpp @@ -182,7 +182,7 @@ namespace session { , emu (clip1) , mut (clip2) , ins (makeName(clip2)) - , ins (defineTiming(Time{FSecs{5}}, Duration{FSecs{2}})) + , ins (defineTiming(Time{FSecs{5}}, Duration{FSecs{1,2}})) , emu (clip2) , emu (forkRoot) , emu (timeline) diff --git a/tests/stage/model/canvas-hook-test.cpp b/tests/stage/model/canvas-hook-test.cpp index 47326f6d8..66b93ca7a 100644 --- a/tests/stage/model/canvas-hook-test.cpp +++ b/tests/stage/model/canvas-hook-test.cpp @@ -152,7 +152,7 @@ namespace test { protected: int - translateTimeToPixels (Time) const override + translateTimeToPixels (TimeValue) const override { NOTREACHED ("Time to pixel translation not covered in this unit test"); return -1; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 70c5079c6..f06e8e659 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -12619,7 +12619,7 @@ - + @@ -23513,7 +23513,7 @@ - + @@ -28577,6 +28577,19 @@ + + + + + + +

+ ...für eine zentrale Schaltstelle und Verteiler.
Denn nur der DisplayFrame ist hinreichend loka und dennoch erreichbar +

+ +
+
+ @@ -28592,7 +28605,7 @@ - +
@@ -28687,10 +28700,14 @@ + + + + - - + + @@ -29562,8 +29579,8 @@ - - + + @@ -29592,8 +29609,101 @@ - - + + + + + + + + + + + + + +

+ ...das ist eine grundlegende Design-Enscheidung (und zwar eine Gute), aber in der Praxis muß es natürlich trotzdem einen Weg geben, nur ist der dann relativ indirekt und auch nicht wirklich dokumentiert +

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

+ Ich will nicht, daß der DisplayManager zu bedeutend wird, weil dann eine direkte Manipulation einzelner Widgets durch den DisplayManager als die "einfachste" und "natürlichste" Lösung erscheinen könnte. Dagegen wehre ich mich, weil es zu einer starken Kopplung führt. +

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

+ es gibt bereits einen Sündenfall, nämlich im RelativeCanvasHook: der muß delegieren, und daher von außen diese Methode aufrufen +

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

+ Das ist eine Konsequenz aus dem Design des Diff-Framework; genauer, aus der konkreten Form, die die Implementierung des Diff-Framework bekommen hat: Und zwar, daß ein generischer Container gebunden wird. Das bedeutet, daß die Elemente im Container wie Werte behandelt werden. Und deshalb müssen sich Widgets selbständig vom Canvas abmelden. Die Alternative dazu wäre, daß der Parent den Diff interpretiert, und seine Kinder direkt manipuliert. Dann wären diese Kinder aber auch Widgets, und nicht nochmal indirekt als Presenter angebunden. Könnte man machen, habe ich aber ein mulmiges Gefühl. Da nehme ich dann doch lieber ein smart-Handle und einen Back-Pointer in Kauf. +

+ +
+
+ + + +
+
+ + + + + + + + + + +
+
@@ -31698,7 +31808,7 @@ - + @@ -53547,6 +53657,36 @@ + + + + + + + + + + + + + + + + + + + + + +

+ in dem Widget, das diesen Aufruf empfängt, wird der Margin abgezogen, und nur dieser reduzierte Wert wird im Widget selber als Allocation gespeichert +

+ +
+
+
+
+
@@ -53559,7 +53699,7 @@ - +