Revert "Uhh..ansohus"
[monky] / src / conky.h
index 78f6e1f..1742526 100644 (file)
@@ -1,4 +1,6 @@
-/* Conky, a system monitor, based on torsmo
+/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
+ *
+ * Conky, a system monitor, based on torsmo
  *
  * Any original torsmo code is licensed under the BSD license
  *
@@ -23,6 +25,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
+ * vim: ts=4 sw=4 noet ai cindent syntax=c
+ *
  */
 
 #ifndef _conky_h_
@@ -87,13 +91,23 @@ char *strndup(const char *s, size_t n);
 #include "nvidia.h"
 #endif
 
+#ifdef HAVE_CURL
+#include "ccurl_thread.h"
+#endif /* HAVE_CURL */
+
 #ifdef RSS
 #include "rss.h"
-#endif
+#endif /* RSS */
 
-#ifdef HAVE_LUA
-#include "llua.h"
-#endif
+#ifdef XOAP
+#ifndef WEATHER
+#error "WEATHER needs to be defined if XOAP is defined"
+#endif /* WEATHER */
+#endif /* XOAP */
+
+#ifdef WEATHER
+#include "weather.h"
+#endif /* WEATHER */
 
 #ifdef TCP_PORT_MONITOR
 #include "tcp-portmon.h"
@@ -143,10 +157,53 @@ struct monitor_info {
        int current;
 };
 
+struct desktop_info {
+        int current;
+        int number;
+        unsigned int nitems;
+        char *all_names;
+        char *name;
+};
+
 struct x11_info {
        struct monitor_info monitor;
+       struct desktop_info desktop;
 };
-#endif
+
+int get_stippled_borders(void);
+
+#endif /* X11 */
+
+/* defined in conky.c */
+extern long default_fg_color, default_bg_color, default_out_color;
+extern long color0, color1, color2, color3, color4, color5, color6, color7,
+          color8, color9;
+void set_current_text_color(long colour);
+long get_current_text_color(void);
+
+void set_updatereset(int);
+int get_updatereset(void);
+
+struct conftree {
+       char* string;
+       struct conftree* horz_next;
+       struct conftree* vert_next;
+       struct conftree* back;
+};
+
+char load_config_file(const char *);
+
+char *get_global_text(void);
+extern long global_text_lines;
+
+//adds newstring to to the tree unless you can already see it when travelling back.
+//if it's possible to attach it then it returns a pointer to the leaf, else it returns NULL
+struct conftree* conftree_add(struct conftree* previous, const char* newstring);
+
+extern struct conftree *currentconffile;
+
+#define MAX_TEMPLATES 10
+char **get_templates(void);
 
 enum {
        INFO_CPU = 0,
@@ -183,9 +240,6 @@ enum {
        INFO_XMMS2 = 22,
 #endif
        INFO_ENTROPY = 23,
-#ifdef RSS
-       INFO_RSS = 24,
-#endif
 #ifdef IBM
        INFO_SMAPI = 25,
 #endif
@@ -204,6 +258,9 @@ enum {
 #ifdef APCUPSD
        INFO_APCUPSD = 32,
 #endif
+#ifdef WEATHER
+       INFO_WEATHER = 33,
+#endif
 };
 
 /* get_battery_stuff() item selector
@@ -231,7 +288,7 @@ struct information {
        double uptime;
 
        /* memory information in kilobytes */
-       unsigned long long mem, memeasyfree, memfree, memmax, swap, swapmax;
+       unsigned long long mem, memeasyfree, memfree, memmax, swap, swapfree, swapmax;
        unsigned long long bufmem, buffers, cached;
 
        unsigned short procs;
@@ -265,6 +322,9 @@ struct information {
        struct process *cpu[10];
        struct process *memu[10];
        struct process *time[10];
+#ifdef IOSTATS
+       struct process *io[10];
+#endif
        struct process *first_process;
        unsigned long looped;
        struct entropy_s entropy;
@@ -281,6 +341,10 @@ struct information {
        short kflags;   /* kernel settings, see enum KFLAG */
 };
 
+#ifdef HAVE_LUA
+#include "llua.h"
+#endif /* HAVE_LUA */
+
 /* needed by linux.c and top.c -> outsource somewhere */
 enum {
        /* set to true if kernel uses "long" format for /proc/stats */
@@ -298,6 +362,9 @@ enum {
 
 /* defined in conky.c, needed by top.c */
 extern int top_cpu, top_mem, top_time;
+#ifdef IOSTATS
+extern int top_io;
+#endif
 
 /* defined in conky.c, needed by top.c */
 extern int cpu_separate;
@@ -317,11 +384,30 @@ int spaced_print(char *, int, const char *, int, ...)
        __attribute__((format(printf, 3, 5)));
 extern int inotify_fd;
 
+/* defined in conky.c
+ * evaluates 'text' and places the result in 'buffer'
+ */
+void evaluate(const char *text, char *buffer);
+
+/* maximum size of config TEXT buffer, i.e. below TEXT line. */
+extern unsigned int max_user_text;
+
+/* path to config file */
+extern char *current_config;
+
+/* just a wrapper for read_exec() defined in conky.c */
+void do_read_exec(const char *data, char *buf, const int size);
+
+#ifdef X11
 #define TO_X 1
+#endif /* X11 */
 #define TO_STDOUT 2
 #define TO_STDERR 4
 #define OVERWRITE_FILE 8
 #define APPEND_FILE 16
+#ifdef NCURSES
+#define TO_NCURSES 32
+#endif /* NCURSES */
 enum x_initialiser_state {
        NO = 0,
        YES = 1,
@@ -330,6 +416,14 @@ enum x_initialiser_state {
 extern int output_methods;
 extern enum x_initialiser_state x_initialised;
 
+void set_update_interval(double interval);
+
 #define DEFAULT_TEXT_BUFFER_SIZE_S "##DEFAULT_TEXT_BUFFER_SIZE"
 
+#define NOBATTERY 0
+
+/* to get rid of 'unused variable' warnings */
+#define UNUSED(a)  (void)a
+#define UNUSED_ATTR __attribute__ ((unused))
+
 #endif /* _conky_h_ */