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