use ArdourButton for the (radio) buttons in the monitor section; fix ArdourButton...
[ardour.git] / gtk2_ardour / ardour_button.h
index ee3fd086d1310b63f472c09c1f58400884ca54aa..f13a36835eb5d1e9c18e63be33a513114c47a863 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef __gtk2_ardour_ardour_button_h__
 #define __gtk2_ardour_ardour_button_h__
 
+#include <list>
 #include <stdint.h>
 
 #include <gtkmm/action.h>
@@ -37,7 +38,6 @@ class ArdourButton : public CairoWidget
                Body = 0x2,
                Text = 0x4,
                Indicator = 0x8,
-               Image = 0x16
        };
        
        static Element default_elements;
@@ -45,8 +45,12 @@ class ArdourButton : public CairoWidget
        static Element just_led_default_elements;
 
        ArdourButton (Element e = default_elements);
+       ArdourButton (const std::string&, Element e = default_elements);
        virtual ~ArdourButton ();
 
+       void set_active_state (Gtkmm2ext::ActiveState);
+       void set_visual_state (Gtkmm2ext::VisualState);
+
        void set_elements (Element);
        Element elements() const { return _elements; }
 
@@ -67,12 +71,15 @@ class ArdourButton : public CairoWidget
 
        void set_related_action (Glib::RefPtr<Gtk::Action>);
 
+       bool on_button_press_event (GdkEventButton*);
+       bool on_button_release_event (GdkEventButton*);
+
+       void set_image (const Glib::RefPtr<Gdk::Pixbuf>&);
+
   protected:
        void render (cairo_t *);
        void on_size_request (Gtk::Requisition* req);
        void on_size_allocate (Gtk::Allocation&);
-       bool on_button_press_event (GdkEventButton*);
-       bool on_button_release_event (GdkEventButton*);
        void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
 
         void controllable_changed ();
@@ -80,6 +87,7 @@ class ArdourButton : public CairoWidget
 
   private:
        Glib::RefPtr<Pango::Layout> _layout;
+       Glib::RefPtr<Gdk::Pixbuf>   _pixbuf;
        std::string                 _text;
        Element                     _elements;
        BindingProxy binding_proxy;
@@ -113,7 +121,6 @@ class ArdourButton : public CairoWidget
        void setup_led_rect ();
        void set_colors ();
        void color_handler ();
-       void state_handler ();
 
        Glib::RefPtr<Gtk::Action> _action;
        void action_activated ();