diff options
author | Carl Hetherington <carl@carlh.net> | 2009-01-27 04:21:13 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-01-27 04:21:13 +0000 |
commit | 9cc7b452ebb8fe8f348ad6aad18054703700da18 (patch) | |
tree | a54d33c5f608b321823665baec607ee4f83d5f70 /gtk2_ardour/port_matrix_component.h | |
parent | 7e1b86aceeef477e13b4c35f524034d909acd92c (diff) |
First cut at mouseovers for the port matrix.
git-svn-id: svn://localhost/ardour2/branches/3.0@4446 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_matrix_component.h')
-rw-r--r-- | gtk2_ardour/port_matrix_component.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gtk2_ardour/port_matrix_component.h b/gtk2_ardour/port_matrix_component.h index cc0f082695..7531e44bdd 100644 --- a/gtk2_ardour/port_matrix_component.h +++ b/gtk2_ardour/port_matrix_component.h @@ -23,6 +23,7 @@ #include <gtkmm/eventbox.h> class PortMatrixBody; +class PortMatrixNode; /** One component of the PortMatrix. This is a cairo-rendered * Pixmap. @@ -33,6 +34,13 @@ public: PortMatrixComponent (PortMatrixBody *); virtual ~PortMatrixComponent (); + virtual double component_to_parent_x (double x) const = 0; + virtual double parent_to_component_x (double x) const = 0; + virtual double component_to_parent_y (double y) const = 0; + virtual double parent_to_component_y (double y) const = 0; + virtual void mouseover_changed (PortMatrixNode const &) = 0; + virtual void draw_extra (cairo_t *) = 0; + void setup (); GdkPixmap* get_pixmap (GdkDrawable *); std::pair<uint32_t, uint32_t> dimensions (); @@ -46,6 +54,14 @@ public: _render_required = true; } + void set_parent_rectangle (Gdk::Rectangle const & r) { + _parent_rectangle = r; + } + + Gdk::Rectangle parent_rectangle () const { + return _parent_rectangle; + } + /** @return width of columns in the grid */ static uint32_t column_width () { return 32; @@ -83,6 +99,10 @@ protected: return 8; } + static uint32_t mouseover_line_width () { + return 4; + } + /** @return angle of column labels, in radians */ static double angle () { return M_PI / 4; @@ -115,6 +135,16 @@ protected: return Gdk::Color ("#cccccc"); } + /** @return colour to paint mouseover lines */ + static Gdk::Color mouseover_line_colour () { + return Gdk::Color ("#ff0000"); + } + + /** @return colour to paint mouseover lines */ + static Gdk::Color mouseover_port_colour () { + return Gdk::Color ("#777777"); + } + /* XXX */ static Gdk::Color get_a_bundle_colour (int x) { if ((x % 2) == 0) { @@ -147,6 +177,7 @@ protected: PortMatrixBody* _body; ///< the PortMatrixBody that we're in uint32_t _width; ///< full width of the contents uint32_t _height; ///< full height of the contents + Gdk::Rectangle _parent_rectangle; private: GdkPixmap* _pixmap; ///< pixmap |