Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / 0.61.09 / 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 // uncomment to enable the blend method selector in the tool options
46 // panel for the circle and gradient tools
47 //
48 // #define BLEND_METHOD_IN_TOOL_OPTIONS
49
50 /* === T Y P E D E F S ===================================================== */
51
52 /* === C L A S S E S & S T R U C T S ======================================= */
53
54 namespace studio {
55
56 class Dockable;
57 class StateManager;
58
59 class Toolbox : public Gtk::Window
60 {
61         friend class studio::StateManager;
62
63         DialogSettings dialog_settings;
64
65         Gtk::Tooltips tooltips;
66         Gtk::Button *button_undo;
67         Gtk::Button *button_redo;
68
69         Gtk::Table *tool_table;
70
71         std::map<synfig::String,Gtk::ToggleButton *> state_button_map;
72
73         Gtk::Menu       *recent_files_menu;
74
75         Gtk::Menu       *dock_dialogs;
76
77         bool changing_state_;
78
79         void on_recent_files_changed();
80         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);
81
82         void change_state_(const Smach::state_base *state);
83
84 public:
85
86         void change_state(const synfig::String& statename);
87
88         void update_undo_redo();
89
90         void refresh() { update_undo_redo(); }
91
92         void set_active_state(const synfig::String& statename);
93
94         void add_state(const Smach::state_base *state);
95
96
97         void dockable_registered(Dockable* x);
98
99         Toolbox();
100         virtual ~Toolbox();
101
102 };
103
104 }; // END of namespace studio
105
106 /* === E N D =============================================================== */
107
108 #endif