Lumiera  0.pre.03
»edit your freedom«
stave-bracket-widget.hpp
Go to the documentation of this file.
1 /*
2  STAVE-BRACKET-WIDGET.hpp - draw connector to indicate nested track structure
3 
4  Copyright (C) Lumiera.org
5  2023, 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_STAVE_BRACKET_WIDGET_H
47 #define STAGE_TIMELINE_STAVE_BRACKET_WIDGET_H
48 
49 #include "stage/gtk-base.hpp"
50 
51 #include <vector>
52 
53 
54 namespace stage {
55 namespace timeline {
56 
57  using CairoC = PCairoContext const&;
58  using StyleC = PStyleContext const&;
59 
60 
68  : public Gtk::DrawingArea
69  {
70  using _Base = Gtk::DrawingArea;
71  std::vector<uint> connectors_;
72 
73  public:
76 
77  void clearConnectors();
78  void addConnector (uint offset);
79 
80  private:/* ===== Internals ===== */
81 
82  bool on_draw(CairoC cox) override;
83 
84  Gtk::SizeRequestMode get_request_mode_vfunc() const final;
85  void get_preferred_width_vfunc (int&, int&) const override;
86  void get_preferred_width_for_height_vfunc (int, int&,int&) const override;
87  };
88 
89 
90 
91  inline void
92  StaveBracketWidget::clearConnectors()
93  {
94  connectors_.clear();
95  }
96 
104  inline void
106  {
107  connectors_.emplace_back (offset);
108  }
109 
110 
111 }}// namespace stage::timeline
112 #endif /*STAGE_TIMELINE_STAVE_BRACKET_WIDGET_H*/
bool on_draw(CairoC cox) override
Custom drawing: a »stave bracket« to indicate track scope.
void get_preferred_width_for_height_vfunc(int, int &, int &) const override
The structural outline adapts flexible in vertical direction, but requires a proportional horizontal ...
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...
Gtk::SizeRequestMode get_request_mode_vfunc() const final
indicate layout oriented towards vertical extension
A set of basic GTK includes for the UI.
void addConnector(uint offset)
Request to draw a connector to the nested sub-Track&#39;s stave bracket.