summaryrefslogtreecommitdiff
path: root/gtk2_ardour/color_manager.h
blob: 39e072ab7b640eac1cd9353e196345fbbc6284b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef __ardour_gtk_color_manager_h__
#define __ardour_gtk_color_manager_h__

#include <gtkmm/treeview.h>
#include <gtkmm/liststore.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/colorselection.h>
#include "ardour_dialog.h"
#include "color.h"

class ColorManager : public ArdourDialog
{
  public:
	ColorManager();
	~ColorManager();

	int load (std::string path);
	int save (std::string path);

  private:
	struct ColorDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
	    ColorDisplayModelColumns() { 
		    add (name);
		    add (color);
		    add (gdkcolor);
		    add (id);
		    add (rgba);
	    }
	    
	    Gtk::TreeModelColumn<Glib::ustring>  name;
	    Gtk::TreeModelColumn<Glib::ustring>  color;
	    Gtk::TreeModelColumn<Gdk::Color>     gdkcolor;
	    Gtk::TreeModelColumn<ColorID> id;
	    Gtk::TreeModelColumn<uint32_t>       rgba;
	};

	ColorDisplayModelColumns columns;
	Gtk::TreeView color_display;
	Glib::RefPtr<Gtk::ListStore> color_list;
	Gtk::ColorSelectionDialog color_dialog;
	Gtk::ScrolledWindow scroller;

	bool button_press_event (GdkEventButton*);
};


#endif /* __ardour_gtk_color_manager_h__ */