menu_parse_state.parent = NULL;
menu_parse_state.pipe_creator = NULL;
- parse_register(menu_parse_inst, "menu", parse_menu, &menu_parse_state);
- parse_register(menu_parse_inst, "item", parse_menu_item,
- &menu_parse_state);
- parse_register(menu_parse_inst, "separator",
- parse_menu_separator, &menu_parse_state);
+ obt_parse_register(menu_parse_inst, "menu", parse_menu, &menu_parse_state);
+ obt_parse_register(menu_parse_inst, "item", parse_menu_item,
+ &menu_parse_state);
+ obt_parse_register(menu_parse_inst, "separator",
+ parse_menu_separator, &menu_parse_state);
for (it = config_menu_files; it; it = g_slist_next(it)) {
- if (parse_load_menu(it->data, &doc, &node)) {
+ if (obt_parse_load_config_file(menu_parse_inst,
+ "openbox",
+ it->data,
+ "openbox_menu"))
+ {
loaded = TRUE;
- parse_tree(menu_parse_inst, doc, node->children);
- xmlFreeDoc(doc);
+ obt_parse_tree_from_root(menu_parse_inst);
+ obt_parse_close(menu_parse_inst);
} else
- g_message(_("Unable to find a valid menu file '%s'"),
+ g_message(_("Unable to find a valid menu file \"%s\""),
(const gchar*)it->data);
}
if (!loaded) {
- if (parse_load_menu("menu.xml", &doc, &node)) {
- parse_tree(menu_parse_inst, doc, node->children);
- xmlFreeDoc(doc);
+ if (obt_parse_load_config_file(menu_parse_inst,
+ "openbox",
+ "menu.xml",
+ "openbox_menu"))
+ {
+ obt_parse_tree_from_root(menu_parse_inst);
+ obt_parse_close(menu_parse_inst);
} else
- g_message(_("Unable to find a valid menu file '%s'"),
+ g_message(_("Unable to find a valid menu file \"%s\""),
"menu.xml");
}
{
menu_parse_state.pipe_creator = self;
menu_parse_state.parent = self;
- parse_tree(menu_parse_inst, doc, node->children);
- xmlFreeDoc(doc);
+ obt_parse_tree_from_root(menu_parse_inst);
+ obt_parse_close(menu_parse_inst);
} else {
- g_message(_("Invalid output from pipe-menu '%s'"), self->execute);
+ g_message(_("Invalid output from pipe-menu \"%s\""), self->execute);
}
g_free(output);
sm_argc = argc;
sm_argv = argv;
- dir = g_build_filename(parse_xdg_data_home_path(),
+ p = obt_paths_new();
+ dir = g_build_filename(obt_paths_cache_home(p),
"openbox", "sessions", NULL);
- if (!parse_mkdir_path(dir, 0700)) {
+ obt_paths_unref(p), p = NULL;
+
+ if (!obt_paths_mkdir_path(dir, 0700)) {
- g_message(_("Unable to make directory '%s': %s"),
+ g_message(_("Unable to make directory \"%s\": %s"),
dir, g_strerror(errno));
}
/* W = windows key, is linked to the Super_L/R buttons */
else if (!g_ascii_strcasecmp("Super", str) ||
!g_ascii_strcasecmp("W", str))
- mask = modkeys_key_to_mask(OB_MODKEY_KEY_SUPER);
+ mask = obt_keyboard_modkey_to_modmask(OBT_KEYBOARD_MODKEY_SUPER);
else if (!g_ascii_strcasecmp("Shift", str) ||
!g_ascii_strcasecmp("S", str))
- mask = modkeys_key_to_mask(OB_MODKEY_KEY_SHIFT);
+ mask = obt_keyboard_modkey_to_modmask(OBT_KEYBOARD_MODKEY_SHIFT);
else if (!g_ascii_strcasecmp("Hyper", str) ||
!g_ascii_strcasecmp("H", str))
- mask = modkeys_key_to_mask(OB_MODKEY_KEY_HYPER);
+ mask = obt_keyboard_modkey_to_modmask(OBT_KEYBOARD_MODKEY_HYPER);
else
- g_message(_("Invalid modifier key '%s' in key/mouse binding"), str);
+ g_message(_("Invalid modifier key \"%s\" in key/mouse binding"), str);
return mask;
}
/* figure out the keycode */
sym = XStringToKeysym(l);
if (sym == NoSymbol) {
- g_message(_("Invalid key name '%s' in key binding"), l);
+ g_message(_("Invalid key name \"%s\" in key binding"), l);
goto translation_fail;
}
- *keycode = XKeysymToKeycode(ob_display, sym);
+ *keycode = XKeysymToKeycode(obt_display, sym);
}
if (!*keycode) {
- g_message(_("Requested key '%s' does not exist on the display"), l);
+ g_message(_("Requested key \"%s\" does not exist on the display"), l);
goto translation_fail;
}