PageRenderTime 28ms CodeModel.GetById 2ms app.highlight 19ms RepoModel.GetById 1ms app.codeStats 0ms

/script_binding/lua/lua_ftk_check_button.c

http://ftk.googlecode.com/
C | 147 lines | 118 code | 28 blank | 1 comment | 11 complexity | 93644b8a9461b7e9edf7255aa13f59b2 MD5 | raw file
  1/*This file is generated by luagen.*/
  2#include "lua_ftk_check_button.h"
  3#include "lua_ftk_callbacks.h"
  4
  5static void tolua_reg_types (lua_State* L)
  6{
  7	tolua_usertype(L, "FtkCheckButton");
  8}
  9
 10static int lua_ftk_check_button_create(lua_State* L)
 11{
 12	tolua_Error err = {0};
 13	FtkCheckButton* retv;
 14	FtkWidget* parent;
 15	int x;
 16	int y;
 17	int width;
 18	int height;
 19	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isnumber(L, 2, 0, &err) && tolua_isnumber(L, 3, 0, &err) && tolua_isnumber(L, 4, 0, &err) && tolua_isnumber(L, 5, 0, &err);
 20
 21	return_val_if_fail(param_ok, 0);
 22
 23	parent = tolua_tousertype(L, 1, 0);
 24	x = tolua_tonumber(L, 2, 0);
 25	y = tolua_tonumber(L, 3, 0);
 26	width = tolua_tonumber(L, 4, 0);
 27	height = tolua_tonumber(L, 5, 0);
 28	retv = ftk_check_button_create(parent, x, y, width, height);
 29	tolua_pushusertype(L, (FtkCheckButton*)retv, "FtkCheckButton");
 30
 31	return 1;
 32}
 33
 34static int lua_ftk_check_button_create_radio(lua_State* L)
 35{
 36	tolua_Error err = {0};
 37	FtkCheckButton* retv;
 38	FtkWidget* parent;
 39	int x;
 40	int y;
 41	int width;
 42	int height;
 43	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isnumber(L, 2, 0, &err) && tolua_isnumber(L, 3, 0, &err) && tolua_isnumber(L, 4, 0, &err) && tolua_isnumber(L, 5, 0, &err);
 44
 45	return_val_if_fail(param_ok, 0);
 46
 47	parent = tolua_tousertype(L, 1, 0);
 48	x = tolua_tonumber(L, 2, 0);
 49	y = tolua_tonumber(L, 3, 0);
 50	width = tolua_tonumber(L, 4, 0);
 51	height = tolua_tonumber(L, 5, 0);
 52	retv = ftk_check_button_create_radio(parent, x, y, width, height);
 53	tolua_pushusertype(L, (FtkCheckButton*)retv, "FtkCheckButton");
 54
 55	return 1;
 56}
 57
 58static int lua_ftk_check_button_set_icon_position(lua_State* L)
 59{
 60	tolua_Error err = {0};
 61	Ret retv;
 62	FtkWidget* thiz;
 63	int at_right;
 64	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isnumber(L, 2, 0, &err);
 65
 66	return_val_if_fail(param_ok, 0);
 67
 68	thiz = tolua_tousertype(L, 1, 0);
 69	at_right = tolua_tonumber(L, 2, 0);
 70	retv = ftk_check_button_set_icon_position(thiz, at_right);
 71	tolua_pushnumber(L, (lua_Number)retv);
 72
 73	return 1;
 74}
 75
 76static int lua_ftk_check_button_get_checked(lua_State* L)
 77{
 78	tolua_Error err = {0};
 79	int retv;
 80	FtkWidget* thiz;
 81	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
 82
 83	return_val_if_fail(param_ok, 0);
 84
 85	thiz = tolua_tousertype(L, 1, 0);
 86	retv = ftk_check_button_get_checked(thiz);
 87	tolua_pushnumber(L, (lua_Number)retv);
 88
 89	return 1;
 90}
 91
 92static int lua_ftk_check_button_set_checked(lua_State* L)
 93{
 94	tolua_Error err = {0};
 95	Ret retv;
 96	FtkWidget* thiz;
 97	int checked;
 98	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isnumber(L, 2, 0, &err);
 99
100	return_val_if_fail(param_ok, 0);
101
102	thiz = tolua_tousertype(L, 1, 0);
103	checked = tolua_tonumber(L, 2, 0);
104	retv = ftk_check_button_set_checked(thiz, checked);
105	tolua_pushnumber(L, (lua_Number)retv);
106
107	return 1;
108}
109
110static int lua_ftk_check_button_set_clicked_listener(lua_State* L)
111{
112	tolua_Error err = {0};
113	Ret retv;
114	FtkWidget* thiz;
115	char* listener;
116	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isstring(L, 2, 0, &err);
117
118	return_val_if_fail(param_ok, 0);
119
120	thiz = tolua_tousertype(L, 1, 0);
121	listener = (char*)tolua_tostring(L, 2, 0);
122	retv = ftk_check_button_set_clicked_listener(thiz, lua_ftk_listener_func, listener);
123	tolua_pushnumber(L, (lua_Number)retv);
124
125	return 1;
126}
127
128int tolua_ftk_check_button_init(lua_State* L)
129{
130	tolua_open(L);
131	tolua_reg_types(L);
132	tolua_module(L, NULL, 0);
133	tolua_beginmodule(L, NULL);
134	tolua_cclass(L,"FtkCheckButton", "FtkCheckButton", "FtkWidget", NULL);
135	tolua_beginmodule(L, "FtkCheckButton");
136	tolua_function(L, "Create", lua_ftk_check_button_create);
137	tolua_function(L, "CreateRadio", lua_ftk_check_button_create_radio);
138	tolua_function(L, "SetIconPosition", lua_ftk_check_button_set_icon_position);
139	tolua_function(L, "GetChecked", lua_ftk_check_button_get_checked);
140	tolua_function(L, "SetChecked", lua_ftk_check_button_set_checked);
141	tolua_function(L, "SetClickedListener", lua_ftk_check_button_set_clicked_listener);
142	tolua_endmodule(L);
143	tolua_endmodule(L);
144
145
146	return 1;
147}