7d246bbca51db9dd0e8da0ae7a84f1c0418a24b7
[monky] / src / core.h
1 /* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
2  *
3  * Conky, a system monitor, based on torsmo
4  *
5  * Any original torsmo code is licensed under the BSD license
6  *
7  * All code written since the fork of torsmo is licensed under the GPL
8  *
9  * Please see COPYING for details
10  *
11  * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
12  * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
13  *      (see AUTHORS)
14  * All rights reserved.
15  *
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.
20  *
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/>.
27  *
28  * vim: ts=4 sw=4 noet ai cindent syntax=c
29  *
30  */
31
32 #ifndef _CONKY_CORE_H_
33 #define _CONKY_CORE_H_
34
35 #include "config.h"     /* defines */
36
37 /* alignments */
38 enum alignment {
39         TOP_LEFT = 1,
40         TOP_RIGHT,
41         TOP_MIDDLE,
42         BOTTOM_LEFT,
43         BOTTOM_RIGHT,
44         BOTTOM_MIDDLE,
45         MIDDLE_LEFT,
46         MIDDLE_RIGHT,
47         NONE
48 };
49
50 #ifdef X11
51 #define TO_X 1
52 #endif /* X11 */
53 #define TO_STDOUT 2
54 #define TO_STDERR 4
55 #define OVERWRITE_FILE 8
56 #define APPEND_FILE 16
57 #ifdef NCURSES
58 #define TO_NCURSES 32
59 #endif /* NCURSES */
60
61 void read_exec(const char *data, char *buf, const int size);
62 void set_default_configurations(conky_context *ctx);
63 void set_update_interval(conky_context *ctx, double interval);
64
65 /* update_text() generates new text and clears old text area */
66 void update_text(conky_context *ctx);
67 void update_text_area(conky_context *ctx);
68 void draw_stuff(conky_context *ctx);
69 char load_config_file(conky_context *ctx, const char *f);
70 void extract_variable_text(conky_context *ctx, const char *p);
71
72 #ifdef X11
73 void clear_text(conky_context *ctx, int exposures);
74 enum alignment string_to_alignment(const char *s);
75 void load_config_file_x11(conky_context *ctx, const char *);
76 void X11_create_window(conky_context *ctx);
77 #endif /* X11 */
78
79 void convert_escapes(char *buf);
80
81 void reload_config(conky_context *ctx);
82
83 void clean_up(conky_context *ctx, void *memtofree1, void *memtofree2);
84
85 #endif /* _CONKY_CORE_H_ */