X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Factions%2Fexecute.c;h=5a7472706bc99b2a58ee48a4430e9a85ef4e3732;hb=ea481338b5f16fd81a7b33e036ead39b918a51af;hp=02de01549d9ccac0a88a91c58d4588c6ff78dc90;hpb=2b8b5da04b14af1639143cc332874c7e1a03a8bb;p=chaz%2Fopenbox diff --git a/openbox/actions/execute.c b/openbox/actions/execute.c index 02de0154..5a747270 100644 --- a/openbox/actions/execute.c +++ b/openbox/actions/execute.c @@ -2,6 +2,7 @@ #include "openbox/event.h" #include "openbox/startupnotify.h" #include "openbox/screen.h" +#include "obt/paths.h" #include "gettext.h" typedef struct { @@ -12,7 +13,7 @@ typedef struct { gchar *sn_wmclass; } Options; -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_func(xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); /* @@ -25,38 +26,34 @@ static void i_cancel_func(gpointer options); void action_execute_startup(void) { - actions_register("Execute", - setup_func, - free_func, - run_func, - NULL, NULL); + actions_register("Execute", setup_func, free_func, run_func, NULL, NULL); } -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) +static gpointer setup_func(xmlNodePtr node) { xmlNodePtr n; Options *o; o = g_new0(Options, 1); - if ((n = parse_find_node("command", node)) || - (n = parse_find_node("execute", node))) + if ((n = obt_parse_find_node(node, "command")) || + (n = obt_parse_find_node(node, "execute"))) { - gchar *s = parse_string(doc, n); - o->cmd = parse_expand_tilde(s); + gchar *s = obt_parse_node_string(n); + o->cmd = obt_paths_expand_tilde(s); g_free(s); } - if ((n = parse_find_node("startupnotify", node))) { + if ((n = obt_parse_find_node(node, "startupnotify"))) { xmlNodePtr m; - if ((m = parse_find_node("enabled", n->xmlChildrenNode))) - o->sn = parse_bool(doc, m); - if ((m = parse_find_node("name", n->xmlChildrenNode))) - o->sn_name = parse_string(doc, m); - if ((m = parse_find_node("icon", n->xmlChildrenNode))) - o->sn_icon = parse_string(doc, m); - if ((m = parse_find_node("wmclass", n->xmlChildrenNode))) - o->sn_wmclass = parse_string(doc, m); + if ((m = obt_parse_find_node(n->children, "enabled"))) + o->sn = obt_parse_node_bool(m); + if ((m = obt_parse_find_node(n->children, "name"))) + o->sn_name = obt_parse_node_string(m); + if ((m = obt_parse_find_node(n->children, "icon"))) + o->sn_icon = obt_parse_node_string(m); + if ((m = obt_parse_find_node(n->children, "wmclass"))) + o->sn_wmclass = obt_parse_node_string(m); } return o; }