Started on breaking up conky.c.
[monky] / src / llua.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  * Copyright (c) 2009 Toni Spets
6  * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
7  *      (see AUTHORS)
8  * All rights reserved.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  * You should have received a copy of the GNU General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 #ifndef LUA_H_
25 #define LUA_H_
26
27 #include <lua.h>
28 #include <lauxlib.h>
29 #include <lualib.h>
30
31 #include "config.h"
32
33 #ifdef X11
34 #include "x11.h"
35 #endif /* X11 */
36
37 #define LUAPREFIX "conky_"
38
39 /* load a lua script */
40 void llua_load(const char *script);
41 /* call a function with args, and return a string from it (must be free'd) */
42 char *llua_getstring(const char *args);
43 /* call a function with args, and return a string from it (must be free'd) */
44 char *llua_getstring_read(const char *function, const char *arg);
45 /* call a function with args, and put the result in ret */
46 int llua_getnumber(const char *args, double *ret);
47 /* close lua stuff */
48 void llua_close(void);
49 #ifdef HAVE_SYS_INOTIFY_H
50 /* check our lua inotify status */
51 void llua_inotify_query(int wd, int mask);
52 #endif /* HAVE_SYS_INOTIFY_H */
53
54 void llua_set_startup_hook(const char *args);
55 void llua_set_shutdown_hook(const char *args);
56
57 void llua_startup_hook(void);
58 void llua_shutdown_hook(void);
59
60 #ifdef X11
61 void llua_draw_pre_hook(void);
62 void llua_draw_post_hook(void);
63
64 void llua_set_draw_pre_hook(const char *args);
65 void llua_set_draw_post_hook(const char *args);
66
67 void llua_setup_window_table(int text_start_x, int text_start_y, int text_width, int text_height);
68 void llua_update_window_table(int text_start_x, int text_start_y, int text_width, int text_height);
69 #endif /* X11 */
70
71 void llua_setup_info(struct information *i, double u_interval);
72 void llua_update_info(struct information *i, double u_interval);
73
74 #endif /* LUA_H_*/