1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-26 04:17:33 +00:00

Use consistent naming for build option macros.

Probably have broken some build features with this commit.
This commit is contained in:
Brenden Matthews 2010-01-06 18:38:12 -08:00
parent 79be66b15a
commit 7e78f036f0
29 changed files with 528 additions and 598 deletions

View File

@ -130,5 +130,8 @@ option(BUILD_WEATHER_XOAP "Enable XOAP weather support" false)
if(BUILD_WEATHER_METAR OR BUILD_WEATHER_XOAP)
set(BUILD_CURL true)
endif(BUILD_WEATHER_METAR OR BUILD_WEATHER_XOAP)
if(BUILD_WEATHER_XOAP)
set(XOAP_FILE "$HOME/.xoaprc" CACHE STRING "Path of XOAP file for weather" FORCE)
endif(BUILD_WEATHER_XOAP)
option(BUILD_APCUPSD "Enable APCUPSD support" true)

View File

@ -31,134 +31,57 @@
#cmakedefine HAVE_FUNOPEN 1
#cmakedefine BUILD_X11 1
#ifdef BUILD_X11
#define X11
#endif /* BUILD_X11 */
#cmakedefine OWN_WINDOW 1
#cmakedefine BUILD_XDAMAGE 1
#ifdef BUILD_XDAMAGE
#define HAVE_XDAMAGE
#endif /* BUILD_XDAMAGE */
#cmakedefine BUILD_XFT 1
#ifdef BUILD_XFT
#define XFT
#endif /* BUILD_XFT */
#cmakedefine BUILD_ARGB 1
#ifdef BUILD_ARGB
#define USE_ARGB
#endif /* BUILD_ARGB */
#cmakedefine BUILD_XDBE 1
#ifdef BUILD_XDBE
#define HAVE_XDBE
#endif /* BUILD_XDBE */
#cmakedefine BUILD_LUA 1
#ifdef BUILD_LUA
#define HAVE_LUA
#endif /* BUILD_LUA */
#cmakedefine BUILD_PORT_MONITORS 1
#ifdef BUILD_PORT_MONITORS
#define TCP_PORT_MONITOR
#endif /* BUILD_PORT_MONITORS */
#cmakedefine BUILD_AUDACIOUS 1
#ifdef BUILD_AUDACIOUS
#define AUDACIOUS
#endif /* BUILD_AUDACIOUS */
#cmakedefine BUILD_AUDACIOUS_LEGACY 1
#ifdef BUILD_AUDACIOUS_LEGACY
#define AUDACIOUS_LEGACY
#endif /* BUILD_AUDACIOUS_LEGACY */
#cmakedefine BUILD_MPD 1
#ifdef BUILD_MPD
#define MPD
#endif /* BUILD_MPD */
#cmakedefine BUILD_MOC 1
#ifdef BUILD_MOC
#define MOC
#endif /* BUILD_MOC */
#cmakedefine BUILD_NVIDIA 0
#ifdef BUILD_NVIDIA
#define NVIDIA
#endif /* BUILD_NVIDIA */
#cmakedefine BUILD_XMMS2 1
#ifdef BUILD_XMMS2
#define XMMS2
#endif /* BUILD_XMMS2 */
#cmakedefine BUILD_HDDTEMP 1
#ifdef BUILD_HDDTEMP
#define HDDTEMP
#endif /* BUILD_HDDTEMP */
#cmakedefine BUILD_EVE 1
#ifdef BUILD_EVE
#define EVE
#define EVEURL_TRAINING "http://api.eve-online.com/char/SkillInTraining.xml.aspx"
#define EVEURL_SKILLTREE "http://api.eve-online.com/eve/Skilltree.xml.aspx"
#define EVE_OUTPUT_FORMAT "%s %d in %s"
#endif /* BUILD_EVE */
#cmakedefine BUILD_LIBXML2 1
#cmakedefine BUILD_CURL 1
#ifdef BUILD_CURL
#define HAVE_CURL
#endif /* BUILD_CURL */
#cmakedefine BUILD_WEATHER_XOAP 1
#cmakedefine BUILD_WEATHER_METAR 1
#ifdef BUILD_WEATHER_XOAP
#define XOAP
#define WEATHER
#define XOAP_FILE "$HOME/.xoaprc"
#endif /* BUILD_WEATHER_XOAP */
#ifdef BUILD_WEATHER_METAR
#define WEATHER
#endif /* BUILD_WEATHER_METAR */
#define XOAP_FILE "@XOAP_FILE@"
#cmakedefine BUILD_IMLIB2 1
#ifdef BUILD_IMLIB2
#define IMLIB2
#endif /* BUILD_IMLIB2 */
#cmakedefine BUILD_MATH 1
#ifdef BUILD_MATH
#define MATH
#endif /* BUILD_MATH */
#cmakedefine BUILD_CONFIG_OUTPUT 1
#ifdef BUILD_CONFIG_OUTPUT
#define CONFIG_OUTPUT
#endif /* BUILD_CONFIG_OUTPUT */
#cmakedefine BUILD_NCURSES 1
#ifdef BUILD_NCURSES
#define NCURSES
#endif /* BUILD_NCURSES */
#cmakedefine BUILD_APCUPSD 1
#ifdef BUILD_APCUPSD
#define APCUPSD
#endif /* BUILD_APCUPSD */
#cmakedefine BUILD_IOSTATS 1
#ifdef BUILD_IOSTATS
#define IOSTATS
#endif /* BUILD_IOSTATS */
#cmakedefine HAVE_ICONV 1

View File

@ -29,11 +29,11 @@
#include <mutex>
#include <glib.h>
#ifndef AUDACIOUS_LEGACY
#ifndef BUILD_AUDACIOUS_LEGACY
#include <glib-object.h>
#include <audacious/audctrl.h>
#include <audacious/dbus.h>
#else
#else /* BUILD_AUDACIOUS_LEGACY */
#include <audacious/beepctrl.h>
#define audacious_remote_is_running(x) \
xmms_remote_is_running(x)
@ -55,7 +55,7 @@
xmms_remote_get_playlist_file(x, y)
#define audacious_remote_get_playlist_length(x) \
xmms_remote_get_playlist_length(x)
#endif
#endif /* BUILD_AUDACIOUS_LEGACY */
/* access to this item array is synchronized */
static audacious_t audacious_items;
@ -125,7 +125,7 @@ void audacious_thread_func(thread_handle &handle)
gint rate, freq, chans, vol;
gchar *psong, *pfilename;
#ifndef AUDACIOUS_LEGACY
#ifndef BUILD_AUDACIOUS_LEGACY
DBusGProxy *session = NULL;
DBusGConnection *connection = NULL;
#else
@ -136,7 +136,7 @@ void audacious_thread_func(thread_handle &handle)
psong = NULL;
pfilename = NULL;
#ifndef AUDACIOUS_LEGACY
#ifndef BUILD_AUDACIOUS_LEGACY
g_type_init();
connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
if (!connection) {
@ -147,7 +147,7 @@ void audacious_thread_func(thread_handle &handle)
if (!session) {
CRIT_ERR(NULL, NULL, "unable to create dbus proxy");
}
#endif /* AUDACIOUS_LEGACY */
#endif /* BUILD_AUDACIOUS_LEGACY */
/* Loop until the main thread resets the runnable signal. */
while (1) {
@ -242,7 +242,7 @@ void audacious_thread_func(thread_handle &handle)
}
if (handle.test(0)) {
#ifndef AUDACIOUS_LEGACY
#ifndef BUILD_AUDACIOUS_LEGACY
/* release reference to dbus proxy */
g_object_unref(session);
#endif

View File

@ -48,10 +48,10 @@ typedef char audacious_t[13][128];
/* type for data exchange with main thread */
typedef struct audacious_s {
audacious_t items; /* e.g. items[AUDACIOUS_STATUS] */
audacious_t items; /* e.g. items[BUILD_AUDACIOUS_STATUS] */
int max_title_len; /* e.g. ${audacious_title 50} */
timed_thread_ptr p_timed_thread;
} AUDACIOUS_S;
} audacious_s;
/* create a worker thread for audacious media player status */
int create_audacious_thread(void);
@ -80,4 +80,4 @@ void print_audacious_playlist_position(struct text_object *, char *, int);
void print_audacious_main_volume(struct text_object *, char *, int);
double audacious_barval(struct text_object *);
#endif
#endif /* AUDACIOUS_H */

View File

@ -29,7 +29,7 @@
*/
#include "conky.h"
#include "logging.h"
#ifdef X11
#ifdef BUILD_X11
#include "x11.h"
#endif
@ -43,11 +43,11 @@ static long redmask, greenmask, bluemask;
static void set_up_gradient(void)
{
int i;
#ifdef X11
#ifdef BUILD_X11
if (output_methods & TO_X) {
colour_depth = DisplayPlanes(display, screen);
} else
#endif /* X11 */
#endif /* BUILD_X11 */
{
colour_depth = 16;
}
@ -173,7 +173,7 @@ unsigned long *do_gradient(int width, unsigned long first_colour, unsigned long
return colours;
}
#ifdef X11
#ifdef BUILD_X11
long get_x11_color(const char *name)
{
XColor color;

View File

@ -468,7 +468,7 @@ void print_loadavg(struct text_object *obj, char *p, int p_max_size)
}
}
#ifdef X11
#ifdef BUILD_X11
void scan_loadgraph_arg(struct text_object *obj, const char *arg)
{
char *buf = 0;
@ -484,7 +484,7 @@ double loadgraphval(struct text_object *obj)
return info.loadavg[0];
}
#endif /* X11 */
#endif /* BUILD_X11 */
uint8_t cpu_percentage(struct text_object *obj)
{

View File

@ -75,10 +75,10 @@ void get_battery_short_status(char *buf, unsigned int n, const char *bat);
void scan_loadavg_arg(struct text_object *, const char *);
void print_loadavg(struct text_object *, char *, int);
#ifdef X11
#ifdef BUILD_X11
void scan_loadgraph_arg(struct text_object *, const char *);
double loadgraphval(struct text_object *);
#endif /* X11 */
#endif /* BUILD_X11 */
uint8_t cpu_percentage(struct text_object *);
double cpu_barval(struct text_object *);

File diff suppressed because it is too large Load Diff

View File

@ -66,66 +66,66 @@ char *strndup(const char *s, size_t n);
/* forward define to make gcc happy */
struct text_object;
#ifdef BMPX
#ifdef BUILD_BMPX
#include "bmpx.h"
#endif
#endif /* BUILD_BMPX */
#ifdef EVE
#ifdef BUILD_EVE
#include "eve.h"
#endif
#endif /* BUILD_EVE */
#ifdef HDDTEMP
#ifdef BUILD_HDDTEMP
#include "hddtemp.h"
#endif /* HDDTEMP */
#endif /* BUILD_HDDTEMP */
#ifdef MOC
#ifdef BUILD_MOC
#include "moc.h"
#endif
#endif /* BUILD_MOC */
#ifdef MPD
#ifdef BUILD_MPD
#include "mpd.h"
#endif
#endif /* BUILD_MPD */
#ifdef __cplusplus
/* this hack exists only to get around a compilation issue with some files
* being converted to C++, will need a better solution */
/* C++ headers */
#ifdef HAVE_CURL
#ifdef BUILD_CURL
#include "ccurl_thread.h"
#endif /* HAVE_CURL */
#endif /* BUILD_CURL */
#ifdef AUDACIOUS
#ifdef BUILD_AUDACIOUS
#include "audacious.h"
#endif
#endif /* BUILD_AUDACIOUS */
#endif /* __cplusplus */
#ifdef RSS
#ifdef BUILD_RSS
#include "rss.h"
#endif /* RSS */
#endif /* BUILD_RSS */
#ifdef XOAP
#ifndef WEATHER
#error "WEATHER needs to be defined if XOAP is defined"
#endif /* WEATHER */
#endif /* XOAP */
#ifdef BUILD_WEATHER_XOAP
#ifndef BUILD_WEATHER_METAR
#error "BUILD_WEATHER_METAR needs to be defined if XOAP is defined"
#endif /* BUILD_WEATHER_METAR */
#endif /* BUILD_WEATHER_XOAP */
#ifdef WEATHER
#ifdef BUILD_WEATHER_METAR
#include "weather.h"
#endif /* WEATHER */
#endif /* BUILD_WEATHER_METAR */
#ifdef TCP_PORT_MONITOR
#ifdef BUILD_PORT_MONITORS
#include "tcp-portmon.h"
#endif
#ifdef XMMS2
#ifdef BUILD_XMMS2
#include "xmms2.h"
#endif
#endif /* BUILD_XMMS2 */
#ifdef APCUPSD
#ifdef BUILD_APCUPSD
#include "apcupsd.h"
#endif
#endif /* BUILD_APCUPSD */
/* sony support */
#include "sony.h"
@ -142,7 +142,7 @@ struct usr_info {
int number;
};
#ifdef X11
#ifdef BUILD_X11
struct monitor_info {
int number;
int current;
@ -161,7 +161,7 @@ struct x11_info {
struct desktop_info desktop;
};
#endif /* X11 */
#endif /* BUILD_X11 */
/* defined in conky.c */
extern long default_fg_color, default_bg_color, default_out_color;
@ -228,29 +228,29 @@ struct information {
float loadavg[3];
#ifdef XMMS2
#ifdef BUILD_XMMS2
struct xmms2_s xmms2;
#endif /* BUILD_XMMS2 */
#ifdef BUILD_AUDACIOUS
audacious_s audacious;
#endif
#ifdef AUDACIOUS
AUDACIOUS_S audacious;
#endif
#ifdef BMPX
#ifdef BUILD_BMPX
struct bmpx_s bmpx;
#endif
#endif /* BUILD_BMPX */
struct usr_info users;
struct process *cpu[10];
struct process *memu[10];
struct process *time[10];
#ifdef IOSTATS
#ifdef BUILD_IOSTATS
struct process *io[10];
#endif
#endif /* BUILD_IOSTATS */
struct process *first_process;
unsigned long looped;
double music_player_interval;
#ifdef X11
#ifdef BUILD_X11
struct x11_info x11;
#endif
#endif /* BUILD_X11 */
short kflags; /* kernel settings, see enum KFLAG */
};
@ -273,9 +273,9 @@ enum {
/* defined in conky.c, needed by top.c */
extern int top_cpu, top_mem, top_time;
#ifdef IOSTATS
#ifdef BUILD_IOSTATS
extern int top_io;
#endif
#endif /* BUILD_IOSTATS */
extern int top_running;
/* defined in conky.c, needed by top.c */
@ -341,16 +341,16 @@ extern unsigned int max_user_text;
/* path to config file */
extern char *current_config;
#ifdef X11
#ifdef BUILD_X11
#define TO_X 1
#endif /* X11 */
#endif /* BUILD_X11 */
#define TO_STDOUT 2
#define TO_STDERR 4
#define OVERWRITE_FILE 8
#define APPEND_FILE 16
#ifdef NCURSES
#ifdef BUILD_NCURSES
#define TO_NCURSES 32
#endif /* NCURSES */
#endif /* BUILD_NCURSES */
enum x_initialiser_state {
NO = 0,
YES = 1,

View File

@ -42,26 +42,26 @@
#include "i8k.h"
#include "imlib2.h"
#include "proc.h"
#ifdef X11
#ifdef BUILD_X11
#include "fonts.h"
#endif
#include "fs.h"
#ifdef IBM
#ifdef BUILD_IBM
#include "ibm.h"
#include "smapi.h"
#endif
#ifdef HAVE_ICONV
#include "iconv_tools.h"
#endif
#ifdef HAVE_LUA
#ifdef BUILD_LUA
#include "llua.h"
#endif /* HAVE_LUA */
#endif /* BUILD_LUA */
#include "logging.h"
#include "mixer.h"
#include "mail.h"
#include "mboxscan.h"
#include "net_stat.h"
#ifdef NVIDIA
#ifdef BUILD_NVIDIA
#include "nvidia.h"
#endif
#include "read_tcp.h"
@ -75,7 +75,7 @@
#include "user.h"
#include "users.h"
#ifdef NCURSES
#ifdef BUILD_NCURSES
#include <ncurses.h>
#endif
@ -157,12 +157,12 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
#define OBJ_IF_ARG(a, n, ...) __OBJ_HEAD(a, n) __OBJ_ARG(__VA_ARGS__) __OBJ_IF; {
#define END } } else
#ifdef X11
#ifdef BUILD_X11
if (s[0] == '#') {
obj->data.l = get_x11_color(s);
obj->callbacks.print = &new_fg;
} else
#endif /* X11 */
#endif /* BUILD_X11 */
#ifndef __OpenBSD__
OBJ(acpitemp, 0)
obj->data.i = open_acpi_temperature(arg);
@ -335,7 +335,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->callbacks.print = &print_i8k_ac_status;
END OBJ(i8k_buttons_status, &update_i8k)
obj->callbacks.print = &print_i8k_buttons_status;
#if defined(IBM)
#if defined(BUILD_IBM)
END OBJ(ibm_fan, 0)
obj->callbacks.print = &get_ibm_acpi_fan;
END OBJ_ARG(ibm_temps, &get_ibm_acpi_temps, "ibm_temps: needs an argument")
@ -418,7 +418,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
scan_bar(obj, arg, 1);
obj->callbacks.barval = &cpu_barval;
DBGP2("Adding $cpubar for CPU %d", obj->data.i);
#ifdef X11
#ifdef BUILD_X11
END OBJ(cpugraph, &update_cpu_usage)
char *buf = 0;
SCAN_CPU(arg, obj->data.i);
@ -429,7 +429,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ(loadgraph, &update_load_average)
scan_loadgraph_arg(obj, arg);
obj->callbacks.graphval = &loadgraphval;
#endif /* X11 */
#endif /* BUILD_X11 */
END OBJ(diskio, &update_diskio)
parse_diskio_arg(obj, arg);
obj->callbacks.print = &print_diskio;
@ -439,7 +439,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ(diskio_write, &update_diskio)
parse_diskio_arg(obj, arg);
obj->callbacks.print = &print_diskio_write;
#ifdef X11
#ifdef BUILD_X11
END OBJ(diskiograph, &update_diskio)
parse_diskiograph_arg(obj, arg);
obj->callbacks.graphval = &diskiographval;
@ -449,15 +449,15 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ(diskiograph_write, &update_diskio)
parse_diskiograph_arg(obj, arg);
obj->callbacks.graphval = &diskiographval_write;
#endif /* X11 */
#endif /* BUILD_X11 */
END OBJ(color, 0)
#ifdef X11
#ifdef BUILD_X11
if (output_methods & TO_X) {
obj->data.l = arg ? get_x11_color(arg) : default_fg_color;
set_current_text_color(obj->data.l);
}
#endif /* X11 */
#ifdef NCURSES
#endif /* BUILD_X11 */
#ifdef BUILD_NCURSES
if (output_methods & TO_NCURSES) {
obj->data.l = COLOR_WHITE;
if(arg) {
@ -480,7 +480,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
set_current_text_color(obj->data.l);
init_pair(obj->data.l, obj->data.l, COLOR_BLACK);
}
#endif /* NCURSES */
#endif /* BUILD_NCURSES */
obj->callbacks.print = &new_fg;
END OBJ(color0, 0)
obj->data.l = color0;
@ -522,12 +522,12 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->data.l = color9;
set_current_text_color(obj->data.l);
obj->callbacks.print = &new_fg;
#ifdef X11
#ifdef BUILD_X11
END OBJ(font, 0)
scan_font(obj, arg);
obj->callbacks.print = &new_font;
obj->callbacks.free = &gen_free_opaque;
#endif /* X11 */
#endif /* BUILD_X11 */
END OBJ(conky_version, 0)
obj_be_plain_text(obj, VERSION);
END OBJ(conky_build_date, 0)
@ -540,11 +540,11 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ(downspeedf, &update_net_stats)
parse_net_stat_arg(obj, arg, free_at_crash);
obj->callbacks.print = &print_downspeedf;
#ifdef X11
#ifdef BUILD_X11
END OBJ(downspeedgraph, &update_net_stats)
parse_net_stat_graph_arg(obj, arg, free_at_crash);
obj->callbacks.graphval = &downspeedgraphval;
#endif /* X11 */
#endif /* BUILD_X11 */
END OBJ(else, 0)
obj_be_ifblock_else(ifblock_opaque, obj);
obj->callbacks.iftest = &gen_false_iftest;
@ -555,12 +555,12 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->data.s = strndup(arg ? arg : "", text_buffer_size);
obj->callbacks.print = &print_evaluate;
obj->callbacks.free = &gen_free_opaque;
#if defined(IMLIB2) && defined(X11)
#if defined(BUILD_IMLIB2) && defined(BUILD_X11)
END OBJ(image, 0)
obj->data.s = strndup(arg ? arg : "", text_buffer_size);
obj->callbacks.print = &print_image_callback;
obj->callbacks.free = &gen_free_opaque;
#endif /* IMLIB2 */
#endif /* BUILD_IMLIB2 */
END OBJ(exec, 0)
scan_exec_arg(obj, arg);
obj->callbacks.print = &print_exec;
@ -578,22 +578,22 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
scan_exec_arg(obj, arg);
obj->callbacks.gaugeval = &execbarval;
obj->callbacks.free = &free_exec;
#ifdef X11
#ifdef BUILD_X11
END OBJ(execgraph, 0)
scan_execgraph_arg(obj, arg);
obj->callbacks.graphval = &execbarval;
obj->callbacks.free = &free_exec;
#endif /* X11 */
#endif /* BUILD_X11 */
END OBJ_ARG(execibar, 0, "execibar needs arguments")
scan_execi_bar_arg(obj, arg);
obj->callbacks.barval = &execi_barval;
obj->callbacks.free = &free_execi;
#ifdef X11
#ifdef BUILD_X11
END OBJ_ARG(execigraph, 0, "execigraph needs arguments")
scan_execgraph_arg(obj, arg);
obj->callbacks.graphval = &execi_barval;
obj->callbacks.free = &free_execi;
#endif /* X11 */
#endif /* BUILD_X11 */
END OBJ_ARG(execigauge, 0, "execigauge needs arguments")
scan_execi_gauge_arg(obj, arg);
obj->callbacks.gaugeval = &execi_barval;
@ -637,11 +637,11 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ(fs_used, &update_fs_stats)
init_fs(obj, arg);
obj->callbacks.print = &print_fs_used;
#ifdef X11
#ifdef BUILD_X11
END OBJ(hr, 0)
obj->data.l = arg ? atoi(arg) : 1;
obj->callbacks.print = &new_hr;
#endif /* X11 */
#endif /* BUILD_X11 */
END OBJ(nameserver, &update_dns_data)
parse_nameserver_arg(obj, arg);
obj->callbacks.print = &print_nameserver;
@ -655,11 +655,11 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ_ARG(goto, 0, "goto needs arguments")
obj->data.l = atoi(arg);
obj->callbacks.print = &new_goto;
#ifdef X11
#ifdef BUILD_X11
END OBJ(tab, 0)
scan_tab(obj, arg);
obj->callbacks.print = &new_tab;
#endif /* X11 */
#endif /* BUILD_X11 */
#ifdef __linux__
END OBJ_ARG(i2c, 0, "i2c needs arguments")
parse_i2c_sensor(obj, arg);
@ -819,14 +819,14 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ(membar, &update_meminfo)
scan_bar(obj, arg, 1);
obj->callbacks.barval = &mem_barval;
#ifdef X11
#ifdef BUILD_X11
END OBJ(memgraph, &update_meminfo)
char *buf = 0;
buf = scan_graph(obj, arg, 1);
if (buf) free(buf);
obj->callbacks.graphval = &mem_barval;
#endif /* X11*/
#endif /* BUILD_X11*/
END OBJ(mixer, 0)
parse_mixer_arg(obj, arg);
obj->callbacks.percentage = &mixer_percentage;
@ -848,7 +848,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ_IF(if_mixer_mute, 0)
parse_mixer_arg(obj, arg);
obj->callbacks.iftest = &check_mixer_muted;
#ifdef X11
#ifdef BUILD_X11
END OBJ(monitor, 0)
obj->callbacks.print = &print_monitor;
END OBJ(monitor_number, 0)
@ -859,7 +859,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->callbacks.print = &print_desktop_number;
END OBJ(desktop_name, 0)
obj->callbacks.print = &print_desktop_name;
#endif
#endif /* BUILD_X11 */
END OBJ_ARG(format_time, 0, "format_time needs a pid as argument")
obj->sub = (text_object*)malloc(sizeof(struct text_object));
extract_variable_text_internal(obj->sub, arg);
@ -1011,20 +1011,20 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->callbacks.print = &print_running_processes;
#endif /* __linux__ */
END OBJ(shadecolor, 0)
#ifdef X11
#ifdef BUILD_X11
obj->data.l = arg ? get_x11_color(arg) : default_bg_color;
obj->callbacks.print = &new_bg;
#endif /* X11 */
#endif /* BUILD_X11 */
END OBJ(outlinecolor, 0)
#ifdef X11
#ifdef BUILD_X11
obj->data.l = arg ? get_x11_color(arg) : default_out_color;
obj->callbacks.print = &new_outline;
#endif /* X11 */
#endif /* BUILD_X11 */
END OBJ(stippled_hr, 0)
#ifdef X11
#ifdef BUILD_X11
scan_stippled_hr(obj, arg);
obj->callbacks.print = &new_stippled_hr;
#endif /* X11 */
#endif /* BUILD_X11 */
END OBJ(swap, &update_meminfo)
obj->callbacks.print = &print_swap;
END OBJ(swapfree, &update_meminfo)
@ -1085,7 +1085,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ(upspeedf, &update_net_stats)
parse_net_stat_arg(obj, arg, free_at_crash);
obj->callbacks.print = &print_upspeedf;
#ifdef X11
#ifdef BUILD_X11
END OBJ(upspeedgraph, &update_net_stats)
parse_net_stat_graph_arg(obj, arg, free_at_crash);
obj->callbacks.graphval = &upspeedgraphval;
@ -1142,7 +1142,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
parse_pop3_mail_args(obj, arg);
obj->callbacks.print = &print_pop3_used;
obj->callbacks.free = &free_mail_obj;
#ifdef IBM
#ifdef BUILD_IBM
END OBJ_ARG(smapi, 0, "smapi needs an argument")
obj->data.s = strndup(arg, text_buffer_size);
obj->callbacks.print = &print_smapi;
@ -1171,8 +1171,8 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
} else
arg = scan_bar(obj, arg + cnt, 100);
obj->callbacks.barval = &smapi_bat_barval;
#endif /* IBM */
#ifdef MPD
#endif /* BUILD_IBM */
#ifdef BUILD_MPD
#define mpd_set_maxlen(name) \
if (arg) { \
int i; \
@ -1259,8 +1259,8 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->callbacks.iftest = &check_mpd_playing;
obj->callbacks.free = &free_mpd;
#undef mpd_set_maxlen
#endif /* MPD */
#ifdef MOC
#endif /* BUILD_MPD */
#ifdef BUILD_MOC
END OBJ(moc_state, &update_moc)
obj->callbacks.print = &print_moc_state;
obj->callbacks.free = &free_moc;
@ -1294,8 +1294,8 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ(moc_rate, &update_moc)
obj->callbacks.print = &print_moc_rate;
obj->callbacks.free = &free_moc;
#endif /* MOC */
#ifdef XMMS2
#endif /* BUILD_MOC */
#ifdef BUILD_XMMS2
END OBJ(xmms2_artist, &update_xmms2)
obj->callbacks.print = &print_xmms2_artist;
obj->callbacks.free = &free_xmms2;
@ -1357,8 +1357,8 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ_IF(if_xmms2_connected, &update_xmms2)
obj->callbacks.iftest = &if_xmms2_connected;
obj->callbacks.free = &free_xmms2;
#endif
#ifdef AUDACIOUS
#endif /* BUILD_XMMS2 */
#ifdef BUILD_AUDACIOUS
END OBJ(audacious_status, &update_audacious)
obj->callbacks.print = &print_audacious_status;
END OBJ_ARG(audacious_title, &update_audacious, "audacious_title needs an argument")
@ -1394,8 +1394,8 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ(audacious_bar, &update_audacious)
scan_bar(obj, arg, 1);
obj->callbacks.barval = &audacious_barval;
#endif /* AUDACIOUS */
#ifdef BMPX
#endif /* BUILD_AUDACIOUS */
#ifdef BUIL_BMPX
END OBJ(bmpx_title, &update_bmpx)
obj->callbacks.print = &print_bmpx_title;
END OBJ(bmpx_artist, &update_bmpx)
@ -1408,38 +1408,38 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->callbacks.print = &print_bmpx_uri;
END OBJ(bmpx_bitrate, &update_bmpx)
obj->callbacks.print = &print_bmpx_bitrate;
#endif
#ifdef EVE
#endif /* BUILD_BMPX */
#ifdef BUILD_EVE
END OBJ_ARG(eve, 0, "eve needs arguments: <userid> <apikey> <characterid>")
scan_eve(obj, arg);
obj->callbacks.print = &print_eve;
obj->callbacks.free = &free_eve;
#endif
#ifdef HAVE_CURL
#endif /* BUILD_EVE */
#ifdef BUILD_CURL
END OBJ_ARG(curl, 0, "curl needs arguments: <uri> <interval in minutes>")
curl_parse_arg(obj, arg);
obj->callbacks.print = &curl_print;
obj->callbacks.free = &curl_obj_free;
#endif
#ifdef RSS
#endif /* BUILD_CURL */
#ifdef BUILD_RSS
END OBJ_ARG(rss, 0, "rss needs arguments: <uri> <interval in minutes> <action> [act_par] [spaces in front]")
rss_scan_arg(obj, arg);
obj->callbacks.print = &rss_print_info;
obj->callbacks.free = &rss_free_obj_info;
#endif
#ifdef WEATHER
#endif /* BUILD_RSS */
#ifdef BUILD_WEATHER_METAR
END OBJ_ARG(weather, 0, "weather needs arguments: <uri> <locID> <data_type> [interval in minutes]")
scan_weather_arg(obj, arg, free_at_crash);
obj->callbacks.print = &print_weather;
obj->callbacks.free = &free_weather;
#endif
#ifdef XOAP
#endif /* BUILD_WEATHER_METAR */
#ifdef BUILD_WEATHER_XOAP
END OBJ_ARG(weather_forecast, 0, "weather_forecast needs arguments: <uri> <locID> <day> <data_type> [interval in minutes]")
scan_weather_forecast_arg(obj, arg, free_at_crash);
obj->callbacks.print = &print_weather_forecast;
obj->callbacks.free = &free_weather;
#endif
#ifdef HAVE_LUA
#endif /* BUILD_WEATHER_XOAP */
#ifdef BUILD_LUA
END OBJ_ARG(lua, 0, "lua needs arguments: <function name> [function parameters]")
obj->data.s = strndup(arg, text_buffer_size);
obj->verbatim_output = 1;
@ -1459,7 +1459,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
}
obj->callbacks.barval = &lua_barval;
obj->callbacks.free = &gen_free_opaque;
#ifdef X11
#ifdef BUILD_X11
END OBJ_ARG(lua_graph, 0, "lua_graph needs arguments: <function name> [height],[width] [gradient colour 1] [gradient colour 2] [scale] [-t] [-l]")
char *buf = 0;
buf = scan_graph(obj, arg, 100);
@ -1470,7 +1470,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
}
obj->callbacks.graphval = &lua_barval;
obj->callbacks.free = &gen_free_opaque;
#endif /* X11 */
#endif /* BUILD_X11 */
END OBJ_ARG(lua_gauge, 0, "lua_gauge needs arguments: <height>,<width> <function name> [function parameters]")
arg = scan_gauge(obj, arg, 100);
if (arg) {
@ -1480,20 +1480,20 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
}
obj->callbacks.gaugeval = &lua_barval;
obj->callbacks.free = &gen_free_opaque;
#endif /* HAVE_LUA */
#ifdef HDDTEMP
#endif /* BUILD_LUA */
#ifdef BUILD_HDDTEMP
END OBJ(hddtemp, &update_hddtemp)
if (arg)
obj->data.s = strndup(arg, text_buffer_size);
obj->callbacks.print = &print_hddtemp;
obj->callbacks.free = &free_hddtemp;
#endif /* HDDTEMP */
#ifdef TCP_PORT_MONITOR
#endif /* BUILD_HDDTEMP */
#ifdef BUILD_PORT_MONITORS
END OBJ_ARG(tcp_portmon, &tcp_portmon_update, "tcp_portmon: needs arguments")
tcp_portmon_init(obj, arg);
obj->callbacks.print = &tcp_portmon_action;
obj->callbacks.free = &tcp_portmon_free;
#endif /* TCP_PORT_MONITOR */
#endif /* BUILD_PORT_MONITORS */
END OBJ(entropy_avail, &update_entropy)
obj->callbacks.print = &print_entropy_avail;
END OBJ(entropy_perc, &update_entropy)
@ -1527,10 +1527,10 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
extract_variable_text_internal(obj->sub, arg);
obj->callbacks.print = &print_to_bytes;
END OBJ(scroll, 0)
#ifdef X11
#ifdef BUILD_X11
/* allocate a follower to reset any color changes */
obj->next = new_text_object_internal();
#endif /* X11 */
#endif /* BUILD_X11 */
parse_scroll_arg(obj, arg, free_at_crash);
obj->callbacks.print = &print_scroll;
obj->callbacks.free = &free_scroll;
@ -1538,7 +1538,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
parse_combine_arg(obj, arg, free_at_crash);
obj->callbacks.print = &print_combine;
obj->callbacks.free = &free_combine;
#ifdef NVIDIA
#ifdef BUILD_NVIDIA
END OBJ_ARG(nvidia, 0, "nvidia needs an argument")
if (set_nvidia_type(obj, arg)) {
CRIT_ERR(obj, free_at_crash, "nvidia: invalid argument"
@ -1546,8 +1546,8 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
}
obj->callbacks.print = &print_nvidia_value;
obj->callbacks.free = &free_nvidia;
#endif /* NVIDIA */
#ifdef APCUPSD
#endif /* BUILD_NVIDIA */
#ifdef BUILD_APCUPSD
END OBJ_ARG(apcupsd, &update_apcupsd, "apcupsd needs arguments: <host> <port>")
if (apcupsd_scan_arg(arg)) {
CRIT_ERR(obj, free_at_crash, "apcupsd needs arguments: <host> <port>");
@ -1570,13 +1570,13 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ(apcupsd_loadbar, &update_apcupsd)
scan_bar(obj, arg, 100);
obj->callbacks.barval = &apcupsd_loadbarval;
#ifdef X11
#ifdef BUILD_X11
END OBJ(apcupsd_loadgraph, &update_apcupsd)
char* buf = 0;
buf = scan_graph(obj, arg, 100);
if (buf) free(buf);
obj->callbacks.graphval = &apcupsd_loadbarval;
#endif /* X11 */
#endif /* BUILD_X11 */
END OBJ(apcupsd_loadgauge, &update_apcupsd)
scan_gauge(obj, arg, 100);
obj->callbacks.gaugeval = &apcupsd_loadbarval;
@ -1588,7 +1588,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->callbacks.print = &print_apcupsd_temp;
END OBJ(apcupsd_lastxfer, &update_apcupsd)
obj->callbacks.print = &print_apcupsd_lastxfer;
#endif /* APCUPSD */
#endif /* BUILD_APCUPSD */
END {
char *buf = (char *)malloc(text_buffer_size);

View File

@ -143,7 +143,7 @@ void print_diskio_write(struct text_object *obj, char *p, int p_max_size)
print_diskio_dir(obj, 1, p, p_max_size);
}
#ifdef X11
#ifdef BUILD_X11
void parse_diskiograph_arg(struct text_object *obj, const char *arg)
{
char *buf = 0;
@ -174,7 +174,7 @@ double diskiographval_write(struct text_object *obj)
return (diskio ? diskio->current_write : 0);
}
#endif /* X11 */
#endif /* BUILD_X11 */
void update_diskio_values(struct diskio_stat *ds,
unsigned int reads, unsigned int writes)

View File

@ -70,11 +70,11 @@ void parse_diskio_arg(struct text_object *, const char *);
void print_diskio(struct text_object *, char *, int);
void print_diskio_read(struct text_object *, char *, int);
void print_diskio_write(struct text_object *, char *, int);
#ifdef X11
#ifdef BUILD_X11
void parse_diskiograph_arg(struct text_object *, const char *);
double diskiographval(struct text_object *);
double diskiographval_read(struct text_object *);
double diskiographval_write(struct text_object *);
#endif /* X11 */
#endif /* BUILD_X11 */
#endif /* DISKIO_H_ */

View File

@ -28,6 +28,10 @@
extern "C" {
#endif
#define EVEURL_TRAINING "http://api.eve-online.com/char/SkillInTraining.xml.aspx"
#define EVEURL_SKILLTREE "http://api.eve-online.com/eve/Skilltree.xml.aspx"
#define EVE_OUTPUT_FORMAT "%s %d in %s"
void scan_eve(struct text_object *, const char *);
void print_eve(struct text_object *, char *, int);
void free_eve(struct text_object *);

View File

@ -270,7 +270,7 @@ void scan_execi_gauge_arg(struct text_object *obj, const char *arg)
scan_execi_arg(obj, arg);
}
#ifdef X11
#ifdef BUILD_X11
void scan_execgraph_arg(struct text_object *obj, const char *arg)
{
struct execi_data *ed;
@ -287,7 +287,7 @@ void scan_execgraph_arg(struct text_object *obj, const char *arg)
ed->cmd = buf;
obj->data.opaque = ed;
}
#endif /* X11 */
#endif /* BUILD_X11 */
void print_exec(struct text_object *obj, char *p, int p_max_size)
{

View File

@ -38,9 +38,9 @@ char fontloaded = 0;
void set_font(void)
{
#ifdef XFT
#ifdef BUILD_XFT
if (use_xft) return;
#endif /* XFT */
#endif /* BUILD_XFT */
if (font_count > -1 && fonts[selected_font].font) {
XSetFont(display, window.gc, fonts[selected_font].font->fid);
}
@ -51,7 +51,7 @@ void setup_fonts(void)
if ((output_methods & TO_X) == 0) {
return;
}
#ifdef XFT
#ifdef BUILD_XFT
if (use_xft) {
if (window.xftdraw) {
XftDrawDestroy(window.xftdraw);
@ -60,7 +60,7 @@ void setup_fonts(void)
window.xftdraw = XftDrawCreate(display, window.drawable,
window.visual, window.colourmap);
}
#endif /* XFT */
#endif /* BUILD_XFT */
set_font();
}
@ -91,7 +91,7 @@ int add_font(const char *data_in)
// must account for null terminator
if (strlen(data_in) < DEFAULT_TEXT_BUFFER_SIZE) {
strncpy(fonts[font_count].name, data_in, DEFAULT_TEXT_BUFFER_SIZE);
#ifdef XFT
#ifdef BUILD_XFT
fonts[font_count].font_alpha = 0xffff;
#endif
} else {
@ -115,7 +115,7 @@ void set_first_font(const char *data_in)
}
if (strlen(data_in) > 1) {
strncpy(fonts[0].name, data_in, DEFAULT_TEXT_BUFFER_SIZE);
#ifdef XFT
#ifdef BUILD_XFT
fonts[0].font_alpha = 0xffff;
#endif
}
@ -129,7 +129,7 @@ void free_fonts(void)
return;
}
for (i = 0; i <= font_count; i++) {
#ifdef XFT
#ifdef BUILD_XFT
if (use_xft) {
/*
* Do we not need to close fonts with Xft? Unsure. Not freeing the
@ -140,7 +140,7 @@ void free_fonts(void)
*/
fonts[i].xftfont = 0;
} else
#endif /* XFT */
#endif /* BUILD_XFT */
{
XFreeFont(display, fonts[i].font);
fonts[i].font = 0;
@ -152,12 +152,12 @@ void free_fonts(void)
}
font_count = -1;
selected_font = 0;
#ifdef XFT
#ifdef BUILD_XFT
if (window.xftdraw) {
XftDrawDestroy(window.xftdraw);
window.xftdraw = 0;
}
#endif /* XFT */
#endif /* BUILD_XFT */
}
void load_fonts(void)
@ -167,7 +167,7 @@ void load_fonts(void)
if ((output_methods & TO_X) == 0)
return;
for (i = 0; i <= font_count; i++) {
#ifdef XFT
#ifdef BUILD_XFT
/* load Xft font */
if (use_xft && fonts[i].xftfont) {
continue;

View File

@ -26,7 +26,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifdef X11
#ifdef BUILD_X11
#ifndef _FONTS_H
#define _FONTS_H
@ -43,13 +43,13 @@ struct font_list {
int num;
XFontStruct *font;
#ifdef XFT
#ifdef BUILD_XFT
XftFont *xftfont;
int font_alpha;
#endif
};
#ifdef XFT
#ifdef BUILD_XFT
#define font_height() (use_xft ? (fonts[selected_font].xftfont->ascent + \
fonts[selected_font].xftfont->descent) \
@ -88,4 +88,4 @@ void load_fonts(void);
#endif
#endif /* _FONTS_H */
#endif /* X11 */
#endif /* BUILD_X11 */

View File

@ -34,7 +34,7 @@
/* connection deleted if unseen again after this # of refreshes */
#define TCP_CONNECTION_STARTING_AGE 1
#define TCP_PORT_MONITOR_HASH_KEY_SIZE 12
#define BUILD_PORT_MONITORS_HASH_KEY_SIZE 12
#define MAX_PORT_MONITOR_CONNECTIONS_DEFAULT 256
/* -------------------------------------------------------------------

View File

@ -129,13 +129,13 @@ void llua_init(void)
lua_pushcfunction(lua_L, &llua_conky_set_update_interval);
lua_setglobal(lua_L, "conky_set_update_interval");
#if defined(X11) && defined(LUA_EXTRAS)
#if defined(BUILD_X11) && defined(LUA_EXTRAS)
/* register tolua++ user types */
tolua_open(lua_L);
tolua_usertype(lua_L, "Drawable");
tolua_usertype(lua_L, "Visual");
tolua_usertype(lua_L, "Display");
#endif /* X11 */
#endif /* BUILD_X11 */
}
void llua_load(const char *script)
@ -432,7 +432,7 @@ void llua_shutdown_hook(void)
llua_do_call(shutdown_hook, 0);
}
#ifdef X11
#ifdef BUILD_X11
void llua_draw_pre_hook(void)
{
if (!lua_L || !draw_pre_hook) return;
@ -512,7 +512,7 @@ void llua_update_window_table(int text_start_x, int text_start_y, int text_width
lua_setglobal(lua_L, "conky_window");
}
#endif /* X11 */
#endif /* BUILD_X11 */
void llua_setup_info(struct information *i, double u_interval)
{

View File

@ -32,9 +32,9 @@ extern "C" {
#include <config.h>
#ifdef X11
#ifdef BUILD_X11
#include "x11.h"
#endif /* X11 */
#endif /* BUILD_X11 */
#define LUAPREFIX "conky_"
@ -53,7 +53,7 @@ void llua_set_shutdown_hook(const char *args);
void llua_startup_hook(void);
void llua_shutdown_hook(void);
#ifdef X11
#ifdef BUILD_X11
void llua_draw_pre_hook(void);
void llua_draw_post_hook(void);
@ -62,7 +62,7 @@ void llua_set_draw_post_hook(const char *args);
void llua_setup_window_table(int text_start_x, int text_start_y, int text_width, int text_height);
void llua_update_window_table(int text_start_x, int text_start_y, int text_width, int text_height);
#endif /* X11 */
#endif /* BUILD_X11 */
void llua_setup_info(struct information *i, double u_interval);
void llua_update_info(struct information *i, double u_interval);

View File

@ -1,5 +1,5 @@
/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
* vim: ts=4 sw=4 noet ai cindent syntax=c
/* -*- mode: c++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
* vim: ts=4 sw=4 noet ai cindent syntax=cpp
*
* Conky, a system monitor, based on torsmo
*

View File

@ -191,7 +191,7 @@ void print_addrs(struct text_object *obj, char *p, int p_max_size)
}
#endif /* __linux__ */
#ifdef X11
#ifdef BUILD_X11
void parse_net_stat_graph_arg(struct text_object *obj, const char *arg, void *free_at_crash)
{
char *buf = 0;
@ -219,7 +219,7 @@ double upspeedgraphval(struct text_object *obj)
return (ns ? (ns->trans_speed / 1024.0) : 0);
}
#endif /* X11 */
#endif /* BUILD_X11 */
#ifdef __linux__
#ifdef HAVE_IWLIB

View File

@ -69,11 +69,11 @@ void print_addr(struct text_object *, char *, int);
#ifdef __linux__
void print_addrs(struct text_object *, char *, int);
#endif /* __linux__ */
#ifdef X11
#ifdef BUILD_X11
void parse_net_stat_graph_arg(struct text_object *, const char *, void *);
double downspeedgraphval(struct text_object *);
double upspeedgraphval(struct text_object *);
#endif /* X11 */
#endif /* BUILD_X11 */
#ifdef __linux__
#ifdef HAVE_IWLIB
void print_wireless_essid(struct text_object *, char *, int);

View File

@ -79,11 +79,11 @@ void parse_scroll_arg(struct text_object *obj, const char *arg, void *free_at_cr
obj->data.opaque = sd;
#ifdef X11
#ifdef BUILD_X11
/* add a color object right after scroll to reset any color changes */
obj->next->data.l = sd->resetcolor;
obj->next->callbacks.print = &new_fg;
#endif /* X11 */
#endif /* BUILD_X11 */
}
void print_scroll(struct text_object *obj, char *p, int p_max_size)

View File

@ -29,9 +29,9 @@
*/
#include "conky.h"
#include "colours.h"
#ifdef X11
#ifdef BUILD_X11
#include "fonts.h"
#endif /* X11 */
#endif /* BUILD_X11 */
#include "logging.h"
#include "specials.h"
#include <math.h>
@ -49,9 +49,9 @@ struct special_t *specials = NULL;
int special_count;
int default_bar_width = 0, default_bar_height = 6;
#ifdef X11
#ifdef BUILD_X11
int default_graph_width = 0, default_graph_height = 25;
#endif /* X11 */
#endif /* BUILD_X11 */
int default_gauge_width = 40, default_gauge_height = 25;
/* special data types flags */
@ -156,7 +156,7 @@ const char *scan_bar(struct text_object *obj, const char *args, double scale)
return args;
}
#ifdef X11
#ifdef BUILD_X11
void scan_font(struct text_object *obj, const char *args)
{
if (args && *args)
@ -244,7 +244,7 @@ char *scan_graph(struct text_object *obj, const char *args, double defscale)
return strndup(buf, text_buffer_size);
}
}
#endif /* X11 */
#endif /* BUILD_X11 */
/*
* Printing various special text objects
@ -270,7 +270,7 @@ void new_gauge_in_shell(struct text_object *obj, char *p, int p_max_size, double
snprintf(p, p_max_size, "%s", gaugevals[round_to_int(usage * 4 / g->scale)]);
}
#ifdef X11
#ifdef BUILD_X11
void new_gauge_in_x11(struct text_object *obj, char *buf, double usage)
{
struct special_t *s = 0;
@ -289,7 +289,7 @@ void new_gauge_in_x11(struct text_object *obj, char *buf, double usage)
s->height = g->height;
s->scale = g->scale;
}
#endif /* X11 */
#endif /* BUILD_X11 */
void new_gauge(struct text_object *obj, char *p, int p_max_size, double usage)
{
@ -303,15 +303,15 @@ void new_gauge(struct text_object *obj, char *p, int p_max_size, double usage)
else
usage = MIN(g->scale, usage);
#ifdef X11
#ifdef BUILD_X11
if (output_methods & TO_X)
new_gauge_in_x11(obj, p, usage);
else
#endif /* X11 */
#endif /* BUILD_X11 */
new_gauge_in_shell(obj, p, p_max_size, usage);
}
#ifdef X11
#ifdef BUILD_X11
void new_font(struct text_object *obj, char *p, int p_max_size)
{
struct special_t *s;
@ -462,14 +462,14 @@ void new_stippled_hr(struct text_object *obj, char *p, int p_max_size)
s->height = sh->height;
s->arg = sh->arg;
}
#endif /* X11 */
#endif /* BUILD_X11 */
void new_fg(struct text_object *obj, char *p, int p_max_size)
{
#ifdef X11
#ifdef BUILD_X11
if (output_methods & TO_X)
new_special(p, FG)->arg = obj->data.l;
#endif /* X11 */
#endif /* BUILD_X11 */
#ifdef NCURSES
if (output_methods & TO_NCURSES)
new_special(p, FG)->arg = obj->data.l;
@ -479,7 +479,7 @@ void new_fg(struct text_object *obj, char *p, int p_max_size)
UNUSED(p_max_size);
}
#ifdef X11
#ifdef BUILD_X11
void new_bg(struct text_object *obj, char *p, int p_max_size)
{
if ((output_methods & TO_X) == 0)
@ -490,7 +490,7 @@ void new_bg(struct text_object *obj, char *p, int p_max_size)
new_special(p, BG)->arg = obj->data.l;
}
#endif /* X11 */
#endif /* BUILD_X11 */
static void new_bar_in_shell(struct text_object *obj, char* buffer, int buf_max_size, double usage)
{
@ -518,7 +518,7 @@ static void new_bar_in_shell(struct text_object *obj, char* buffer, int buf_max_
buffer[i] = 0;
}
#ifdef X11
#ifdef BUILD_X11
static void new_bar_in_x11(struct text_object *obj, char *buf, double usage)
{
struct special_t *s = 0;
@ -537,7 +537,7 @@ static void new_bar_in_x11(struct text_object *obj, char *buf, double usage)
s->height = b->height;
s->scale = b->scale;
}
#endif /* X11 */
#endif /* BUILD_X11 */
/* usage is in range [0,255] */
void new_bar(struct text_object *obj, char *p, int p_max_size, double usage)
@ -552,11 +552,11 @@ void new_bar(struct text_object *obj, char *p, int p_max_size, double usage)
else
usage = MIN(b->scale, usage);
#ifdef X11
#ifdef BUILD_X11
if ((output_methods & TO_X))
new_bar_in_x11(obj, p, usage);
else
#endif /* X11 */
#endif /* BUILD_X11 */
new_bar_in_shell(obj, p, p_max_size, usage);
}

View File

@ -80,12 +80,12 @@ extern int special_count;
extern int default_bar_width;
extern int default_bar_height;
#ifdef X11
#ifdef BUILD_X11
extern int default_graph_width;
extern int default_graph_height;
extern int default_gauge_width;
extern int default_gauge_height;
#endif
#endif /* BUILD_X11 */
/* forward declare to avoid mutual inclusion between specials.h and text_object.h */
struct text_object;
@ -96,7 +96,7 @@ extern int max_specials;
/* scanning special arguments */
const char *scan_bar(struct text_object *, const char *, double);
const char *scan_gauge(struct text_object *, const char *, double);
#ifdef X11
#ifdef BUILD_X11
void scan_font(struct text_object *, const char *);
char *scan_graph(struct text_object *, const char *, double);
void scan_tab(struct text_object *, const char *);
@ -107,7 +107,7 @@ void new_font(struct text_object *, char *, int);
void new_graph(struct text_object *, char *, int, double);
void new_hr(struct text_object *, char *, int);
void new_stippled_hr(struct text_object *, char *, int);
#endif
#endif /* BUILD_X11 */
void new_gauge(struct text_object *, char *, int, double);
void new_bar(struct text_object *, char *, int, double);
void new_fg(struct text_object *, char *, int);

View File

@ -36,18 +36,18 @@
#ifdef MATH
#include <math.h>
#endif /* MATH */
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
#include <libxml/parser.h>
#include <libxml/xpath.h>
#endif /* XOAP */
#endif /* BUILD_WEATHER_XOAP */
/* WEATHER data */
typedef struct PWEATHER_ {
char lastupd[32];
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
char xoap_t[32];
char icon[3];
#endif /* XOAP */
#endif /* BUILD_WEATHER_XOAP */
int temp;
int dew;
int cc;
@ -58,7 +58,7 @@ typedef struct PWEATHER_ {
int wc;
} PWEATHER;
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
#define FORECAST_DAYS 5
typedef struct PWEATHER_FORECAST_ {
int hi[FORECAST_DAYS];
@ -73,7 +73,7 @@ typedef struct PWEATHER_FORECAST_ {
int ppcp[FORECAST_DAYS];
} PWEATHER_FORECAST;
/* Xpath expressions for XOAP xml parsing */
/* Xpath expressions for BUILD_WEATHER_XOAP xml parsing */
#define NUM_XPATH_EXPRESSIONS_CC 8
const char *xpath_expression_cc[NUM_XPATH_EXPRESSIONS_CC] = {
"/weather/cc/lsup", "/weather/cc/tmp", "/weather/cc/t",
@ -89,7 +89,7 @@ const char *xpath_expression_df[NUM_XPATH_EXPRESSIONS_DF] = {
"/weather/dayf/day[*]/part[1]/ppcp", "/weather/dayf/day[*]/part[1]/hmid",
"/weather/dayf/day[*]/@t", "/weather/dayf/day[*]/@dt"
};
#endif /* XOAP */
#endif /* BUILD_WEATHER_XOAP */
/* Possible sky conditions */
#define NUM_CC_CODES 6
@ -113,7 +113,7 @@ const char *WC_CODES[NUM_WC_CODES] = {
};
static ccurl_location_list locations_cc;
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
static ccurl_location_list locations_df;
#endif
@ -123,7 +123,7 @@ struct weather_data {
int interval;
};
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
struct weather_forecast_data {
char uri[128];
unsigned int day;
@ -135,7 +135,7 @@ struct weather_forecast_data {
void weather_free_info(void)
{
ccurl_free_locations(locations_cc);
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
ccurl_free_locations(locations_df);
#endif
}
@ -152,7 +152,7 @@ int rel_humidity(int dew_point, int air) {
#endif /* MATH */
}
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
static void parse_df(PWEATHER_FORECAST *res, xmlXPathContextPtr xpathCtx)
{
int i, j, k;
@ -321,7 +321,7 @@ static void parse_weather_xml(PWEATHER *res, const char *data)
xmlFreeDoc(doc);
return;
}
#endif /* XOAP */
#endif /* BUILD_WEATHER_XOAP */
/*
* Horrible hack to avoid using regexes
@ -613,7 +613,7 @@ static inline void parse_token(PWEATHER *res, char *token) {
}
}
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
void parse_weather_forecast(void *result, const char *data)
{
PWEATHER_FORECAST *res = (PWEATHER_FORECAST*)result;
@ -625,7 +625,7 @@ void parse_weather_forecast(void *result, const char *data)
parse_weather_forecast_xml(res, data);
}
}
#endif /* XOAP */
#endif /* BUILD_WEATHER_XOAP */
void parse_weather(void *result, const char *data)
{
@ -633,12 +633,12 @@ void parse_weather(void *result, const char *data)
/* Reset results */
memset(res, 0, sizeof(PWEATHER));
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
//Check if it is an xml file
if ( strncmp(data, "<?xml ", 6) == 0 ) {
parse_weather_xml(res, data);
} else
#endif /* XOAP */
#endif /* BUILD_WEATHER_XOAP */
{
//We assume its a text file
char s_tmp[256];
@ -707,7 +707,7 @@ void wind_deg_to_dir(char *p, int p_max_size, int wind_deg) {
};
}
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
static void weather_forecast_process_info(char *p, int p_max_size, char *uri, unsigned int day, char *data_type, int interval)
{
PWEATHER_FORECAST *data;
@ -751,7 +751,7 @@ static void weather_forecast_process_info(char *p, int p_max_size, char *uri, un
}
}
#endif /* XOAP */
#endif /* BUILD_WEATHER_XOAP */
static void weather_process_info(char *p, int p_max_size, char *uri, char *data_type, int interval)
{
@ -782,7 +782,7 @@ static void weather_process_info(char *p, int p_max_size, char *uri, char *data_
} else if (strcmp(data_type, "temperature") == EQUAL) {
temp_print(p, p_max_size, data->temp, TEMP_CELSIUS);
} else if (strcmp(data_type, "cloud_cover") == EQUAL) {
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
if (data->xoap_t[0] != '\0') {
char *s = p;
strncpy(p, data->xoap_t, p_max_size);
@ -791,7 +791,7 @@ static void weather_process_info(char *p, int p_max_size, char *uri, char *data_
s++;
}
} else
#endif /* XOAP */
#endif /* BUILD_WEATHER_XOAP */
if (data->cc == 0) {
strncpy(p, "", p_max_size);
} else if (data->cc < 3) {
@ -807,10 +807,10 @@ static void weather_process_info(char *p, int p_max_size, char *uri, char *data_
} else {
strncpy(p, "cumulonimbus", p_max_size);
}
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
} else if (strcmp(data_type, "icon") == EQUAL) {
strncpy(p, data->icon, p_max_size);
#endif /* XOAP */
#endif /* BUILD_WEATHER_XOAP */
} else if (strcmp(data_type, "pressure") == EQUAL) {
snprintf(p, p_max_size, "%d", data->bar);
} else if (strcmp(data_type, "wind_speed") == EQUAL) {
@ -828,11 +828,11 @@ static void weather_process_info(char *p, int p_max_size, char *uri, char *data_
}
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
/* xoap suffix for weather from weather.com */
static char *xoap_cc = NULL;
static char *xoap_df = NULL;
#endif /* XOAP */
#endif /* BUILD_WEATHER_XOAP */
static int process_weather_uri(char *uri, char *locID, int dayf UNUSED_ATTR)
{
@ -845,7 +845,7 @@ static int process_weather_uri(char *uri, char *locID, int dayf UNUSED_ATTR)
}
/* Construct complete uri */
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
if (strstr(uri, "xoap.weather.com")) {
if ((dayf == 0) && (xoap_cc != NULL)) {
strcat(uri, locID);
@ -858,7 +858,7 @@ static int process_weather_uri(char *uri, char *locID, int dayf UNUSED_ATTR)
uri = NULL;
}
} else
#endif /* XOAP */
#endif /* BUILD_WEATHER_XOAP */
if (strstr(uri, "weather.noaa.gov")) {
strcat(uri, locID);
strcat(uri, ".TXT");
@ -868,7 +868,7 @@ static int process_weather_uri(char *uri, char *locID, int dayf UNUSED_ATTR)
return 0;
}
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
/*
* TODO: make the xoap keys file readable from the config file
@ -963,7 +963,7 @@ void print_weather_forecast(struct text_object *obj, char *p, int p_max_size)
}
weather_forecast_process_info(p, p_max_size, wfd->uri, wfd->day, wfd->data_type, wfd->interval);
}
#endif /* XOAP */
#endif /* BUILD_WEATHER_XOAP */
void scan_weather_arg(struct text_object *obj, const char *arg, void *free_at_crash)
{

View File

@ -37,11 +37,11 @@ extern "C" {
/* Prototypes */
void weather_free_info(void);
#ifdef XOAP
#ifdef BUILD_WEATHER_XOAP
void load_xoap_keys(void);
void scan_weather_forecast_arg(struct text_object *, const char *, void *);
void print_weather_forecast(struct text_object *, char *, int);
#endif /* XOAP */
#endif /* BUILD_WEATHER_XOAP */
void scan_weather_arg(struct text_object *, const char *, void *);
void print_weather(struct text_object *, char *, int);

View File

@ -42,20 +42,20 @@
#include "imlib2.h"
#endif /* IMLIB2 */
#ifdef XFT
#ifdef BUILD_XFT
#include <X11/Xft/Xft.h>
int use_xft = 0;
#endif
#ifdef HAVE_XDBE
#ifdef BUILD_XDBE
int use_xdbe;
#endif
#ifdef USE_ARGB
#ifdef BUILD_ARGB
int use_argb_visual;
int own_window_argb_value;
int have_argb_visual;
#endif /* USE_ARGB */
#endif /* BUILD_ARGB */
/* some basic X11 stuff */
Display *display = NULL;
@ -184,7 +184,7 @@ void set_transparent_background(Window win, int alpha)
{
(void)alpha; /* disable warnings when unused */
#ifdef USE_ARGB
#ifdef BUILD_ARGB
if (have_argb_visual) {
// real transparency
if (set_transparent) {
@ -195,7 +195,7 @@ void set_transparent_background(Window win, int alpha)
colour_set = background_colour;
}
} else {
#endif /* USE_ARGB */
#endif /* BUILD_ARGB */
// pseudo transparency
if (set_transparent) {
@ -215,12 +215,12 @@ void set_transparent_background(Window win, int alpha)
XSetWindowBackground(display, win, background_colour);
colour_set = background_colour;
}
#ifdef USE_ARGB
#ifdef BUILD_ARGB
}
#endif /* USE_ARGB */
#endif /* BUILD_ARGB */
}
#ifdef USE_ARGB
#ifdef BUILD_ARGB
static int get_argb_visual(Visual** visual, int *depth) {
/* code from gtk project, gdk_screen_get_rgba_visual */
XVisualInfo visual_template;
@ -247,15 +247,15 @@ static int get_argb_visual(Visual** visual, int *depth) {
XFree(visual_list);
return 0;
}
#endif /* USE_ARGB */
#endif /* BUILD_ARGB */
void destroy_window(void)
{
#ifdef XFT
#ifdef BUILD_XFT
if(window.xftdraw) {
XftDrawDestroy(window.xftdraw);
}
#endif
#endif /* BUILD_XFT */
if(window.gc) {
XFreeGC(display, window.gc);
}
@ -282,21 +282,21 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
return;
}
#ifdef USE_ARGB
#ifdef BUILD_ARGB
if (use_argb_visual && get_argb_visual(&visual, &depth)) {
have_argb_visual = 1;
window.visual = visual;
window.colourmap = XCreateColormap(display,
DefaultRootWindow(display), window.visual, AllocNone);
} else {
#endif /* USE_ARGB */
#endif /* BUILD_ARGB */
window.visual = DefaultVisual(display, screen);
window.colourmap = DefaultColormap(display, screen);
depth = CopyFromParent;
visual = CopyFromParent;
#ifdef USE_ARGB
#ifdef BUILD_ARGB
}
#endif /* USE_ARGB */
#endif /* BUILD_ARGB */
if (window.type == TYPE_OVERRIDE) {
@ -305,16 +305,16 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
XSetWindowAttributes attrs = { ParentRelative, 0L, 0, 0L, 0, 0,
Always, 0L, 0L, False, StructureNotifyMask | ExposureMask, 0L,
True, 0, 0 };
#ifdef USE_ARGB
#ifdef BUILD_ARGB
if (have_argb_visual) {
attrs.colormap = window.colourmap;
flags = CWBorderPixel | CWColormap | CWOverrideRedirect;
} else {
#endif /* USE_ARGB */
#endif /* BUILD_ARGB */
flags = CWBackPixel | CWOverrideRedirect;
#ifdef USE_ARGB
#ifdef BUILD_ARGB
}
#endif /* USE_ARGB */
#endif /* BUILD_ARGB */
/* Parent is desktop window (which might be a child of root) */
window.window = XCreateWindow(display, window.desktop, window.x,
@ -337,16 +337,16 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
XWMHints wmHint;
Atom xa;
#ifdef USE_ARGB
#ifdef BUILD_ARGB
if (have_argb_visual) {
attrs.colormap = window.colourmap;
flags = CWBorderPixel | CWColormap | CWOverrideRedirect;
} else {
#endif /* USE_ARGB */
#endif /* BUILD_ARGB */
flags = CWBackPixel | CWOverrideRedirect;
#ifdef USE_ARGB
#ifdef BUILD_ARGB
}
#endif /* USE_ARGB */
#endif /* BUILD_ARGB */
if (window.type == TYPE_DOCK) {
window.x = window.y = 0;
@ -543,7 +543,7 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
/* Drawable is same as window. This may be changed by double buffering. */
window.drawable = window.window;
#ifdef HAVE_XDBE
#ifdef BUILD_XDBE
if (use_xdbe) {
int major, minor;
@ -909,7 +909,7 @@ void set_struts(int sidenum)
}
#endif /* OWN_WINDOW */
#ifdef HAVE_XDBE
#ifdef BUILD_XDBE
void xdbe_swap_buffers(void)
{
if (use_xdbe) {
@ -920,5 +920,5 @@ void xdbe_swap_buffers(void)
XdbeSwapBuffers(display, &swap, 1);
}
}
#endif /* HAVE_XDBE */
#endif /* BUILD_XDBE */

View File

@ -1,6 +1,6 @@
/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- */
#ifdef X11
#ifdef BUILD_X11
#ifndef X11_H_
#define X11_H_
@ -8,11 +8,11 @@
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#ifdef XFT
#ifdef BUILD_XFT
#include <X11/Xft/Xft.h>
#endif
#ifdef HAVE_XDBE
#ifdef BUILD_XDBE
#include <X11/extensions/Xdbe.h>
#endif
@ -48,10 +48,10 @@ struct conky_window {
GC gc;
long border_inner_margin, border_outer_margin, border_width;
#ifdef HAVE_XDBE
#ifdef BUILD_XDBE
XdbeBackBuffer back_buffer;
#endif
#ifdef XFT
#ifdef BUILD_XFT
XftDraw *xftdraw;
#endif
@ -67,15 +67,15 @@ struct conky_window {
#endif
};
#ifdef HAVE_XDBE
#ifdef BUILD_XDBE
extern int use_xdbe;
#endif
#ifdef XFT
#ifdef BUILD_XFT
extern int use_xft;
#endif
#if defined(USE_ARGB) && defined(OWN_WINDOW)
#if defined(BUILD_ARGB) && defined(OWN_WINDOW)
/* 1 if config var set to 1, otherwise 0 */
extern int use_argb_visual;
/* 1 if use_argb_visual=1 and argb visual was found, otherwise 0 */
@ -110,9 +110,9 @@ void print_desktop_number(struct text_object *, char *, int);
void print_desktop_name(struct text_object *, char *, int);
void free_desktop_info(void);
#ifdef HAVE_XDBE
#ifdef BUILD_XDBE
void xdbe_swap_buffers(void);
#endif /* HAVE_XDBE */
#endif /* BUILD_XDBE */
#endif /*X11_H_*/
#endif /* X11 */
#endif /* BUILD_X11 */