1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 02:25:09 +00:00

Bugfix: vars related to graphics produced wrong output when not running in X

This commit is contained in:
Nikolas Garofil 2009-05-09 14:06:58 +02:00
parent 9153318329
commit 10495ed282

View File

@ -206,27 +206,38 @@ static struct special_t *new_special(char *buf, enum special_types t)
void new_gauge(char *buf, int w, int h, int usage) void new_gauge(char *buf, int w, int h, int usage)
{ {
#ifdef X11
if ((output_methods & TO_X) == 0)
return;
struct special_t *s = new_special(buf, GAUGE); struct special_t *s = new_special(buf, GAUGE);
s->arg = (usage > 255) ? 255 : ((usage < 0) ? 0 : usage); s->arg = (usage > 255) ? 255 : ((usage < 0) ? 0 : usage);
s->width = w; s->width = w;
s->height = h; s->height = h;
#endif
} }
void new_bar(char *buf, int w, int h, int usage) void new_bar(char *buf, int w, int h, int usage)
{ {
#ifdef X11
if ((output_methods & TO_X) == 0)
return;
struct special_t *s = new_special(buf, BAR); struct special_t *s = new_special(buf, BAR);
s->arg = (usage > 255) ? 255 : ((usage < 0) ? 0 : usage); s->arg = (usage > 255) ? 255 : ((usage < 0) ? 0 : usage);
s->width = w; s->width = w;
s->height = h; s->height = h;
#endif
} }
void new_font(char *buf, char *args) void new_font(char *buf, char *args)
{ {
#ifdef X11
if ((output_methods & TO_X) == 0) if ((output_methods & TO_X) == 0)
return; return;
#ifdef X11
if (args) { if (args) {
struct special_t *s = new_special(buf, FONT); struct special_t *s = new_special(buf, FONT);
@ -284,6 +295,10 @@ static void graph_append(struct special_t *graph, double f, char showaslog)
void new_graph(char *buf, int w, int h, unsigned int first_colour, void new_graph(char *buf, int w, int h, unsigned int first_colour,
unsigned int second_colour, double i, int scale, int append, char showaslog) unsigned int second_colour, double i, int scale, int append, char showaslog)
{ {
#ifdef X11
if ((output_methods & TO_X) == 0)
return;
struct special_t *s = new_special(buf, GRAPH); struct special_t *s = new_special(buf, GRAPH);
s->width = w; s->width = w;
@ -321,29 +336,50 @@ void new_graph(char *buf, int w, int h, unsigned int first_colour,
if (append) { if (append) {
graph_append(s, i, showaslog); graph_append(s, i, showaslog);
} }
#endif
} }
void new_hr(char *buf, int a) void new_hr(char *buf, int a)
{ {
#ifdef X11
if ((output_methods & TO_X) == 0)
return;
new_special(buf, HORIZONTAL_LINE)->height = a; new_special(buf, HORIZONTAL_LINE)->height = a;
#endif
} }
void new_stippled_hr(char *buf, int a, int b) void new_stippled_hr(char *buf, int a, int b)
{ {
#ifdef X11
if ((output_methods & TO_X) == 0)
return;
struct special_t *s = new_special(buf, STIPPLED_HR); struct special_t *s = new_special(buf, STIPPLED_HR);
s->height = b; s->height = b;
s->arg = a; s->arg = a;
#endif
} }
void new_fg(char *buf, long c) void new_fg(char *buf, long c)
{ {
#ifdef X11
if ((output_methods & TO_X) == 0)
return;
new_special(buf, FG)->arg = c; new_special(buf, FG)->arg = c;
#endif
} }
void new_bg(char *buf, long c) void new_bg(char *buf, long c)
{ {
#ifdef X11
if ((output_methods & TO_X) == 0)
return;
new_special(buf, BG)->arg = c; new_special(buf, BG)->arg = c;
#endif
} }
void new_outline(char *buf, long c) void new_outline(char *buf, long c)