Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / synfigstudio_0_61_04 / synfig-studio / src / gtkmm / toolbox.h
1 /*! ========================================================================
2 ** Synfig
3 ** Template Header File
4 ** $Id: toolbox.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
5 **
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 **
18 ** === N O T E S ===========================================================
19 **
20 ** ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SYNFIG_GTKMM_TOOLBOX_H
25 #define __SYNFIG_GTKMM_TOOLBOX_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include <gtkmm/window.h>
30 #include <gtkmm/tooltips.h>
31 #include <gtkmm/button.h>
32 #include <gtkmm/togglebutton.h>
33 #include <gtkmm/menu.h>
34 #include <gtkmm/table.h>
35 #include <synfig/string.h>
36 #include "smach.h"
37 #include <map>
38 #include "dialogsettings.h"
39
40 /* === M A C R O S ========================================================= */
41
42 /* === T Y P E D E F S ===================================================== */
43
44 /* === C L A S S E S & S T R U C T S ======================================= */
45
46 namespace studio {
47
48 class Dockable;
49 class StateManager;
50         
51 class Toolbox : public Gtk::Window
52 {
53         friend class studio::StateManager;
54         
55         DialogSettings dialog_settings;
56
57         Gtk::Tooltips tooltips;
58         Gtk::Button *button_undo;
59         Gtk::Button *button_redo;
60
61         Gtk::Button *button_eyedrop;
62         Gtk::Button *button_rotoscope;
63         Gtk::Button *button_rotoscope_bline;
64         Gtk::Button *button_rotoscope_polygon;
65         
66         Gtk::Table *tool_table;
67
68         std::map<synfig::String,Gtk::ToggleButton *> state_button_map;
69         
70         Gtk::Menu       *recent_files_menu;
71
72         Gtk::Menu       *dock_dialogs;
73
74         bool changing_state_;
75         
76         void on_recent_files_changed(); 
77         void on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time);
78
79         void change_state_(const Smach::state_base *state);
80         
81 public:
82
83         void change_state(const synfig::String& statename);
84
85         void update_undo_redo();
86
87         void refresh() { update_undo_redo(); }
88
89         void set_active_state(const synfig::String& statename);
90
91         void add_state(const Smach::state_base *state);
92
93         
94         void dockable_registered(Dockable* x);
95         
96         Toolbox();
97         virtual ~Toolbox();
98         
99 };
100
101 }; // END of namespace studio
102
103 /* === E N D =============================================================== */
104
105 #endif