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) Lumiera.org
5  2016, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
46 #ifndef STAGE_TIMELINE_TRACK_HEAD_WIDGET_H
47 #define STAGE_TIMELINE_TRACK_HEAD_WIDGET_H
48 
49 #include "stage/gtk-base.hpp"
50 #include "stage/ctrl/bus-term.hpp"
54 
55 
56 
57 
58 namespace stage {
59 namespace timeline {
60 
61  using ID = ctrl::BusTerm::ID;
62 
64  : public Gtk::Grid
65  {
66  Gtk::Label ctrlTODO_;
67 
68  public:
70  ~HeadControlArea();
71  };
72 
81  : public Gtk::Grid
82  , public model::ViewHook<TrackHeadWidget>
83  {
84  widget::ElementBoxWidget trackName_;
85  StaveBracketWidget structure_;
86  Gtk::Box padding_;
87  HeadControlArea headCtrl_;
88 
89  uint childCnt_;
90 
91  /* ==== Interface: ViewHook ===== */
92 
93  void hook (TrackHeadWidget&) override;
94  void remove (TrackHeadWidget&) override;
95  void rehook (TrackHeadWidget&) noexcept override;
96 
97  public:
99  ~TrackHeadWidget();
100 
101  void setTrackName (cuString&);
102 
103  uint getContentHeight() const;
104  uint getOverallHeight() const;
105 
106  void accommodateContentHeight(uint);
107  void accommodateOverallHeight(uint);
108  void syncSubtrackStartHeight (uint);
109 
110  private:/* ===== Internals ===== */
111 
113  void attachSubFork (TrackHeadWidget& subForkHead);
114  void detachSubFork (TrackHeadWidget& subForkHead);
115 
117  void clearFork();
118 
119  void linkSubTrackPositions (uint);
120 
122  uint getHeightAt (int left, int top) const;
123  void enforceHeightAt(int left, int top, uint height);
124 
125  uint getExpansionHeight() const { return getHeightAt (0,1); };
126  uint getSyncPadHeight() const { return getHeightAt (1,2); };
127  uint getLabelHeight() const { return getHeightAt (0,0); };
128 
129  void enforceContentHeight (uint h){ enforceHeightAt (1,1, h); }
130  void enforceSyncPadHeight (uint h){ enforceHeightAt (1,2, h); }
131  void enforceExpansionHeight(uint h){ enforceHeightAt (0,1, h); }
132  };
133 
134 
137  inline uint
139  {
140  return getHeightAt (1,1);
141  }
142 
143 
144 }}// namespace stage::timeline
145 #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:84
Allow widgets to connect to a common shared presentation context.
Attachment point to the UI-Bus.
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:46
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.