diff --git a/cmake/config.h.in b/cmake/config.h.in index ac9e4d59..0050d645 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -85,7 +85,13 @@ #cmakedefine HAVE_ICONV 1 -#cmakedefine LUA_EXTRAS 1 +#cmakedefine BUILD_LUA_CAIRO 1 + +#cmakedefine BUILD_LUA_IMLIB2 1 + +#if defined(BUILD_LUA_CAIRO) || defined(BUILD_LUA_IMLIB2) +#define BUILD_LUA_EXTRAS +#endif #cmakedefine BUILD_IBM 1 diff --git a/src/conky.cc b/src/conky.cc index 4d329984..c552fa78 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -54,9 +54,9 @@ #ifdef BUILD_XDAMAGE #include #endif -#ifdef IMLIB2 +#ifdef BUILD_IMLIB2 #include "imlib2.h" -#endif /* IMLIB2 */ +#endif /* BUILD_IMLIB2 */ #endif /* BUILD_X11 */ #include #include @@ -1755,9 +1755,9 @@ static void draw_text(void) static void draw_stuff(void) { -#ifdef IMLIB2 +#ifdef BUILD_IMLIB2 cimlib_render(text_start_x, text_start_y, window.width, window.height); -#endif /* IMLIB2 */ +#endif /* BUILD_IMLIB2 */ if (overwrite_file) { overwrite_fpointer = fopen(overwrite_file, "w"); if(!overwrite_fpointer) @@ -1845,9 +1845,9 @@ static int need_to_update; /* update_text() generates new text and clears old text area */ static void update_text(void) { -#ifdef IMLIB2 +#ifdef BUILD_IMLIB2 cimlib_cleanup(); -#endif /* IMLIB2 */ +#endif /* BUILD_IMLIB2 */ generate_text(); #ifdef BUILD_X11 if (output_methods & TO_X) @@ -2460,10 +2460,10 @@ void clean_up(void *memtofree1, void* memtofree2) llua_shutdown_hook(); llua_close(); #endif /* BUILD_LUA */ -#ifdef IMLIB2 +#ifdef BUILD_IMLIB2 if (output_methods & TO_X) cimlib_deinit(); -#endif /* IMLIB2 */ +#endif /* BUILD_IMLIB2 */ #ifdef BUILD_WEATHER_XOAP xmlCleanupParser(); #endif /* BUILD_WEATHER_XOAP */ @@ -3458,7 +3458,7 @@ char load_config_file(const char *f) stippled_borders = 4; } } -#ifdef IMLIB2 +#ifdef BUILD_IMLIB2 CONF("imlib_cache_size") { if (value) { cimlib_set_cache_size(atoi(value)); @@ -3469,7 +3469,7 @@ char load_config_file(const char *f) cimlib_set_cache_flush_interval(atoi(value)); } } -#endif /* IMLIB2 */ +#endif /* BUILD_IMLIB2 */ #endif /* BUILD_X11 */ CONF("update_interval_on_battery") { if (value) { diff --git a/src/llua.cc b/src/llua.cc index d5639b29..1ba00351 100644 --- a/src/llua.cc +++ b/src/llua.cc @@ -28,11 +28,11 @@ #include "logging.h" #include "build.h" +#ifdef BUILD_LUA_EXTRAS extern "C" { -#ifdef LUA_EXTRAS #include -#endif /* LUA_EXTRAS */ } +#endif /* BUILD_LUA_EXTRAS */ #ifdef HAVE_SYS_INOTIFY_H #include @@ -129,7 +129,7 @@ void llua_init(void) lua_pushcfunction(lua_L, &llua_conky_set_update_interval); lua_setglobal(lua_L, "conky_set_update_interval"); -#if defined(BUILD_X11) && defined(LUA_EXTRAS) +#if defined(BUILD_X11) && defined(BUILD_LUA_EXTRAS) /* register tolua++ user types */ tolua_open(lua_L); tolua_usertype(lua_L, "Drawable"); @@ -455,13 +455,13 @@ void llua_set_draw_post_hook(const char *args) draw_post_hook = strdup(args); } -#ifdef LUA_EXTRAS +#ifdef BUILD_LUA_EXTRAS void llua_set_userdata(const char *key, const char *type, void *value) { tolua_pushusertype(lua_L, value, type); lua_setfield(lua_L, -2, key); } -#endif /* LUA_EXTRAS */ +#endif /* BUILD_LUA_EXTRAS */ void llua_setup_window_table(int text_start_x, int text_start_y, int text_width, int text_height) { @@ -469,11 +469,11 @@ void llua_setup_window_table(int text_start_x, int text_start_y, int text_width, lua_newtable(lua_L); if (output_methods & TO_X) { -#ifdef LUA_EXTRAS +#ifdef BUILD_LUA_EXTRAS llua_set_userdata("drawable", "Drawable", (void*)&window.drawable); llua_set_userdata("visual", "Visual", window.visual); llua_set_userdata("display", "Display", display); -#endif /* LUA_EXTRAS */ +#endif /* BUILD_LUA_EXTRAS */ llua_set_number("width", window.width); diff --git a/src/x11.cc b/src/x11.cc index ef865972..689ab4e3 100644 --- a/src/x11.cc +++ b/src/x11.cc @@ -38,9 +38,9 @@ #include #include #include -#ifdef IMLIB2 +#ifdef BUILD_IMLIB2 #include "imlib2.h" -#endif /* IMLIB2 */ +#endif /* BUILD_IMLIB2 */ #ifdef BUILD_XFT #include @@ -567,11 +567,11 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour, fprintf(stderr, PACKAGE_NAME": drawing to single buffer\n"); } #endif -#ifdef IMLIB2 +#ifdef BUILD_IMLIB2 { cimlib_init(display, window.drawable, window.visual, window.colourmap); } -#endif /* IMLIB2 */ +#endif /* BUILD_IMLIB2 */ XFlush(display); XSelectInput(display, window.window, ExposureMask | PropertyChangeMask