From: Dana Jansens Date: Sun, 7 Sep 2003 23:34:01 +0000 (+0000) Subject: dont use obsolete xmlChildrenNode X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=84a60ebbfbdf9deea446c35c53f8703edeb8213d;p=chaz%2Fopenbox dont use obsolete xmlChildrenNode --- diff --git a/openbox/config.c b/openbox/config.c index cee3c137..61b786fb 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -71,7 +71,7 @@ static void parse_key(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, if (parse_attr_string("key", n, &key)) { keylist = g_list_append(keylist, key); - parse_key(i, doc, n->xmlChildrenNode, keylist); + parse_key(i, doc, n->children, keylist); it = g_list_last(keylist); g_free(it->data); @@ -93,7 +93,7 @@ static void parse_key(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, static void parse_keyboard(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, void *d) { - parse_key(i, doc, node->xmlChildrenNode, NULL); + parse_key(i, doc, node->children, NULL); } /* @@ -116,7 +116,7 @@ static void parse_mouse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, ObMouseAction mact; ObAction *action; - node = node->xmlChildrenNode; + node = node->children; if ((n = parse_find_node("dragThreshold", node))) config_mouse_threshold = parse_int(doc, n); @@ -127,7 +127,7 @@ static void parse_mouse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, while (n) { if (!parse_attr_string("name", n, &contextstr)) goto next_n; - nbut = parse_find_node("mousebind", n->xmlChildrenNode); + nbut = parse_find_node("mousebind", n->children); while (nbut) { if (!parse_attr_string("button", nbut, &buttonstr)) goto next_nbut; @@ -148,7 +148,7 @@ static void parse_mouse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, mact = OB_MOUSE_ACTION_MOTION; } else goto next_nbut; - nact = parse_find_node("action", nbut->xmlChildrenNode); + nact = parse_find_node("action", nbut->children); while (nact) { if ((action = action_parse(i, doc, nact, uact))) mouse_bind(buttonstr, contextstr, mact, action); @@ -169,7 +169,7 @@ static void parse_focus(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, { xmlNodePtr n; - node = node->xmlChildrenNode; + node = node->children; if ((n = parse_find_node("focusNew", node))) config_focus_new = parse_bool(doc, n); @@ -188,7 +188,7 @@ static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, { xmlNodePtr n; - node = node->xmlChildrenNode; + node = node->children; if ((n = parse_find_node("name", node))) { gchar *c; @@ -209,7 +209,7 @@ static void parse_desktops(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, { xmlNodePtr n; - node = node->xmlChildrenNode; + node = node->children; if ((n = parse_find_node("number", node))) config_desktops_num = parse_int(doc, n); @@ -222,7 +222,7 @@ static void parse_desktops(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, g_slist_free(config_desktops_names); config_desktops_names = NULL; - nname = parse_find_node("name", n->xmlChildrenNode); + nname = parse_find_node("name", n->children); while (nname) { config_desktops_names = g_slist_append(config_desktops_names, parse_string(doc, nname)); @@ -236,7 +236,7 @@ static void parse_resize(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, { xmlNodePtr n; - node = node->xmlChildrenNode; + node = node->children; if ((n = parse_find_node("drawContents", node))) config_redraw_resize = parse_bool(doc, n); @@ -246,7 +246,7 @@ static void parse_dock(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, void *d) { xmlNodePtr n; - node = node->xmlChildrenNode; + node = node->children; if ((n = parse_find_node("position", node))) { if (parse_contains("TopLeft", doc, n)) @@ -304,7 +304,7 @@ static void parse_dock(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, void *d) static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, void *d) { - for (node = node->xmlChildrenNode; node; node = node->next) { + for (node = node->children; node; node = node->next) { if (!xmlStrcasecmp(node->name, (const xmlChar*) "file")) { gchar *c; @@ -321,7 +321,7 @@ static void parse_resistance(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, { xmlNodePtr n; - node = node->xmlChildrenNode; + node = node->children; if ((n = parse_find_node("strength", node))) config_resist_win = parse_int(doc, n); if ((n = parse_find_node("screen_edge_strength", node))) diff --git a/openbox/menu.c b/openbox/menu.c index 74a743ee..286434cf 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -89,13 +89,13 @@ void menu_startup(gboolean reconfig) for (it = config_menu_files; it; it = g_slist_next(it)) { if (menu_open(it->data, &doc, &node)) { loaded = TRUE; - parse_tree(menu_parse_inst, doc, node->xmlChildrenNode); + parse_tree(menu_parse_inst, doc, node->children); xmlFreeDoc(doc); } } if (!loaded) { if (menu_open("menu.xml", &doc, &node)) { - parse_tree(menu_parse_inst, doc, node->xmlChildrenNode); + parse_tree(menu_parse_inst, doc, node->children); xmlFreeDoc(doc); } } @@ -149,7 +149,7 @@ void menu_pipe_execute(ObMenu *self) menu_parse_state.pipe_creator = self; menu_parse_state.parent = self; - parse_tree(menu_parse_inst, doc, node->xmlChildrenNode); + parse_tree(menu_parse_inst, doc, node->children); xmlFreeDoc(doc); } else { g_warning("Invalid output from pipe-menu: %s", self->execute); @@ -178,7 +178,7 @@ static void parse_menu_item(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, if (parse_attr_string("label", node, &label)) { GSList *acts = NULL; - for (node = node->xmlChildrenNode; node; node = node->next) + for (node = node->children; node; node = node->next) if (!xmlStrcasecmp(node->name, (const xmlChar*) "action")) acts = g_slist_append(acts, action_parse (i, doc, node, @@ -222,7 +222,7 @@ static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, old = state->parent; state->parent = menu; - parse_tree(i, doc, node->xmlChildrenNode); + parse_tree(i, doc, node->children); state->parent = old; } } diff --git a/openbox/session.c b/openbox/session.c index 10cb26bc..2894c435 100644 --- a/openbox/session.c +++ b/openbox/session.c @@ -469,7 +469,7 @@ static void session_load(char *path) g_free(sm_id); sm_id = id; - node = parse_find_node("window", node->xmlChildrenNode); + node = parse_find_node("window", node->children); while (node) { ObSessionState *state; @@ -477,52 +477,52 @@ static void session_load(char *path) if (!parse_attr_string("id", node, &state->id)) goto session_load_bail; - if (!(n = parse_find_node("name", node->xmlChildrenNode))) + if (!(n = parse_find_node("name", node->children))) goto session_load_bail; state->name = parse_string(doc, n); - if (!(n = parse_find_node("class", node->xmlChildrenNode))) + if (!(n = parse_find_node("class", node->children))) goto session_load_bail; state->class = parse_string(doc, n); - if (!(n = parse_find_node("role", node->xmlChildrenNode))) + if (!(n = parse_find_node("role", node->children))) goto session_load_bail; state->role = parse_string(doc, n); - if (!(n = parse_find_node("stacking", node->xmlChildrenNode))) + if (!(n = parse_find_node("stacking", node->children))) goto session_load_bail; state->stacking = parse_int(doc, n); - if (!(n = parse_find_node("desktop", node->xmlChildrenNode))) + if (!(n = parse_find_node("desktop", node->children))) goto session_load_bail; state->desktop = parse_int(doc, n); - if (!(n = parse_find_node("x", node->xmlChildrenNode))) + if (!(n = parse_find_node("x", node->children))) goto session_load_bail; state->x = parse_int(doc, n); - if (!(n = parse_find_node("y", node->xmlChildrenNode))) + if (!(n = parse_find_node("y", node->children))) goto session_load_bail; state->y = parse_int(doc, n); - if (!(n = parse_find_node("width", node->xmlChildrenNode))) + if (!(n = parse_find_node("width", node->children))) goto session_load_bail; state->w = parse_int(doc, n); - if (!(n = parse_find_node("height", node->xmlChildrenNode))) + if (!(n = parse_find_node("height", node->children))) goto session_load_bail; state->h = parse_int(doc, n); state->shaded = - parse_find_node("shaded", node->xmlChildrenNode) != NULL; + parse_find_node("shaded", node->children) != NULL; state->iconic = - parse_find_node("iconic", node->xmlChildrenNode) != NULL; + parse_find_node("iconic", node->children) != NULL; state->skip_pager = - parse_find_node("skip_pager", node->xmlChildrenNode) != NULL; + parse_find_node("skip_pager", node->children) != NULL; state->skip_taskbar = - parse_find_node("skip_taskbar", node->xmlChildrenNode) != NULL; + parse_find_node("skip_taskbar", node->children) != NULL; state->fullscreen = - parse_find_node("fullscreen", node->xmlChildrenNode) != NULL; + parse_find_node("fullscreen", node->children) != NULL; state->above = - parse_find_node("above", node->xmlChildrenNode) != NULL; + parse_find_node("above", node->children) != NULL; state->below = - parse_find_node("below", node->xmlChildrenNode) != NULL; + parse_find_node("below", node->children) != NULL; state->max_horz = - parse_find_node("max_horz", node->xmlChildrenNode) != NULL; + parse_find_node("max_horz", node->children) != NULL; state->max_vert = - parse_find_node("max_vert", node->xmlChildrenNode) != NULL; + parse_find_node("max_vert", node->children) != NULL; /* save this */ session_saved_state = g_list_prepend(session_saved_state, state); diff --git a/parser/parse.c b/parser/parse.c index 75bc3a3d..a335315e 100644 --- a/parser/parse.c +++ b/parser/parse.c @@ -136,7 +136,7 @@ void parse_tree(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) char *parse_string(xmlDocPtr doc, xmlNodePtr node) { - xmlChar *c = xmlNodeListGetString(doc, node->xmlChildrenNode, TRUE); + xmlChar *c = xmlNodeListGetString(doc, node->children, TRUE); char *s = g_strdup(c ? (char*)c : ""); xmlFree(c); return s; @@ -144,7 +144,7 @@ char *parse_string(xmlDocPtr doc, xmlNodePtr node) int parse_int(xmlDocPtr doc, xmlNodePtr node) { - xmlChar *c = xmlNodeListGetString(doc, node->xmlChildrenNode, TRUE); + xmlChar *c = xmlNodeListGetString(doc, node->children, TRUE); int i = atoi((char*)c); xmlFree(c); return i; @@ -152,7 +152,7 @@ int parse_int(xmlDocPtr doc, xmlNodePtr node) gboolean parse_bool(xmlDocPtr doc, xmlNodePtr node) { - xmlChar *c = xmlNodeListGetString(doc, node->xmlChildrenNode, TRUE); + xmlChar *c = xmlNodeListGetString(doc, node->children, TRUE); gboolean b = FALSE; if (!xmlStrcasecmp(c, (const xmlChar*) "true")) b = TRUE; @@ -166,7 +166,7 @@ gboolean parse_bool(xmlDocPtr doc, xmlNodePtr node) gboolean parse_contains(const char *val, xmlDocPtr doc, xmlNodePtr node) { - xmlChar *c = xmlNodeListGetString(doc, node->xmlChildrenNode, TRUE); + xmlChar *c = xmlNodeListGetString(doc, node->children, TRUE); gboolean r; r = !xmlStrcasecmp(c, (const xmlChar*) val); xmlFree(c);