Lumiera  0.pre.03
»edit your freedom«
track-head-widget.hpp
Go to the documentation of this file.
1 /*
2  TRACK-HEAD-WIDGET.hpp - display of track heads within the timeline
3 
4  Copyright (C)
5  2016, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
14 
37 #ifndef STAGE_TIMELINE_TRACK_HEAD_WIDGET_H
38 #define STAGE_TIMELINE_TRACK_HEAD_WIDGET_H
39 
40 #include "stage/gtk-base.hpp"
41 #include "stage/ctrl/bus-term.hpp"
45 
46 
47 
48 
49 namespace stage {
50 namespace timeline {
51 
52  using ID = ctrl::BusTerm::ID;
53 
55  : public Gtk::Grid
56  {
57  Gtk::Label ctrlTODO_;
58 
59  public:
61  ~HeadControlArea();
62  };
63 
72  : public Gtk::Grid
73  , public model::ViewHook<TrackHeadWidget>
74  {
75  widget::ElementBoxWidget trackName_;
76  StaveBracketWidget structure_;
77  Gtk::Box padding_;
78  HeadControlArea headCtrl_;
79 
80  uint childCnt_;
81 
82  /* ==== Interface: ViewHook ===== */
83 
84  void hook (TrackHeadWidget&) override;
85  void remove (TrackHeadWidget&) override;
86  void rehook (TrackHeadWidget&) noexcept override;
87 
88  public:
90  ~TrackHeadWidget();
91 
92  void setTrackName (cuString&);
93 
94  uint getContentHeight() const;
95  uint getOverallHeight() const;
96 
97  void accommodateContentHeight(uint);
98  void accommodateOverallHeight(uint);
99  void syncSubtrackStartHeight (uint);
100 
101  private:/* ===== Internals ===== */
102 
104  void attachSubFork (TrackHeadWidget& subForkHead);
105  void detachSubFork (TrackHeadWidget& subForkHead);
106 
108  void clearFork();
109 
110  void linkSubTrackPositions (uint);
111 
113  uint getHeightAt (int left, int top) const;
114  void enforceHeightAt(int left, int top, uint height);
115 
116  uint getExpansionHeight() const { return getHeightAt (0,1); };
117  uint getSyncPadHeight() const { return getHeightAt (1,2); };
118  uint getLabelHeight() const { return getHeightAt (0,0); };
119 
120  void enforceContentHeight (uint h){ enforceHeightAt (1,1, h); }
121  void enforceSyncPadHeight (uint h){ enforceHeightAt (1,2, h); }
122  void enforceExpansionHeight(uint h){ enforceHeightAt (0,1, h); }
123  };
124 
125 
128  inline uint
130  {
131  return getHeightAt (1,1);
132  }
133 
134 
135 }}// namespace stage::timeline
136 #endif /*STAGE_TIMELINE_TRACK_HEAD_WIDGET_H*/
Header pane control area corresponding to a Track with nested child Tracks.
Widget to group tracks visually in the Timeline presentation.
A basic building block of the Lumiera UI.
Widget to render an ID label with associated icon.
Interface to represent _"some presentation layout entity",_ with the ability to attach widgets (manag...
Definition: view-hook.hpp:75
Allow widgets to connect to a common shared presentation context.
Attachment point to the UI-Bus.
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:37
Helper widget to handle display of the structure of track nesting in the timeline header pane...
A set of basic GTK includes for the UI.