[ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17143)

This commit is contained in:
CocosRobot 2017-01-10 16:59:15 +08:00 committed by minggo
parent e9a947b02a
commit 91ae4b1c03
4 changed files with 71 additions and 41 deletions

View File

@ -78,10 +78,12 @@ str
/**
* @method loadURL
* @param {String} arg0
*/
loadURL : function (
str
* @param {String|String} str
* @param {bool} bool
*/
loadURL : function(
str,
bool
)
{
},

View File

@ -163,22 +163,40 @@ bool js_cocos2dx_experimental_webView_WebView_loadFile(JSContext *cx, uint32_t a
}
bool js_cocos2dx_experimental_webView_WebView_loadURL(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::experimental::ui::WebView* cobj = (cocos2d::experimental::ui::WebView *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_webView_WebView_loadURL : 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_experimental_webView_WebView_loadURL : Error processing arguments");
cobj->loadURL(arg0);
args.rval().setUndefined();
return true;
}
cocos2d::experimental::ui::WebView* cobj = nullptr;
JS_ReportError(cx, "js_cocos2dx_experimental_webView_WebView_loadURL : wrong number of arguments: %d, was expecting %d", argc, 1);
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::RootedObject obj(cx);
obj.set(args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cobj = (cocos2d::experimental::ui::WebView *)(proxy ? proxy->ptr : nullptr);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_webView_WebView_loadURL : Invalid Native Object");
do {
if (argc == 2) {
std::string arg0;
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
if (!ok) { ok = true; break; }
bool arg1;
arg1 = JS::ToBoolean(args.get(1));
cobj->loadURL(arg0, arg1);
args.rval().setUndefined();
return true;
}
} while(0);
do {
if (argc == 1) {
std::string arg0;
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
if (!ok) { ok = true; break; }
cobj->loadURL(arg0);
args.rval().setUndefined();
return true;
}
} while(0);
JS_ReportError(cx, "js_cocos2dx_experimental_webView_WebView_loadURL : wrong number of arguments");
return false;
}
bool js_cocos2dx_experimental_webView_WebView_setBounces(JSContext *cx, uint32_t argc, jsval *vp)

View File

@ -49,13 +49,14 @@
-- @return experimental::ui::WebView#experimental::ui::WebView self (return value: cc.experimental::ui::WebView)
--------------------------------
-- Loads the given URL.<br>
-- param url Content URL.
-- @function [parent=#WebView] loadURL
-- @overload self, string, bool
-- @overload self, string
-- @function [parent=#WebView] loadURL
-- @param self
-- @param #string url
-- @param #bool cleanCachedData
-- @return experimental::ui::WebView#experimental::ui::WebView self (return value: cc.experimental::ui::WebView)
--------------------------------
-- Set whether the webview bounces at end of scroll of WebView.
-- @function [parent=#WebView] setBounces

View File

@ -317,42 +317,51 @@ int lua_cocos2dx_experimental_webview_WebView_loadURL(lua_State* tolua_S)
int argc = 0;
cocos2d::experimental::ui::WebView* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"ccexp.WebView",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::experimental::ui::WebView*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_webview_WebView_loadURL'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
std::string arg0;
do{
if (argc == 2) {
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccexp.WebView:loadURL");
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccexp.WebView:loadURL");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_webview_WebView_loadURL'", nullptr);
return 0;
if (!ok) { break; }
bool arg1;
ok &= luaval_to_boolean(tolua_S, 3,&arg1, "ccexp.WebView:loadURL");
if (!ok) { break; }
cobj->loadURL(arg0, arg1);
lua_settop(tolua_S, 1);
return 1;
}
cobj->loadURL(arg0);
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.WebView:loadURL",argc, 1);
}while(0);
ok = true;
do{
if (argc == 1) {
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccexp.WebView:loadURL");
if (!ok) { break; }
cobj->loadURL(arg0);
lua_settop(tolua_S, 1);
return 1;
}
}while(0);
ok = true;
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.WebView:loadURL",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1