my log
[synfig.git] / synfig-studio / trunk / 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 Robert B. Quattlebaum Jr.
7 **
8 ** This software and associated documentation
9 ** are CONFIDENTIAL and PROPRIETARY property of
10 ** the above-mentioned copyright holder.
11 **
12 ** You may not copy, print, publish, or in any
13 ** other way distribute this software without
14 ** a prior written agreement with
15 ** the copyright holder.
16 **
17 ** === N O T E S ===========================================================
18 **
19 ** ========================================================================= */
20
21 /* === S T A R T =========================================================== */
22
23 #ifndef __SYNFIG_GTKMM_TOOLBOX_H
24 #define __SYNFIG_GTKMM_TOOLBOX_H
25
26 /* === H E A D E R S ======================================================= */
27
28 #include <gtkmm/window.h>
29 #include <gtkmm/tooltips.h>
30 #include <gtkmm/button.h>
31 #include <gtkmm/togglebutton.h>
32 #include <gtkmm/menu.h>
33 #include <gtkmm/table.h>
34 #include <synfig/string.h>
35 #include "smach.h"
36 #include <map>
37 #include "dialogsettings.h"
38
39 /* === M A C R O S ========================================================= */
40
41 /* === T Y P E D E F S ===================================================== */
42
43 /* === C L A S S E S & S T R U C T S ======================================= */
44
45 namespace studio {
46
47 class Dockable;
48 class StateManager;
49         
50 class Toolbox : public Gtk::Window
51 {
52         friend class studio::StateManager;
53         
54         DialogSettings dialog_settings;
55
56         Gtk::Tooltips tooltips;
57         Gtk::Button *button_undo;
58         Gtk::Button *button_redo;
59
60         Gtk::Button *button_eyedrop;
61         Gtk::Button *button_rotoscope;
62         Gtk::Button *button_rotoscope_bline;
63         Gtk::Button *button_rotoscope_polygon;
64         
65         Gtk::Table *tool_table;
66
67         std::map<synfig::String,Gtk::ToggleButton *> state_button_map;
68         
69         Gtk::Menu       *recent_files_menu;
70
71         Gtk::Menu       *dock_dialogs;
72
73         bool changing_state_;
74         
75         void on_recent_files_changed(); 
76         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);
77
78         void change_state_(const Smach::state_base *state);
79         
80 public:
81
82         void change_state(const synfig::String& statename);
83
84         void update_undo_redo();
85
86         void refresh() { update_undo_redo(); }
87
88         void set_active_state(const synfig::String& statename);
89
90         void add_state(const Smach::state_base *state);
91
92         
93         void dockable_registered(Dockable* x);
94         
95         Toolbox();
96         virtual ~Toolbox();
97         
98 };
99
100 }; // END of namespace studio
101
102 /* === E N D =============================================================== */
103
104 #endif