static int lua_cocos2dx_TableView_setDataSource(lua_State* L) { if (nullptr == L) return 0; int argc = 0; TableView* self = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; if (!tolua_isusertype(L,1,"cc.TableView",0,&tolua_err)) goto tolua_lerror; #endif self = (TableView*) tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 if (nullptr == self) { tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_TableView_setDataSource'\n", nullptr); return 0; } #endif argc = lua_gettop(L) - 1; if (0 == argc) { LUA_TableViewDataSource* dataSource = new (std::nothrow) LUA_TableViewDataSource(); if (nullptr == dataSource) return 0; __Dictionary* userDict = static_cast<__Dictionary*>(self->getUserObject()); if (nullptr == userDict) { userDict = new __Dictionary(); if (NULL == userDict) return 0; self->setUserObject(userDict); userDict->release(); } userDict->setObject(dataSource, KEY_TABLEVIEW_DATA_SOURCE); self->setDataSource(dataSource); dataSource->release(); return 0; } luaL_error(L, "'setDataSource' function of TableView wrong number of arguments: %d, was expecting %d\n", argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(L,"#ferror in function 'setDataSource'.",&tolua_err); return 0; #endif }
static int tolua_Cocos2dx_CCTableView_setDataSource(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( !tolua_isusertype(tolua_S,1,"CCTableView",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { CCTableView* self = (CCTableView*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'setDataSource'", NULL); #endif LUA_TableViewDataSource* dataSource = new LUA_TableViewDataSource(); if (NULL == dataSource) return 0; CCDictionary* userDict = static_cast<CCDictionary*>(self->getUserObject()); if (NULL == userDict) { userDict = new CCDictionary(); if (NULL == userDict) return 0; self->setUserObject(userDict); userDict->release(); } userDict->setObject(dataSource, KEY_TABLEVIEW_DATA_SOURCE); self->setDataSource(dataSource); dataSource->release(); return 0; } return 0; #ifndef TOLUA_RELEASE tolua_lerror: tolua_error(tolua_S,"#ferror in function 'setDataSource'.",&tolua_err); return 0; #endif }
static int tolua_Cocos2dx_CCTableView_create00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( !tolua_isusertable(tolua_S, 1, "CCTableView", 0, &tolua_err) || !tolua_isusertype(tolua_S, 2, "CCSize", 0, &tolua_err) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { LUA_TableViewDataSource* dataSource = new LUA_TableViewDataSource(); if (NULL == dataSource) return 0; CCSize size = *((CCSize*) tolua_tousertype(tolua_S,2,0)); CCTableView* tolua_ret = CCTableView::create(dataSource, size); if (NULL == tolua_ret) return 0; tolua_ret->reloadData(); CCDictionary* userDict = new CCDictionary(); userDict->setObject(dataSource, KEY_TABLEVIEW_DATA_SOURCE); tolua_ret->setUserObject(userDict); userDict->release(); dataSource->release(); int nID = (int)tolua_ret->m_uID; int* pLuaID = &tolua_ret->m_nLuaID; toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCTableView"); return 1; } return 0; #ifndef TOLUA_RELEASE tolua_lerror: tolua_error(tolua_S,"#ferror in function 'create'.",&tolua_err); return 0; #endif }
static int tolua_Cocos2dx_CCTableView_create01(lua_State* tolua_S) { tolua_Error tolua_err; if ( !tolua_isusertable(tolua_S,1,"CCTableView",0,&tolua_err) || !tolua_isusertype(tolua_S, 2, "CCSize", 0, &tolua_err) || !tolua_isusertype(tolua_S,3,"CCNode",0,&tolua_err) || !tolua_isnoobj(tolua_S,4,&tolua_err) ) goto tolua_lerror; else { LUA_TableViewDataSource* dataSource = new LUA_TableViewDataSource(); if (NULL == dataSource) return 0; CCSize size = *((CCSize*) tolua_tousertype(tolua_S,2,0)); CCNode* node = static_cast<CCNode*>(tolua_tousertype(tolua_S, 3, 0)); CCTableView* tolua_ret = CCTableView::create(dataSource,size,node); if (NULL == tolua_ret) return 0; tolua_ret->reloadData(); CCDictionary* userDict = new CCDictionary(); userDict->setObject(dataSource, KEY_TABLEVIEW_DATA_SOURCE); tolua_ret->setUserObject(userDict); userDict->release(); dataSource->release(); int nID = (int)tolua_ret->m_uID; int* pLuaID = &tolua_ret->m_nLuaID; toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCTableView"); return 1; } return 0; tolua_lerror: return tolua_Cocos2dx_CCTableView_create00(tolua_S); }
static int lua_cocos2dx_TableView_create(lua_State* L) { if (nullptr == L) return 0; int argc = 0; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; if (!tolua_isusertable(L,1,"cc.TableView",0,&tolua_err)) goto tolua_lerror; #endif argc = lua_gettop(L) - 1; if (2 == argc || 1 == argc) { LUA_TableViewDataSource* dataSource = new (std::nothrow) LUA_TableViewDataSource(); Size size; ok &= luaval_to_size(L, 2, &size, "cc.TableView:create"); TableView* ret = nullptr; if (1 == argc) { ret = TableView::create(dataSource, size); } else { #if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(L,3,"cc.Node",0,&tolua_err)) goto tolua_lerror; #endif Node* node = static_cast<Node*>(tolua_tousertype(L, 3, nullptr)); ret = TableView::create(dataSource, size, node); } if (nullptr == ret) return 0; ret->reloadData(); __Dictionary* userDict = new __Dictionary(); userDict->setObject(dataSource, KEY_TABLEVIEW_DATA_SOURCE); ret->setUserObject(userDict); userDict->release(); dataSource->release(); int nID = (int)ret->_ID; int* pLuaID = &ret->_luaID; toluafix_pushusertype_ccobject(L, nID, pLuaID, (void*)ret,"cc.TableView"); return 1; } luaL_error(L, "'create' function of TableView wrong number of arguments: %d, was expecting %d\n", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(L,"#ferror in function 'create'.",&tolua_err); return 0; #endif }