Merge branch 'imlib2' into wip/mikabox
authorMikael Magnusson <mikachu@comhem.se>
Mon, 28 Apr 2008 22:08:57 +0000 (00:08 +0200)
committerMikael Magnusson <mikachu@comhem.se>
Mon, 28 Apr 2008 22:08:57 +0000 (00:08 +0200)
Conflicts:

Makefile.am
openbox/config.c
openbox/menu.c

1  2 
Makefile.am
configure.ac
openbox/config.c
openbox/config.h
openbox/menu.c
render/image.c
render/render.h

diff --cc Makefile.am
index c0d7f261a20df4ed3f589a0e7b5d6ca2ed7349cf,1226d154b25171eb04bdf9950a8e5c8806ab29bc..b5c9db82fa022939e5032d0bcf9a11cd0d9130d9
@@@ -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 \
        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 \
        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 configure.ac
Simple merge
index 5a8b4527430c79cf70e4dc6a70b2b9eb64ac2c97,2ba42505dcddc446b06bf2f4eb14a6aa5a47ced5..fc628ce0d8be3be46a61e6129d1975c747239dcb
@@@ -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;
  
Simple merge
diff --cc openbox/menu.c
index f7d50e39f0f59f8e05b7c1b1e805827beb2bab33,fc42abc850d5f1274db01764741d61e004a35f3c..390f9dde68bc2934182585a3788934676589b9c4
@@@ -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) {
 -            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)
diff --cc render/image.c
index 0ab213747acd4a6c105e90ce9635732b8ca96e26,a9deeefc295bfdadd5c4c0a68ed2ade85448bea8..ce183ba193b58e53b5a7436af9818ee77d519625
@@@ -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)
diff --cc render/render.h
Simple merge