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)
5  2023, 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 
37 #ifndef STAGE_TIMELINE_STAVE_BRACKET_WIDGET_H
38 #define STAGE_TIMELINE_STAVE_BRACKET_WIDGET_H
39 
40 #include "stage/gtk-base.hpp"
41 
42 #include <vector>
43 
44 
45 namespace stage {
46 namespace timeline {
47 
48  using CairoC = PCairoContext const&;
49  using StyleC = PStyleContext const&;
50 
51 
59  : public Gtk::DrawingArea
60  {
61  using _Base = Gtk::DrawingArea;
62  std::vector<uint> connectors_;
63 
64  public:
67 
68  void clearConnectors();
69  void addConnector (uint offset);
70 
71  private:/* ===== Internals ===== */
72 
73  bool on_draw(CairoC cox) override;
74 
75  Gtk::SizeRequestMode get_request_mode_vfunc() const final;
76  void get_preferred_width_vfunc (int&, int&) const override;
77  void get_preferred_width_for_height_vfunc (int, int&,int&) const override;
78  };
79 
80 
81 
82  inline void
83  StaveBracketWidget::clearConnectors()
84  {
85  connectors_.clear();
86  }
87 
95  inline void
97  {
98  connectors_.emplace_back (offset);
99  }
100 
101 
102 }}// namespace stage::timeline
103 #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:37
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.