mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 11:05:18 +00:00
color: convert to callbacks.print
This commit is contained in:
parent
08122354a9
commit
1a6803454c
35
src/conky.c
35
src/conky.c
@ -898,41 +898,6 @@ void generate_text_internal(char *p, int p_max_size,
|
|||||||
OBJ(loadgraph) {
|
OBJ(loadgraph) {
|
||||||
print_loadgraph(obj, p, p_max_size);
|
print_loadgraph(obj, p, p_max_size);
|
||||||
}
|
}
|
||||||
#endif /* X11 */
|
|
||||||
OBJ(color) {
|
|
||||||
new_fg(obj, p, p_max_size);
|
|
||||||
}
|
|
||||||
#ifdef X11
|
|
||||||
OBJ(color0) {
|
|
||||||
new_fg(obj, p, p_max_size);
|
|
||||||
}
|
|
||||||
OBJ(color1) {
|
|
||||||
new_fg(obj, p, p_max_size);
|
|
||||||
}
|
|
||||||
OBJ(color2) {
|
|
||||||
new_fg(obj, p, p_max_size);
|
|
||||||
}
|
|
||||||
OBJ(color3) {
|
|
||||||
new_fg(obj, p, p_max_size);
|
|
||||||
}
|
|
||||||
OBJ(color4) {
|
|
||||||
new_fg(obj, p, p_max_size);
|
|
||||||
}
|
|
||||||
OBJ(color5) {
|
|
||||||
new_fg(obj, p, p_max_size);
|
|
||||||
}
|
|
||||||
OBJ(color6) {
|
|
||||||
new_fg(obj, p, p_max_size);
|
|
||||||
}
|
|
||||||
OBJ(color7) {
|
|
||||||
new_fg(obj, p, p_max_size);
|
|
||||||
}
|
|
||||||
OBJ(color8) {
|
|
||||||
new_fg(obj, p, p_max_size);
|
|
||||||
}
|
|
||||||
OBJ(color9) {
|
|
||||||
new_fg(obj, p, p_max_size);
|
|
||||||
}
|
|
||||||
#endif /* X11 */
|
#endif /* X11 */
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
OBJ(disk_protect) {
|
OBJ(disk_protect) {
|
||||||
|
12
src/core.c
12
src/core.c
@ -151,6 +151,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
|||||||
if (s[0] == '#') {
|
if (s[0] == '#') {
|
||||||
obj->type = OBJ_color;
|
obj->type = OBJ_color;
|
||||||
obj->data.l = get_x11_color(s);
|
obj->data.l = get_x11_color(s);
|
||||||
|
obj->callbacks.print = &new_fg;
|
||||||
} else
|
} else
|
||||||
#endif /* X11 */
|
#endif /* X11 */
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
@ -445,36 +446,47 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
|||||||
init_pair(obj->data.l, obj->data.l, COLOR_BLACK);
|
init_pair(obj->data.l, obj->data.l, COLOR_BLACK);
|
||||||
}
|
}
|
||||||
#endif /* NCURSES */
|
#endif /* NCURSES */
|
||||||
|
obj->callbacks.print = &new_fg;
|
||||||
END OBJ(color0, 0)
|
END OBJ(color0, 0)
|
||||||
obj->data.l = color0;
|
obj->data.l = color0;
|
||||||
set_current_text_color(obj->data.l);
|
set_current_text_color(obj->data.l);
|
||||||
|
obj->callbacks.print = &new_fg;
|
||||||
END OBJ(color1, 0)
|
END OBJ(color1, 0)
|
||||||
obj->data.l = color1;
|
obj->data.l = color1;
|
||||||
set_current_text_color(obj->data.l);
|
set_current_text_color(obj->data.l);
|
||||||
|
obj->callbacks.print = &new_fg;
|
||||||
END OBJ(color2, 0)
|
END OBJ(color2, 0)
|
||||||
obj->data.l = color2;
|
obj->data.l = color2;
|
||||||
set_current_text_color(obj->data.l);
|
set_current_text_color(obj->data.l);
|
||||||
|
obj->callbacks.print = &new_fg;
|
||||||
END OBJ(color3, 0)
|
END OBJ(color3, 0)
|
||||||
obj->data.l = color3;
|
obj->data.l = color3;
|
||||||
set_current_text_color(obj->data.l);
|
set_current_text_color(obj->data.l);
|
||||||
|
obj->callbacks.print = &new_fg;
|
||||||
END OBJ(color4, 0)
|
END OBJ(color4, 0)
|
||||||
obj->data.l = color4;
|
obj->data.l = color4;
|
||||||
set_current_text_color(obj->data.l);
|
set_current_text_color(obj->data.l);
|
||||||
|
obj->callbacks.print = &new_fg;
|
||||||
END OBJ(color5, 0)
|
END OBJ(color5, 0)
|
||||||
obj->data.l = color5;
|
obj->data.l = color5;
|
||||||
set_current_text_color(obj->data.l);
|
set_current_text_color(obj->data.l);
|
||||||
|
obj->callbacks.print = &new_fg;
|
||||||
END OBJ(color6, 0)
|
END OBJ(color6, 0)
|
||||||
obj->data.l = color6;
|
obj->data.l = color6;
|
||||||
set_current_text_color(obj->data.l);
|
set_current_text_color(obj->data.l);
|
||||||
|
obj->callbacks.print = &new_fg;
|
||||||
END OBJ(color7, 0)
|
END OBJ(color7, 0)
|
||||||
obj->data.l = color7;
|
obj->data.l = color7;
|
||||||
set_current_text_color(obj->data.l);
|
set_current_text_color(obj->data.l);
|
||||||
|
obj->callbacks.print = &new_fg;
|
||||||
END OBJ(color8, 0)
|
END OBJ(color8, 0)
|
||||||
obj->data.l = color8;
|
obj->data.l = color8;
|
||||||
set_current_text_color(obj->data.l);
|
set_current_text_color(obj->data.l);
|
||||||
|
obj->callbacks.print = &new_fg;
|
||||||
END OBJ(color9, 0)
|
END OBJ(color9, 0)
|
||||||
obj->data.l = color9;
|
obj->data.l = color9;
|
||||||
set_current_text_color(obj->data.l);
|
set_current_text_color(obj->data.l);
|
||||||
|
obj->callbacks.print = &new_fg;
|
||||||
#ifdef X11
|
#ifdef X11
|
||||||
END OBJ(font, 0)
|
END OBJ(font, 0)
|
||||||
obj->data.s = scan_font(arg);
|
obj->data.s = scan_font(arg);
|
||||||
|
Loading…
Reference in New Issue
Block a user