diff --git a/libs/gtkmm2ext/bindings.cc b/libs/gtkmm2ext/bindings.cc index 1c84a5a5ca..cf98bbca4d 100644 --- a/libs/gtkmm2ext/bindings.cc +++ b/libs/gtkmm2ext/bindings.cc @@ -1188,6 +1188,30 @@ ActionMap::find_action (const string& name) return RefPtr(); } +RefPtr +ActionMap::find_toggle_action (const string& name) +{ + RefPtr act = find_action (name); + + if (!act) { + return RefPtr(); + } + + return Glib::RefPtr::cast_dynamic (act); +} + +RefPtr +ActionMap::find_radio_action (const string& name) +{ + RefPtr act = find_action (name); + + if (!act) { + return RefPtr(); + } + + return Glib::RefPtr::cast_dynamic (act); +} + RefPtr ActionMap::find_action (char const * group_name, char const * action_name) { @@ -1205,6 +1229,31 @@ ActionMap::find_action (char const * group_name, char const * action_name) return RefPtr(); } +RefPtr +ActionMap::find_toggle_action (char const * group_name, char const * action_name) +{ + RefPtr act = find_action (group_name, action_name); + + if (!act) { + return RefPtr(); + } + + return Glib::RefPtr::cast_dynamic (act); +} + +RefPtr +ActionMap::find_radio_action (char const * group_name, char const * action_name) +{ + RefPtr act = find_action (group_name, action_name); + + if (!act) { + return RefPtr(); + } + + return Glib::RefPtr::cast_dynamic (act); +} + + RefPtr ActionMap::create_action_group (const string& name) { diff --git a/libs/gtkmm2ext/gtkmm2ext/bindings.h b/libs/gtkmm2ext/gtkmm2ext/bindings.h index 93e8f4c1f5..1cbb6af904 100644 --- a/libs/gtkmm2ext/gtkmm2ext/bindings.h +++ b/libs/gtkmm2ext/gtkmm2ext/bindings.h @@ -107,6 +107,10 @@ class LIBGTKMM2EXT_API ActionMap { Glib::RefPtr find_action (const std::string& name); Glib::RefPtr find_action (char const * group_name, char const * action_name); + Glib::RefPtr find_toggle_action (const std::string& name); + Glib::RefPtr find_toggle_action (char const * group_name, char const * action_name); + Glib::RefPtr find_radio_action (const std::string& name); + Glib::RefPtr find_radio_action (char const * group_name, char const * action_name); void set_bindings (Bindings*); Bindings* bindings() const { return _bindings; }