summaryrefslogtreecommitdiff
path: root/gtk2_ardour/cairo_widget.h
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/cairo_widget.h')
-rw-r--r--gtk2_ardour/cairo_widget.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk2_ardour/cairo_widget.h b/gtk2_ardour/cairo_widget.h
index 8665f66198..e368a21a03 100644
--- a/gtk2_ardour/cairo_widget.h
+++ b/gtk2_ardour/cairo_widget.h
@@ -35,14 +35,33 @@ public:
void set_dirty ();
+ /* widget states: unlike GTK, these OR-together so that
+ a widget can be both Active *and* Selected, rather than
+ each one being orthogonal.
+ */
+
+ enum State {
+ Active = 0x1,
+ Mid = 0x2,
+ Selected = 0x4,
+ Prelight = 0x8,
+ Insensitive = 0x10,
+ };
+
+ State state() const { return _state; }
+ virtual void set_state (State, bool);
+ sigc::signal<void> StateChanged;
+
protected:
/** Render the widget to the given Cairo context */
virtual void render (cairo_t *) = 0;
virtual bool on_expose_event (GdkEventExpose *);
void on_size_allocate (Gtk::Allocation &);
+ Gdk::Color get_parent_bg ();
int _width; ///< pixmap width
int _height; ///< pixmap height
+ State _state;
private:
bool _dirty; ///< true if the pixmap requires re-rendering