PageRenderTime 344ms CodeModel.GetById 161ms app.highlight 17ms RepoModel.GetById 164ms app.codeStats 0ms

/script_binding/lua/lua_ftk_scroll_bar.c

http://ftk.googlecode.com/
C | 211 lines | 166 code | 44 blank | 1 comment | 9 complexity | 469a24a41fb69a77a8a4474521bf71b3 MD5 | raw file
  1/*This file is generated by luagen.*/
  2#include "lua_ftk_scroll_bar.h"
  3#include "lua_ftk_callbacks.h"
  4
  5static void tolua_reg_types (lua_State* L)
  6{
  7	tolua_usertype(L, "FtkScrollBar");
  8}
  9
 10static int lua_ftk_scroll_bar_create(lua_State* L)
 11{
 12	tolua_Error err = {0};
 13	FtkScrollBar* 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_scroll_bar_create(parent, x, y, width, height);
 29	tolua_pushusertype(L, (FtkScrollBar*)retv, "FtkScrollBar");
 30
 31	return 1;
 32}
 33
 34static int lua_ftk_scroll_bar_set_param(lua_State* L)
 35{
 36	tolua_Error err = {0};
 37	Ret retv;
 38	FtkWidget* thiz;
 39	int value;
 40	int max_value;
 41	int page_delta;
 42	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);
 43
 44	return_val_if_fail(param_ok, 0);
 45
 46	thiz = tolua_tousertype(L, 1, 0);
 47	value = tolua_tonumber(L, 2, 0);
 48	max_value = tolua_tonumber(L, 3, 0);
 49	page_delta = tolua_tonumber(L, 4, 0);
 50	retv = ftk_scroll_bar_set_param(thiz, value, max_value, page_delta);
 51	tolua_pushnumber(L, (lua_Number)retv);
 52
 53	return 1;
 54}
 55
 56static int lua_ftk_scroll_bar_set_listener(lua_State* L)
 57{
 58	tolua_Error err = {0};
 59	Ret retv;
 60	FtkWidget* thiz;
 61	char* listener;
 62	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isstring(L, 2, 0, &err);
 63
 64	return_val_if_fail(param_ok, 0);
 65
 66	thiz = tolua_tousertype(L, 1, 0);
 67	listener = (char*)tolua_tostring(L, 2, 0);
 68	retv = ftk_scroll_bar_set_listener(thiz, lua_ftk_widget_listener_func, listener);
 69	tolua_pushnumber(L, (lua_Number)retv);
 70
 71	return 1;
 72}
 73
 74static int lua_ftk_scroll_bar_get_value(lua_State* L)
 75{
 76	tolua_Error err = {0};
 77	int retv;
 78	FtkWidget* thiz;
 79	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
 80
 81	return_val_if_fail(param_ok, 0);
 82
 83	thiz = tolua_tousertype(L, 1, 0);
 84	retv = ftk_scroll_bar_get_value(thiz);
 85	tolua_pushnumber(L, (lua_Number)retv);
 86
 87	return 1;
 88}
 89
 90static int lua_ftk_scroll_bar_get_max_value(lua_State* L)
 91{
 92	tolua_Error err = {0};
 93	int retv;
 94	FtkWidget* thiz;
 95	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
 96
 97	return_val_if_fail(param_ok, 0);
 98
 99	thiz = tolua_tousertype(L, 1, 0);
100	retv = ftk_scroll_bar_get_max_value(thiz);
101	tolua_pushnumber(L, (lua_Number)retv);
102
103	return 1;
104}
105
106static int lua_ftk_scroll_bar_inc(lua_State* L)
107{
108	tolua_Error err = {0};
109	Ret retv;
110	FtkWidget* thiz;
111	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
112
113	return_val_if_fail(param_ok, 0);
114
115	thiz = tolua_tousertype(L, 1, 0);
116	retv = ftk_scroll_bar_inc(thiz);
117	tolua_pushnumber(L, (lua_Number)retv);
118
119	return 1;
120}
121
122static int lua_ftk_scroll_bar_dec(lua_State* L)
123{
124	tolua_Error err = {0};
125	Ret retv;
126	FtkWidget* thiz;
127	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
128
129	return_val_if_fail(param_ok, 0);
130
131	thiz = tolua_tousertype(L, 1, 0);
132	retv = ftk_scroll_bar_dec(thiz);
133	tolua_pushnumber(L, (lua_Number)retv);
134
135	return 1;
136}
137
138static int lua_ftk_scroll_bar_pageup(lua_State* L)
139{
140	tolua_Error err = {0};
141	Ret retv;
142	FtkWidget* thiz;
143	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
144
145	return_val_if_fail(param_ok, 0);
146
147	thiz = tolua_tousertype(L, 1, 0);
148	retv = ftk_scroll_bar_pageup(thiz);
149	tolua_pushnumber(L, (lua_Number)retv);
150
151	return 1;
152}
153
154static int lua_ftk_scroll_bar_pagedown(lua_State* L)
155{
156	tolua_Error err = {0};
157	Ret retv;
158	FtkWidget* thiz;
159	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
160
161	return_val_if_fail(param_ok, 0);
162
163	thiz = tolua_tousertype(L, 1, 0);
164	retv = ftk_scroll_bar_pagedown(thiz);
165	tolua_pushnumber(L, (lua_Number)retv);
166
167	return 1;
168}
169
170static int lua_ftk_scroll_bar_set_value(lua_State* L)
171{
172	tolua_Error err = {0};
173	Ret retv;
174	FtkWidget* thiz;
175	int value;
176	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isnumber(L, 2, 0, &err);
177
178	return_val_if_fail(param_ok, 0);
179
180	thiz = tolua_tousertype(L, 1, 0);
181	value = tolua_tonumber(L, 2, 0);
182	retv = ftk_scroll_bar_set_value(thiz, value);
183	tolua_pushnumber(L, (lua_Number)retv);
184
185	return 1;
186}
187
188int tolua_ftk_scroll_bar_init(lua_State* L)
189{
190	tolua_open(L);
191	tolua_reg_types(L);
192	tolua_module(L, NULL, 0);
193	tolua_beginmodule(L, NULL);
194	tolua_cclass(L,"FtkScrollBar", "FtkScrollBar", "FtkWidget", NULL);
195	tolua_beginmodule(L, "FtkScrollBar");
196	tolua_function(L, "Create", lua_ftk_scroll_bar_create);
197	tolua_function(L, "SetParam", lua_ftk_scroll_bar_set_param);
198	tolua_function(L, "SetListener", lua_ftk_scroll_bar_set_listener);
199	tolua_function(L, "GetValue", lua_ftk_scroll_bar_get_value);
200	tolua_function(L, "GetMaxValue", lua_ftk_scroll_bar_get_max_value);
201	tolua_function(L, "Inc", lua_ftk_scroll_bar_inc);
202	tolua_function(L, "Dec", lua_ftk_scroll_bar_dec);
203	tolua_function(L, "Pageup", lua_ftk_scroll_bar_pageup);
204	tolua_function(L, "Pagedown", lua_ftk_scroll_bar_pagedown);
205	tolua_function(L, "SetValue", lua_ftk_scroll_bar_set_value);
206	tolua_endmodule(L);
207	tolua_endmodule(L);
208
209
210	return 1;
211}