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/growtoedge.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/growtoedge.c')
| -rw-r--r-- | openbox/actions/growtoedge.c | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/openbox/actions/growtoedge.c b/openbox/actions/growtoedge.c index 630ead10..a37e3a26 100644 --- a/openbox/actions/growtoedge.c +++ b/openbox/actions/growtoedge.c @@ -10,27 +10,19 @@ typedef struct { gboolean shrink; } Options; -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); -static gpointer setup_shrink_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); -static void free_func(gpointer options); +static gpointer setup_func(xmlNodePtr node); +static gpointer setup_shrink_func(xmlNodePtr node); static gboolean run_func(ObActionsData *data, gpointer options); void action_growtoedge_startup(void) { - actions_register("GrowToEdge", - setup_func, - free_func, - run_func, - NULL, NULL); - - actions_register("ShrinkToEdge", - setup_shrink_func, - free_func, - run_func, - NULL, NULL); + actions_register("GrowToEdge", setup_func, + g_free, run_func, NULL, NULL); + actions_register("ShrinkToEdge", setup_shrink_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; @@ -39,8 +31,8 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) o->dir = OB_DIRECTION_NORTH; o->shrink = FALSE; - 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; @@ -59,23 +51,16 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) return o; } -static gpointer setup_shrink_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) +static gpointer setup_shrink_func(xmlNodePtr node) { Options *o; - o = setup_func(i, doc, node); + o = setup_func(node); o->shrink = TRUE; return o; } -static void free_func(gpointer options) -{ - Options *o = options; - - g_free(o); -} - static gboolean do_grow(ObActionsData *data, gint x, gint y, gint w, gint h) { gint realw, realh, lw, lh; |
