PageRenderTime 31ms CodeModel.GetById 14ms app.highlight 13ms RepoModel.GetById 2ms app.codeStats 0ms

/script_binding/lua/lua_ftk_list_view.c

http://ftk.googlecode.com/
C | 124 lines | 99 code | 24 blank | 1 comment | 8 complexity | 9efb4482861f371a59b2054a80007773 MD5 | raw file
  1/*This file is generated by luagen.*/
  2#include "lua_ftk_list_view.h"
  3#include "lua_ftk_callbacks.h"
  4
  5static void tolua_reg_types (lua_State* L)
  6{
  7	tolua_usertype(L, "FtkListView");
  8}
  9
 10static int lua_ftk_list_view_create(lua_State* L)
 11{
 12	tolua_Error err = {0};
 13	FtkListView* 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_list_view_create(parent, x, y, width, height);
 29	tolua_pushusertype(L, (FtkListView*)retv, "FtkListView");
 30
 31	return 1;
 32}
 33
 34static int lua_ftk_list_view_init(lua_State* L)
 35{
 36	tolua_Error err = {0};
 37	Ret retv;
 38	FtkWidget* thiz;
 39	FtkListModel* model;
 40	FtkListRender* render;
 41	int item_height;
 42	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isusertype(L, 2, "FtkListModel", 0, &err) && tolua_isusertype(L, 3, "FtkListRender", 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	model = tolua_tousertype(L, 2, 0);
 48	render = tolua_tousertype(L, 3, 0);
 49	item_height = tolua_tonumber(L, 4, 0);
 50	retv = ftk_list_view_init(thiz, model, render, item_height);
 51	tolua_pushnumber(L, (lua_Number)retv);
 52
 53	return 1;
 54}
 55
 56static int lua_ftk_list_view_get_selected(lua_State* L)
 57{
 58	tolua_Error err = {0};
 59	int retv;
 60	FtkWidget* thiz;
 61	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
 62
 63	return_val_if_fail(param_ok, 0);
 64
 65	thiz = tolua_tousertype(L, 1, 0);
 66	retv = ftk_list_view_get_selected(thiz);
 67	tolua_pushnumber(L, (lua_Number)retv);
 68
 69	return 1;
 70}
 71
 72static int lua_ftk_list_view_get_model(lua_State* L)
 73{
 74	tolua_Error err = {0};
 75	FtkListModel* retv;
 76	FtkWidget* thiz;
 77	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
 78
 79	return_val_if_fail(param_ok, 0);
 80
 81	thiz = tolua_tousertype(L, 1, 0);
 82	retv = ftk_list_view_get_model(thiz);
 83	tolua_pushusertype(L, (FtkListModel*)retv, "FtkListModel");
 84
 85	return 1;
 86}
 87
 88static int lua_ftk_list_view_set_clicked_listener(lua_State* L)
 89{
 90	tolua_Error err = {0};
 91	Ret retv;
 92	FtkWidget* thiz;
 93	char* listener;
 94	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isstring(L, 2, 0, &err);
 95
 96	return_val_if_fail(param_ok, 0);
 97
 98	thiz = tolua_tousertype(L, 1, 0);
 99	listener = (char*)tolua_tostring(L, 2, 0);
100	retv = ftk_list_view_set_clicked_listener(thiz, lua_ftk_widget_listener_func, listener);
101	tolua_pushnumber(L, (lua_Number)retv);
102
103	return 1;
104}
105
106int tolua_ftk_list_view_init(lua_State* L)
107{
108	tolua_open(L);
109	tolua_reg_types(L);
110	tolua_module(L, NULL, 0);
111	tolua_beginmodule(L, NULL);
112	tolua_cclass(L,"FtkListView", "FtkListView", "FtkWidget", NULL);
113	tolua_beginmodule(L, "FtkListView");
114	tolua_function(L, "Create", lua_ftk_list_view_create);
115	tolua_function(L, "Init", lua_ftk_list_view_init);
116	tolua_function(L, "GetSelected", lua_ftk_list_view_get_selected);
117	tolua_function(L, "GetModel", lua_ftk_list_view_get_model);
118	tolua_function(L, "SetClickedListener", lua_ftk_list_view_set_clicked_listener);
119	tolua_endmodule(L);
120	tolua_endmodule(L);
121
122
123	return 1;
124}