Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / synfigstudio_0_61_07_rc2 / src / gtkmm / compview.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file compview.h
3 **      \brief Header File
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 ** === N O T E S ===========================================================
22 **
23 ** ========================================================================= */
24
25 /* === S T A R T =========================================================== */
26
27 #ifndef __SYNFIG_COMPVIEW_H
28 #define __SYNFIG_COMPVIEW_H
29
30 /* === H E A D E R S ======================================================= */
31
32 #include <gtkmm/window.h>
33 #include <gtkmm/image.h>
34 #include <gtkmm/tooltips.h>
35 #include <gtkmm/table.h>
36 #include <gtkmm/button.h>
37 #include <gtkmm/menu.h>
38 #include <gtkmm/optionmenu.h>
39 #include <gtkmm/notebook.h>
40 #include <gtkmm/treeview.h>
41 #include <gtkmm/box.h>
42
43 #include <ETL/handle>
44
45 #include "dialogsettings.h"
46
47 /* === M A C R O S ========================================================= */
48
49 /* === T Y P E D E F S ===================================================== */
50
51 /* === C L A S S E S & S T R U C T S ======================================= */
52
53 namespace synfig { class Canvas; };
54
55 namespace studio {
56
57 class Instance;
58 class CanvasView;
59
60 class CompView : public Gtk::Window
61 {
62         DialogSettings dialog_settings;
63
64         Gtk::Tooltips tooltips;
65
66         Gtk::OptionMenu *instance_selector;
67         Gtk::Notebook *notebook;
68
69         Gtk::TreeView *canvas_tree;
70         Gtk::TreeView *action_tree;
71
72         Gtk::Menu       instance_list_menu;
73         Gtk::Menu       menu;
74
75         etl::loose_handle<studio::Instance>     selected_instance;
76
77         void set_selected_instance_(etl::handle<studio::Instance> x);
78
79         void clear_history();
80         void clear_redo();
81
82 public:
83         CompView();
84         ~CompView();
85
86         etl::loose_handle<studio::Instance> get_selected_instance() { return selected_instance; }
87
88         etl::loose_handle<synfig::Canvas> get_selected_canvas();
89
90         etl::loose_handle<studio::CanvasView> get_selected_canvas_view();
91
92         void set_selected_instance(etl::loose_handle<studio::Instance> x);
93
94         void set_selected_instance_signal(etl::handle<studio::Instance> x);
95
96         void new_instance(etl::handle<studio::Instance> x);
97
98         void delete_instance(etl::handle<studio::Instance> x);
99
100         void refresh_instances();
101
102         bool close();
103
104 private:
105
106         Gtk::Widget* create_canvas_tree();
107         Gtk::Widget* create_action_tree();
108         Gtk::Widget* create_instance_selector();
109
110         void on_row_activate(const Gtk::TreeModel::Path &path, Gtk::TreeViewColumn *);
111         bool on_tree_event(GdkEvent *event);
112
113         bool on_action_event(GdkEvent *event);
114
115         void init_menu();
116
117         void menu_new_canvas();
118         void menu_delete();
119         void menu_rename();
120
121         void on_action_toggle(const Glib::ustring& path);
122 };
123
124 };
125
126 /* === E N D =============================================================== */
127
128 #endif