Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / 0.61.08 / src / gtkmm / layergrouptree.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file 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 "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;
73
74         bool editable_;
75
76
77         sigc::signal<void,etl::handle<synfig::Layer> > signal_popup_layer_menu_;
78
79 //      sigc::signal<void,LayerList> signal_select_layers_;
80         Gtk::TreeView::Column* label_column;
81
82         /*
83  -- ** -- P R I V A T E   M E T H O D S ---------------------------------------
84         */
85
86 private:
87
88         /*
89  -- ** -- S I G N A L   T E R M I N A L S -------------------------------------
90         */
91
92 private:
93
94         bool on_event(GdkEvent *event);
95
96         /*
97  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
98         */
99
100 public:
101
102         LayerGroupTree();
103         ~LayerGroupTree();
104         void set_cursor(const Gtk::TreeModel::Path& path, bool start_editing=false);
105
106         Glib::RefPtr<LayerGroupTreeStore> get_model() { return layer_group_tree_store_; }
107
108         sigc::signal<void,etl::handle<synfig::Layer> >& signal_popup_layer_menu() { return signal_popup_layer_menu_; }
109
110 //      sigc::signal<void,LayerList>& signal_select_layers() { return signal_select_layers_; }
111
112         void set_model(Glib::RefPtr<LayerGroupTreeStore> layer_group_tree_store_);
113
114         void set_editable(bool x=true);
115
116         bool get_editable()const { return editable_; }
117
118         std::list<synfig::String> get_selected_groups()const;
119
120         LayerList get_selected_layers()const;
121 }; // END of LayerGroupTree
122
123 }; // END of namespace studio
124
125 /* === E N D =============================================================== */
126
127 #endif