d05d67e974f6e37a56985db7682cf221730053db
[ardour.git] / gtk2_ardour / stripable_colorpicker.h
1 /*
2  * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
3  *
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.
8  *
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.
13  *
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.
17  */
18
19 #ifndef __gtkardour_stripable_colorpicker_h__
20 #define __gtkardour_stripable_colorpicker_h__
21
22 #include <boost/shared_ptr.hpp>
23 #include <gtkmm/colorselection.h>
24 #include "ardour/stripable.h"
25
26 class StripableColorDialog : public Gtk::ColorSelectionDialog
27 {
28 public:
29         StripableColorDialog ();
30         ~StripableColorDialog ();
31         void reset ();
32         void popup (boost::shared_ptr<ARDOUR::Stripable> s);
33
34 private:
35         void initialize_color_palette ();
36         void finish_color_edit (int response);
37
38         boost::shared_ptr<ARDOUR::Stripable> _stripable;
39
40
41         static bool palette_initialized;
42         static void palette_changed_hook (const Glib::RefPtr<Gdk::Screen>&, const Gdk::ArrayHandle_Color&);
43         static Gtk::ColorSelection::SlotChangePaletteHook gtk_palette_changed_hook;
44 };
45
46 #endif