/script_binding/lua/lua_ftk_icon_cache.c
http://ftk.googlecode.com/ · C · 77 lines · 60 code · 16 blank · 1 comment · 2 complexity · b4bdbe8a751997a63856649935853239 MD5 · raw file
- /*This file is generated by luagen.*/
- #include "lua_ftk_icon_cache.h"
- #include "lua_ftk_callbacks.h"
- static void tolua_reg_types (lua_State* L)
- {
- tolua_usertype(L, "FtkIconCache");
- }
- static int lua_ftk_icon_cache_create(lua_State* L)
- {
- tolua_Error err = {0};
- FtkIconCache* retv;
- const char** root_path;
- const char* rel_path;
- int param_ok = tolua_istable(L, 1, 0, &err) && tolua_isstring(L, 2, 0, &err);
- return_val_if_fail(param_ok, 0);
- root_path = tolua_tostrings(L, 1, 0);
- rel_path = tolua_tostring(L, 2, 0);
- retv = ftk_icon_cache_create(root_path, rel_path);
- tolua_pushusertype(L, (FtkIconCache*)retv, "FtkIconCache");
- free(root_path);
- return 1;
- }
- static int lua_ftk_icon_cache_load(lua_State* L)
- {
- tolua_Error err = {0};
- FtkBitmap* retv;
- FtkIconCache* thiz;
- const char* filename;
- int param_ok = tolua_isusertype(L, 1, "FtkIconCache", 0, &err) && tolua_isstring(L, 2, 0, &err);
- return_val_if_fail(param_ok, 0);
- thiz = tolua_tousertype(L, 1, 0);
- filename = tolua_tostring(L, 2, 0);
- retv = ftk_icon_cache_load(thiz, filename);
- tolua_pushusertype(L, (FtkBitmap*)retv, "FtkBitmap");
- return 1;
- }
- static int lua_ftk_icon_cache_destroy(lua_State* L)
- {
- tolua_Error err = {0};
- FtkIconCache* thiz;
- int param_ok = tolua_isusertype(L, 1, "FtkIconCache", 0, &err);
- return_val_if_fail(param_ok, 0);
- thiz = tolua_tousertype(L, 1, 0);
- ftk_icon_cache_destroy(thiz);
- return 1;
- }
- int tolua_ftk_icon_cache_init(lua_State* L)
- {
- tolua_open(L);
- tolua_reg_types(L);
- tolua_module(L, NULL, 0);
- tolua_beginmodule(L, NULL);
- tolua_cclass(L,"FtkIconCache", "FtkIconCache", "", NULL);
- tolua_beginmodule(L, "FtkIconCache");
- tolua_function(L, "Create", lua_ftk_icon_cache_create);
- tolua_function(L, "Load", lua_ftk_icon_cache_load);
- tolua_function(L, "Destroy", lua_ftk_icon_cache_destroy);
- tolua_endmodule(L);
- tolua_endmodule(L);
- return 1;
- }