1 /* === S Y N F I G ========================================================= */
2 /*!	\file trees/layergrouptree.h
3 **	\brief Template Header
4 **
5 **	$Id$
6 **
7 **	\legal
8 **	Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **
10 **	This package is free software; you can redistribute it and/or
11 **	modify it under the terms of the GNU General Public License as
12 **	published by the Free Software Foundation; either version 2 of
13 **	the License, or (at your option) any later version.
14 **
15 **	This package is distributed in the hope that it will be useful,
16 **	but WITHOUT ANY WARRANTY; without even the implied warranty of
17 **	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 **	General Public License for more details.
19 **	\endlegal
20 */
21 /* ========================================================================= */
22 
23 /* === S T A R T =========================================================== */
24 
25 #ifndef __SYNFIG_STUDIO_LAYERGROUPTREE_H
26 #define __SYNFIG_STUDIO_LAYERGROUPTREE_H
27 
28 /* === H E A D E R S ======================================================= */
29 
30 #include <gtkmm/treeview.h>
31 #include <gtkmm/treestore.h>
32 #include <synfigapp/canvasinterface.h>
33 #include <synfigapp/value_desc.h>
34 #include "trees/layergrouptreestore.h"
35 
36 /* === M A C R O S ========================================================= */
37 
38 /* === T Y P E D E F S ===================================================== */
39 
40 /* === C L A S S E S & S T R U C T S ======================================= */
41 
42 namespace synfig { class Layer; }
43 
44 namespace studio {
45 
46 class LayerGroupTree : public Gtk::TreeView
47 {
48 	/*
49  -- ** -- P U B L I C   T Y P E S ---------------------------------------------
50 	*/
51 
52 public:
53 
54 	typedef std::list<synfig::Layer::Handle> LayerList;
55 
56 	/*
57  -- ** -- P U B L I C  D A T A ------------------------------------------------
58 	*/
59 
60 public:
61 
62 	LayerGroupTreeStore::Model model;
63 
64 	/*
65  -- ** -- P R I V A T E   D A T A ---------------------------------------------
66 	*/
67 
68 private:
69 
70 	Glib::RefPtr<LayerGroupTreeStore> layer_group_tree_store_;
71 
72 	// Gtk::CellRendererText *cell_renderer_description; // seems to be unused
73 
74 	bool editable_;
75 
76 
77 	sigc::signal<void,etl::handle<synfig::Layer> > signal_popup_layer_menu_;
78 
79 	/*
80  -- ** -- P R I V A T E   M E T H O D S ---------------------------------------
81 	*/
82 
83 private:
84 
85 	/*
86  -- ** -- S I G N A L   T E R M I N A L S -------------------------------------
87 	*/
88 
89 private:
90 
91 	bool on_event(GdkEvent *event);
92 	void on_toggle(const Glib::ustring& path_string);
93 	void on_layer_renamed(const Glib::ustring&path_string,const Glib::ustring& value);
94 
95 	/*
96  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
97 	*/
98 
99 public:
100 
101 	LayerGroupTree();
102 	~LayerGroupTree();
103 
get_model()104 	Glib::RefPtr<LayerGroupTreeStore> get_model() { return layer_group_tree_store_; }
105 
signal_popup_layer_menu()106 	sigc::signal<void,etl::handle<synfig::Layer> >& signal_popup_layer_menu() { return signal_popup_layer_menu_; }
107 
108 //	sigc::signal<void,LayerList>& signal_select_layers() { return signal_select_layers_; }
109 
110 	void set_model(Glib::RefPtr<LayerGroupTreeStore> layer_group_tree_store_);
111 
112 	void set_editable(bool x=true);
113 
get_editable()114 	bool get_editable()const { return editable_; }
115 
116 	std::list<synfig::String> get_selected_groups()const;
117 
118 	LayerList get_selected_layers()const;
119 }; // END of LayerGroupTree
120 
121 }; // END of namespace studio
122 
123 /* === E N D =============================================================== */
124 
125 #endif
126