1 #ifndef __gtk_ardour_matrix_h__
2 #define __gtk_ardour_matrix_h__
9 #include <gtkmm/eventbox.h>
10 #include <gtkmm/widget.h>
12 #include "port_group.h"
16 OtherPort (const std::string& n, PortGroup& g)
17 : _name (n), _group (g) {}
19 std::string name() const { return _name; }
20 PortGroup& group() const { return _group; }
21 bool visible() const { return _group.visible; }
30 MatrixNode (std::string a, OtherPort o, int32_t x, int32_t y)
31 : _name (a), them (o), _connected (random()%3), _x(x), _y(y) {}
34 PortGroup& get_group() const { return them.group(); }
36 std::string our_name() const { return _name; }
37 std::string their_name() const { return them.name(); }
39 bool connected() const { return _connected; }
40 void set_connected (bool yn) { _connected = yn; }
41 int32_t x() const { return _x; }
42 int32_t y() const { return _y; }
52 class Matrix : public Gtk::EventBox
57 void set_ports (const std::list<std::string>&);
58 void add_group (PortGroup&);
59 void remove_group (PortGroup&);
60 void hide_group (PortGroup&);
61 void show_group (PortGroup&);
63 int row_spacing () const { return xstep; }
66 bool on_button_press_event (GdkEventButton* ev);
67 bool on_expose_event (GdkEventExpose* ev);
68 void on_size_allocate (Gtk::Allocation&);
69 void on_size_request (Gtk::Requisition*);
71 bool on_motion_notify_event (GdkEventMotion*);
72 bool on_leave_notify_event (GdkEventCrossing*);
74 MatrixNode* get_node (int32_t x, int32_t y);
94 std::list<std::string> ours;
95 std::list<OtherPort> others;
96 std::vector<MatrixNode*> nodes;
99 void redraw (GdkDrawable*, GdkRectangle*);
100 void alloc_pixmap ();
106 #endif /* __gtk_ardour_matrix_h__ */