ardour
port_matrix_body.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2009 Paul Davis
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18 */
19 
20 #ifndef __gtk_ardour_port_matrix_body_h__
21 #define __gtk_ardour_port_matrix_body_h__
22 
23 #include <gtkmm/eventbox.h>
24 #include "port_group.h"
25 #include "port_matrix_types.h"
26 
27 class PortMatrix;
30 class PortMatrixGrid;
32 
36 class PortMatrixBody : public Gtk::EventBox
37 {
38 public:
40  ~PortMatrixBody ();
41 
42  void setup ();
43 
44  uint32_t full_scroll_width ();
45  uint32_t alloc_scroll_width ();
46  uint32_t full_scroll_height ();
47  uint32_t alloc_scroll_height ();
48 
49  uint32_t xoffset () const {
50  return _xoffset;
51  }
52  void set_xoffset (uint32_t);
53  uint32_t yoffset () const {
54  return _yoffset;
55  }
56  void set_yoffset (uint32_t);
57 
58  void rebuild_and_draw_grid ();
59 
60  void set_mouseover (PortMatrixNode const &);
61  void set_mouseover (std::list<PortMatrixNode> const &);
62  std::list<PortMatrixNode> mouseover () const {
63  return _mouseover;
64  }
65 
67  void component_size_changed ();
68  std::pair<uint32_t, uint32_t> max_size () const;
69 
70  uint32_t column_labels_border_x () const;
71  uint32_t column_labels_height () const;
72 
73  sigc::signal<void> DimensionsChanged;
74 
75 protected:
76  bool on_expose_event (GdkEventExpose *);
77  void on_size_request (Gtk::Requisition *);
78  void on_size_allocate (Gtk::Allocation &);
79  bool on_button_press_event (GdkEventButton *);
80  bool on_button_release_event (GdkEventButton *);
81  bool on_leave_notify_event (GdkEventCrossing *);
82  bool on_motion_notify_event (GdkEventMotion *);
83 
84 private:
85  void compute_rectangles ();
88  void update_bundles ();
89  void set_cairo_clip (cairo_t *, Gdk::Rectangle const &) const;
90 
95  std::list<PortMatrixComponent*> _components;
96 
97  uint32_t _alloc_width;
98  uint32_t _alloc_height;
99  uint32_t _xoffset;
100  uint32_t _yoffset;
103 
104  std::list<PortMatrixNode> _mouseover;
106 
108 };
109 
110 #endif
uint32_t _alloc_width
allocated width
void set_xoffset(uint32_t)
bool on_motion_notify_event(GdkEventMotion *)
bool on_button_press_event(GdkEventButton *)
PortMatrix * _matrix
uint32_t xoffset() const
uint32_t full_scroll_width()
PortMatrixBody(PortMatrix *)
std::list< PortMatrixNode > mouseover() const
uint32_t column_labels_border_x() const
std::list< PortMatrixComponent * > _components
uint32_t _column_labels_height
std::pair< uint32_t, uint32_t > max_size() const
void on_size_allocate(Gtk::Allocation &)
void rebuild_and_draw_grid()
PortMatrixColumnLabels * _column_labels
PortMatrixRowLabels * _row_labels
void rebuild_and_draw_column_labels()
std::list< PortMatrixNode > _mouseover
void rebuild_and_draw_row_labels()
uint32_t _alloc_height
allocated height
uint32_t yoffset() const
bool on_leave_notify_event(GdkEventCrossing *)
uint32_t full_scroll_height()
PBD::ScopedConnectionList _bundle_connections
sigc::signal< void > DimensionsChanged
void set_cairo_clip(cairo_t *, Gdk::Rectangle const &) const
void highlight_associated_channels(int, ARDOUR::BundleChannel)
void set_yoffset(uint32_t)
bool on_button_release_event(GdkEventButton *)
PortMatrixGrid * _grid
void on_size_request(Gtk::Requisition *)
void set_mouseover(PortMatrixNode const &)
uint32_t _column_labels_border_x
void component_size_changed()
bool on_expose_event(GdkEventExpose *)
bool _ignore_component_size_changed
void update_bundles()
uint32_t column_labels_height() const
uint32_t alloc_scroll_height()
uint32_t alloc_scroll_width()