summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/gtkmm2ext/bindings.cc5
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/bindings.h18
2 files changed, 20 insertions, 3 deletions
diff --git a/libs/gtkmm2ext/bindings.cc b/libs/gtkmm2ext/bindings.cc
index b1abcb0507..1c84a5a5ca 100644
--- a/libs/gtkmm2ext/bindings.cc
+++ b/libs/gtkmm2ext/bindings.cc
@@ -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;
diff --git a/libs/gtkmm2ext/gtkmm2ext/bindings.h b/libs/gtkmm2ext/gtkmm2ext/bindings.h
index 54f1f3eee9..93e8f4c1f5 100644
--- a/libs/gtkmm2ext/gtkmm2ext/bindings.h
+++ b/libs/gtkmm2ext/gtkmm2ext/bindings.h
@@ -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 {