Lumiera  0.pre.03
»edit your freedom«
display-manager.hpp
Go to the documentation of this file.
1 /*
2  DISPLAY-MANAGER.hpp - abstraction to translate model structure and extension into screen layout
3 
4  Copyright (C) Lumiera.org
5  2018, 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 
79 #ifndef STAGE_TIMELINE_DISPLAY_MANAGER_H
80 #define STAGE_TIMELINE_DISPLAY_MANAGER_H
81 
82 
83 #include "lib/error.hpp"
84 #include "lib/nocopy.hpp"
87 #include "lib/util.hpp"
88 
89 #include <sigc++/signal.h>
90 
91 
92 
93 namespace stage {
94 namespace timeline {
95 
96  using util::max;
97 
99  class TrackHeadWidget;
100  class TrackBody;
101 
102 
116  {
117  public:
118  virtual ~DisplayViewHooks() { }
119 
120  virtual model::ViewHook<TrackHeadWidget>& getHeadHook() =0;
121  virtual model::ViewHook<TrackBody>& getBodyHook() =0;
122  virtual model::CanvasHook<Gtk::Widget>& getClipHook() =0;
123  };
124 
125 
126 
128  struct PixSpan
129  {
130  int b = 0;
131  int e = 0;
132 
133  PixSpan() { }
134  PixSpan(int begin, int end)
135  : b{begin}, e{max (begin,end)}
136  { }
137 
138  bool
139  empty() const
140  {
141  return e <= b;
142  }
143 
144  int
145  delta() const
146  {
147  return e - b;
148  }
149  };
150 
157  , public DisplayViewHooks
158  , public model::DisplayMetric
159  {
160 
161 
162  public:
163  virtual ~DisplayManager();
164 
166  virtual void triggerDisplayEvaluation() =0;
167 
168  using SignalStructureChange = sigc::signal<void>;
169 
177  SignalStructureChange signalStructureChange_;
178 
179 
181  PixSpan
183  {
184  return {translateTimeToPixels (coveredTime().start())
185  ,translateTimeToPixels (coveredTime().end())
186  };
187  }
188 
189 
190  private:/* ===== Internals ===== */
191 
192  };
193 
194 
195 }}// namespace stage::timeline
196 #endif /*STAGE_TIMELINE_DISPLAY_MANAGER_H*/
PixSpan getPixSpan()
the overall horizontal pixel span to cover by this timeline
SignalStructureChange signalStructureChange_
signal to be invoked whenever the virtual structure of the corresponding timeline changes...
Mix-in interface to allow for concrete CanvasHooked widgets to adapt themselves to the metric current...
Definition: canvas-hook.hpp:82
Any copy and copy construction prohibited.
Definition: nocopy.hpp:46
Allow widgets to connect to a common shared presentation context.
virtual ~DisplayViewHooks()
this is an interface
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Specialised (abstracted) presentation context with positioning by coordinates.
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:46
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Interface: a compound of anchoring facilities.
Lumiera error handling (C++ interface).
basic constant internal time value.
Definition: timevalue.hpp:142
Interface for coordination of the overall timeline display.