PageRenderTime 144ms CodeModel.GetById 122ms app.highlight 18ms RepoModel.GetById 1ms app.codeStats 0ms

/script_binding/lua/lua_ftk_window.c

http://ftk.googlecode.com/
C | 296 lines | 231 code | 64 blank | 1 comment | 9 complexity | 0951fa1410a4a77cb81294849ade0aad MD5 | raw file
  1/*This file is generated by luagen.*/
  2#include "lua_ftk_window.h"
  3#include "lua_ftk_callbacks.h"
  4
  5static void tolua_reg_types (lua_State* L)
  6{
  7	tolua_usertype(L, "FtkWindow");
  8}
  9
 10static int lua_ftk_window_set_focus(lua_State* L)
 11{
 12	tolua_Error err = {0};
 13	Ret retv;
 14	FtkWidget* thiz;
 15	FtkWidget* focus_widget;
 16	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isusertype(L, 2, "FtkWidget", 0, &err);
 17
 18	return_val_if_fail(param_ok, 0);
 19
 20	thiz = tolua_tousertype(L, 1, 0);
 21	focus_widget = tolua_tousertype(L, 2, 0);
 22	retv = ftk_window_set_focus(thiz, focus_widget);
 23	tolua_pushnumber(L, (lua_Number)retv);
 24
 25	return 1;
 26}
 27
 28static int lua_ftk_window_get_focus(lua_State* L)
 29{
 30	tolua_Error err = {0};
 31	FtkWidget* retv;
 32	FtkWidget* thiz;
 33	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
 34
 35	return_val_if_fail(param_ok, 0);
 36
 37	thiz = tolua_tousertype(L, 1, 0);
 38	retv = ftk_window_get_focus(thiz);
 39	tolua_pushusertype(L, (FtkWidget*)retv, "FtkWidget");
 40
 41	return 1;
 42}
 43
 44static int lua_ftk_window_grab(lua_State* L)
 45{
 46	tolua_Error err = {0};
 47	Ret retv;
 48	FtkWidget* thiz;
 49	FtkWidget* grab_widget;
 50	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isusertype(L, 2, "FtkWidget", 0, &err);
 51
 52	return_val_if_fail(param_ok, 0);
 53
 54	thiz = tolua_tousertype(L, 1, 0);
 55	grab_widget = tolua_tousertype(L, 2, 0);
 56	retv = ftk_window_grab(thiz, grab_widget);
 57	tolua_pushnumber(L, (lua_Number)retv);
 58
 59	return 1;
 60}
 61
 62static int lua_ftk_window_ungrab(lua_State* L)
 63{
 64	tolua_Error err = {0};
 65	Ret retv;
 66	FtkWidget* thiz;
 67	FtkWidget* grab_widget;
 68	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isusertype(L, 2, "FtkWidget", 0, &err);
 69
 70	return_val_if_fail(param_ok, 0);
 71
 72	thiz = tolua_tousertype(L, 1, 0);
 73	grab_widget = tolua_tousertype(L, 2, 0);
 74	retv = ftk_window_ungrab(thiz, grab_widget);
 75	tolua_pushnumber(L, (lua_Number)retv);
 76
 77	return 1;
 78}
 79
 80static int lua_ftk_window_paint_forcely(lua_State* L)
 81{
 82	tolua_Error err = {0};
 83	Ret retv;
 84	FtkWidget* thiz;
 85	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
 86
 87	return_val_if_fail(param_ok, 0);
 88
 89	thiz = tolua_tousertype(L, 1, 0);
 90	retv = ftk_window_paint_forcely(thiz);
 91	tolua_pushnumber(L, (lua_Number)retv);
 92
 93	return 1;
 94}
 95
 96static int lua_ftk_window_update(lua_State* L)
 97{
 98	tolua_Error err = {0};
 99	Ret retv;
100	FtkWidget* thiz;
101	FtkRect* rect;
102	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isusertype(L, 2, "FtkRect", 0, &err);
103
104	return_val_if_fail(param_ok, 0);
105
106	thiz = tolua_tousertype(L, 1, 0);
107	rect = tolua_tousertype(L, 2, 0);
108	retv = ftk_window_update(thiz, rect);
109	tolua_pushnumber(L, (lua_Number)retv);
110
111	return 1;
112}
113
114static int lua_ftk_window_is_mapped(lua_State* L)
115{
116	tolua_Error err = {0};
117	int retv;
118	FtkWidget* thiz;
119	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
120
121	return_val_if_fail(param_ok, 0);
122
123	thiz = tolua_tousertype(L, 1, 0);
124	retv = ftk_window_is_mapped(thiz);
125	tolua_pushnumber(L, (lua_Number)retv);
126
127	return 1;
128}
129
130static int lua_ftk_window_is_fullscreen(lua_State* L)
131{
132	tolua_Error err = {0};
133	int retv;
134	FtkWidget* thiz;
135	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
136
137	return_val_if_fail(param_ok, 0);
138
139	thiz = tolua_tousertype(L, 1, 0);
140	retv = ftk_window_is_fullscreen(thiz);
141	tolua_pushnumber(L, (lua_Number)retv);
142
143	return 1;
144}
145
146static int lua_ftk_window_set_fullscreen(lua_State* L)
147{
148	tolua_Error err = {0};
149	Ret retv;
150	FtkWidget* thiz;
151	int fullscreen;
152	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isnumber(L, 2, 0, &err);
153
154	return_val_if_fail(param_ok, 0);
155
156	thiz = tolua_tousertype(L, 1, 0);
157	fullscreen = tolua_tonumber(L, 2, 0);
158	retv = ftk_window_set_fullscreen(thiz, fullscreen);
159	tolua_pushnumber(L, (lua_Number)retv);
160
161	return 1;
162}
163
164static int lua_ftk_window_invalidate(lua_State* L)
165{
166	tolua_Error err = {0};
167	Ret retv;
168	FtkWidget* thiz;
169	FtkRect* rect;
170	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isusertype(L, 2, "FtkRect", 0, &err);
171
172	return_val_if_fail(param_ok, 0);
173
174	thiz = tolua_tousertype(L, 1, 0);
175	rect = tolua_tousertype(L, 2, 0);
176	retv = ftk_window_invalidate(thiz, rect);
177	tolua_pushnumber(L, (lua_Number)retv);
178
179	return 1;
180}
181
182static int lua_ftk_window_set_background_with_alpha(lua_State* L)
183{
184	tolua_Error err = {0};
185	Ret retv;
186	FtkWidget* thiz;
187	FtkBitmap* bitmap;
188	FtkColor bg;
189	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isusertype(L, 2, "FtkBitmap", 0, &err) && tolua_isusertype(L, 3, "FtkColor", 0, &err);
190
191	return_val_if_fail(param_ok, 0);
192
193	thiz = tolua_tousertype(L, 1, 0);
194	bitmap = tolua_tousertype(L, 2, 0);
195	bg = *(FtkColor*)tolua_tousertype(L, 3, 0);
196	retv = ftk_window_set_background_with_alpha(thiz, bitmap, bg);
197	tolua_pushnumber(L, (lua_Number)retv);
198
199	return 1;
200}
201
202static int lua_ftk_window_enable_update(lua_State* L)
203{
204	tolua_Error err = {0};
205	Ret retv;
206	FtkWidget* thiz;
207	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
208
209	return_val_if_fail(param_ok, 0);
210
211	thiz = tolua_tousertype(L, 1, 0);
212	retv = ftk_window_enable_update(thiz);
213	tolua_pushnumber(L, (lua_Number)retv);
214
215	return 1;
216}
217
218static int lua_ftk_window_disable_update(lua_State* L)
219{
220	tolua_Error err = {0};
221	Ret retv;
222	FtkWidget* thiz;
223	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
224
225	return_val_if_fail(param_ok, 0);
226
227	thiz = tolua_tousertype(L, 1, 0);
228	retv = ftk_window_disable_update(thiz);
229	tolua_pushnumber(L, (lua_Number)retv);
230
231	return 1;
232}
233
234static int lua_ftk_window_get_animation_hint(lua_State* L)
235{
236	tolua_Error err = {0};
237	const char* retv;
238	FtkWidget* thiz;
239	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
240
241	return_val_if_fail(param_ok, 0);
242
243	thiz = tolua_tousertype(L, 1, 0);
244	retv = ftk_window_get_animation_hint(thiz);
245	tolua_pushstring(L, (const char*)retv);
246
247	return 1;
248}
249
250static int lua_ftk_window_set_animation_hint(lua_State* L)
251{
252	tolua_Error err = {0};
253	Ret retv;
254	FtkWidget* thiz;
255	const char* hint;
256	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isstring(L, 2, 0, &err);
257
258	return_val_if_fail(param_ok, 0);
259
260	thiz = tolua_tousertype(L, 1, 0);
261	hint = tolua_tostring(L, 2, 0);
262	retv = ftk_window_set_animation_hint(thiz, hint);
263	tolua_pushnumber(L, (lua_Number)retv);
264
265	return 1;
266}
267
268int tolua_ftk_window_init(lua_State* L)
269{
270	tolua_open(L);
271	tolua_reg_types(L);
272	tolua_module(L, NULL, 0);
273	tolua_beginmodule(L, NULL);
274	tolua_cclass(L,"FtkWindow", "FtkWindow", "FtkWidget", NULL);
275	tolua_beginmodule(L, "FtkWindow");
276	tolua_function(L, "SetFocus", lua_ftk_window_set_focus);
277	tolua_function(L, "GetFocus", lua_ftk_window_get_focus);
278	tolua_function(L, "Grab", lua_ftk_window_grab);
279	tolua_function(L, "Ungrab", lua_ftk_window_ungrab);
280	tolua_function(L, "PaintForcely", lua_ftk_window_paint_forcely);
281	tolua_function(L, "Update", lua_ftk_window_update);
282	tolua_function(L, "IsMapped", lua_ftk_window_is_mapped);
283	tolua_function(L, "IsFullscreen", lua_ftk_window_is_fullscreen);
284	tolua_function(L, "SetFullscreen", lua_ftk_window_set_fullscreen);
285	tolua_function(L, "Invalidate", lua_ftk_window_invalidate);
286	tolua_function(L, "SetBackgroundWithAlpha", lua_ftk_window_set_background_with_alpha);
287	tolua_function(L, "EnableUpdate", lua_ftk_window_enable_update);
288	tolua_function(L, "DisableUpdate", lua_ftk_window_disable_update);
289	tolua_function(L, "GetAnimationHint", lua_ftk_window_get_animation_hint);
290	tolua_function(L, "SetAnimationHint", lua_ftk_window_set_animation_hint);
291	tolua_endmodule(L);
292	tolua_endmodule(L);
293
294
295	return 1;
296}