2005-10-17 11:12:50 -04:00
|
|
|
#ifndef __ardour_gtk_actions_h__
|
|
|
|
#define __ardour_gtk_actions_h__
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <gtkmm/action.h>
|
|
|
|
#include <gtkmm/radioaction.h>
|
|
|
|
#include <gtkmm/toggleaction.h>
|
|
|
|
#include <gtkmm/actiongroup.h>
|
2005-11-22 23:13:32 -05:00
|
|
|
#include <gtkmm/accelkey.h>
|
2005-10-17 11:12:50 -04:00
|
|
|
|
|
|
|
namespace Gtk {
|
|
|
|
class UIManager;
|
|
|
|
}
|
|
|
|
|
2005-11-22 23:13:32 -05:00
|
|
|
class ActionManager
|
2005-10-17 11:12:50 -04:00
|
|
|
{
|
2005-11-22 23:13:32 -05:00
|
|
|
public:
|
|
|
|
ActionManager() {}
|
|
|
|
virtual ~ActionManager () {}
|
2005-10-17 11:12:50 -04:00
|
|
|
|
2005-11-25 19:06:46 -05:00
|
|
|
static void init ();
|
|
|
|
|
2005-11-22 23:13:32 -05:00
|
|
|
static std::vector<Glib::RefPtr<Gtk::Action> > session_sensitive_actions;
|
|
|
|
static std::vector<Glib::RefPtr<Gtk::Action> > region_list_selection_sensitive_actions;
|
|
|
|
static std::vector<Glib::RefPtr<Gtk::Action> > region_selection_sensitive_actions;
|
|
|
|
static std::vector<Glib::RefPtr<Gtk::Action> > track_selection_sensitive_actions;
|
|
|
|
static std::vector<Glib::RefPtr<Gtk::Action> > plugin_selection_sensitive_actions;
|
|
|
|
static std::vector<Glib::RefPtr<Gtk::Action> > range_sensitive_actions;
|
2005-12-21 16:37:18 -05:00
|
|
|
static std::vector<Glib::RefPtr<Gtk::Action> > transport_sensitive_actions;
|
2005-11-22 23:13:32 -05:00
|
|
|
static std::vector<Glib::RefPtr<Gtk::Action> > jack_sensitive_actions;
|
2005-11-28 10:29:49 -05:00
|
|
|
static std::vector<Glib::RefPtr<Gtk::Action> > jack_opposite_sensitive_actions;
|
2005-12-24 13:25:26 -05:00
|
|
|
static std::vector<Glib::RefPtr<Gtk::Action> > edit_cursor_in_region_sensitive_actions;
|
2005-11-28 10:29:49 -05:00
|
|
|
|
|
|
|
static void set_sensitive (std::vector<Glib::RefPtr<Gtk::Action> >& actions, bool);
|
2005-11-17 16:31:37 -05:00
|
|
|
|
2005-11-22 23:13:32 -05:00
|
|
|
static std::string unbound_string; /* the key string returned if an action is not bound */
|
2005-11-25 19:06:46 -05:00
|
|
|
static Glib::RefPtr<Gtk::UIManager> ui_manager;
|
2005-10-17 11:12:50 -04:00
|
|
|
|
2005-12-22 08:01:39 -05:00
|
|
|
static Gtk::Widget* get_widget (const char * name);
|
2005-12-29 19:34:21 -05:00
|
|
|
static Glib::RefPtr<Gtk::Action> get_action (const char* group, const char* name);
|
2005-11-24 09:59:36 -05:00
|
|
|
|
2005-11-22 23:13:32 -05:00
|
|
|
static void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);
|
|
|
|
|
|
|
|
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
2005-12-22 08:01:39 -05:00
|
|
|
const char * name, const char * label);
|
2005-11-22 23:13:32 -05:00
|
|
|
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
2005-12-22 08:01:39 -05:00
|
|
|
const char * name, const char * label, sigc::slot<void> sl,
|
2005-10-17 11:12:50 -04:00
|
|
|
guint key, Gdk::ModifierType mods);
|
2005-11-22 23:13:32 -05:00
|
|
|
static Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
2005-12-22 08:01:39 -05:00
|
|
|
const char * name, const char * label, sigc::slot<void> sl);
|
2005-10-17 11:12:50 -04:00
|
|
|
|
2006-01-02 13:10:29 -05:00
|
|
|
static Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
|
2005-12-22 08:01:39 -05:00
|
|
|
const char * name, const char * label, sigc::slot<void> sl,
|
2005-10-17 11:12:50 -04:00
|
|
|
guint key, Gdk::ModifierType mods);
|
2006-01-02 13:10:29 -05:00
|
|
|
static Glib::RefPtr<Gtk::Action> register_radio_action (Glib::RefPtr<Gtk::ActionGroup> group, Gtk::RadioAction::Group&,
|
2005-12-22 08:01:39 -05:00
|
|
|
const char * name, const char * label, sigc::slot<void> sl);
|
2005-10-17 11:12:50 -04:00
|
|
|
|
2005-11-22 23:13:32 -05:00
|
|
|
static Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
2005-12-22 08:01:39 -05:00
|
|
|
const char * name, const char * label, sigc::slot<void> sl,
|
2005-10-17 11:12:50 -04:00
|
|
|
guint key, Gdk::ModifierType mods);
|
2005-11-22 23:13:32 -05:00
|
|
|
static Glib::RefPtr<Gtk::Action> register_toggle_action (Glib::RefPtr<Gtk::ActionGroup> group,
|
2005-12-22 08:01:39 -05:00
|
|
|
const char * name, const char * label, sigc::slot<void> sl);
|
2005-11-17 16:31:37 -05:00
|
|
|
|
2005-11-22 23:13:32 -05:00
|
|
|
static bool lookup_entry (const Glib::ustring accel_path, Gtk::AccelKey& key);
|
2005-11-17 16:31:37 -05:00
|
|
|
|
2005-11-22 23:13:32 -05:00
|
|
|
static void get_all_actions (std::vector<std::string>& names,
|
|
|
|
std::vector<std::string>& paths,
|
|
|
|
std::vector<std::string>& keys,
|
|
|
|
std::vector<Gtk::AccelKey>& bindings);
|
2005-12-02 17:12:56 -05:00
|
|
|
|
2005-12-22 08:01:39 -05:00
|
|
|
static void uncheck_toggleaction (const char * actionname);
|
2005-10-17 11:12:50 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_gtk_actions_h__ */
|