]> Dogcows Code - chaz/openbox/commitdiff
Some style changes, less ifdefs.
authorMikael Magnusson <mikachu@comhem.se>
Thu, 8 May 2008 17:27:52 +0000 (19:27 +0200)
committerDana Jansens <danakj@orodu.net>
Fri, 8 Jan 2010 22:55:19 +0000 (17:55 -0500)
Makefile.am
openbox/imageload.c
openbox/imageload.h
openbox/menu.c

index f13d52ac2cd1a5964b342887d3c2deb020a3e7b6..164724676d3f3ba3dfbb4513cb257e8846008bc4 100644 (file)
@@ -244,6 +244,7 @@ openbox_openbox_SOURCES = \
        openbox/grab.h \
        openbox/group.c \
        openbox/group.h \
+       openbox/imageload.c \
        openbox/imageload.h \
        openbox/keyboard.c \
        openbox/keyboard.h \
@@ -284,9 +285,6 @@ openbox_openbox_SOURCES = \
        openbox/window.c \
        openbox/window.h
 
-if USE_IMLIB2
-    openbox_openbox_SOURCES += openbox/imageload.c
-endif
 
 ## gnome-panel-control ##
 
index c80aa134981b5f83803a729bf458efc87339dd48..9bfe918705ce73971abfa93289518a1ab02399fb 100644 (file)
 #include "imageload.h"
 #include <Imlib2.h>
 
+#ifndef USE_IMLIB2
+RrImage* RrImageFetchFromFile(RrImageCache *cache, const gchar *name)
+{
+    return NULL;
+}
+#else
 
 static void CreateFileNameTable(RrImageCache *self)
 {
@@ -133,3 +139,5 @@ RrImage* RrImageFetchFromFile(RrImageCache *cache, const gchar *name)
 
     return rr_image;
 }
+
+#endif
index 1c7addf3b9297be5d5b38bbc5d0f8e13d139ae03..21e7c9b09f20e7a3f3d37772fb51648bd8f1ed1c 100644 (file)
@@ -1,11 +1,7 @@
 #ifndef __imageload_h
 #define __imageload_h
 
-#ifdef USE_IMLIB2
 #include "obrender/render.h"
 RrImage* RrImageFetchFromFile(RrImageCache *cache, const gchar *name);
-#else
-#define RrImageFetchFromFile(cache, name) NULL
-#endif
 
 #endif
index f53e4f0b44661e23cc82f69c17750fd865750f93..77d9548c0da34069884a41d57042230849f9751a 100644 (file)
@@ -270,19 +270,17 @@ static void parse_menu_item(xmlNodePtr node,  gpointer data)
 {
     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 &&
             obt_xml_attr_string(node, "icon", &icon)))
-               icon = NULL;
-        #endif
+        {
+            icon = NULL;
+        }
 
         if (obt_xml_attr_string(node, "label", &label)) {
             GSList *acts = NULL;
@@ -296,17 +294,12 @@ static void parse_menu_item(xmlNodePtr node,  gpointer data)
             }
             e = menu_add_normal(state->parent, -1, label, acts, TRUE);
             
-            #ifdef USE_IMLIB2
             if (icon) { /* Icon will be used. */
                 e->data.normal.icon = RrImageFetchFromFile(ob_rr_icons, icon);
-                if (e->data.normal.icon) {
+                if (e->data.normal.icon)
                     e->data.normal.icon_alpha = 0xff;
-                }
                 g_free(icon);
             }
-
-            menu_add_normal(state->parent, -1, label, acts, TRUE);
-            #endif
             g_free(label);
         }
     }
This page took 0.029232 seconds and 4 git commands to generate.