xmlNodePtr n;
node = node->children;
- if ((n = parse_find_node("hideDelay", node)))
- config_menu_hide_delay = parse_int(doc, n);
- if ((n = parse_find_node("middle", node)))
- config_menu_middle = parse_bool(doc, n);
- if ((n = parse_find_node("submenuShowDelay", node)))
- config_submenu_show_delay = parse_int(doc, n);
- if ((n = parse_find_node("applicationIcons", node)))
- config_menu_client_list_icons = parse_bool(doc, n);
- if ((n = parse_find_node("manageDesktops", node)))
- config_menu_manage_desktops = parse_bool(doc, n);
- if ((n = parse_find_node("showIcons", node))) {
- config_menu_user_show_icons = parse_bool(doc, n);
- #ifndef USE_IMLIB2
+ if ((n = obt_parse_find_node(node, "hideDelay")))
+ config_menu_hide_delay = obt_parse_node_int(n);
+ if ((n = obt_parse_find_node(node, "middle")))
+ config_menu_middle = obt_parse_node_bool(n);
+ if ((n = obt_parse_find_node(node, "submenuShowDelay")))
+ config_submenu_show_delay = obt_parse_node_int(n);
+ if ((n = obt_parse_find_node(node, "applicationIcons")))
+ config_menu_client_list_icons = obt_parse_node_bool(n);
+ if ((n = obt_parse_find_node(node, "manageDesktops")))
+ config_menu_manage_desktops = obt_parse_node_bool(n);
+
++ if ((n = obt_parse_find_node(node, "showIcons"))) {
++ config_menu_user_show_icons = obt_parse_node_bool(n);
++#ifndef USE_IMLIB2
+ if (config_menu_user_show_icons)
+ g_message(_("Openbox was compiled without Imlib2."
+ " Icons in user-defined menus will NOT be loaded."));
- #endif
++#endif
+ }
+
- while ((node = parse_find_node("file", node))) {
- gchar *c = parse_string(doc, node);
+ while ((node = obt_parse_find_node(node, "file"))) {
+ gchar *c = obt_parse_node_string(node);
config_menu_files = g_slist_append(config_menu_files,
- parse_expand_tilde(c));
+ obt_paths_expand_tilde(c));
g_free(c);
node = node->next;
}
config_menu_client_list_icons = TRUE;
config_menu_manage_desktops = TRUE;
config_menu_files = NULL;
+ config_menu_user_show_icons = TRUE;
- parse_register(i, "menu", parse_menu, NULL);
+ obt_parse_register(i, "menu", parse_menu, NULL);
+
+ obt_parse_register(i, "hooks", parse_hooks, NULL);
config_per_app_settings = NULL;
#include "client_list_menu.h"
#include "client_list_combined_menu.h"
#include "gettext.h"
-#include "parser/parse.h"
+#include "obt/parse.h"
+#include "obt/paths.h"
+ #include "imageload.h"
typedef struct _ObMenuParseState ObMenuParseState;
{
ObMenuParseState *state = data;
gchar *label;
+ #ifdef USE_IMLIB2
+ gchar *icon;
+ #endif
+ ObMenuEntry *e;
if (state->parent) {
- parse_attr_string("icon", node, &icon)))
+ #ifdef USE_IMLIB2
+ /* Don't try to extract "icon" attribute if icons in user-defined
+ menus are not enabled. */
+ if (!(config_menu_user_show_icons &&
- if (parse_attr_string("label", node, &label)) {
++ obt_parse_attr_string(node, "icon", &icon)))
+ icon = NULL;
+ #endif
+
+ if (obt_parse_attr_string(node, "label", &label)) {
GSList *acts = NULL;
for (node = node->children; node; node = node->next)
{
if (self && --self->ref == 0) {
#ifdef DEBUG
- g_message("Refcount to 0, removing ALL pictures from the cache:\n "
- "Image 0x%x", (guint)self);
+ g_debug("Refcount to 0, removing ALL pictures from the cache:\n "
+ "Image 0x%x", (guint)self);
#endif
+ if (self->destroy_func)
+ self->destroy_func(self);
while (self->n_original > 0)
RemovePicture(self, &self->original, 0, &self->n_original);
while (self->n_resized > 0)