PageRenderTime 864ms CodeModel.GetById 243ms app.highlight 314ms RepoModel.GetById 197ms app.codeStats 0ms

/script_binding/lua/lua_ftk_menu_item.c

http://ftk.googlecode.com/
C | 59 lines | 46 code | 12 blank | 1 comment | 1 complexity | ba9df3fb712acf7b302c2062235bd3a1 MD5 | raw file
 1/*This file is generated by luagen.*/
 2#include "lua_ftk_menu_item.h"
 3#include "lua_ftk_callbacks.h"
 4
 5static void tolua_reg_types (lua_State* L)
 6{
 7	tolua_usertype(L, "FtkMenuItem");
 8}
 9
10static int lua_ftk_menu_item_create(lua_State* L)
11{
12	tolua_Error err = {0};
13	FtkMenuItem* retv;
14	FtkWidget* parent;
15	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
16
17	return_val_if_fail(param_ok, 0);
18
19	parent = tolua_tousertype(L, 1, 0);
20	retv = ftk_menu_item_create(parent);
21	tolua_pushusertype(L, (FtkMenuItem*)retv, "FtkMenuItem");
22
23	return 1;
24}
25
26static int lua_ftk_menu_item_set_clicked_listener(lua_State* L)
27{
28	tolua_Error err = {0};
29	Ret retv;
30	FtkWidget* thiz;
31	char* listener;
32	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isstring(L, 2, 0, &err);
33
34	return_val_if_fail(param_ok, 0);
35
36	thiz = tolua_tousertype(L, 1, 0);
37	listener = (char*)tolua_tostring(L, 2, 0);
38	retv = ftk_menu_item_set_clicked_listener(thiz, lua_ftk_widget_listener_func, listener);
39	tolua_pushnumber(L, (lua_Number)retv);
40
41	return 1;
42}
43
44int tolua_ftk_menu_item_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,"FtkMenuItem", "FtkMenuItem", "FtkWidget", NULL);
51	tolua_beginmodule(L, "FtkMenuItem");
52	tolua_function(L, "Create", lua_ftk_menu_item_create);
53	tolua_function(L, "SetClickedListener", lua_ftk_menu_item_set_clicked_listener);
54	tolua_endmodule(L);
55	tolua_endmodule(L);
56
57
58	return 1;
59}