mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 18:45:10 +00:00
Fix building in ncurses
This commit is contained in:
parent
b9a7b0e33e
commit
c06e54157f
30
src/conky.cc
30
src/conky.cc
@ -64,7 +64,7 @@
|
||||
#include <netdb.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#ifdef NCURSES
|
||||
#ifdef BUILD_NCURSES
|
||||
#include <ncurses.h>
|
||||
#endif
|
||||
#ifdef BUILD_WEATHER_XOAP
|
||||
@ -1121,11 +1121,11 @@ static inline void set_foreground_color(long c)
|
||||
XSetForeground(display, window.gc, current_color);
|
||||
}
|
||||
#endif /* BUILD_X11 */
|
||||
#ifdef NCURSES
|
||||
#ifdef BUILD_NCURSES
|
||||
if (output_methods & TO_NCURSES) {
|
||||
attron(COLOR_PAIR(c));
|
||||
}
|
||||
#endif /* NCURSES */
|
||||
#endif /* BUILD_NCURSES */
|
||||
UNUSED(c);
|
||||
return;
|
||||
}
|
||||
@ -1163,7 +1163,7 @@ static void draw_string(const char *s)
|
||||
if ((output_methods & APPEND_FILE) && draw_mode == FG && append_fpointer) {
|
||||
fprintf(append_fpointer, "%s\n", s_with_newlines);
|
||||
}
|
||||
#ifdef NCURSES
|
||||
#ifdef BUILD_NCURSES
|
||||
if ((output_methods & TO_NCURSES) && draw_mode == FG) {
|
||||
printw("%s", s_with_newlines);
|
||||
}
|
||||
@ -1694,11 +1694,11 @@ int draw_each_line_inner(char *s, int special_index, int last_special_applied)
|
||||
cur_y += cur_y_add;
|
||||
#endif /* BUILD_X11 */
|
||||
draw_string(s);
|
||||
#ifdef NCURSES
|
||||
#ifdef BUILD_NCURSES
|
||||
if (output_methods & TO_NCURSES) {
|
||||
printw("\n");
|
||||
}
|
||||
#endif /* NCURSES */
|
||||
#endif /* BUILD_NCURSES */
|
||||
#ifdef BUILD_X11
|
||||
if (output_methods & TO_X)
|
||||
cur_y += font_descent();
|
||||
@ -1717,11 +1717,11 @@ static int draw_line(char *s, int special_index)
|
||||
return draw_each_line_inner(s, special_index, -1);
|
||||
}
|
||||
#endif /* BUILD_X11 */
|
||||
#ifdef NCURSES
|
||||
#ifdef BUILD_NCURSES
|
||||
if (output_methods & TO_NCURSES) {
|
||||
return draw_each_line_inner(s, special_index, -1);
|
||||
}
|
||||
#endif /* NCURSES */
|
||||
#endif /* BUILD_NCURSES */
|
||||
draw_string(s);
|
||||
UNUSED(special_index);
|
||||
return 0;
|
||||
@ -1759,10 +1759,10 @@ static void draw_text(void)
|
||||
}
|
||||
setup_fonts();
|
||||
#endif /* BUILD_X11 */
|
||||
#ifdef NCURSES
|
||||
#ifdef BUILD_NCURSES
|
||||
init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK);
|
||||
attron(COLOR_PAIR(COLOR_WHITE));
|
||||
#endif /* NCURSES */
|
||||
#endif /* BUILD_NCURSES */
|
||||
for_each_line(text_buffer, draw_line);
|
||||
#if defined(BUILD_LUA) && defined(BUILD_X11)
|
||||
llua_draw_post_hook();
|
||||
@ -2228,7 +2228,7 @@ static void main_loop(void)
|
||||
if(t > 0) usleep((useconds_t)t);
|
||||
update_text();
|
||||
draw_stuff();
|
||||
#ifdef NCURSES
|
||||
#ifdef BUILD_NCURSES
|
||||
if(output_methods & TO_NCURSES) {
|
||||
refresh();
|
||||
clear();
|
||||
@ -2376,7 +2376,7 @@ void clean_up(void *memtofree1, void* memtofree2)
|
||||
|
||||
free_update_callbacks();
|
||||
|
||||
#ifdef NCURSES
|
||||
#ifdef BUILD_NCURSES
|
||||
if(output_methods & TO_NCURSES) {
|
||||
endwin();
|
||||
}
|
||||
@ -3206,7 +3206,7 @@ char load_config_file(const char *f)
|
||||
if(string_to_bool(value))
|
||||
output_methods |= TO_STDERR;
|
||||
}
|
||||
#ifdef NCURSES
|
||||
#ifdef BUILD_NCURSES
|
||||
CONF("out_to_ncurses") {
|
||||
if(string_to_bool(value)) {
|
||||
initscr();
|
||||
@ -3709,7 +3709,7 @@ char load_config_file(const char *f)
|
||||
if (!output_methods) {
|
||||
CRIT_ERR(0, 0, "no output_methods have been selected; exiting");
|
||||
}
|
||||
#if defined(NCURSES)
|
||||
#if defined(BUILD_NCURSES)
|
||||
#if defined(BUILD_X11)
|
||||
if ((output_methods & TO_X) && (output_methods & TO_NCURSES)) {
|
||||
NORM_ERR("out_to_x and out_to_ncurses are incompatible, turning out_to_ncurses off");
|
||||
@ -3721,7 +3721,7 @@ char load_config_file(const char *f)
|
||||
NORM_ERR("out_to_ncurses conflicts with out_to_console and out_to_stderr, disabling the later ones");
|
||||
output_methods &= ~(TO_STDOUT | TO_STDERR);
|
||||
}
|
||||
#endif /* NCURSES */
|
||||
#endif /* BUILD_NCURSES */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -472,10 +472,10 @@ void new_fg(struct text_object *obj, char *p, int p_max_size)
|
||||
if (output_methods & TO_X)
|
||||
new_special(p, FG)->arg = obj->data.l;
|
||||
#endif /* BUILD_X11 */
|
||||
#ifdef NCURSES
|
||||
#ifdef BUILD_NCURSES
|
||||
if (output_methods & TO_NCURSES)
|
||||
new_special(p, FG)->arg = obj->data.l;
|
||||
#endif /* NCURSES */
|
||||
#endif /* BUILD_NCURSES */
|
||||
UNUSED(obj);
|
||||
UNUSED(p);
|
||||
UNUSED(p_max_size);
|
||||
|
Loading…
Reference in New Issue
Block a user