PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 9ms RepoModel.GetById 31ms app.codeStats 0ms

/script_binding/lua/lua_ftk_combo_box.c

http://ftk.googlecode.com/
C | 105 lines | 84 code | 20 blank | 1 comment | 7 complexity | a80428eec57b75ce9a8b59d41537abed MD5 | raw file
  1/*This file is generated by luagen.*/
  2#include "lua_ftk_combo_box.h"
  3#include "lua_ftk_callbacks.h"
  4
  5static void tolua_reg_types (lua_State* L)
  6{
  7	tolua_usertype(L, "FtkComboBox");
  8}
  9
 10static int lua_ftk_combo_box_create(lua_State* L)
 11{
 12	tolua_Error err = {0};
 13	FtkComboBox* 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_combo_box_create(parent, x, y, width, height);
 29	tolua_pushusertype(L, (FtkComboBox*)retv, "FtkComboBox");
 30
 31	return 1;
 32}
 33
 34static int lua_ftk_combo_box_get_text(lua_State* L)
 35{
 36	tolua_Error err = {0};
 37	const char* retv;
 38	FtkWidget* thiz;
 39	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err);
 40
 41	return_val_if_fail(param_ok, 0);
 42
 43	thiz = tolua_tousertype(L, 1, 0);
 44	retv = ftk_combo_box_get_text(thiz);
 45	tolua_pushstring(L, (const char*)retv);
 46
 47	return 1;
 48}
 49
 50static int lua_ftk_combo_box_set_text(lua_State* L)
 51{
 52	tolua_Error err = {0};
 53	Ret retv;
 54	FtkWidget* thiz;
 55	const char* text;
 56	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isstring(L, 2, 0, &err);
 57
 58	return_val_if_fail(param_ok, 0);
 59
 60	thiz = tolua_tousertype(L, 1, 0);
 61	text = tolua_tostring(L, 2, 0);
 62	retv = ftk_combo_box_set_text(thiz, text);
 63	tolua_pushnumber(L, (lua_Number)retv);
 64
 65	return 1;
 66}
 67
 68static int lua_ftk_combo_box_append(lua_State* L)
 69{
 70	tolua_Error err = {0};
 71	Ret retv;
 72	FtkWidget* thiz;
 73	FtkBitmap* icon;
 74	const char* text;
 75	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isusertype(L, 2, "FtkBitmap", 0, &err) && tolua_isstring(L, 3, 0, &err);
 76
 77	return_val_if_fail(param_ok, 0);
 78
 79	thiz = tolua_tousertype(L, 1, 0);
 80	icon = tolua_tousertype(L, 2, 0);
 81	text = tolua_tostring(L, 3, 0);
 82	retv = ftk_combo_box_append(thiz, icon, text);
 83	tolua_pushnumber(L, (lua_Number)retv);
 84
 85	return 1;
 86}
 87
 88int tolua_ftk_combo_box_init(lua_State* L)
 89{
 90	tolua_open(L);
 91	tolua_reg_types(L);
 92	tolua_module(L, NULL, 0);
 93	tolua_beginmodule(L, NULL);
 94	tolua_cclass(L,"FtkComboBox", "FtkComboBox", "FtkWidget", NULL);
 95	tolua_beginmodule(L, "FtkComboBox");
 96	tolua_function(L, "Create", lua_ftk_combo_box_create);
 97	tolua_function(L, "GetText", lua_ftk_combo_box_get_text);
 98	tolua_function(L, "SetText", lua_ftk_combo_box_set_text);
 99	tolua_function(L, "Append", lua_ftk_combo_box_append);
100	tolua_endmodule(L);
101	tolua_endmodule(L);
102
103
104	return 1;
105}