ObActionsRunFunc run;
ObActionsInteractiveInputFunc i_input;
ObActionsInteractiveCancelFunc i_cancel;
+ ObActionsShutdownFunc shutdown;
};
struct _ObActionsAct {
/* free all the registered actions */
while (registered) {
- actions_definition_unref(registered->data);
+ ObActionsDefinition *d = registered->data;
+ if (d->shutdown) d->shutdown();
+ actions_definition_unref(d);
registered = g_slist_delete_link(registered, registered);
}
}
return TRUE;
}
+gboolean actions_set_shutdown(const gchar *name,
+ ObActionsShutdownFunc shutdown)
+{
+ GSList *it;
+ ObActionsDefinition *def;
+
+ for (it = registered; it; it = g_slist_next(it)) {
+ def = it->data;
+ if (!g_ascii_strcasecmp(name, def->name)) {
+ def->shutdown = shutdown;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
static void actions_definition_ref(ObActionsDefinition *def)
{
++def->ref;
typedef void (*ObActionsDataFreeFunc)(gpointer options);
typedef gboolean (*ObActionsRunFunc)(ObActionsData *data,
gpointer options);
+typedef void (*ObActionsShutdownFunc)(void);
typedef gboolean (*ObActionsInteractiveInputFunc)(guint initial_state,
XEvent *e,
gpointer options,
ObActionsInteractiveInputFunc i_input,
ObActionsInteractiveCancelFunc i_cancel);
+gboolean actions_set_shutdown(const gchar *name,
+ ObActionsShutdownFunc shutdown);
+
ObActionsAct* actions_parse(ObParseInst *i,
xmlDocPtr doc,
xmlNodePtr node);
+
ObActionsAct* actions_parse_string(const gchar *name);
gboolean actions_act_is_interactive(ObActionsAct *act);