Merge pull request #9676 from CocosRobot/update_lua_bindings_1419818723

[AUTO]: updating luabinding automatically
This commit is contained in:
minggo 2014-12-29 10:09:43 +08:00
commit 9d993fbbd4
3 changed files with 166 additions and 108 deletions

View File

@ -4,11 +4,6 @@
-- @extend Ref
-- @parent_module cc
--------------------------------
-- stops the Console. 'stop' will be called at destruction time as well
-- @function [parent=#Console] stop
-- @param self
--------------------------------
-- starts listening to specifed TCP port
-- @function [parent=#Console] listenOnTCP
@ -16,6 +11,24 @@
-- @param #int port
-- @return bool#bool ret (return value: bool)
--------------------------------
-- log something in the console
-- @function [parent=#Console] log
-- @param self
-- @param #char buf
--------------------------------
-- set bind address<br>
-- address : 127.0.0.1
-- @function [parent=#Console] setBindAddress
-- @param self
-- @param #string address
--------------------------------
-- stops the Console. 'stop' will be called at destruction time as well
-- @function [parent=#Console] stop
-- @param self
--------------------------------
-- starts listening to specifed file descriptor
-- @function [parent=#Console] listenOnFileDescriptor
@ -23,10 +36,4 @@
-- @param #int fd
-- @return bool#bool ret (return value: bool)
--------------------------------
-- log something in the console
-- @function [parent=#Console] log
-- @param self
-- @param #char buf
return nil

View File

@ -167,52 +167,6 @@ int lua_register_cocos2dx_Ref(lua_State* tolua_S)
return 1;
}
int lua_cocos2dx_Console_stop(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Console* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.Console",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Console*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Console_stop'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Console_stop'", nullptr);
return 0;
}
cobj->stop();
return 0;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Console:stop",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Console_stop'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Console_listenOnTCP(lua_State* tolua_S)
{
int argc = 0;
@ -263,6 +217,150 @@ int lua_cocos2dx_Console_listenOnTCP(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Console_log(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Console* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.Console",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Console*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Console_log'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
const char* arg0;
std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.Console:log"); arg0 = arg0_tmp.c_str();
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Console_log'", nullptr);
return 0;
}
cobj->log(arg0);
return 0;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Console:log",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Console_log'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Console_setBindAddress(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Console* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.Console",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Console*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Console_setBindAddress'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Console:setBindAddress");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Console_setBindAddress'", nullptr);
return 0;
}
cobj->setBindAddress(arg0);
return 0;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Console:setBindAddress",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Console_setBindAddress'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Console_stop(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Console* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.Console",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Console*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Console_stop'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Console_stop'", nullptr);
return 0;
}
cobj->stop();
return 0;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Console:stop",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Console_stop'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Console_listenOnFileDescriptor(lua_State* tolua_S)
{
int argc = 0;
@ -313,55 +411,6 @@ int lua_cocos2dx_Console_listenOnFileDescriptor(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Console_log(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Console* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.Console",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Console*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Console_log'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
const char* arg0;
std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.Console:log"); arg0 = arg0_tmp.c_str();
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Console_log'", nullptr);
return 0;
}
cobj->log(arg0);
return 0;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Console:log",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Console_log'.",&tolua_err);
#endif
return 0;
}
static int lua_cocos2dx_Console_finalize(lua_State* tolua_S)
{
printf("luabindings: finalizing LUA object (Console)");
@ -374,10 +423,11 @@ int lua_register_cocos2dx_Console(lua_State* tolua_S)
tolua_cclass(tolua_S,"Console","cc.Console","cc.Ref",nullptr);
tolua_beginmodule(tolua_S,"Console");
tolua_function(tolua_S,"stop",lua_cocos2dx_Console_stop);
tolua_function(tolua_S,"listenOnTCP",lua_cocos2dx_Console_listenOnTCP);
tolua_function(tolua_S,"listenOnFileDescriptor",lua_cocos2dx_Console_listenOnFileDescriptor);
tolua_function(tolua_S,"log",lua_cocos2dx_Console_log);
tolua_function(tolua_S,"setBindAddress",lua_cocos2dx_Console_setBindAddress);
tolua_function(tolua_S,"stop",lua_cocos2dx_Console_stop);
tolua_function(tolua_S,"listenOnFileDescriptor",lua_cocos2dx_Console_listenOnFileDescriptor);
tolua_endmodule(tolua_S);
std::string typeName = typeid(cocos2d::Console).name();
g_luaType[typeName] = "cc.Console";

View File

@ -1625,6 +1625,7 @@ int register_all_cocos2dx(lua_State* tolua_S);
#endif // __cocos2dx_h__