From 9eeb13ec71687f43d31d66171efedb859a94285e Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 26 Mar 2003 12:53:04 +0000 Subject: [PATCH] create actions from string names --- openbox/action.c | 2 ++ openbox/action.h | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/openbox/action.c b/openbox/action.c index 2265b466..4cd75107 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -98,6 +98,8 @@ Action *action_from_string(char *name) 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; diff --git a/openbox/action.h b/openbox/action.h index 52080251..e3d891f0 100644 --- a/openbox/action.h +++ b/openbox/action.h @@ -85,6 +85,15 @@ typedef struct { } 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 */ -- 2.39.2