PageRenderTime 24ms CodeModel.GetById 8ms app.highlight 12ms RepoModel.GetById 1ms app.codeStats 1ms

/script_binding/lua/lua_ftk_display.c

http://ftk.googlecode.com/
C | 128 lines | 103 code | 24 blank | 1 comment | 10 complexity | cfbc2f31130a6df77af59b6f19d5cd7a MD5 | raw file
  1/*This file is generated by luagen.*/
  2#include "lua_ftk_display.h"
  3#include "lua_ftk_callbacks.h"
  4
  5static void tolua_reg_types (lua_State* L)
  6{
  7	tolua_usertype(L, "FtkDisplay");
  8}
  9
 10static int lua_ftk_display_update(lua_State* L)
 11{
 12	tolua_Error err = {0};
 13	Ret retv;
 14	FtkDisplay* thiz;
 15	FtkBitmap* bitmap;
 16	FtkRect* rect;
 17	int xoffset;
 18	int yoffset;
 19	int param_ok = tolua_isusertype(L, 1, "FtkDisplay", 0, &err) && tolua_isusertype(L, 2, "FtkBitmap", 0, &err) && tolua_isusertype(L, 3, "FtkRect", 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	thiz = tolua_tousertype(L, 1, 0);
 24	bitmap = tolua_tousertype(L, 2, 0);
 25	rect = tolua_tousertype(L, 3, 0);
 26	xoffset = tolua_tonumber(L, 4, 0);
 27	yoffset = tolua_tonumber(L, 5, 0);
 28	retv = ftk_display_update(thiz, bitmap, rect, xoffset, yoffset);
 29	tolua_pushnumber(L, (lua_Number)retv);
 30
 31	return 1;
 32}
 33
 34static int lua_ftk_display_update_and_notify(lua_State* L)
 35{
 36	tolua_Error err = {0};
 37	Ret retv;
 38	FtkDisplay* thiz;
 39	FtkBitmap* bitmap;
 40	FtkRect* rect;
 41	int xoffset;
 42	int yoffset;
 43	int param_ok = tolua_isusertype(L, 1, "FtkDisplay", 0, &err) && tolua_isusertype(L, 2, "FtkBitmap", 0, &err) && tolua_isusertype(L, 3, "FtkRect", 0, &err) && tolua_isnumber(L, 4, 0, &err) && tolua_isnumber(L, 5, 0, &err);
 44
 45	return_val_if_fail(param_ok, 0);
 46
 47	thiz = tolua_tousertype(L, 1, 0);
 48	bitmap = tolua_tousertype(L, 2, 0);
 49	rect = tolua_tousertype(L, 3, 0);
 50	xoffset = tolua_tonumber(L, 4, 0);
 51	yoffset = tolua_tonumber(L, 5, 0);
 52	retv = ftk_display_update_and_notify(thiz, bitmap, rect, xoffset, yoffset);
 53	tolua_pushnumber(L, (lua_Number)retv);
 54
 55	return 1;
 56}
 57
 58static int lua_ftk_display_width(lua_State* L)
 59{
 60	tolua_Error err = {0};
 61	int retv;
 62	FtkDisplay* thiz;
 63	int param_ok = tolua_isusertype(L, 1, "FtkDisplay", 0, &err);
 64
 65	return_val_if_fail(param_ok, 0);
 66
 67	thiz = tolua_tousertype(L, 1, 0);
 68	retv = ftk_display_width(thiz);
 69	tolua_pushnumber(L, (lua_Number)retv);
 70
 71	return 1;
 72}
 73
 74static int lua_ftk_display_height(lua_State* L)
 75{
 76	tolua_Error err = {0};
 77	int retv;
 78	FtkDisplay* thiz;
 79	int param_ok = tolua_isusertype(L, 1, "FtkDisplay", 0, &err);
 80
 81	return_val_if_fail(param_ok, 0);
 82
 83	thiz = tolua_tousertype(L, 1, 0);
 84	retv = ftk_display_height(thiz);
 85	tolua_pushnumber(L, (lua_Number)retv);
 86
 87	return 1;
 88}
 89
 90static int lua_ftk_display_snap(lua_State* L)
 91{
 92	tolua_Error err = {0};
 93	Ret retv;
 94	FtkDisplay* thiz;
 95	FtkRect* rect;
 96	FtkBitmap* bitmap;
 97	int param_ok = tolua_isusertype(L, 1, "FtkDisplay", 0, &err) && tolua_isusertype(L, 2, "FtkRect", 0, &err) && tolua_isusertype(L, 3, "FtkBitmap", 0, &err);
 98
 99	return_val_if_fail(param_ok, 0);
100
101	thiz = tolua_tousertype(L, 1, 0);
102	rect = tolua_tousertype(L, 2, 0);
103	bitmap = tolua_tousertype(L, 3, 0);
104	retv = ftk_display_snap(thiz, rect, bitmap);
105	tolua_pushnumber(L, (lua_Number)retv);
106
107	return 1;
108}
109
110int tolua_ftk_display_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,"FtkDisplay", "FtkDisplay", "", NULL);
117	tolua_beginmodule(L, "FtkDisplay");
118	tolua_function(L, "Update", lua_ftk_display_update);
119	tolua_function(L, "UpdateAndNotify", lua_ftk_display_update_and_notify);
120	tolua_function(L, "Width", lua_ftk_display_width);
121	tolua_function(L, "Height", lua_ftk_display_height);
122	tolua_function(L, "Snap", lua_ftk_display_snap);
123	tolua_endmodule(L);
124	tolua_endmodule(L);
125
126
127	return 1;
128}