From: Dana Jansens Date: Thu, 21 Feb 2008 18:24:19 +0000 (-0500) Subject: Merge branch 'backport' into work X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=198d98986bdf224ed29361541d19841339953088;p=chaz%2Fopenbox Merge branch 'backport' into work Conflicts: openbox/openbox.c openbox/session.c --- 198d98986bdf224ed29361541d19841339953088 diff --cc openbox/menu.c index 63b74b95,0c10b757..432aa2be --- a/openbox/menu.c +++ b/openbox/menu.c @@@ -82,35 -88,27 +82,35 @@@ void menu_startup(gboolean reconfig 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"); } @@@ -179,10 -179,10 +179,10 @@@ void menu_pipe_execute(ObMenu *self { 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); diff --cc openbox/session.c index 3822d414,0f74ec28..99d66221 --- a/openbox/session.c +++ b/openbox/session.c @@@ -98,13 -97,10 +98,13 @@@ void session_startup(gint argc, gchar * 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)); } diff --cc openbox/translate.c index 7e89e32c,bd8b88f6..50d50008 --- a/openbox/translate.c +++ b/openbox/translate.c @@@ -48,15 -48,15 +48,15 @@@ static guint translate_modifier(gchar * /* 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; } @@@ -142,13 -142,13 +142,13 @@@ gboolean translate_key(const gchar *str /* 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; }