From: Mikael Magnusson Date: Mon, 28 Apr 2008 22:08:57 +0000 (+0200) Subject: Merge branch 'imlib2' into wip/mikabox X-Git-Tag: mikabox-3.4.7.2~42 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=ba3acf3148184d1591aba3498335d6d9f66d7af1;p=mikachu%2Fopenbox.git Merge branch 'imlib2' into wip/mikabox Conflicts: Makefile.am openbox/config.c openbox/menu.c --- ba3acf3148184d1591aba3498335d6d9f66d7af1 diff --cc Makefile.am index c0d7f261,1226d154..b5c9db82 --- a/Makefile.am +++ b/Makefile.am @@@ -161,8 -151,9 +162,9 @@@ openbox_openbox_LDADD = $(XML_LIBS) \ $(EFENCE_LIBS) \ $(LIBINTL) \ + $(IMLIB2_LIBS) \ render/libobrender.la \ - parser/libobparser.la + obt/libobt.la openbox_openbox_LDFLAGS = -export-dynamic openbox_openbox_SOURCES = \ gettext.h \ @@@ -248,8 -233,7 +250,9 @@@ openbox/grab.h \ openbox/group.c \ openbox/group.h \ + openbox/hooks.c \ + openbox/hooks.h \ + openbox/imageload.h \ openbox/keyboard.c \ openbox/keyboard.h \ openbox/keytree.c \ @@@ -287,8 -277,15 +290,12 @@@ openbox/translate.c \ openbox/translate.h \ openbox/window.c \ - openbox/window.h \ - openbox/xerror.c \ - openbox/xerror.h + openbox/window.h + if USE_IMLIB2 + openbox_openbox_SOURCES += openbox/imageload.c + endif + - ## gnome-panel-control ## tools_gnome_panel_control_gnome_panel_control_CPPFLAGS = \ diff --cc openbox/config.c index 5a8b4527,2ba42505..fc628ce0 --- a/openbox/config.c +++ b/openbox/config.c @@@ -830,21 -791,29 +831,30 @@@ static void parse_menu(xmlNodePtr node 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; } @@@ -1041,10 -1009,9 +1051,11 @@@ void config_startup(ObtParseInst *i 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; diff --cc openbox/menu.c index f7d50e39,fc42abc8..390f9dde --- a/openbox/menu.c +++ b/openbox/menu.c @@@ -34,8 -35,8 +34,9 @@@ #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; @@@ -266,9 -268,21 +267,21 @@@ static void parse_menu_item(xmlNodePtr { ObMenuParseState *state = data; gchar *label; + #ifdef USE_IMLIB2 + gchar *icon; + #endif + ObMenuEntry *e; if (state->parent) { + #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 && - parse_attr_string("icon", node, &icon))) ++ obt_parse_attr_string(node, "icon", &icon))) + icon = NULL; + #endif + - if (parse_attr_string("label", node, &label)) { + if (obt_parse_attr_string(node, "label", &label)) { GSList *acts = NULL; for (node = node->children; node; node = node->next) diff --cc render/image.c index 0ab21374,a9deeefc..ce183ba1 --- a/render/image.c +++ b/render/image.c @@@ -330,9 -336,11 +336,11 @@@ void RrImageUnref(RrImage *self { 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)