fix incorrect accumulation of export video options each time the dialog is used
[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/colorbutton.h>
24 #include <gtkmm/colorselection.h>
25
26 #include "ardour/stripable.h"
27
28 class StripableColorDialog : public Gtk::ColorSelectionDialog
29 {
30 public:
31         StripableColorDialog ();
32         ~StripableColorDialog ();
33         void reset ();
34         void popup (boost::shared_ptr<ARDOUR::Stripable> s);
35         void popup (const std::string&, uint32_t);
36         sigc::signal<void, uint32_t> ColorChanged;
37
38 private:
39         void initialize_color_palette ();
40         void finish_color_edit (int response);
41         void color_changed ();
42
43         boost::shared_ptr<ARDOUR::Stripable> _stripable;
44         ARDOUR::PresentationInfo::color_t _initial_color;
45
46         sigc::connection _color_changed_connection;
47
48
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;
52 };
53
54 class ArdourColorButton : public Gtk::ColorButton
55 {
56 public:
57         ArdourColorButton ();
58
59 protected:
60         void on_clicked();
61         void color_selected (uint32_t color);
62
63 private:
64         StripableColorDialog _color_picker;
65 };
66
67 #endif