Prefer testing the session instead of using a global variable
[ardour.git] / gtk2_ardour / stripable_colorpicker.h
index 79b7ffcf622922378e7259b96b745736237da806..4af5bbd7e1dcabe5e51c24e84ad75e5306f97fa1 100644 (file)
@@ -20,7 +20,9 @@
 #define __gtkardour_stripable_colorpicker_h__
 
 #include <boost/shared_ptr.hpp>
+#include <gtkmm/colorbutton.h>
 #include <gtkmm/colorselection.h>
+
 #include "ardour/stripable.h"
 
 class StripableColorDialog : public Gtk::ColorSelectionDialog
@@ -30,11 +32,36 @@ public:
        ~StripableColorDialog ();
        void reset ();
        void popup (boost::shared_ptr<ARDOUR::Stripable> s);
+       void popup (const std::string&, uint32_t);
+       sigc::signal<void, uint32_t> ColorChanged;
 
 private:
+       void initialize_color_palette ();
        void finish_color_edit (int response);
+       void color_changed ();
 
        boost::shared_ptr<ARDOUR::Stripable> _stripable;
+       ARDOUR::PresentationInfo::color_t _initial_color;
+
+       sigc::connection _color_changed_connection;
+
+
+       static bool palette_initialized;
+       static void palette_changed_hook (const Glib::RefPtr<Gdk::Screen>&, const Gdk::ArrayHandle_Color&);
+       static Gtk::ColorSelection::SlotChangePaletteHook gtk_palette_changed_hook;
+};
+
+class ArdourColorButton : public Gtk::ColorButton
+{
+public:
+       ArdourColorButton ();
+
+protected:
+       void on_clicked();
+       void color_selected (uint32_t color);
+
+private:
+       StripableColorDialog _color_picker;
 };
 
 #endif