diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-07-27 01:37:28 -0400 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2008-01-20 01:36:55 -0500 |
| commit | fdabb69f4f25596df972caa76c85c2aeba26226e (patch) | |
| tree | 2566f1a229a65e54cdffd88a255301d0bf7fa3a7 /openbox/actions/movetoedge.c | |
| parent | 0667bbc3e2fbd3fa39206e843560735524840d35 (diff) | |
update openbox to use the current parser interface in libobt
there is also some random bug fixes for other libobt stuff in here.
Diffstat (limited to 'openbox/actions/movetoedge.c')
| -rw-r--r-- | openbox/actions/movetoedge.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/openbox/actions/movetoedge.c b/openbox/actions/movetoedge.c index 5941bde9..f360ddd0 100644 --- a/openbox/actions/movetoedge.c +++ b/openbox/actions/movetoedge.c @@ -9,20 +9,15 @@ typedef struct { ObDirection dir; } Options; -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); -static void free_func(gpointer options); +static gpointer setup_func(xmlNodePtr node); static gboolean run_func(ObActionsData *data, gpointer options); void action_movetoedge_startup(void) { - actions_register("MoveToEdge", - setup_func, - free_func, - run_func, - NULL, NULL); + actions_register("MoveToEdge", setup_func, g_free, run_func, NULL, NULL); } -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) +static gpointer setup_func(xmlNodePtr node) { xmlNodePtr n; Options *o; @@ -30,8 +25,8 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) o = g_new0(Options, 1); o->dir = OB_DIRECTION_NORTH; - if ((n = parse_find_node("direction", node))) { - gchar *s = parse_string(doc, n); + if ((n = obt_parse_find_node(node, "direction"))) { + gchar *s = obt_parse_node_string(n); if (!g_ascii_strcasecmp(s, "north") || !g_ascii_strcasecmp(s, "up")) o->dir = OB_DIRECTION_NORTH; @@ -50,13 +45,6 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) return o; } -static void free_func(gpointer options) -{ - Options *o = options; - - g_free(o); -} - /* Always return FALSE because its not interactive */ static gboolean run_func(ObActionsData *data, gpointer options) { |
