diff options
| author | Mikael Magnusson <mikachu@comhem.se> | 2008-05-08 19:27:52 +0200 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2010-01-08 17:55:19 -0500 |
| commit | 51257397b04d206e73fb788fba0818c238a61adb (patch) | |
| tree | 9d1f2210abaaef7b97855fa54df0c847dbbba248 /openbox | |
| parent | 0352abfa88892bc17bdff2022745e3c1b312edd0 (diff) | |
Some style changes, less ifdefs.
Diffstat (limited to 'openbox')
| -rw-r--r-- | openbox/imageload.c | 8 | ||||
| -rw-r--r-- | openbox/imageload.h | 4 | ||||
| -rw-r--r-- | openbox/menu.c | 15 |
3 files changed, 12 insertions, 15 deletions
diff --git a/openbox/imageload.c b/openbox/imageload.c index c80aa134..9bfe9187 100644 --- a/openbox/imageload.c +++ b/openbox/imageload.c @@ -26,6 +26,12 @@ #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 diff --git a/openbox/imageload.h b/openbox/imageload.h index 1c7addf3..21e7c9b0 100644 --- a/openbox/imageload.h +++ b/openbox/imageload.h @@ -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 diff --git a/openbox/menu.c b/openbox/menu.c index f53e4f0b..77d9548c 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -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); } } |
