PageRenderTime 135ms CodeModel.GetById 129ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/script_binding/lua/lua_ftk_source_timer.c

http://ftk.googlecode.com/
C | 59 lines | 46 code | 12 blank | 1 comment | 1 complexity | 0c974a235a9df1ebc2bec8a5893c03b1 MD5 | raw file
 1/*This file is generated by luagen.*/
 2#include "lua_ftk_source_timer.h"
 3#include "lua_ftk_callbacks.h"
 4
 5static void tolua_reg_types (lua_State* L)
 6{
 7	tolua_usertype(L, "FtkSourceTimer");
 8}
 9
10static int lua_ftk_source_timer_create(lua_State* L)
11{
12	tolua_Error err = {0};
13	FtkSource* retv;
14	int interval;
15	char* action;
16	int param_ok = tolua_isnumber(L, 1, 0, &err) && tolua_isstring(L, 2, 0, &err);
17
18	return_val_if_fail(param_ok, 0);
19
20	interval = tolua_tonumber(L, 1, 0);
21	action = (char*)tolua_tostring(L, 2, 0);
22	retv = ftk_source_timer_create(interval, lua_ftk_timer_func, action);
23	tolua_pushusertype(L, (FtkSource*)retv, "FtkSource");
24
25	return 1;
26}
27
28static int lua_ftk_source_timer_reset(lua_State* L)
29{
30	tolua_Error err = {0};
31	Ret retv;
32	FtkSource* thiz;
33	int param_ok = tolua_isusertype(L, 1, "FtkSource", 0, &err);
34
35	return_val_if_fail(param_ok, 0);
36
37	thiz = tolua_tousertype(L, 1, 0);
38	retv = ftk_source_timer_reset(thiz);
39	tolua_pushnumber(L, (lua_Number)retv);
40
41	return 1;
42}
43
44int tolua_ftk_source_timer_init(lua_State* L)
45{
46	tolua_open(L);
47	tolua_reg_types(L);
48	tolua_module(L, NULL, 0);
49	tolua_beginmodule(L, NULL);
50	tolua_cclass(L,"FtkSourceTimer", "FtkSourceTimer", "FtkSource", NULL);
51	tolua_beginmodule(L, "FtkSourceTimer");
52	tolua_function(L, "Create", lua_ftk_source_timer_create);
53	tolua_function(L, "Reset", lua_ftk_source_timer_reset);
54	tolua_endmodule(L);
55	tolua_endmodule(L);
56
57
58	return 1;
59}