PageRenderTime 23ms CodeModel.GetById 11ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/script_binding/lua/lua_ftk_main_loop.c

http://ftk.googlecode.com/
C | 127 lines | 98 code | 28 blank | 1 comment | 2 complexity | aba671626d33ddf54094c6ddfe6f7f30 MD5 | raw file
  1/*This file is generated by luagen.*/
  2#include "lua_ftk_main_loop.h"
  3#include "lua_ftk_callbacks.h"
  4
  5static void tolua_reg_types (lua_State* L)
  6{
  7	tolua_usertype(L, "FtkMainLoop");
  8}
  9
 10static int lua_ftk_main_loop_create(lua_State* L)
 11{
 12	tolua_Error err = {0};
 13	FtkMainLoop* retv;
 14	FtkSourcesManager* sources_manager;
 15	int param_ok = tolua_isusertype(L, 1, "FtkSourcesManager", 0, &err);
 16
 17	return_val_if_fail(param_ok, 0);
 18
 19	sources_manager = tolua_tousertype(L, 1, 0);
 20	retv = ftk_main_loop_create(sources_manager);
 21	tolua_pushusertype(L, (FtkMainLoop*)retv, "FtkMainLoop");
 22
 23	return 1;
 24}
 25
 26static int lua_ftk_main_loop_run(lua_State* L)
 27{
 28	tolua_Error err = {0};
 29	Ret retv;
 30	FtkMainLoop* thiz;
 31	int param_ok = tolua_isusertype(L, 1, "FtkMainLoop", 0, &err);
 32
 33	return_val_if_fail(param_ok, 0);
 34
 35	thiz = tolua_tousertype(L, 1, 0);
 36	retv = ftk_main_loop_run(thiz);
 37	tolua_pushnumber(L, (lua_Number)retv);
 38
 39	return 1;
 40}
 41
 42static int lua_ftk_main_loop_quit(lua_State* L)
 43{
 44	tolua_Error err = {0};
 45	Ret retv;
 46	FtkMainLoop* thiz;
 47	int param_ok = tolua_isusertype(L, 1, "FtkMainLoop", 0, &err);
 48
 49	return_val_if_fail(param_ok, 0);
 50
 51	thiz = tolua_tousertype(L, 1, 0);
 52	retv = ftk_main_loop_quit(thiz);
 53	tolua_pushnumber(L, (lua_Number)retv);
 54
 55	return 1;
 56}
 57
 58static int lua_ftk_main_loop_add_source(lua_State* L)
 59{
 60	tolua_Error err = {0};
 61	Ret retv;
 62	FtkMainLoop* thiz;
 63	FtkSource* source;
 64	int param_ok = tolua_isusertype(L, 1, "FtkMainLoop", 0, &err) && tolua_isusertype(L, 2, "FtkSource", 0, &err);
 65
 66	return_val_if_fail(param_ok, 0);
 67
 68	thiz = tolua_tousertype(L, 1, 0);
 69	source = tolua_tousertype(L, 2, 0);
 70	retv = ftk_main_loop_add_source(thiz, source);
 71	tolua_pushnumber(L, (lua_Number)retv);
 72
 73	return 1;
 74}
 75
 76static int lua_ftk_main_loop_remove_source(lua_State* L)
 77{
 78	tolua_Error err = {0};
 79	Ret retv;
 80	FtkMainLoop* thiz;
 81	FtkSource* source;
 82	int param_ok = tolua_isusertype(L, 1, "FtkMainLoop", 0, &err) && tolua_isusertype(L, 2, "FtkSource", 0, &err);
 83
 84	return_val_if_fail(param_ok, 0);
 85
 86	thiz = tolua_tousertype(L, 1, 0);
 87	source = tolua_tousertype(L, 2, 0);
 88	retv = ftk_main_loop_remove_source(thiz, source);
 89	tolua_pushnumber(L, (lua_Number)retv);
 90
 91	return 1;
 92}
 93
 94static int lua_ftk_main_loop_destroy(lua_State* L)
 95{
 96	tolua_Error err = {0};
 97	FtkMainLoop* thiz;
 98	int param_ok = tolua_isusertype(L, 1, "FtkMainLoop", 0, &err);
 99
100	return_val_if_fail(param_ok, 0);
101
102	thiz = tolua_tousertype(L, 1, 0);
103	ftk_main_loop_destroy(thiz);
104
105	return 1;
106}
107
108int tolua_ftk_main_loop_init(lua_State* L)
109{
110	tolua_open(L);
111	tolua_reg_types(L);
112	tolua_module(L, NULL, 0);
113	tolua_beginmodule(L, NULL);
114	tolua_cclass(L,"FtkMainLoop", "FtkMainLoop", "", NULL);
115	tolua_beginmodule(L, "FtkMainLoop");
116	tolua_function(L, "Create", lua_ftk_main_loop_create);
117	tolua_function(L, "Run", lua_ftk_main_loop_run);
118	tolua_function(L, "Quit", lua_ftk_main_loop_quit);
119	tolua_function(L, "AddSource", lua_ftk_main_loop_add_source);
120	tolua_function(L, "RemoveSource", lua_ftk_main_loop_remove_source);
121	tolua_function(L, "Destroy", lua_ftk_main_loop_destroy);
122	tolua_endmodule(L);
123	tolua_endmodule(L);
124
125
126	return 1;
127}