Ardour  9.0-pre0-582-g084a23a80d
stripable_colorpicker.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (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 along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #pragma once
20 
21 #include <memory>
22 
23 #include <gtkmm/colorbutton.h>
24 #include <gtkmm/colorselection.h>
25 
26 #include "ardour/stripable.h"
27 
29 {
30 public:
33  void reset ();
34  void popup (std::shared_ptr<ARDOUR::Stripable> s);
35  void popup (const std::string&, uint32_t);
36  sigc::signal<void, uint32_t> ColorChanged;
37 
38 private:
41  void color_changed ();
42 
43  std::shared_ptr<ARDOUR::Stripable> _stripable;
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&);
52 };
53 
55 {
56 public:
58 
59 protected:
60  void on_clicked();
61  void color_selected (uint32_t color);
62 
63 private:
65 };
66 
void on_clicked()
This is a default handler for the signal signal_clicked().
StripableColorDialog _color_picker
void color_selected(uint32_t color)
sigc::slot< void, const Glib::RefPtr< Gdk::Screen > &, const Gdk::ArrayHandle_Color & > SlotChangePaletteHook
void response(int response_id)
std::shared_ptr< ARDOUR::Stripable > _stripable
void popup(std::shared_ptr< ARDOUR::Stripable > s)
sigc::signal< void, uint32_t > ColorChanged
sigc::connection _color_changed_connection
static Gtk::ColorSelection::SlotChangePaletteHook gtk_palette_changed_hook
ARDOUR::PresentationInfo::color_t _initial_color
void finish_color_edit(int response)
static void palette_changed_hook(const Glib::RefPtr< Gdk::Screen > &, const Gdk::ArrayHandle_Color &)
void popup(const std::string &, uint32_t)
void initialize_color_palette()
PBD::PropertyDescriptor< uint32_t > color
Glib::ArrayHandle< Color, ColorTraits > ArrayHandle_Color
Definition: color.h:242