fix inconsistent display on selection clocks when in join-object-range mode, and...
[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         extern void do_action (const char* group, const char* name);
47         extern void set_toggle_action (const char* group, const char* name, bool);
48
49         extern void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);
50
51         extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
52                                                    const char * name, const char * label);
53         extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
54                                                    const char * name, const char * label, sigc::slot<void> sl,
55                                                    guint key, Gdk::ModifierType mods);
56         extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
57                                                    const char * name, const char * label, sigc::slot<void> sl);
58
59         extern Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
60                                                                 const char * name, const char * label, sigc::slot<void> sl,
61                                                                 guint key, Gdk::ModifierType mods);
62         extern Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
63                                                                 const char * name, const char * label, sigc::slot<void> sl);
64         extern Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
65                                                                 std::string const &, std::string const &, std::string const &, sigc::slot<void> sl);
66
67         extern Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
68                                                           const char * name, const char * label, sigc::slot<void> sl,
69                                                           guint key, Gdk::ModifierType mods);
70         extern Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
71                                                                  std::string const &, std::string const &, std::string const &, sigc::slot<void> sl);
72         extern Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
73                                                                  const char * name, const char * label, sigc::slot<void> sl);
74
75         extern bool lookup_entry (const Glib::ustring accel_path, Gtk::AccelKey& key);
76
77         extern void get_all_actions (std::vector<std::string>& names,
78                                      std::vector<std::string>& paths,
79                                      std::vector<std::string>& tooltips,
80                                      std::vector<std::string>& keys,
81                                      std::vector<Gtk::AccelKey>& bindings);
82
83         extern void get_all_actions (std::vector<std::string>& groups,
84                                      std::vector<std::string>& paths,
85                                      std::vector<std::string>& tooltips,
86                                      std::vector<Gtk::AccelKey>& bindings);
87
88         extern void uncheck_toggleaction (std::string);
89 };
90
91 #endif /* __libgtkmm2ext_actions_h__ */