dont use obsolete xmlChildrenNode
This commit is contained in:
parent
804b12d46a
commit
84a60ebbfb
4 changed files with 41 additions and 41 deletions
|
@ -71,7 +71,7 @@ static void parse_key(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
if (parse_attr_string("key", n, &key)) {
|
if (parse_attr_string("key", n, &key)) {
|
||||||
keylist = g_list_append(keylist, 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);
|
it = g_list_last(keylist);
|
||||||
g_free(it->data);
|
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,
|
static void parse_keyboard(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
void *d)
|
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;
|
ObMouseAction mact;
|
||||||
ObAction *action;
|
ObAction *action;
|
||||||
|
|
||||||
node = node->xmlChildrenNode;
|
node = node->children;
|
||||||
|
|
||||||
if ((n = parse_find_node("dragThreshold", node)))
|
if ((n = parse_find_node("dragThreshold", node)))
|
||||||
config_mouse_threshold = parse_int(doc, n);
|
config_mouse_threshold = parse_int(doc, n);
|
||||||
|
@ -127,7 +127,7 @@ static void parse_mouse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
while (n) {
|
while (n) {
|
||||||
if (!parse_attr_string("name", n, &contextstr))
|
if (!parse_attr_string("name", n, &contextstr))
|
||||||
goto next_n;
|
goto next_n;
|
||||||
nbut = parse_find_node("mousebind", n->xmlChildrenNode);
|
nbut = parse_find_node("mousebind", n->children);
|
||||||
while (nbut) {
|
while (nbut) {
|
||||||
if (!parse_attr_string("button", nbut, &buttonstr))
|
if (!parse_attr_string("button", nbut, &buttonstr))
|
||||||
goto next_nbut;
|
goto next_nbut;
|
||||||
|
@ -148,7 +148,7 @@ static void parse_mouse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
mact = OB_MOUSE_ACTION_MOTION;
|
mact = OB_MOUSE_ACTION_MOTION;
|
||||||
} else
|
} else
|
||||||
goto next_nbut;
|
goto next_nbut;
|
||||||
nact = parse_find_node("action", nbut->xmlChildrenNode);
|
nact = parse_find_node("action", nbut->children);
|
||||||
while (nact) {
|
while (nact) {
|
||||||
if ((action = action_parse(i, doc, nact, uact)))
|
if ((action = action_parse(i, doc, nact, uact)))
|
||||||
mouse_bind(buttonstr, contextstr, mact, action);
|
mouse_bind(buttonstr, contextstr, mact, action);
|
||||||
|
@ -169,7 +169,7 @@ static void parse_focus(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
{
|
{
|
||||||
xmlNodePtr n;
|
xmlNodePtr n;
|
||||||
|
|
||||||
node = node->xmlChildrenNode;
|
node = node->children;
|
||||||
|
|
||||||
if ((n = parse_find_node("focusNew", node)))
|
if ((n = parse_find_node("focusNew", node)))
|
||||||
config_focus_new = parse_bool(doc, n);
|
config_focus_new = parse_bool(doc, n);
|
||||||
|
@ -188,7 +188,7 @@ static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
{
|
{
|
||||||
xmlNodePtr n;
|
xmlNodePtr n;
|
||||||
|
|
||||||
node = node->xmlChildrenNode;
|
node = node->children;
|
||||||
|
|
||||||
if ((n = parse_find_node("name", node))) {
|
if ((n = parse_find_node("name", node))) {
|
||||||
gchar *c;
|
gchar *c;
|
||||||
|
@ -209,7 +209,7 @@ static void parse_desktops(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
{
|
{
|
||||||
xmlNodePtr n;
|
xmlNodePtr n;
|
||||||
|
|
||||||
node = node->xmlChildrenNode;
|
node = node->children;
|
||||||
|
|
||||||
if ((n = parse_find_node("number", node)))
|
if ((n = parse_find_node("number", node)))
|
||||||
config_desktops_num = parse_int(doc, n);
|
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);
|
g_slist_free(config_desktops_names);
|
||||||
config_desktops_names = NULL;
|
config_desktops_names = NULL;
|
||||||
|
|
||||||
nname = parse_find_node("name", n->xmlChildrenNode);
|
nname = parse_find_node("name", n->children);
|
||||||
while (nname) {
|
while (nname) {
|
||||||
config_desktops_names = g_slist_append(config_desktops_names,
|
config_desktops_names = g_slist_append(config_desktops_names,
|
||||||
parse_string(doc, nname));
|
parse_string(doc, nname));
|
||||||
|
@ -236,7 +236,7 @@ static void parse_resize(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
{
|
{
|
||||||
xmlNodePtr n;
|
xmlNodePtr n;
|
||||||
|
|
||||||
node = node->xmlChildrenNode;
|
node = node->children;
|
||||||
|
|
||||||
if ((n = parse_find_node("drawContents", node)))
|
if ((n = parse_find_node("drawContents", node)))
|
||||||
config_redraw_resize = parse_bool(doc, n);
|
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;
|
xmlNodePtr n;
|
||||||
|
|
||||||
node = node->xmlChildrenNode;
|
node = node->children;
|
||||||
|
|
||||||
if ((n = parse_find_node("position", node))) {
|
if ((n = parse_find_node("position", node))) {
|
||||||
if (parse_contains("TopLeft", doc, n))
|
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)
|
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")) {
|
if (!xmlStrcasecmp(node->name, (const xmlChar*) "file")) {
|
||||||
gchar *c;
|
gchar *c;
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ static void parse_resistance(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
{
|
{
|
||||||
xmlNodePtr n;
|
xmlNodePtr n;
|
||||||
|
|
||||||
node = node->xmlChildrenNode;
|
node = node->children;
|
||||||
if ((n = parse_find_node("strength", node)))
|
if ((n = parse_find_node("strength", node)))
|
||||||
config_resist_win = parse_int(doc, n);
|
config_resist_win = parse_int(doc, n);
|
||||||
if ((n = parse_find_node("screen_edge_strength", node)))
|
if ((n = parse_find_node("screen_edge_strength", node)))
|
||||||
|
|
|
@ -89,13 +89,13 @@ void menu_startup(gboolean reconfig)
|
||||||
for (it = config_menu_files; it; it = g_slist_next(it)) {
|
for (it = config_menu_files; it; it = g_slist_next(it)) {
|
||||||
if (menu_open(it->data, &doc, &node)) {
|
if (menu_open(it->data, &doc, &node)) {
|
||||||
loaded = TRUE;
|
loaded = TRUE;
|
||||||
parse_tree(menu_parse_inst, doc, node->xmlChildrenNode);
|
parse_tree(menu_parse_inst, doc, node->children);
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!loaded) {
|
if (!loaded) {
|
||||||
if (menu_open("menu.xml", &doc, &node)) {
|
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);
|
xmlFreeDoc(doc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ void menu_pipe_execute(ObMenu *self)
|
||||||
|
|
||||||
menu_parse_state.pipe_creator = self;
|
menu_parse_state.pipe_creator = self;
|
||||||
menu_parse_state.parent = self;
|
menu_parse_state.parent = self;
|
||||||
parse_tree(menu_parse_inst, doc, node->xmlChildrenNode);
|
parse_tree(menu_parse_inst, doc, node->children);
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
} else {
|
} else {
|
||||||
g_warning("Invalid output from pipe-menu: %s", self->execute);
|
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)) {
|
if (parse_attr_string("label", node, &label)) {
|
||||||
GSList *acts = NULL;
|
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"))
|
if (!xmlStrcasecmp(node->name, (const xmlChar*) "action"))
|
||||||
acts = g_slist_append(acts, action_parse
|
acts = g_slist_append(acts, action_parse
|
||||||
(i, doc, node,
|
(i, doc, node,
|
||||||
|
@ -222,7 +222,7 @@ static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
||||||
|
|
||||||
old = state->parent;
|
old = state->parent;
|
||||||
state->parent = menu;
|
state->parent = menu;
|
||||||
parse_tree(i, doc, node->xmlChildrenNode);
|
parse_tree(i, doc, node->children);
|
||||||
state->parent = old;
|
state->parent = old;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -469,7 +469,7 @@ static void session_load(char *path)
|
||||||
g_free(sm_id);
|
g_free(sm_id);
|
||||||
sm_id = id;
|
sm_id = id;
|
||||||
|
|
||||||
node = parse_find_node("window", node->xmlChildrenNode);
|
node = parse_find_node("window", node->children);
|
||||||
while (node) {
|
while (node) {
|
||||||
ObSessionState *state;
|
ObSessionState *state;
|
||||||
|
|
||||||
|
@ -477,52 +477,52 @@ static void session_load(char *path)
|
||||||
|
|
||||||
if (!parse_attr_string("id", node, &state->id))
|
if (!parse_attr_string("id", node, &state->id))
|
||||||
goto session_load_bail;
|
goto session_load_bail;
|
||||||
if (!(n = parse_find_node("name", node->xmlChildrenNode)))
|
if (!(n = parse_find_node("name", node->children)))
|
||||||
goto session_load_bail;
|
goto session_load_bail;
|
||||||
state->name = parse_string(doc, n);
|
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;
|
goto session_load_bail;
|
||||||
state->class = parse_string(doc, n);
|
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;
|
goto session_load_bail;
|
||||||
state->role = parse_string(doc, n);
|
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;
|
goto session_load_bail;
|
||||||
state->stacking = parse_int(doc, n);
|
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;
|
goto session_load_bail;
|
||||||
state->desktop = parse_int(doc, n);
|
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;
|
goto session_load_bail;
|
||||||
state->x = parse_int(doc, n);
|
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;
|
goto session_load_bail;
|
||||||
state->y = parse_int(doc, n);
|
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;
|
goto session_load_bail;
|
||||||
state->w = parse_int(doc, n);
|
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;
|
goto session_load_bail;
|
||||||
state->h = parse_int(doc, n);
|
state->h = parse_int(doc, n);
|
||||||
|
|
||||||
state->shaded =
|
state->shaded =
|
||||||
parse_find_node("shaded", node->xmlChildrenNode) != NULL;
|
parse_find_node("shaded", node->children) != NULL;
|
||||||
state->iconic =
|
state->iconic =
|
||||||
parse_find_node("iconic", node->xmlChildrenNode) != NULL;
|
parse_find_node("iconic", node->children) != NULL;
|
||||||
state->skip_pager =
|
state->skip_pager =
|
||||||
parse_find_node("skip_pager", node->xmlChildrenNode) != NULL;
|
parse_find_node("skip_pager", node->children) != NULL;
|
||||||
state->skip_taskbar =
|
state->skip_taskbar =
|
||||||
parse_find_node("skip_taskbar", node->xmlChildrenNode) != NULL;
|
parse_find_node("skip_taskbar", node->children) != NULL;
|
||||||
state->fullscreen =
|
state->fullscreen =
|
||||||
parse_find_node("fullscreen", node->xmlChildrenNode) != NULL;
|
parse_find_node("fullscreen", node->children) != NULL;
|
||||||
state->above =
|
state->above =
|
||||||
parse_find_node("above", node->xmlChildrenNode) != NULL;
|
parse_find_node("above", node->children) != NULL;
|
||||||
state->below =
|
state->below =
|
||||||
parse_find_node("below", node->xmlChildrenNode) != NULL;
|
parse_find_node("below", node->children) != NULL;
|
||||||
state->max_horz =
|
state->max_horz =
|
||||||
parse_find_node("max_horz", node->xmlChildrenNode) != NULL;
|
parse_find_node("max_horz", node->children) != NULL;
|
||||||
state->max_vert =
|
state->max_vert =
|
||||||
parse_find_node("max_vert", node->xmlChildrenNode) != NULL;
|
parse_find_node("max_vert", node->children) != NULL;
|
||||||
|
|
||||||
/* save this */
|
/* save this */
|
||||||
session_saved_state = g_list_prepend(session_saved_state, state);
|
session_saved_state = g_list_prepend(session_saved_state, state);
|
||||||
|
|
|
@ -136,7 +136,7 @@ void parse_tree(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
|
||||||
|
|
||||||
char *parse_string(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 : "");
|
char *s = g_strdup(c ? (char*)c : "");
|
||||||
xmlFree(c);
|
xmlFree(c);
|
||||||
return s;
|
return s;
|
||||||
|
@ -144,7 +144,7 @@ char *parse_string(xmlDocPtr doc, xmlNodePtr node)
|
||||||
|
|
||||||
int parse_int(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);
|
int i = atoi((char*)c);
|
||||||
xmlFree(c);
|
xmlFree(c);
|
||||||
return i;
|
return i;
|
||||||
|
@ -152,7 +152,7 @@ int parse_int(xmlDocPtr doc, xmlNodePtr node)
|
||||||
|
|
||||||
gboolean parse_bool(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;
|
gboolean b = FALSE;
|
||||||
if (!xmlStrcasecmp(c, (const xmlChar*) "true"))
|
if (!xmlStrcasecmp(c, (const xmlChar*) "true"))
|
||||||
b = TRUE;
|
b = TRUE;
|
||||||
|
@ -166,7 +166,7 @@ gboolean parse_bool(xmlDocPtr doc, xmlNodePtr node)
|
||||||
|
|
||||||
gboolean parse_contains(const char *val, 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;
|
gboolean r;
|
||||||
r = !xmlStrcasecmp(c, (const xmlChar*) val);
|
r = !xmlStrcasecmp(c, (const xmlChar*) val);
|
||||||
xmlFree(c);
|
xmlFree(c);
|
||||||
|
|
Loading…
Reference in a new issue