PageRenderTime 370ms CodeModel.GetById 186ms app.highlight 7ms RepoModel.GetById 174ms app.codeStats 0ms

/script_binding/lua/lua_ftk_bitmap_factory.c

http://ftk.googlecode.com/
C | 86 lines | 67 code | 18 blank | 1 comment | 2 complexity | 2c824da5ba202b88a4c66acc3442d46b MD5 | raw file
 1/*This file is generated by luagen.*/
 2#include "lua_ftk_bitmap_factory.h"
 3#include "lua_ftk_callbacks.h"
 4
 5static void tolua_reg_types (lua_State* L)
 6{
 7	tolua_usertype(L, "FtkBitmapFactory");
 8}
 9
10static int lua_ftk_bitmap_factory_create(lua_State* L)
11{
12	FtkBitmapFactory* retv;
13	retv = ftk_bitmap_factory_create();
14	tolua_pushusertype(L, (FtkBitmapFactory*)retv, "FtkBitmapFactory");
15
16	return 1;
17}
18
19static int lua_ftk_bitmap_factory_load(lua_State* L)
20{
21	tolua_Error err = {0};
22	FtkBitmap* retv;
23	FtkBitmapFactory* thiz;
24	const char* filename;
25	int param_ok = tolua_isusertype(L, 1, "FtkBitmapFactory", 0, &err) && tolua_isstring(L, 2, 0, &err);
26
27	return_val_if_fail(param_ok, 0);
28
29	thiz = tolua_tousertype(L, 1, 0);
30	filename = tolua_tostring(L, 2, 0);
31	retv = ftk_bitmap_factory_load(thiz, filename);
32	tolua_pushusertype(L, (FtkBitmap*)retv, "FtkBitmap");
33
34	return 1;
35}
36
37static int lua_ftk_bitmap_factory_add_decoder(lua_State* L)
38{
39	tolua_Error err = {0};
40	Ret retv;
41	FtkBitmapFactory* thiz;
42	FtkImageDecoder* decoder;
43	int param_ok = tolua_isusertype(L, 1, "FtkBitmapFactory", 0, &err) && tolua_isusertype(L, 2, "FtkImageDecoder", 0, &err);
44
45	return_val_if_fail(param_ok, 0);
46
47	thiz = tolua_tousertype(L, 1, 0);
48	decoder = tolua_tousertype(L, 2, 0);
49	retv = ftk_bitmap_factory_add_decoder(thiz, decoder);
50	tolua_pushnumber(L, (lua_Number)retv);
51
52	return 1;
53}
54
55static int lua_ftk_bitmap_factory_destroy(lua_State* L)
56{
57	tolua_Error err = {0};
58	FtkBitmapFactory* thiz;
59	int param_ok = tolua_isusertype(L, 1, "FtkBitmapFactory", 0, &err);
60
61	return_val_if_fail(param_ok, 0);
62
63	thiz = tolua_tousertype(L, 1, 0);
64	ftk_bitmap_factory_destroy(thiz);
65
66	return 1;
67}
68
69int tolua_ftk_bitmap_factory_init(lua_State* L)
70{
71	tolua_open(L);
72	tolua_reg_types(L);
73	tolua_module(L, NULL, 0);
74	tolua_beginmodule(L, NULL);
75	tolua_cclass(L,"FtkBitmapFactory", "FtkBitmapFactory", "", NULL);
76	tolua_beginmodule(L, "FtkBitmapFactory");
77	tolua_function(L, "Create", lua_ftk_bitmap_factory_create);
78	tolua_function(L, "Load", lua_ftk_bitmap_factory_load);
79	tolua_function(L, "AddDecoder", lua_ftk_bitmap_factory_add_decoder);
80	tolua_function(L, "Destroy", lua_ftk_bitmap_factory_destroy);
81	tolua_endmodule(L);
82	tolua_endmodule(L);
83
84
85	return 1;
86}