X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fport_matrix_component.h;h=0b472e157ddc48fb57efa111de14260455aa34da;hb=c8c6bca6587450ff64303dbc994a4cd28d6ce7aa;hp=d28299b8efd2ef432689979651565a8759141e49;hpb=be40312e01ea36e1aaa86cae8551e42353849bc2;p=ardour.git diff --git a/gtk2_ardour/port_matrix_component.h b/gtk2_ardour/port_matrix_component.h index d28299b8ef..0b472e157d 100644 --- a/gtk2_ardour/port_matrix_component.h +++ b/gtk2_ardour/port_matrix_component.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2009 Paul Davis + Copyright (C) 2002-2009 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,10 +22,18 @@ #include #include +#include class PortMatrix; class PortMatrixBody; class PortMatrixNode; +class PortGroup; +class PortGroupList; + +namespace ARDOUR { + class Bundle; + class BundleChannel; +} /** One component of the PortMatrix. This is a cairo-rendered * Pixmap. @@ -40,8 +48,11 @@ public: 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 mouseover_changed (std::list const &) = 0; virtual void draw_extra (cairo_t *) = 0; + virtual void button_press (double, double, GdkEventButton *) {} + virtual void button_release (double, double, GdkEventButton *) {} + virtual void motion (double, double) {} void set_show_ports (bool); void setup (); @@ -51,7 +62,7 @@ public: void require_render () { _render_required = true; } - + void require_rebuild () { _dimension_computation_required = true; _render_required = true; @@ -65,14 +76,9 @@ public: return _parent_rectangle; } - /** @return width of columns in the grid */ - static uint32_t column_width () { - return 32; - } - - /** @return height of rows in the grid */ - static uint32_t row_height () { - return 32; + /** @return grid spacing */ + static uint32_t grid_spacing () { + return 24; } protected: @@ -99,7 +105,7 @@ protected: /** @return space around the connection indicator */ static uint32_t connection_indicator_pad () { - return 8; + return 6; } static uint32_t mouseover_line_width () { @@ -132,7 +138,7 @@ protected: } /** @return colour to paint grid squares when they can't be associated */ - static Gdk::Color unknown_colour () { + static Gdk::Color non_connectable_colour () { return Gdk::Color ("#cccccc"); } @@ -149,9 +155,9 @@ protected: /* XXX */ static Gdk::Color get_a_bundle_colour (int x) { if ((x % 2) == 0) { - return Gdk::Color ("#547027"); + return Gdk::Color ("#555555"); } else { - return Gdk::Color ("#3552a6"); + return Gdk::Color ("#666666"); } } @@ -163,9 +169,12 @@ protected: return Gdk::Color ("#444444"); } } - + void set_source_rgb (cairo_t *, Gdk::Color const &); void set_source_rgba (cairo_t *, Gdk::Color const &, double); + uint32_t group_size (boost::shared_ptr) const; + uint32_t channel_to_position (ARDOUR::BundleChannel, boost::shared_ptr) const; + virtual ARDOUR::BundleChannel position_to_channel (double, double, boost::shared_ptr) const; /** Render the complete component to a cairo context. */ virtual void render (cairo_t *) = 0; @@ -180,7 +189,7 @@ protected: uint32_t _height; ///< full height of the contents Gdk::Rectangle _parent_rectangle; -private: +private: GdkPixmap* _pixmap; ///< pixmap bool _render_required; ///< true if the rendered pixmap is out of date bool _dimension_computation_required; ///< true if the dimensions are out of date