diff --git a/src/lib/verb-token.hpp b/src/lib/verb-token.hpp index bd8b509a7..4a7eb0521 100644 --- a/src/lib/verb-token.hpp +++ b/src/lib/verb-token.hpp @@ -81,8 +81,10 @@ namespace lib { template class VerbToken { + public: typedef RET (REC::*Handler) (ARGS...); + private: Handler handler_; Literal token_; diff --git a/src/stage/timeline/body-canvas-widget.hpp b/src/stage/timeline/body-canvas-widget.hpp index b8925e51e..b24b193d4 100644 --- a/src/stage/timeline/body-canvas-widget.hpp +++ b/src/stage/timeline/body-canvas-widget.hpp @@ -58,10 +58,11 @@ #define STAGE_TIMELINE_BODY_CANVAS_WIDGET_H #include "stage/gtk-base.hpp" +#include "stage/timeline/track-profile.hpp" //#include "lib/util.hpp" -#include +//#include //#include @@ -69,18 +70,15 @@ namespace stage { namespace timeline { - class TrackProfile; class TrackBody; class TimelineCanvas : public Gtk::Layout { - using TProfile = std::unique_ptr; - public: TrackBody* rootBody_; - TProfile profile_; + TrackProfile profile_; TimelineCanvas(); diff --git a/src/stage/timeline/track-body.hpp b/src/stage/timeline/track-body.hpp index 1efa69f2f..dfae724cb 100644 --- a/src/stage/timeline/track-body.hpp +++ b/src/stage/timeline/track-body.hpp @@ -41,7 +41,6 @@ #define STAGE_TIMELINE_TRACK_BODY_H #include "stage/gtk-base.hpp" -#include "stage/timeline/track-profile.hpp" #include "stage/timeline/ruler-track.hpp" //#include "lib/util.hpp" diff --git a/src/stage/timeline/track-profile.hpp b/src/stage/timeline/track-profile.hpp index dca5c322e..8cd50f52b 100644 --- a/src/stage/timeline/track-profile.hpp +++ b/src/stage/timeline/track-profile.hpp @@ -41,7 +41,8 @@ #include "stage/gtk-base.hpp" #include "lib/verb-token.hpp" -//#include "lib/util.hpp" +#include "lib/symbol.hpp" +#include "lib/util.hpp" //#include #include @@ -51,6 +52,21 @@ namespace stage { namespace timeline { + using lib::Literal; + + class ProfileInterpreter + { + public: + ~ProfileInterpreter() { } ///< this is an interface + + virtual void ruler(uint h) =0; ///< represent a overview/ruler track with the given height + virtual void gap(uint h) =0; ///< represent a gap to structure the display + virtual void content(uint h) =0; ///< represent a content area with the given vertical extension + virtual void open(uint n) =0; ///< indicate entering a nested structure, typically as 3D inset (`n` is always 1) + virtual void close(uint n) =0; ///< indicate the end of `n` nested structures, typically by ascending back `n` levels + virtual void prelude(uint f) =0; ///< start rack presentation at top of the timeline, with `f` pinned (always visible) elements + virtual void coda(uint pad) =0; ///< the closing part of the timeline at the bottom of the track display, with `pad` additional padding + }; /** * Description of the structure and arrangement of tracks for display in the UI. @@ -61,13 +77,44 @@ namespace timeline { * we let the individual TrackBody elements just emit these structure description. * @todo WIP-WIP as of 4/2019 */ - class TrackProfile + struct TrackProfile { + using SlopeVerb = lib::VerbToken; + using SlopeElm = std::tuple; + using Elements = std::vector; + + Elements elements; + + // default constructible, standard copy operations + + explicit + operator bool() const + { + return not util::isnil (elements); + } + + private:/* ===== Internals: handling tokens ===== */ + void + append (SlopeVerb::Handler handler, Literal token, uint param) + { + elements.emplace_back (SlopeVerb{handler, token}, param); + } + +#define TOKEN_BUILDER(_TOK_) \ + void \ + append_ ## _TOK_ (uint param)\ + { \ + this->append (&ProfileInterpreter::_TOK_, STRINGIFY(_TOK_), param);\ + } public: - - - private:/* ===== Internals ===== */ + TOKEN_BUILDER (ruler) + TOKEN_BUILDER (gap) + TOKEN_BUILDER (content) + TOKEN_BUILDER (open) + TOKEN_BUILDER (close) + TOKEN_BUILDER (prelude) + TOKEN_BUILDER (coda) }; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 7bba4b305..a707825ad 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -19693,12 +19693,22 @@ - - - - - - + + + + + + + + + + + + + + + + @@ -19728,8 +19738,13 @@ - - + + + + + + +