PageRenderTime 19ms CodeModel.GetById 2ms app.highlight 14ms RepoModel.GetById 1ms app.codeStats 0ms

/script_binding/lua/lua_ftk_config.c

http://ftk.googlecode.com/
C | 220 lines | 171 code | 48 blank | 1 comment | 5 complexity | db3ad61ec4e2fa5e7e181531fb5b5e91 MD5 | raw file
  1/*This file is generated by luagen.*/
  2#include "lua_ftk_config.h"
  3#include "lua_ftk_callbacks.h"
  4
  5static void tolua_reg_types (lua_State* L)
  6{
  7	tolua_usertype(L, "FtkConfig");
  8}
  9
 10static int lua_ftk_config_get_theme(lua_State* L)
 11{
 12	tolua_Error err = {0};
 13	const char* retv;
 14	FtkConfig* thiz;
 15	int param_ok = tolua_isusertype(L, 1, "FtkConfig", 0, &err);
 16
 17	return_val_if_fail(param_ok, 0);
 18
 19	thiz = tolua_tousertype(L, 1, 0);
 20	retv = ftk_config_get_theme(thiz);
 21	tolua_pushstring(L, (const char*)retv);
 22
 23	return 1;
 24}
 25
 26static int lua_ftk_config_get_data_dir(lua_State* L)
 27{
 28	tolua_Error err = {0};
 29	const char* retv;
 30	FtkConfig* thiz;
 31	int param_ok = tolua_isusertype(L, 1, "FtkConfig", 0, &err);
 32
 33	return_val_if_fail(param_ok, 0);
 34
 35	thiz = tolua_tousertype(L, 1, 0);
 36	retv = ftk_config_get_data_dir(thiz);
 37	tolua_pushstring(L, (const char*)retv);
 38
 39	return 1;
 40}
 41
 42static int lua_ftk_config_get_data_root_dir(lua_State* L)
 43{
 44	tolua_Error err = {0};
 45	const char* retv;
 46	FtkConfig* thiz;
 47	int param_ok = tolua_isusertype(L, 1, "FtkConfig", 0, &err);
 48
 49	return_val_if_fail(param_ok, 0);
 50
 51	thiz = tolua_tousertype(L, 1, 0);
 52	retv = ftk_config_get_data_root_dir(thiz);
 53	tolua_pushstring(L, (const char*)retv);
 54
 55	return 1;
 56}
 57
 58static int lua_ftk_config_get_test_data_dir(lua_State* L)
 59{
 60	tolua_Error err = {0};
 61	const char* retv;
 62	FtkConfig* thiz;
 63	int param_ok = tolua_isusertype(L, 1, "FtkConfig", 0, &err);
 64
 65	return_val_if_fail(param_ok, 0);
 66
 67	thiz = tolua_tousertype(L, 1, 0);
 68	retv = ftk_config_get_test_data_dir(thiz);
 69	tolua_pushstring(L, (const char*)retv);
 70
 71	return 1;
 72}
 73
 74static int lua_ftk_config_get_enable_cursor(lua_State* L)
 75{
 76	tolua_Error err = {0};
 77	int retv;
 78	FtkConfig* thiz;
 79	int param_ok = tolua_isusertype(L, 1, "FtkConfig", 0, &err);
 80
 81	return_val_if_fail(param_ok, 0);
 82
 83	thiz = tolua_tousertype(L, 1, 0);
 84	retv = ftk_config_get_enable_cursor(thiz);
 85	tolua_pushnumber(L, (lua_Number)retv);
 86
 87	return 1;
 88}
 89
 90static int lua_ftk_config_get_enable_status_bar(lua_State* L)
 91{
 92	tolua_Error err = {0};
 93	int retv;
 94	FtkConfig* thiz;
 95	int param_ok = tolua_isusertype(L, 1, "FtkConfig", 0, &err);
 96
 97	return_val_if_fail(param_ok, 0);
 98
 99	thiz = tolua_tousertype(L, 1, 0);
100	retv = ftk_config_get_enable_status_bar(thiz);
101	tolua_pushnumber(L, (lua_Number)retv);
102
103	return 1;
104}
105
106static int lua_ftk_config_set_theme(lua_State* L)
107{
108	tolua_Error err = {0};
109	Ret retv;
110	FtkConfig* thiz;
111	const char* theme;
112	int param_ok = tolua_isusertype(L, 1, "FtkConfig", 0, &err) && tolua_isstring(L, 2, 0, &err);
113
114	return_val_if_fail(param_ok, 0);
115
116	thiz = tolua_tousertype(L, 1, 0);
117	theme = tolua_tostring(L, 2, 0);
118	retv = ftk_config_set_theme(thiz, theme);
119	tolua_pushnumber(L, (lua_Number)retv);
120
121	return 1;
122}
123
124static int lua_ftk_config_set_data_dir(lua_State* L)
125{
126	tolua_Error err = {0};
127	Ret retv;
128	FtkConfig* thiz;
129	const char* data_dir;
130	int param_ok = tolua_isusertype(L, 1, "FtkConfig", 0, &err) && tolua_isstring(L, 2, 0, &err);
131
132	return_val_if_fail(param_ok, 0);
133
134	thiz = tolua_tousertype(L, 1, 0);
135	data_dir = tolua_tostring(L, 2, 0);
136	retv = ftk_config_set_data_dir(thiz, data_dir);
137	tolua_pushnumber(L, (lua_Number)retv);
138
139	return 1;
140}
141
142static int lua_ftk_config_set_test_data_dir(lua_State* L)
143{
144	tolua_Error err = {0};
145	Ret retv;
146	FtkConfig* thiz;
147	const char* test_data_dir;
148	int param_ok = tolua_isusertype(L, 1, "FtkConfig", 0, &err) && tolua_isstring(L, 2, 0, &err);
149
150	return_val_if_fail(param_ok, 0);
151
152	thiz = tolua_tousertype(L, 1, 0);
153	test_data_dir = tolua_tostring(L, 2, 0);
154	retv = ftk_config_set_test_data_dir(thiz, test_data_dir);
155	tolua_pushnumber(L, (lua_Number)retv);
156
157	return 1;
158}
159
160static int lua_ftk_config_set_enable_cursor(lua_State* L)
161{
162	tolua_Error err = {0};
163	Ret retv;
164	FtkConfig* thiz;
165	int enable_cursor;
166	int param_ok = tolua_isusertype(L, 1, "FtkConfig", 0, &err) && tolua_isnumber(L, 2, 0, &err);
167
168	return_val_if_fail(param_ok, 0);
169
170	thiz = tolua_tousertype(L, 1, 0);
171	enable_cursor = tolua_tonumber(L, 2, 0);
172	retv = ftk_config_set_enable_cursor(thiz, enable_cursor);
173	tolua_pushnumber(L, (lua_Number)retv);
174
175	return 1;
176}
177
178static int lua_ftk_config_set_enable_status_bar(lua_State* L)
179{
180	tolua_Error err = {0};
181	Ret retv;
182	FtkConfig* thiz;
183	int enable_status_bar;
184	int param_ok = tolua_isusertype(L, 1, "FtkConfig", 0, &err) && tolua_isnumber(L, 2, 0, &err);
185
186	return_val_if_fail(param_ok, 0);
187
188	thiz = tolua_tousertype(L, 1, 0);
189	enable_status_bar = tolua_tonumber(L, 2, 0);
190	retv = ftk_config_set_enable_status_bar(thiz, enable_status_bar);
191	tolua_pushnumber(L, (lua_Number)retv);
192
193	return 1;
194}
195
196int tolua_ftk_config_init(lua_State* L)
197{
198	tolua_open(L);
199	tolua_reg_types(L);
200	tolua_module(L, NULL, 0);
201	tolua_beginmodule(L, NULL);
202	tolua_cclass(L,"FtkConfig", "FtkConfig", "", NULL);
203	tolua_beginmodule(L, "FtkConfig");
204	tolua_function(L, "GetTheme", lua_ftk_config_get_theme);
205	tolua_function(L, "GetDataDir", lua_ftk_config_get_data_dir);
206	tolua_function(L, "GetDataRootDir", lua_ftk_config_get_data_root_dir);
207	tolua_function(L, "GetTestDataDir", lua_ftk_config_get_test_data_dir);
208	tolua_function(L, "GetEnableCursor", lua_ftk_config_get_enable_cursor);
209	tolua_function(L, "GetEnableStatusBar", lua_ftk_config_get_enable_status_bar);
210	tolua_function(L, "SetTheme", lua_ftk_config_set_theme);
211	tolua_function(L, "SetDataDir", lua_ftk_config_set_data_dir);
212	tolua_function(L, "SetTestDataDir", lua_ftk_config_set_test_data_dir);
213	tolua_function(L, "SetEnableCursor", lua_ftk_config_set_enable_cursor);
214	tolua_function(L, "SetEnableStatusBar", lua_ftk_config_set_enable_status_bar);
215	tolua_endmodule(L);
216	tolua_endmodule(L);
217
218
219	return 1;
220}