Fix port matrix menu checkbox when the window is closed. Make the port matrix origin...
[ardour.git] / libs / gtkmm2ext / gtkmm2ext / actions.h
1 /*
2     Copyright (C) 2000-2007 Paul Davis
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __libgtkmm2ext_actions_h__
21 #define __libgtkmm2ext_actions_h__
22
23 #include <vector>
24
25 #include <gtkmm/action.h>
26 #include <gtkmm/radioaction.h>
27 #include <gtkmm/toggleaction.h>
28 #include <gtkmm/actiongroup.h>
29 #include <gtkmm/accelkey.h>
30
31 namespace Gtk {
32         class UIManager;
33 }
34
35 namespace ActionManager {
36
37         extern std::string unbound_string;  /* the key string returned if an action is not bound */
38         extern Glib::RefPtr<Gtk::UIManager> ui_manager;
39         
40         extern void set_sensitive (std::vector<Glib::RefPtr<Gtk::Action> >& actions, bool);
41         extern std::string get_key_representation (const std::string& accel_path, Gtk::AccelKey& key);
42
43         extern Gtk::Widget* get_widget (const char * name);
44         extern Glib::RefPtr<Gtk::Action> get_action (const char* group, const char* name);
45         extern Glib::RefPtr<Gtk::Action> get_action (const char* path);
46
47         extern void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);
48
49         extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
50                                                    const char * name, const char * label);
51         extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
52                                                    const char * name, const char * label, sigc::slot<void> sl,
53                                                    guint key, Gdk::ModifierType mods);
54         extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
55                                                    const char * name, const char * label, sigc::slot<void> sl);
56
57         extern Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
58                                                                 const char * name, const char * label, sigc::slot<void> sl,
59                                                                 guint key, Gdk::ModifierType mods);
60         extern Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
61                                                          const char * name, const char * label, sigc::slot<void> sl);
62
63         extern Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
64                                                           const char * name, const char * label, sigc::slot<void> sl,
65                                                           guint key, Gdk::ModifierType mods);
66         extern Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
67                                                           const char * name, const char * label, sigc::slot<void> sl);
68
69         extern bool lookup_entry (const Glib::ustring accel_path, Gtk::AccelKey& key);
70
71         extern void get_all_actions (std::vector<std::string>& names,
72                                      std::vector<std::string>& paths,
73                                      std::vector<std::string>& keys,
74                                      std::vector<Gtk::AccelKey>& bindings);
75
76         extern void get_all_actions (std::vector<std::string>& groups,
77                                      std::vector<std::string>& paths,
78                                      std::vector<Gtk::AccelKey>& bindings);
79
80         extern void uncheck_toggleaction (std::string);
81 };
82
83 #endif /* __libgtkmm2ext_actions_h__ */