PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/script_binding/lua/lua_ftk_image.c

http://ftk.googlecode.com/
C | 67 lines | 54 code | 12 blank | 1 comment | 5 complexity | e1ca392d309f8fbde1e0a381539bef10 MD5 | raw file
 1/*This file is generated by luagen.*/
 2#include "lua_ftk_image.h"
 3#include "lua_ftk_callbacks.h"
 4
 5static void tolua_reg_types (lua_State* L)
 6{
 7	tolua_usertype(L, "FtkImage");
 8}
 9
10static int lua_ftk_image_create(lua_State* L)
11{
12	tolua_Error err = {0};
13	FtkWidget* 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_image_create(parent, x, y, width, height);
29	tolua_pushusertype(L, (FtkWidget*)retv, "FtkWidget");
30
31	return 1;
32}
33
34static int lua_ftk_image_set_image(lua_State* L)
35{
36	tolua_Error err = {0};
37	Ret retv;
38	FtkWidget* thiz;
39	FtkBitmap* image;
40	int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isusertype(L, 2, "FtkBitmap", 0, &err);
41
42	return_val_if_fail(param_ok, 0);
43
44	thiz = tolua_tousertype(L, 1, 0);
45	image = tolua_tousertype(L, 2, 0);
46	retv = ftk_image_set_image(thiz, image);
47	tolua_pushnumber(L, (lua_Number)retv);
48
49	return 1;
50}
51
52int tolua_ftk_image_init(lua_State* L)
53{
54	tolua_open(L);
55	tolua_reg_types(L);
56	tolua_module(L, NULL, 0);
57	tolua_beginmodule(L, NULL);
58	tolua_cclass(L,"FtkImage", "FtkImage", "", NULL);
59	tolua_beginmodule(L, "FtkImage");
60	tolua_function(L, "Create", lua_ftk_image_create);
61	tolua_function(L, "SetImage", lua_ftk_image_set_image);
62	tolua_endmodule(L);
63	tolua_endmodule(L);
64
65
66	return 1;
67}