X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fopenbox;a=blobdiff_plain;f=openbox%2Factions%2Ffocus.c;h=8bae49c7a1aaf0778aa142d789f4a43b0366682f;hp=1b544910220f8143dedd588ceda914b620c0058d;hb=73575c10ce3ede1637e4f959b56e1f7d5f110b91;hpb=f163c46eaf01ced8405fa36a3bf4a5c488f0f5aa diff --git a/openbox/actions/focus.c b/openbox/actions/focus.c index 1b544910..8bae49c7 100644 --- a/openbox/actions/focus.c +++ b/openbox/actions/focus.c @@ -9,20 +9,15 @@ typedef struct { gboolean stop_int; } 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_focus_startup(void) { - actions_register("Focus", - setup_func, - free_func, - run_func, - NULL, NULL); + actions_register("Focus", setup_func, g_free, run_func); } -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) +static gpointer setup_func(xmlNodePtr node) { xmlNodePtr n; Options *o; @@ -30,20 +25,13 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) o = g_new0(Options, 1); o->stop_int = TRUE; - if ((n = parse_find_node("here", node))) - o->here = parse_bool(doc, n); - if ((n = parse_find_node("stopInteractive", node))) - o->stop_int = parse_bool(doc, n); + if ((n = obt_xml_find_node(node, "here"))) + o->here = obt_xml_node_bool(n); + if ((n = obt_xml_find_node(node, "stopInteractive"))) + o->stop_int = obt_xml_node_bool(n); 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) {