From e73da6b72e6ff029d04441a0135ee9620b575d60 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Sat, 13 Nov 2010 23:59:31 +0100 Subject: [PATCH] Fix compiling without X11 support --- src/conky.cc | 2 ++ src/core.cc | 10 +++++++--- src/exec.cc | 2 +- src/specials.cc | 2 ++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/conky.cc b/src/conky.cc index 97e5d095..9c0fb289 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -2917,9 +2917,11 @@ void initialisation(int argc, char **argv) { conky::set_config_settings(*state); +#ifdef BUILD_X11 if(out_to_x.get(*state)) { current_text_color = default_color.get(*state); } +#endif /* generate text and get initial size */ extract_variable_text(global_text); diff --git a/src/core.cc b/src/core.cc index 69e708fb..8707937a 100644 --- a/src/core.cc +++ b/src/core.cc @@ -549,11 +549,13 @@ struct text_object *construct_text_object(char *s, const char *arg, long SCAN_CPU(arg, obj->data.i); obj->callbacks.percentage = &cpu_percentage; DBGP2("Adding $cpu for CPU %d", obj->data.i); +#ifdef BUILD_X11 END OBJ(cpugauge, &update_cpu_usage) SCAN_CPU(arg, obj->data.i); scan_gauge(obj, arg, 1); obj->callbacks.gaugeval = &cpu_barval; DBGP2("Adding $cpugauge for CPU %d", obj->data.i); +#endif END OBJ(cpubar, &update_cpu_usage) SCAN_CPU(arg, obj->data.i); scan_bar(obj, arg, 1); @@ -746,11 +748,11 @@ struct text_object *construct_text_object(char *s, const char *arg, long scan_execgraph_arg(obj, arg); obj->callbacks.graphval = &execi_barval; obj->callbacks.free = &free_execi; -#endif /* BUILD_X11 */ END OBJ_ARG(execigauge, 0, "execigauge needs arguments") scan_execi_gauge_arg(obj, arg); obj->callbacks.gaugeval = &execi_barval; obj->callbacks.free = &free_execi; +#endif /* BUILD_X11 */ END OBJ_ARG(execi, 0, "execi needs arguments") scan_execi_arg(obj, arg); obj->parse = false; @@ -979,9 +981,11 @@ struct text_object *construct_text_object(char *s, const char *arg, long obj->callbacks.print = &print_memmax; END OBJ(memperc, &update_meminfo) obj->callbacks.percentage = &mem_percentage; +#ifdef BUILD_X11 END OBJ(memgauge, &update_meminfo) scan_gauge(obj, arg, 1); obj->callbacks.gaugeval = &mem_barval; +#endif END OBJ(membar, &update_meminfo) scan_bar(obj, arg, 1); obj->callbacks.barval = &mem_barval; @@ -1653,7 +1657,6 @@ struct text_object *construct_text_object(char *s, const char *arg, long } obj->callbacks.graphval = &lua_barval; obj->callbacks.free = &gen_free_opaque; -#endif /* BUILD_X11 */ END OBJ_ARG(lua_gauge, 0, "lua_gauge needs arguments: , [function parameters]") arg = scan_gauge(obj, arg, 100); if (arg) { @@ -1663,6 +1666,7 @@ struct text_object *construct_text_object(char *s, const char *arg, long } obj->callbacks.gaugeval = &lua_barval; obj->callbacks.free = &gen_free_opaque; +#endif /* BUILD_X11 */ #endif /* BUILD_LUA */ #ifdef BUILD_HDDTEMP END OBJ(hddtemp, &update_hddtemp) @@ -1749,10 +1753,10 @@ struct text_object *construct_text_object(char *s, const char *arg, long buf = scan_graph(obj, arg, 100); free_and_zero(buf); obj->callbacks.graphval = &apcupsd_loadbarval; -#endif /* BUILD_X11 */ END OBJ(apcupsd_loadgauge, &update_apcupsd) scan_gauge(obj, arg, 100); obj->callbacks.gaugeval = &apcupsd_loadbarval; +#endif /* BUILD_X11 */ END OBJ(apcupsd_charge, &update_apcupsd) obj->callbacks.print = &print_apcupsd_charge; END OBJ(apcupsd_timeleft, &update_apcupsd) diff --git a/src/exec.cc b/src/exec.cc index a0ee6acb..60ec47db 100644 --- a/src/exec.cc +++ b/src/exec.cc @@ -262,6 +262,7 @@ void scan_execi_bar_arg(struct text_object *obj, const char *arg) scan_execi_arg(obj, arg); } +#ifdef BUILD_X11 void scan_execi_gauge_arg(struct text_object *obj, const char *arg) { /* XXX: do real gauge parsing here */ @@ -269,7 +270,6 @@ void scan_execi_gauge_arg(struct text_object *obj, const char *arg) scan_execi_arg(obj, arg); } -#ifdef BUILD_X11 void scan_execgraph_arg(struct text_object *obj, const char *arg) { struct execi_data *ed; diff --git a/src/specials.cc b/src/specials.cc index eff36928..3e05810e 100644 --- a/src/specials.cc +++ b/src/specials.cc @@ -104,6 +104,7 @@ struct tab { * Scanning arguments to various special text objects */ +#ifdef BUILD_X11 const char *scan_gauge(struct text_object *obj, const char *args, double scale) { struct gauge *g; @@ -135,6 +136,7 @@ const char *scan_gauge(struct text_object *obj, const char *args, double scale) obj->special_data = g; return args; } +#endif const char *scan_bar(struct text_object *obj, const char *args, double scale) {