From a71b2f8c3fd49a1c1d220e97bd48fd0205befc21 Mon Sep 17 00:00:00 2001 From: Roman Bogorodskiy Date: Thu, 24 Aug 2006 18:01:22 +0000 Subject: [PATCH] Fix build when configured with "--disable-x11" by moving print_version() out of #ifdef X11. git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@695 7f574dfc-610e-0410-a909-a81674777703 --- src/conky.c | 112 ++++++++++++++++++++++++++-------------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/src/conky.c b/src/conky.c index f9188c35..506c14de 100644 --- a/src/conky.c +++ b/src/conky.c @@ -50,62 +50,6 @@ /* #define SIGNAL_BLOCKING */ #undef SIGNAL_BLOCKING -#ifdef X11 - -/* - * text size - */ - -static int text_start_x, text_start_y; /* text start position in window */ -static int text_width, text_height; - -/* alignments */ -enum alignment { - TOP_LEFT = 1, - TOP_RIGHT, - BOTTOM_LEFT, - BOTTOM_RIGHT, - NONE -}; - - -/* for fonts */ -struct font_list { - - char name[TEXT_BUFFER_SIZE]; - int num; - XFontStruct *font; - -#ifdef XFT - XftFont *xftfont; - int font_alpha; -#endif - -}; -static int selected_font = 0; -static int font_count = -1; -struct font_list *fonts = NULL; - -#ifdef XFT - -#define font_height() (use_xft ? (fonts[selected_font].xftfont->ascent + fonts[selected_font].xftfont->descent) : \ -(fonts[selected_font].font->max_bounds.ascent + fonts[selected_font].font->max_bounds.descent)) -#define font_ascent() (use_xft ? fonts[selected_font].xftfont->ascent : fonts[selected_font].font->max_bounds.ascent) -#define font_descent() (use_xft ? fonts[selected_font].xftfont->descent : fonts[selected_font].font->max_bounds.descent) - -#else - -#define font_height() (fonts[selected_font].font->max_bounds.ascent + fonts[selected_font].font->max_bounds.descent) -#define font_ascent() fonts[selected_font].font->max_bounds.ascent -#define font_descent() fonts[selected_font].font->max_bounds.descent - -#endif - -#define MAX_FONTS 64 // hmm, no particular reason, just makes sense. - - -static void set_font(); - static void print_version() { printf("Conky %s compiled %s for %s\n", @@ -165,6 +109,62 @@ static void print_version() exit(0); } +#ifdef X11 + +/* + * text size + */ + +static int text_start_x, text_start_y; /* text start position in window */ +static int text_width, text_height; + +/* alignments */ +enum alignment { + TOP_LEFT = 1, + TOP_RIGHT, + BOTTOM_LEFT, + BOTTOM_RIGHT, + NONE +}; + + +/* for fonts */ +struct font_list { + + char name[TEXT_BUFFER_SIZE]; + int num; + XFontStruct *font; + +#ifdef XFT + XftFont *xftfont; + int font_alpha; +#endif + +}; +static int selected_font = 0; +static int font_count = -1; +struct font_list *fonts = NULL; + +#ifdef XFT + +#define font_height() (use_xft ? (fonts[selected_font].xftfont->ascent + fonts[selected_font].xftfont->descent) : \ +(fonts[selected_font].font->max_bounds.ascent + fonts[selected_font].font->max_bounds.descent)) +#define font_ascent() (use_xft ? fonts[selected_font].xftfont->ascent : fonts[selected_font].font->max_bounds.ascent) +#define font_descent() (use_xft ? fonts[selected_font].xftfont->descent : fonts[selected_font].font->max_bounds.descent) + +#else + +#define font_height() (fonts[selected_font].font->max_bounds.ascent + fonts[selected_font].font->max_bounds.descent) +#define font_ascent() fonts[selected_font].font->max_bounds.ascent +#define font_descent() fonts[selected_font].font->max_bounds.descent + +#endif + +#define MAX_FONTS 64 // hmm, no particular reason, just makes sense. + + +static void set_font(); + int addfont(const char *data_in) { if (font_count > MAX_FONTS) {