13
0

some ActionMap infrastructure to start removing ActionManager

This commit is contained in:
Paul Davis 2018-12-05 17:32:02 -05:00
parent 4d7e9d5706
commit eb48c14ec4
2 changed files with 20 additions and 3 deletions

View File

@ -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;

View File

@ -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 {