Lumiera  0.pre.03
»edit your freedom«
track-body.hpp
Go to the documentation of this file.
1 /*
2  TRACK-BODY.hpp - track body area within the timeline display canvas
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 
31 #ifndef STAGE_TIMELINE_TRACK_BODY_H
32 #define STAGE_TIMELINE_TRACK_BODY_H
33 
34 #include "stage/gtk-base.hpp"
38 
39 
40 #include <memory>
41 #include <vector>
42 #include <array>
43 
44 
45 
46 namespace stage {
47 namespace timeline {
48 
49  class TrackPresenter;
50  class TrackProfile;
51 
52 
61  struct Decoration
62  {
63  uint content = 0;
64  uint ruler = 0;
65  uint topMar = 0;
66  uint botMar = 0;
67  uint trackPad = 0;
68 
69  using Borders = std::array<uint, 6>;
70  Borders borders{0,0,0,0,0,0};
71  };
72 
73 
86  class TrackBody
87  : public model::ViewHook<TrackBody>
88  {
89  uint contentHeight_;
90  uint contentOffset_;
91  uint startLine_;
92 
93  using PRuler = std::unique_ptr<RulerTrack>;
94  using Rulers = std::vector<PRuler>;
95 
96  using SubTracks = std::vector<TrackBody*>;
97 
98  SubTracks subTracks_;
99  Rulers rulers_;
100 
101  public:
103 
104  TrackBody();
105  ~TrackBody();
106 
107  void setTrackName (cuString&);
108  uint establishTrackSpace (TrackProfile&);
109  void accommodateContentHeight(uint contentExtension);
110 
112  uint getContentOffsetY() const { return startLine_ + contentOffset_; }
113 
114  uint calcHeight() const;
115  uint calcRulerHeight() const;
116  uint calcContentHeight() const;
117  uint calcSubtrackHeight() const;
118 
119  DisplayManager::SignalStructureChange signalStructureChange_;
120 
121 
122  /* ==== Interface: ViewHook ===== */
123 
124  void hook (TrackBody&) override;
125  void remove (TrackBody&) override;
126  void rehook (TrackBody&) noexcept override;
127 
128  /* ===== Internals ===== */
139  Rulers&
141  {
142  return rulers_;
143  }
144 
145  };
146 
147 
148 }}// namespace stage::timeline
149 #endif /*STAGE_TIMELINE_TRACK_BODY_H*/
static Decoration decoration
storage for common style/padding settings
Definition: track-body.hpp:102
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.
Borders borders
width of up to 6 levels of combined upward slope borders (defined in CSS)
Definition: track-body.hpp:70
Abstraction: service for the widgets to translate themselves into screen layout.
Description of the structure and arrangement of tracks for display in the UI.
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:37
Helper to organise and draw the space allocated for a fork of sub-tracks.
Definition: track-body.hpp:86
Configure additional vertical padding for the decorations added through CSS.
Definition: track-body.hpp:61
uint getContentOffsetY() const
Definition: track-body.hpp:112
Timeline presentation helper to organise drawing of the overview rulers.
A set of basic GTK includes for the UI.