Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / synfigstudio_0_61_07_rc3 / src / gtkmm / toolbox.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file toolbox.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_GTKMM_TOOLBOX_H
28 #define __SYNFIG_GTKMM_TOOLBOX_H
29
30 /* === H E A D E R S ======================================================= */
31
32 #include <gtkmm/window.h>
33 #include <gtkmm/tooltips.h>
34 #include <gtkmm/button.h>
35 #include <gtkmm/togglebutton.h>
36 #include <gtkmm/menu.h>
37 #include <gtkmm/table.h>
38 #include <synfig/string.h>
39 #include "smach.h"
40 #include <map>
41 #include "dialogsettings.h"
42
43 /* === M A C R O S ========================================================= */
44
45 /* === T Y P E D E F S ===================================================== */
46
47 /* === C L A S S E S & S T R U C T S ======================================= */
48
49 namespace studio {
50
51 class Dockable;
52 class StateManager;
53
54 class Toolbox : public Gtk::Window
55 {
56         friend class studio::StateManager;
57
58         DialogSettings dialog_settings;
59
60         Gtk::Tooltips tooltips;
61         Gtk::Button *button_undo;
62         Gtk::Button *button_redo;
63
64         Gtk::Table *tool_table;
65
66         std::map<synfig::String,Gtk::ToggleButton *> state_button_map;
67
68         Gtk::Menu       *recent_files_menu;
69
70         Gtk::Menu       *dock_dialogs;
71
72         bool changing_state_;
73
74         void on_recent_files_changed();
75         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);
76
77         void change_state_(const Smach::state_base *state);
78
79 public:
80
81         void change_state(const synfig::String& statename);
82
83         void update_undo_redo();
84
85         void refresh() { update_undo_redo(); }
86
87         void set_active_state(const synfig::String& statename);
88
89         void add_state(const Smach::state_base *state);
90
91
92         void dockable_registered(Dockable* x);
93
94         Toolbox();
95         virtual ~Toolbox();
96
97 };
98
99 }; // END of namespace studio
100
101 /* === E N D =============================================================== */
102
103 #endif