create actions from string names
Dana Jansens danakj@orodu.net
2 files changed,
11 insertions(+),
0 deletions(-)
M
openbox/action.c
→
openbox/action.c
@@ -98,6 +98,8 @@ } else if (!g_ascii_strcasecmp(name, "sendtopreviousdesktopwrap")) {
a = action_new(action_send_to_previous_desktop); a->data.sendtonextprev.wrap = TRUE; a->data.sendtonextprev.follow = TRUE; + } else if (!g_ascii_strcasecmp(name, "desktop")) { + a = action_new(action_desktop); } else if (!g_ascii_strcasecmp(name, "nextdesktop")) { a = action_new(action_next_desktop); a->data.nextprevdesktop.wrap = FALSE;
M
openbox/action.h
→
openbox/action.h
@@ -85,6 +85,15 @@ union ActionData data;
} Action; Action *action_new(void (*func)(union ActionData *data)); + +/* Creates a new Action from the name of the action + A few action types need data set after making this call still. Check if + the returned action's "func" is one of these. + action_execute - the path needs to be set + action_restart - the path can optionally be set + action_desktop - the destination desktop needs to be set +*/ +Action *action_from_string(char *name); void action_free(Action *a); /* Execute */