mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 18:45:10 +00:00
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
This commit is contained in:
parent
bdc57586fc
commit
a71b2f8c3f
112
src/conky.c
112
src/conky.c
@ -50,62 +50,6 @@
|
|||||||
/* #define SIGNAL_BLOCKING */
|
/* #define SIGNAL_BLOCKING */
|
||||||
#undef 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()
|
static void print_version()
|
||||||
{
|
{
|
||||||
printf("Conky %s compiled %s for %s\n",
|
printf("Conky %s compiled %s for %s\n",
|
||||||
@ -165,6 +109,62 @@ static void print_version()
|
|||||||
exit(0);
|
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)
|
int addfont(const char *data_in)
|
||||||
{
|
{
|
||||||
if (font_count > MAX_FONTS) {
|
if (font_count > MAX_FONTS) {
|
||||||
|
Loading…
Reference in New Issue
Block a user