PageRenderTime 284ms CodeModel.GetById 160ms app.highlight 13ms RepoModel.GetById 108ms app.codeStats 0ms

/script_binding/lua/lua_ftk_text_view.c

http://ftk.googlecode.com/
C | 128 lines | 103 code | 24 blank | 1 comment | 10 complexity | 26840745ebbf00b9b3c161885de63c70 MD5 | raw file
  1/*This file is generated by luagen.*/
  2#include "lua_ftk_text_view.h"
  3#include "lua_ftk_callbacks.h"
  4
  5static void tolua_reg_types (lua_State* L)
  6{
  7	tolua_usertype(L, "FtkTextView");
  8}
  9
 10static int lua_ftk_text_view_create(lua_State* L)
 11{
 12	tolua_Error err = {0};
 13	FtkTextView* 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_text_view_create(parent, x, y, width, height);
 29	tolua_pushusertype(L, (FtkTextView*)retv, "FtkTextView");
 30
 31	return 1;
 32}
 33
 34static int lua_ftk_text_view_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_text_view_get_text(thiz);
 45	tolua_pushstring(L, (const char*)retv);
 46
 47	return 1;
 48}
 49
 50static int lua_ftk_text_view_set_text(lua_State* L)
 51{
 52	tolua_Error err = {0};
 53	Ret retv;
 54	FtkWidget* thiz;
 55	const char* text;
 56	int len;
 57	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isstring(L, 2, 0, &err) && tolua_isnumber(L, 3, 0, &err);
 58
 59	return_val_if_fail(param_ok, 0);
 60
 61	thiz = tolua_tousertype(L, 1, 0);
 62	text = tolua_tostring(L, 2, 0);
 63	len = tolua_tonumber(L, 3, 0);
 64	retv = ftk_text_view_set_text(thiz, text, len);
 65	tolua_pushnumber(L, (lua_Number)retv);
 66
 67	return 1;
 68}
 69
 70static int lua_ftk_text_view_insert_text(lua_State* L)
 71{
 72	tolua_Error err = {0};
 73	Ret retv;
 74	FtkWidget* thiz;
 75	int pos;
 76	const char* text;
 77	int len;
 78	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isnumber(L, 2, 0, &err) && tolua_isstring(L, 3, 0, &err) && tolua_isnumber(L, 4, 0, &err);
 79
 80	return_val_if_fail(param_ok, 0);
 81
 82	thiz = tolua_tousertype(L, 1, 0);
 83	pos = tolua_tonumber(L, 2, 0);
 84	text = tolua_tostring(L, 3, 0);
 85	len = tolua_tonumber(L, 4, 0);
 86	retv = ftk_text_view_insert_text(thiz, pos, text, len);
 87	tolua_pushnumber(L, (lua_Number)retv);
 88
 89	return 1;
 90}
 91
 92static int lua_ftk_text_view_set_readonly(lua_State* L)
 93{
 94	tolua_Error err = {0};
 95	Ret retv;
 96	FtkWidget* thiz;
 97	int ro;
 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	ro = tolua_tonumber(L, 2, 0);
104	retv = ftk_text_view_set_readonly(thiz, ro);
105	tolua_pushnumber(L, (lua_Number)retv);
106
107	return 1;
108}
109
110int tolua_ftk_text_view_init(lua_State* L)
111{
112	tolua_open(L);
113	tolua_reg_types(L);
114	tolua_module(L, NULL, 0);
115	tolua_beginmodule(L, NULL);
116	tolua_cclass(L,"FtkTextView", "FtkTextView", "FtkWidget", NULL);
117	tolua_beginmodule(L, "FtkTextView");
118	tolua_function(L, "Create", lua_ftk_text_view_create);
119	tolua_function(L, "GetText", lua_ftk_text_view_get_text);
120	tolua_function(L, "SetText", lua_ftk_text_view_set_text);
121	tolua_function(L, "InsertText", lua_ftk_text_view_insert_text);
122	tolua_function(L, "SetReadonly", lua_ftk_text_view_set_readonly);
123	tolua_endmodule(L);
124	tolua_endmodule(L);
125
126
127	return 1;
128}