Added missing '\endlegal'.
[synfig.git] / synfig-studio / trunk / src / gtkmm / compview.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file compview.h
3 **      \brief Header File
4 **
5 **      \legal
6 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
7 **
8 **      This package is free software; you can redistribute it and/or
9 **      modify it under the terms of the GNU General Public License as
10 **      published by the Free Software Foundation; either version 2 of
11 **      the License, or (at your option) any later version.
12 **
13 **      This package is distributed in the hope that it will be useful,
14 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
15 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 **      General Public License for more details.
17 **      \endlegal
18 **
19 ** === N O T E S ===========================================================
20 **
21 ** ========================================================================= */
22
23 /* === S T A R T =========================================================== */
24
25 #ifndef __SYNFIG_COMPVIEW_H
26 #define __SYNFIG_COMPVIEW_H
27
28 /* === H E A D E R S ======================================================= */
29
30 #include <gtkmm/window.h>
31 #include <gtkmm/image.h>
32 #include <gtkmm/tooltips.h>
33 #include <gtkmm/table.h>
34 #include <gtkmm/button.h>
35 #include <gtkmm/menu.h>
36 #include <gtkmm/optionmenu.h>
37 #include <gtkmm/notebook.h>
38 #include <gtkmm/treeview.h>
39 #include <gtkmm/box.h>
40
41 #include <ETL/handle>
42
43 #include "dialogsettings.h"
44
45 /* === M A C R O S ========================================================= */
46
47 /* === T Y P E D E F S ===================================================== */
48
49 /* === C L A S S E S & S T R U C T S ======================================= */
50
51 namespace synfig { class Canvas; };
52
53 namespace studio {
54
55 class Instance;
56 class CanvasView;
57
58 class CompView : public Gtk::Window
59 {
60         DialogSettings dialog_settings;
61
62         Gtk::Tooltips tooltips;
63
64         Gtk::OptionMenu *instance_selector;
65         Gtk::Notebook *notebook;
66
67         Gtk::TreeView *canvas_tree;
68         Gtk::TreeView *action_tree;
69
70         Gtk::Menu       instance_list_menu;
71         Gtk::Menu       menu;
72
73         etl::loose_handle<studio::Instance>     selected_instance;
74
75         void set_selected_instance_(etl::handle<studio::Instance> x);
76
77         void clear_history();
78         void clear_redo();
79
80 public:
81         CompView();
82         ~CompView();
83
84         etl::loose_handle<studio::Instance> get_selected_instance() { return selected_instance; }
85
86         etl::loose_handle<synfig::Canvas> get_selected_canvas();
87
88         etl::loose_handle<studio::CanvasView> get_selected_canvas_view();
89
90         void set_selected_instance(etl::loose_handle<studio::Instance> x);
91
92         void set_selected_instance_signal(etl::handle<studio::Instance> x);
93
94         void new_instance(etl::handle<studio::Instance> x);
95
96         void delete_instance(etl::handle<studio::Instance> x);
97
98         void refresh_instances();
99
100         bool close();
101
102 private:
103
104         Gtk::Widget* create_canvas_tree();
105         Gtk::Widget* create_action_tree();
106         Gtk::Widget* create_instance_selector();
107
108         void on_row_activate(const Gtk::TreeModel::Path &path, Gtk::TreeViewColumn *);
109         bool on_tree_event(GdkEvent *event);
110
111         bool on_action_event(GdkEvent *event);
112
113         void init_menu();
114
115         void menu_new_canvas();
116         void menu_delete();
117         void menu_rename();
118
119         void on_action_toggle(const Glib::ustring& path);
120 };
121
122 };
123
124 /* === E N D =============================================================== */
125
126 #endif