Merge branch 'backport' into work
[dana/openbox.git] / openbox / actions / focus.c
index 1b54491..8bae49c 100644 (file)
@@ -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)
 {