various fixes
[lqt.git] / lqt_common.hpp
blob3c9ce31c21e01a9107734bdb3021cdb89154e239
1 /*
2 * Copyright (c) 2007-2008 Mauro Iazzi
3 *
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use,
8 * copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following
11 * conditions:
13 * The above copyright notice and this permission notice shall be
14 * included in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
27 #ifndef __LQT_COMMON_HPP
28 #define __LQT_COMMON_HPP
30 extern "C" {
31 #include <lua.h>
32 #include <lualib.h>
33 #include <lauxlib.h>
36 #include <QVariant>
37 #include <QIcon>
38 #include <QLocale>
39 //#include <iostream>
41 #define LQT_POINTERS "Registry Pointers"
42 #define LQT_ENUMS "Registry Enumerations"
44 template<typename T> class LuaBinder;
46 extern int& lqtL_tointref (lua_State *, int);
48 extern void lqtL_pusharguments (lua_State *, char**);
49 extern char** lqtL_toarguments (lua_State *, int);
50 extern bool lqtL_testarguments (lua_State *, int);
52 extern void lqtL_manageudata (lua_State *, int);
53 extern void lqtL_unmanageudata (lua_State *, int);
54 extern void lqtL_pushudata (lua_State *, const void *, const char *);
55 extern void lqtL_passudata (lua_State *, const void *, const char *);
56 extern void * lqtL_toudata (lua_State *, int, const char *);
57 extern bool lqtL_testudata (lua_State *, int, const char *);
58 //#define lqtL_checkudata(a...) luaL_checkudata(a)
59 extern void * lqtL_checkudata (lua_State *, int, const char *);
60 #define lqtL_isudata(a...) lqtL_testudata(a)
62 extern void lqtL_pushenum (lua_State *, int, const char *);
63 extern bool lqtL_isenum (lua_State *, int, const char *);
64 extern int lqtL_toenum (lua_State *, int, const char *);
67 extern int lqtL_baseindex (lua_State *, int, int);
69 extern int lqtL_gc (lua_State *);
70 extern int lqtL_index (lua_State *);
71 extern int lqtL_newindex (lua_State *);
74 #endif // __LQT_COMMON_HPP