#include <gtkmm/eventbox.h>
class PortMatrixBody;
+class PortMatrixNode;
/** One component of the PortMatrix. This is a cairo-rendered
* Pixmap.
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 ();
_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;
return 8;
}
+ static uint32_t mouseover_line_width () {
+ return 4;
+ }
+
/** @return angle of column labels, in radians */
static double angle () {
return M_PI / 4;
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) {
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