some ActionMap infrastructure to start removing ActionManager
This commit is contained in:
parent
4d7e9d5706
commit
eb48c14ec4
@ -1174,6 +1174,7 @@ ActionMap::get_actions (ActionMap::Actions& acts)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RefPtr<Action>
|
||||
ActionMap::find_action (const string& name)
|
||||
{
|
||||
@ -1190,9 +1191,7 @@ ActionMap::find_action (const string& name)
|
||||
RefPtr<Action>
|
||||
ActionMap::find_action (char const * group_name, char const * action_name)
|
||||
{
|
||||
string fullpath;
|
||||
|
||||
fullpath = group_name;
|
||||
string fullpath (group_name);
|
||||
fullpath += '/';
|
||||
fullpath += action_name;
|
||||
|
||||
|
@ -139,6 +139,24 @@ class LIBGTKMM2EXT_API ActionMap {
|
||||
|
||||
};
|
||||
|
||||
class LIBGTKMM2EXT_API ActionMapOwner {
|
||||
protected:
|
||||
Gtkmm2ext::ActionMap myactions;
|
||||
public:
|
||||
ActionMapOwner (std::string const & map_name) : myactions (map_name) {}
|
||||
Glib::RefPtr<Gtk::Action> find_action (const std::string& name) { return myactions.find_action (name); }
|
||||
Glib::RefPtr<Gtk::Action> find_action (char const * group_name, char const * action_name) { return myactions.find_action (group_name, action_name); }
|
||||
};
|
||||
|
||||
class LIBGTKMM2EXT_API StaticActionMapOwner {
|
||||
protected:
|
||||
virtual Gtkmm2ext::ActionMap& my_actions() const = 0;
|
||||
public:
|
||||
virtual ~StaticActionMapOwner() {}
|
||||
Glib::RefPtr<Gtk::Action> find_action (const std::string& name) { return my_actions().find_action (name); }
|
||||
Glib::RefPtr<Gtk::Action> find_action (char const * group_name, char const * action_name) { return my_actions().find_action (group_name, action_name); }
|
||||
};
|
||||
|
||||
class LIBGTKMM2EXT_API Bindings {
|
||||
public:
|
||||
enum Operation {
|
||||
|
Loading…
Reference in New Issue
Block a user