1 /* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
3 * Conky, a system monitor, based on torsmo
5 * Any original torsmo code is licensed under the BSD license
7 * All code written since the fork of torsmo is licensed under the GPL
9 * Please see COPYING for details
11 * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
12 * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
14 * All rights reserved.
16 * This program is free software: you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation, either version 3 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29 #ifndef _TEXT_OBJECT_H
30 #define _TEXT_OBJECT_H
32 #include "config.h" /* for the defines */
33 #include "timed_thread.h" /* timed_thread */
35 #ifdef TCP_PORT_MONITOR
36 #include "tcp-portmon.h" /* tcp_port_monitor_data */
39 #include "mail.h" /* local_mail_s */
40 #include "fs.h" /* struct fs_stat */
43 #include "nvidia.h" /* nvidia_s */
46 #define SPECIAL_CHAR '\x01'
47 #define SECRIT_MULTILINE_CHAR '\x02'
49 enum text_object_type {
52 #if defined(__linux__)
54 #endif /* __linux__ */
66 #endif /* !__OpenBSD__ */
97 OBJ_diskiograph_write,
141 #if defined(__linux__)
147 OBJ_i8k_left_fan_status,
148 OBJ_i8k_right_fan_status,
149 OBJ_i8k_left_fan_rpm,
150 OBJ_i8k_right_fan_rpm,
152 OBJ_i8k_buttons_status,
165 OBJ_if_smapi_bat_installed,
167 /* information from sony_laptop kernel module
168 * /sys/devices/platform/sony-laptop */
180 OBJ_wireless_bitrate,
182 OBJ_wireless_link_qual,
183 OBJ_wireless_link_qual_max,
184 OBJ_wireless_link_qual_perc,
185 OBJ_wireless_link_bar,
186 #endif /* __linux__ */
187 #if defined(__FreeBSD__) || defined(__linux__)
216 OBJ_unforwarded_mails,
253 OBJ_running_processes,
285 #if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
286 || defined(__OpenBSD__)) && (defined(i386) || defined(__i386__))
288 OBJ_apm_battery_time,
289 OBJ_apm_battery_life,
290 #endif /* __FreeBSD__ __OpenBSD__ */
292 OBJ_obsd_sensors_temp,
293 OBJ_obsd_sensors_fan,
294 OBJ_obsd_sensors_volt,
297 #endif /* __OpenBSD__ */
351 OBJ_xmms2_timesplayed,
352 OBJ_if_xmms2_connected,
355 OBJ_audacious_status,
357 OBJ_audacious_length,
358 OBJ_audacious_length_seconds,
359 OBJ_audacious_position,
360 OBJ_audacious_position_seconds,
361 OBJ_audacious_bitrate,
362 OBJ_audacious_frequency,
363 OBJ_audacious_channels,
364 OBJ_audacious_filename,
365 OBJ_audacious_playlist_length,
366 OBJ_audacious_playlist_position,
367 OBJ_audacious_main_volume,
371 #endif /* AUDACIOUS */
385 #endif /* HAVE_CURL */
393 OBJ_weather_forecast,
403 #endif /* HAVE_LUA */
404 #ifdef TCP_PORT_MONITOR
406 #endif /* TCP_PORT_MONITOR */
410 #endif /* HAVE_ICONV */
421 OBJ_entropy_poolsize,
434 OBJ_apcupsd_loadgraph,
435 OBJ_apcupsd_loadgauge,
438 OBJ_apcupsd_timeleft,
440 OBJ_apcupsd_lastxfer,
445 struct text_object *next, *prev; /* doubly linked list of text objects */
446 struct text_object *sub; /* for objects parsing text into objects */
448 char *s; /* some string */
449 int i; /* some integer */
450 long l; /* some other integer */
452 struct net_stat *net;
454 struct diskio_stat *diskio;
455 unsigned char loadavg[3];
456 unsigned int cpu_index;
465 char *tz; /* timezone variable */
466 char *fmt; /* time display formatting */
486 float factor, offset;
490 struct text_object *next;
524 timed_thread *p_timed_thread;
530 #ifdef TCP_PORT_MONITOR
531 struct tcp_port_monitor_data tcp_port_monitor;
561 unsigned int nrspaces;
598 struct local_mail_s local_mail;
600 struct nvidia_s nvidia;
607 unsigned int c, d, e;
612 /* text object list helpers */
613 int append_object(struct text_object *root, struct text_object *obj);
617 * Opaque is a pointer to the address of the ifblock stack's top object.
618 * Calling clients should pass the address of a defined void pointer which
619 * was initialised to NULL (empty stack).
621 int obj_be_ifblock_if(void **opaque, struct text_object *);
622 int obj_be_ifblock_else(void **opaque, struct text_object *);
623 int obj_be_ifblock_endif(void **opaque, struct text_object *);
624 int ifblock_stack_empty(void **opaque);
626 #endif /* _TEXT_OBJECT_H */