diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-06-22 03:45:53 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-06-22 03:45:53 +0000 |
| commit | 9dacac5e5e6b9ed86e76680b048bc227d8866ac6 (patch) | |
| tree | e154b3b5b959d06060e66ddb21466e075a8d364a /openbox/actions | |
| parent | b76ec18d1c8857cf32598c822364298fc535c84e (diff) | |
added the debug action
Diffstat (limited to 'openbox/actions')
| -rw-r--r-- | openbox/actions/all.c | 1 | ||||
| -rw-r--r-- | openbox/actions/all.h | 1 | ||||
| -rw-r--r-- | openbox/actions/debug.c | 58 |
3 files changed, 60 insertions, 0 deletions
diff --git a/openbox/actions/all.c b/openbox/actions/all.c index 7c0b253e..09eae59a 100644 --- a/openbox/actions/all.c +++ b/openbox/actions/all.c @@ -3,4 +3,5 @@ void action_all_startup() { action_execute_startup(); + action_debug_startup(); } diff --git a/openbox/actions/all.h b/openbox/actions/all.h index 599c29fc..b93f140a 100644 --- a/openbox/actions/all.h +++ b/openbox/actions/all.h @@ -4,5 +4,6 @@ void action_all_startup(); void action_execute_startup(); +void action_debug_startup(); #endif diff --git a/openbox/actions/debug.c b/openbox/actions/debug.c new file mode 100644 index 00000000..f219e059 --- /dev/null +++ b/openbox/actions/debug.c @@ -0,0 +1,58 @@ +#include "openbox/actions.h" +#include <glib.h> + +typedef struct { + gchar *str; +} Options; + +static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); +static void free_func(gpointer options); +static gboolean run_func(ObActionsData *data, gpointer options); +/* +static gboolean i_input_func(guint initial_state, + XEvent *e, + gpointer options, + gboolean *used); +static void i_cancel_func(gpointer options); +*/ + +void action_debug_startup() +{ + actions_register("Debug", + setup_func, + free_func, + run_func, + NULL, NULL); +} + +static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) +{ + xmlNodePtr n; + Options *o; + + o = g_new0(Options, 1); + + if ((n = parse_find_node("string", node))) + o->str = parse_string(doc, n); + return o; +} + +static void free_func(gpointer options) +{ + Options *o = options; + + if (o) { + g_free(o->str); + g_free(o); + } +} + +/* Always return FALSE because its not interactive */ +static gboolean run_func(ObActionsData *data, gpointer options) +{ + Options *o = options; + + if (o->str) g_print("%s\n", o->str); + + return FALSE; +} |
