return RefPtr<Action>();
}
+void
+ActionManager::get_actions (void* owner, std::vector<Glib::RefPtr<Gtk::Action> >& acts)
+{
+ for (ActionMap::const_iterator a = actions.begin(); a != actions.end(); ++a) {
+ if (owner) {
+ Glib::RefPtr<Gtk::ActionGroup> group = a->second->property_action_group ();
+ if (group->get_data (X_("owner")) == owner) {
+ acts.push_back (a->second);
+ }
+ } else {
+ acts.push_back (a->second);
+ }
+ }
+}
+
void
ActionManager::get_all_actions (std::vector<std::string>& paths,
std::vector<std::string>& labels,
rmap.insert (make_pair (k->second.action, k->first));
}
-#if 0
-
/* get a list of all actions XXX relevant for these bindings */
- ActionMap::Actions all_actions;
- ActionManager::get_actions (all_actions);
+ std::vector<Glib::RefPtr<Action> > relevant_actions;
+ ActionManager::get_actions (this, relevant_actions);
- for (ActionMap::Actions::const_iterator act = all_actions.begin(); act != all_actions.end(); ++act) {
+ for (vector<Glib::RefPtr<Action> >::const_iterator act = relevant_actions.begin(); act != relevant_actions.end(); ++act) {
paths.push_back ((*act)->get_accel_path());
labels.push_back ((*act)->get_label());
actions.push_back (*act);
}
-#endif
}
Bindings*
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::RadioAction> get_radio_action (const std::string& name, bool or_die = true);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::RadioAction> get_radio_action (char const * group_name, char const * action_name, bool or_die = true);
+ LIBGTKMM2EXT_API extern void get_actions (void* owner, std::vector<Glib::RefPtr<Gtk::Action> >&);
LIBGTKMM2EXT_API extern void get_all_actions (std::vector<std::string>& paths,
std::vector<std::string>& labels,