41 _column_labels_border_x (0),
42 _column_labels_height (0),
43 _ignore_component_size_changed (false)
53 add_events (Gdk::LEAVE_NOTIFY_MASK | Gdk::POINTER_MOTION_MASK);
74 cairo_t* cr = gdk_cairo_create (get_window()->gobj());
76 cairo_set_source_rgb (cr, 0, 0, 0);
82 t =
_(
"There are no ports to connect.");
87 cairo_text_extents_t ext;
88 cairo_text_extents (cr, t.c_str(), &ext);
90 cairo_set_source_rgb (cr, 1, 1, 1);
92 cairo_show_text (cr, t.c_str ());
99 Gdk::Rectangle
const exposure (
100 event->area.x, event->area.y, event->area.width, event->area.height
107 Gdk::Rectangle r = exposure;
111 GdkPixmap* p = (*i)->get_pixmap (get_window()->gobj());
112 r.intersect ((*i)->parent_rectangle(), intersects);
117 get_window()->gobj(),
118 get_style()->get_fg_gc (Gtk::STATE_NORMAL)->gobj(),
120 (*i)->parent_to_component_x (r.get_x()),
121 (*i)->parent_to_component_y (r.get_y()),
131 cairo_t* cr = gdk_cairo_create (get_window()->gobj());
136 (*i)->draw_extra (cr);
152 if (grid.first == 0 && grid.second == 0) {
163 int const min_width = 512;
164 int const min_height = 512;
166 req->width = min (min_width, max (col.first, grid.first + row.first));
173 Gtk::EventBox::on_size_allocate (alloc);
191 Gdk::Rectangle col_rect;
192 Gdk::Rectangle row_rect;
193 Gdk::Rectangle grid_rect;
205 col_rect.set_height (y);
218 grid_rect.set_width (x);
226 row_rect.set_height (std::min (
_alloc_height - col_rect.get_height(), row.second));
229 row_rect.set_y (
_alloc_height - row_rect.get_height() - col_rect.get_height());
232 grid_rect.set_x (row_rect.get_width());
233 grid_rect.set_y (
_alloc_height - row_rect.get_height() - col_rect.get_height());
234 grid_rect.set_width (std::min (
_alloc_width - row_rect.get_width(), grid.first));
235 grid_rect.set_height (row_rect.get_height ());
237 col_rect.set_width (grid_rect.get_width () + col_overhang);
238 col_rect.set_x (row_rect.get_width() + grid_rect.get_width() - col_rect.get_width());
263 for (PortGroup::BundleList::iterator i = r.begin(); i != r.end(); ++i) {
272 for (PortGroup::BundleList::iterator i = c.begin(); i != c.end(); ++i) {
333 if (Gdk::Region ((*i)->parent_rectangle()).point_in (ev->x, ev->y)) {
335 (*i)->parent_to_component_x (ev->x),
336 (*i)->parent_to_component_y (ev->y),
349 if (Gdk::Region ((*i)->parent_rectangle()).point_in (ev->x, ev->y)) {
350 (*i)->button_release (
351 (*i)->parent_to_component_x (ev->x),
352 (*i)->parent_to_component_y (ev->y),
356 (*i)->button_release (
390 if (ev->type == GDK_LEAVE_NOTIFY) {
403 if (Gdk::Region ((*i)->parent_rectangle()).point_in (ev->x, ev->y)) {
405 (*i)->parent_to_component_x (ev->x),
406 (*i)->parent_to_component_y (ev->y)
424 list<PortMatrixNode> m;
451 (*i)->mouseover_changed (old);
473 for (PortGroup::BundleList::const_iterator i = b.begin(); i != b.end(); ++i) {
474 for (uint32_t j = 0; j < (*i)->bundle->nchannels().n_total(); ++j) {
500 cairo_rectangle (cr, r.get_x(), r.get_y(), r.get_width(), r.get_height());
515 pair<uint32_t, uint32_t>
522 return make_pair (std::max (row.first,
_column_labels->
overhang()) + grid.first, col.second + grid.second);
uint32_t _alloc_width
allocated width
void compute_rectangles()
void add_channel_highlight(ARDOUR::BundleChannel const &)
const char * to_i18n_string() const
void set_xoffset(uint32_t)
the ports are not associated
void clear_channel_highlights()
bool on_motion_notify_event(GdkEventMotion *)
bool on_button_press_event(GdkEventButton *)
std::list< BundleRecord * > BundleList
uint32_t full_scroll_width()
PortMatrixBody(PortMatrix *)
bool should_show(ARDOUR::DataType) 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
ARDOUR::BundleChannel row
column labels on top, row labels to the right
void on_size_allocate(Gtk::Allocation &)
void rebuild_and_draw_grid()
PortMatrixNode::State get_association(PortMatrixNode) const
PortMatrixColumnLabels * _column_labels
PortMatrixRowLabels * _row_labels
Gdk::Rectangle parent_rectangle() const
void rebuild_and_draw_column_labels()
std::list< PortMatrixNode > _mouseover
void rebuild_and_draw_row_labels()
uint32_t _alloc_height
allocated height
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
std::pair< uint32_t, uint32_t > dimensions()
void highlight_associated_channels(int, ARDOUR::BundleChannel)
void set_yoffset(uint32_t)
bool on_button_release_event(GdkEventButton *)
row labels to the left, column labels on the bottom
ARDOUR::BundleChannel column
ARDOUR::DataType type() const
void on_size_request(Gtk::Requisition *)
void set_mouseover(PortMatrixNode const &)
void set_parent_rectangle(Gdk::Rectangle const &r)
uint32_t _column_labels_border_x
boost::shared_ptr< const PortGroup > visible_ports(int d) const
void component_size_changed()
bool on_expose_event(GdkEventExpose *)
int min_height_divisor() const
boost::shared_ptr< const PortGroup > visible_columns() const
bool _ignore_component_size_changed
uint32_t overhang() const
boost::shared_ptr< const PortGroup > visible_rows() const
uint32_t column_labels_height() const
static bool bundle_with_channels(boost::shared_ptr< ARDOUR::Bundle >)
Arrangement arrangement() const
uint32_t alloc_scroll_height()
std::string string_compose(const std::string &fmt, const T1 &o1)
uint32_t alloc_scroll_width()