PageRenderTime 313ms CodeModel.GetById 105ms app.highlight 83ms RepoModel.GetById 119ms app.codeStats 0ms

/script_binding/lua/lua_ftk_wnd_manager.c

http://ftk.googlecode.com/
C | 247 lines | 194 code | 52 blank | 1 comment | 11 complexity | e25562984a8eb4807912b69830810ded MD5 | raw file
  1/*This file is generated by luagen.*/
  2#include "lua_ftk_wnd_manager.h"
  3#include "lua_ftk_callbacks.h"
  4
  5static void tolua_reg_types (lua_State* L)
  6{
  7	tolua_usertype(L, "FtkWndManager");
  8}
  9
 10static int lua_ftk_wnd_manager_restack(lua_State* L)
 11{
 12	tolua_Error err = {0};
 13	Ret retv;
 14	FtkWndManager* thiz;
 15	FtkWidget* window;
 16	int offset;
 17	int param_ok = tolua_isusertype(L, 1, "FtkWndManager", 0, &err) && tolua_isusertype(L, 2, "FtkWidget", 0, &err) && tolua_isnumber(L, 3, 0, &err);
 18
 19	return_val_if_fail(param_ok, 0);
 20
 21	thiz = tolua_tousertype(L, 1, 0);
 22	window = tolua_tousertype(L, 2, 0);
 23	offset = tolua_tonumber(L, 3, 0);
 24	retv = ftk_wnd_manager_restack(thiz, window, offset);
 25	tolua_pushnumber(L, (lua_Number)retv);
 26
 27	return 1;
 28}
 29
 30static int lua_ftk_wnd_manager_grab(lua_State* L)
 31{
 32	tolua_Error err = {0};
 33	Ret retv;
 34	FtkWndManager* thiz;
 35	FtkWidget* window;
 36	int param_ok = tolua_isusertype(L, 1, "FtkWndManager", 0, &err) && tolua_isusertype(L, 2, "FtkWidget", 0, &err);
 37
 38	return_val_if_fail(param_ok, 0);
 39
 40	thiz = tolua_tousertype(L, 1, 0);
 41	window = tolua_tousertype(L, 2, 0);
 42	retv = ftk_wnd_manager_grab(thiz, window);
 43	tolua_pushnumber(L, (lua_Number)retv);
 44
 45	return 1;
 46}
 47
 48static int lua_ftk_wnd_manager_ungrab(lua_State* L)
 49{
 50	tolua_Error err = {0};
 51	Ret retv;
 52	FtkWndManager* thiz;
 53	FtkWidget* window;
 54	int param_ok = tolua_isusertype(L, 1, "FtkWndManager", 0, &err) && tolua_isusertype(L, 2, "FtkWidget", 0, &err);
 55
 56	return_val_if_fail(param_ok, 0);
 57
 58	thiz = tolua_tousertype(L, 1, 0);
 59	window = tolua_tousertype(L, 2, 0);
 60	retv = ftk_wnd_manager_ungrab(thiz, window);
 61	tolua_pushnumber(L, (lua_Number)retv);
 62
 63	return 1;
 64}
 65
 66static int lua_ftk_wnd_manager_add(lua_State* L)
 67{
 68	tolua_Error err = {0};
 69	Ret retv;
 70	FtkWndManager* thiz;
 71	FtkWidget* window;
 72	int param_ok = tolua_isusertype(L, 1, "FtkWndManager", 0, &err) && tolua_isusertype(L, 2, "FtkWidget", 0, &err);
 73
 74	return_val_if_fail(param_ok, 0);
 75
 76	thiz = tolua_tousertype(L, 1, 0);
 77	window = tolua_tousertype(L, 2, 0);
 78	retv = ftk_wnd_manager_add(thiz, window);
 79	tolua_pushnumber(L, (lua_Number)retv);
 80
 81	return 1;
 82}
 83
 84static int lua_ftk_wnd_manager_remove(lua_State* L)
 85{
 86	tolua_Error err = {0};
 87	Ret retv;
 88	FtkWndManager* thiz;
 89	FtkWidget* window;
 90	int param_ok = tolua_isusertype(L, 1, "FtkWndManager", 0, &err) && tolua_isusertype(L, 2, "FtkWidget", 0, &err);
 91
 92	return_val_if_fail(param_ok, 0);
 93
 94	thiz = tolua_tousertype(L, 1, 0);
 95	window = tolua_tousertype(L, 2, 0);
 96	retv = ftk_wnd_manager_remove(thiz, window);
 97	tolua_pushnumber(L, (lua_Number)retv);
 98
 99	return 1;
100}
101
102static int lua_ftk_wnd_manager_update(lua_State* L)
103{
104	tolua_Error err = {0};
105	Ret retv;
106	FtkWndManager* thiz;
107	int param_ok = tolua_isusertype(L, 1, "FtkWndManager", 0, &err);
108
109	return_val_if_fail(param_ok, 0);
110
111	thiz = tolua_tousertype(L, 1, 0);
112	retv = ftk_wnd_manager_update(thiz);
113	tolua_pushnumber(L, (lua_Number)retv);
114
115	return 1;
116}
117
118static int lua_ftk_wnd_manager_get_work_area(lua_State* L)
119{
120	tolua_Error err = {0};
121	Ret retv;
122	FtkWndManager* thiz;
123	FtkRect* rect;
124	int param_ok = tolua_isusertype(L, 1, "FtkWndManager", 0, &err) && tolua_isusertype(L, 2, "FtkRect", 0, &err);
125
126	return_val_if_fail(param_ok, 0);
127
128	thiz = tolua_tousertype(L, 1, 0);
129	rect = tolua_tousertype(L, 2, 0);
130	retv = ftk_wnd_manager_get_work_area(thiz, rect);
131	tolua_pushnumber(L, (lua_Number)retv);
132
133	return 1;
134}
135
136static int lua_ftk_wnd_manager_queue_event(lua_State* L)
137{
138	tolua_Error err = {0};
139	Ret retv;
140	FtkWndManager* thiz;
141	FtkEvent* event;
142	int param_ok = tolua_isusertype(L, 1, "FtkWndManager", 0, &err) && tolua_isusertype(L, 2, "FtkEvent", 0, &err);
143
144	return_val_if_fail(param_ok, 0);
145
146	thiz = tolua_tousertype(L, 1, 0);
147	event = tolua_tousertype(L, 2, 0);
148	retv = ftk_wnd_manager_queue_event(thiz, event);
149	tolua_pushnumber(L, (lua_Number)retv);
150
151	return 1;
152}
153
154static int lua_ftk_wnd_manager_dispatch_event(lua_State* L)
155{
156	tolua_Error err = {0};
157	Ret retv;
158	FtkWndManager* thiz;
159	FtkEvent* event;
160	int param_ok = tolua_isusertype(L, 1, "FtkWndManager", 0, &err) && tolua_isusertype(L, 2, "FtkEvent", 0, &err);
161
162	return_val_if_fail(param_ok, 0);
163
164	thiz = tolua_tousertype(L, 1, 0);
165	event = tolua_tousertype(L, 2, 0);
166	retv = ftk_wnd_manager_dispatch_event(thiz, event);
167	tolua_pushnumber(L, (lua_Number)retv);
168
169	return 1;
170}
171
172static int lua_ftk_wnd_manager_add_global_listener(lua_State* L)
173{
174	tolua_Error err = {0};
175	Ret retv;
176	FtkWndManager* thiz;
177	char* listener;
178	int param_ok = tolua_isusertype(L, 1, "FtkWndManager", 0, &err) && tolua_isstring(L, 2, 0, &err);
179
180	return_val_if_fail(param_ok, 0);
181
182	thiz = tolua_tousertype(L, 1, 0);
183	listener = (char*)tolua_tostring(L, 2, 0);
184	retv = ftk_wnd_manager_add_global_listener(thiz, lua_ftk_listener_func, listener);
185	tolua_pushnumber(L, (lua_Number)retv);
186
187	return 1;
188}
189
190static int lua_ftk_wnd_manager_remove_global_listener(lua_State* L)
191{
192	tolua_Error err = {0};
193	Ret retv;
194	FtkWndManager* thiz;
195	char* listener;
196	int param_ok = tolua_isusertype(L, 1, "FtkWndManager", 0, &err) && tolua_isstring(L, 2, 0, &err);
197
198	return_val_if_fail(param_ok, 0);
199
200	thiz = tolua_tousertype(L, 1, 0);
201	listener = (char*)tolua_tostring(L, 2, 0);
202	retv = ftk_wnd_manager_remove_global_listener(thiz, lua_ftk_listener_func, listener);
203	tolua_pushnumber(L, (lua_Number)retv);
204
205	return 1;
206}
207
208static int lua_ftk_wnd_manager_destroy(lua_State* L)
209{
210	tolua_Error err = {0};
211	FtkWndManager* thiz;
212	int param_ok = tolua_isusertype(L, 1, "FtkWndManager", 0, &err);
213
214	return_val_if_fail(param_ok, 0);
215
216	thiz = tolua_tousertype(L, 1, 0);
217	ftk_wnd_manager_destroy(thiz);
218
219	return 1;
220}
221
222int tolua_ftk_wnd_manager_init(lua_State* L)
223{
224	tolua_open(L);
225	tolua_reg_types(L);
226	tolua_module(L, NULL, 0);
227	tolua_beginmodule(L, NULL);
228	tolua_cclass(L,"FtkWndManager", "FtkWndManager", "", NULL);
229	tolua_beginmodule(L, "FtkWndManager");
230	tolua_function(L, "Restack", lua_ftk_wnd_manager_restack);
231	tolua_function(L, "Grab", lua_ftk_wnd_manager_grab);
232	tolua_function(L, "Ungrab", lua_ftk_wnd_manager_ungrab);
233	tolua_function(L, "Add", lua_ftk_wnd_manager_add);
234	tolua_function(L, "Remove", lua_ftk_wnd_manager_remove);
235	tolua_function(L, "Update", lua_ftk_wnd_manager_update);
236	tolua_function(L, "GetWorkArea", lua_ftk_wnd_manager_get_work_area);
237	tolua_function(L, "QueueEvent", lua_ftk_wnd_manager_queue_event);
238	tolua_function(L, "DispatchEvent", lua_ftk_wnd_manager_dispatch_event);
239	tolua_function(L, "AddGlobalListener", lua_ftk_wnd_manager_add_global_listener);
240	tolua_function(L, "RemoveGlobalListener", lua_ftk_wnd_manager_remove_global_listener);
241	tolua_function(L, "Destroy", lua_ftk_wnd_manager_destroy);
242	tolua_endmodule(L);
243	tolua_endmodule(L);
244
245
246	return 1;
247}