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)
5  2018, 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 
70 #ifndef STAGE_TIMELINE_DISPLAY_MANAGER_H
71 #define STAGE_TIMELINE_DISPLAY_MANAGER_H
72 
73 
74 #include "lib/error.hpp"
75 #include "lib/nocopy.hpp"
78 #include "lib/util.hpp"
79 
80 #include <sigc++/signal.h>
81 
82 
83 
84 namespace stage {
85 namespace timeline {
86 
87  using util::max;
88 
90  class TrackHeadWidget;
91  class TrackBody;
92 
93 
107  {
108  public:
109  virtual ~DisplayViewHooks() { }
110 
111  virtual model::ViewHook<TrackHeadWidget>& getHeadHook() =0;
112  virtual model::ViewHook<TrackBody>& getBodyHook() =0;
113  virtual model::CanvasHook<Gtk::Widget>& getClipHook() =0;
114  };
115 
116 
117 
119  struct PixSpan
120  {
121  int b = 0;
122  int e = 0;
123 
124  PixSpan() { }
125  PixSpan(int begin, int end)
126  : b{begin}, e{max (begin,end)}
127  { }
128 
129  bool
130  empty() const
131  {
132  return e <= b;
133  }
134 
135  int
136  delta() const
137  {
138  return e - b;
139  }
140  };
141 
148  , public DisplayViewHooks
149  , public model::DisplayMetric
150  {
151 
152 
153  public:
154  virtual ~DisplayManager();
155 
157  virtual void triggerDisplayEvaluation() =0;
158 
159  using SignalStructureChange = sigc::signal<void>;
160 
168  SignalStructureChange signalStructureChange_;
169 
170 
172  PixSpan
174  {
175  return {translateTimeToPixels (coveredTime().start())
176  ,translateTimeToPixels (coveredTime().end())
177  };
178  }
179 
180 
181  private:/* ===== Internals ===== */
182 
183  };
184 
185 
186 }}// namespace stage::timeline
187 #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:73
Any copy and copy construction prohibited.
Definition: nocopy.hpp:37
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:37
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:133
Interface for coordination of the overall timeline display.