PageRenderTime 453ms CodeModel.GetById 67ms app.highlight 207ms RepoModel.GetById 119ms app.codeStats 0ms

/script_binding/lua/lua_ftk_dialog.c

http://ftk.googlecode.com/
C | 160 lines | 127 code | 32 blank | 1 comment | 9 complexity | 110a6d865935ec17c7a0c93952126617 MD5 | raw file
  1/*This file is generated by luagen.*/
  2#include "lua_ftk_dialog.h"
  3#include "lua_ftk_callbacks.h"
  4
  5static void tolua_reg_types (lua_State* L)
  6{
  7	tolua_usertype(L, "FtkDialog");
  8}
  9
 10static int lua_ftk_dialog_create(lua_State* L)
 11{
 12	tolua_Error err = {0};
 13	FtkDialog* retv;
 14	int x;
 15	int y;
 16	int width;
 17	int height;
 18	int param_ok = tolua_isnumber(L, 1, 0, &err) && tolua_isnumber(L, 2, 0, &err) && tolua_isnumber(L, 3, 0, &err) && tolua_isnumber(L, 4, 0, &err);
 19
 20	return_val_if_fail(param_ok, 0);
 21
 22	x = tolua_tonumber(L, 1, 0);
 23	y = tolua_tonumber(L, 2, 0);
 24	width = tolua_tonumber(L, 3, 0);
 25	height = tolua_tonumber(L, 4, 0);
 26	retv = ftk_dialog_create(x, y, width, height);
 27	tolua_pushusertype(L, (FtkDialog*)retv, "FtkDialog");
 28
 29	return 1;
 30}
 31
 32static int lua_ftk_dialog_create_ex(lua_State* L)
 33{
 34	tolua_Error err = {0};
 35	FtkDialog* retv;
 36	int attr;
 37	int x;
 38	int y;
 39	int width;
 40	int height;
 41	int param_ok = tolua_isnumber(L, 1, 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);
 42
 43	return_val_if_fail(param_ok, 0);
 44
 45	attr = tolua_tonumber(L, 1, 0);
 46	x = tolua_tonumber(L, 2, 0);
 47	y = tolua_tonumber(L, 3, 0);
 48	width = tolua_tonumber(L, 4, 0);
 49	height = tolua_tonumber(L, 5, 0);
 50	retv = ftk_dialog_create_ex(attr, x, y, width, height);
 51	tolua_pushusertype(L, (FtkDialog*)retv, "FtkDialog");
 52
 53	return 1;
 54}
 55
 56static int lua_ftk_dialog_set_icon(lua_State* L)
 57{
 58	tolua_Error err = {0};
 59	Ret retv;
 60	FtkWidget* thiz;
 61	FtkBitmap* icon;
 62	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isusertype(L, 2, "FtkBitmap", 0, &err);
 63
 64	return_val_if_fail(param_ok, 0);
 65
 66	thiz = tolua_tousertype(L, 1, 0);
 67	icon = tolua_tousertype(L, 2, 0);
 68	retv = ftk_dialog_set_icon(thiz, icon);
 69	tolua_pushnumber(L, (lua_Number)retv);
 70
 71	return 1;
 72}
 73
 74static int lua_ftk_dialog_hide_title(lua_State* L)
 75{
 76	tolua_Error err = {0};
 77	Ret 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_dialog_hide_title(thiz);
 85	tolua_pushnumber(L, (lua_Number)retv);
 86
 87	return 1;
 88}
 89
 90static int lua_ftk_dialog_run(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_dialog_run(thiz);
101	tolua_pushnumber(L, (lua_Number)retv);
102
103	return 1;
104}
105
106static int lua_ftk_dialog_quit(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_dialog_quit(thiz);
117	tolua_pushnumber(L, (lua_Number)retv);
118
119	return 1;
120}
121
122static int lua_ftk_dialog_quit_after(lua_State* L)
123{
124	tolua_Error err = {0};
125	Ret retv;
126	FtkWidget* thiz;
127	int ms;
128	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isnumber(L, 2, 0, &err);
129
130	return_val_if_fail(param_ok, 0);
131
132	thiz = tolua_tousertype(L, 1, 0);
133	ms = tolua_tonumber(L, 2, 0);
134	retv = ftk_dialog_quit_after(thiz, ms);
135	tolua_pushnumber(L, (lua_Number)retv);
136
137	return 1;
138}
139
140int tolua_ftk_dialog_init(lua_State* L)
141{
142	tolua_open(L);
143	tolua_reg_types(L);
144	tolua_module(L, NULL, 0);
145	tolua_beginmodule(L, NULL);
146	tolua_cclass(L,"FtkDialog", "FtkDialog", "FtkWindow", NULL);
147	tolua_beginmodule(L, "FtkDialog");
148	tolua_function(L, "Create", lua_ftk_dialog_create);
149	tolua_function(L, "CreateEx", lua_ftk_dialog_create_ex);
150	tolua_function(L, "SetIcon", lua_ftk_dialog_set_icon);
151	tolua_function(L, "HideTitle", lua_ftk_dialog_hide_title);
152	tolua_function(L, "Run", lua_ftk_dialog_run);
153	tolua_function(L, "Quit", lua_ftk_dialog_quit);
154	tolua_function(L, "QuitAfter", lua_ftk_dialog_quit_after);
155	tolua_endmodule(L);
156	tolua_endmodule(L);
157
158
159	return 1;
160}