Merge pull request #14366 from CocosRobot/update_lua_bindings_1447224545

[ci skip][AUTO]: updating luabinding & jsbinding automatically
This commit is contained in:
pandamicro 2015-11-11 14:54:32 +08:00
commit 3e5e499cbe
6 changed files with 181 additions and 96 deletions

View File

@ -20948,18 +20948,6 @@ char
*/
cc.Application = {
/**
* @method openURL
* @param {String} arg0
* @return {bool}
*/
openURL : function (
str
)
{
return false;
},
/**
* @method getTargetPlatform
* @return {cc.ApplicationProtocol::Platform}
@ -20980,6 +20968,28 @@ getCurrentLanguage : function (
return 0;
},
/**
* @method openURL
* @param {String} arg0
* @return {bool}
*/
openURL : function (
str
)
{
return false;
},
/**
* @method getVersion
* @return {String}
*/
getVersion : function (
)
{
return ;
},
/**
* @method getInstance
* @return {cc.Application}

View File

@ -65525,28 +65525,6 @@ void js_register_cocos2dx_SAXParser(JSContext *cx, JS::HandleObject global) {
JSClass *jsb_cocos2d_Application_class;
JSObject *jsb_cocos2d_Application_prototype;
bool js_cocos2dx_Application_openURL(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
bool ok = true;
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::Application* cobj = (cocos2d::Application *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Application_openURL : Invalid Native Object");
if (argc == 1) {
std::string arg0;
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Application_openURL : Error processing arguments");
bool ret = cobj->openURL(arg0);
jsval jsret = JSVAL_NULL;
jsret = BOOLEAN_TO_JSVAL(ret);
args.rval().set(jsret);
return true;
}
JS_ReportError(cx, "js_cocos2dx_Application_openURL : wrong number of arguments: %d, was expecting %d", argc, 1);
return false;
}
bool js_cocos2dx_Application_getTargetPlatform(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -65583,6 +65561,46 @@ bool js_cocos2dx_Application_getCurrentLanguage(JSContext *cx, uint32_t argc, js
JS_ReportError(cx, "js_cocos2dx_Application_getCurrentLanguage : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_Application_openURL(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
bool ok = true;
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::Application* cobj = (cocos2d::Application *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Application_openURL : Invalid Native Object");
if (argc == 1) {
std::string arg0;
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Application_openURL : Error processing arguments");
bool ret = cobj->openURL(arg0);
jsval jsret = JSVAL_NULL;
jsret = BOOLEAN_TO_JSVAL(ret);
args.rval().set(jsret);
return true;
}
JS_ReportError(cx, "js_cocos2dx_Application_openURL : wrong number of arguments: %d, was expecting %d", argc, 1);
return false;
}
bool js_cocos2dx_Application_getVersion(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::Application* cobj = (cocos2d::Application *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Application_getVersion : Invalid Native Object");
if (argc == 0) {
std::string ret = cobj->getVersion();
jsval jsret = JSVAL_NULL;
jsret = std_string_to_jsval(cx, ret);
args.rval().set(jsret);
return true;
}
JS_ReportError(cx, "js_cocos2dx_Application_getVersion : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_Application_getInstance(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -65627,9 +65645,10 @@ void js_register_cocos2dx_Application(JSContext *cx, JS::HandleObject global) {
};
static JSFunctionSpec funcs[] = {
JS_FN("openURL", js_cocos2dx_Application_openURL, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getTargetPlatform", js_cocos2dx_Application_getTargetPlatform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getCurrentLanguage", js_cocos2dx_Application_getCurrentLanguage, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("openURL", js_cocos2dx_Application_openURL, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getVersion", js_cocos2dx_Application_getVersion, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FS_END
};

View File

@ -3763,9 +3763,10 @@ bool js_cocos2dx_Application_constructor(JSContext *cx, uint32_t argc, jsval *vp
void js_cocos2dx_Application_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_Application(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_Application_openURL(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Application_getTargetPlatform(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Application_getCurrentLanguage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Application_openURL(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Application_getVersion(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Application_getInstance(JSContext *cx, uint32_t argc, jsval *vp);
extern JSClass *jsb_cocos2d_AnimationCache_class;

View File

@ -3,15 +3,6 @@
-- @module Application
-- @parent_module cc
--------------------------------
-- brief Open url in default browser<br>
-- param String with url to open.<br>
-- return true if the resource located by the URL was successfully opened; otherwise false.
-- @function [parent=#Application] openURL
-- @param self
-- @param #string url
-- @return bool#bool ret (return value: bool)
--------------------------------
-- brief Get target platform
-- @function [parent=#Application] getTargetPlatform
@ -32,6 +23,21 @@
-- @param self
-- @return char#char ret (return value: char)
--------------------------------
-- brief Open url in default browser<br>
-- param String with url to open.<br>
-- return true if the resource located by the URL was successfully opened; otherwise false.
-- @function [parent=#Application] openURL
-- @param self
-- @param #string url
-- @return bool#bool ret (return value: bool)
--------------------------------
-- brief Get application version.
-- @function [parent=#Application] getVersion
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
-- brief Callback by Director to limit FPS.<br>
-- param interval The time, expressed in seconds, between current frame and next.

View File

@ -87288,56 +87288,6 @@ int lua_register_cocos2dx_Device(lua_State* tolua_S)
return 1;
}
int lua_cocos2dx_Application_openURL(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Application* 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.Application",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Application*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Application_openURL'", 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.Application:openURL");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Application_openURL'", nullptr);
return 0;
}
bool ret = cobj->openURL(arg0);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Application:openURL",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Application_openURL'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Application_getTargetPlatform(lua_State* tolua_S)
{
int argc = 0;
@ -87479,6 +87429,103 @@ int lua_cocos2dx_Application_getCurrentLanguageCode(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Application_openURL(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Application* 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.Application",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Application*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Application_openURL'", 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.Application:openURL");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Application_openURL'", nullptr);
return 0;
}
bool ret = cobj->openURL(arg0);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Application:openURL",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Application_openURL'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Application_getVersion(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Application* 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.Application",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Application*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Application_getVersion'", 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_Application_getVersion'", nullptr);
return 0;
}
std::string ret = cobj->getVersion();
tolua_pushcppstring(tolua_S,ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Application:getVersion",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Application_getVersion'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Application_setAnimationInterval(lua_State* tolua_S)
{
int argc = 0;
@ -87575,10 +87622,11 @@ int lua_register_cocos2dx_Application(lua_State* tolua_S)
tolua_cclass(tolua_S,"Application","cc.Application","",nullptr);
tolua_beginmodule(tolua_S,"Application");
tolua_function(tolua_S,"openURL",lua_cocos2dx_Application_openURL);
tolua_function(tolua_S,"getTargetPlatform",lua_cocos2dx_Application_getTargetPlatform);
tolua_function(tolua_S,"getCurrentLanguage",lua_cocos2dx_Application_getCurrentLanguage);
tolua_function(tolua_S,"getCurrentLanguageCode",lua_cocos2dx_Application_getCurrentLanguageCode);
tolua_function(tolua_S,"openURL",lua_cocos2dx_Application_openURL);
tolua_function(tolua_S,"getVersion",lua_cocos2dx_Application_getVersion);
tolua_function(tolua_S,"setAnimationInterval",lua_cocos2dx_Application_setAnimationInterval);
tolua_function(tolua_S,"getInstance", lua_cocos2dx_Application_getInstance);
tolua_endmodule(tolua_S);

View File

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