2 * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef __gtkardour_stripable_colorpicker_h__
20 #define __gtkardour_stripable_colorpicker_h__
22 #include <boost/shared_ptr.hpp>
23 #include <gtkmm/colorbutton.h>
24 #include <gtkmm/colorselection.h>
26 #include "ardour/stripable.h"
28 class StripableColorDialog : public Gtk::ColorSelectionDialog
31 StripableColorDialog ();
32 ~StripableColorDialog ();
34 void popup (boost::shared_ptr<ARDOUR::Stripable> s);
35 void popup (const std::string&, uint32_t);
36 sigc::signal<void, uint32_t> ColorChanged;
39 void initialize_color_palette ();
40 void finish_color_edit (int response);
41 void color_changed ();
43 boost::shared_ptr<ARDOUR::Stripable> _stripable;
44 ARDOUR::PresentationInfo::color_t _initial_color;
46 sigc::connection _color_changed_connection;
49 static bool palette_initialized;
50 static void palette_changed_hook (const Glib::RefPtr<Gdk::Screen>&, const Gdk::ArrayHandle_Color&);
51 static Gtk::ColorSelection::SlotChangePaletteHook gtk_palette_changed_hook;
54 class ArdourColorButton : public Gtk::ColorButton
61 void color_selected (uint32_t color);
64 StripableColorDialog _color_picker;