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

This commit is contained in:
CocosRobot 2018-05-23 11:32:42 +08:00 committed by leda
parent 1ea57fe42a
commit 2b80503972
6 changed files with 221 additions and 25 deletions

View File

@ -2378,6 +2378,16 @@ getViewPortRect : function (
return cc.Rect;
},
/**
* @method getScaleY
* @return {float}
*/
getScaleY : function (
)
{
return 0;
},
/**
* @method setContentScaleFactor
* @param {float} arg0
@ -2477,13 +2487,11 @@ bool
},
/**
* @method getScaleY
* @return {float}
* @method setDefaultIcon
*/
getScaleY : function (
setDefaultIcon : function (
)
{
return 0;
},
/**
@ -2546,6 +2554,16 @@ getDesignResolutionSize : function (
return cc.Size;
},
/**
* @method setIcon
* @param {Array|String} array
*/
setIcon : function(
str
)
{
},
/**
* @method windowShouldClose
* @return {bool}

View File

@ -6025,6 +6025,24 @@ bool js_cocos2dx_GLView_getViewPortRect(JSContext *cx, uint32_t argc, jsval *vp)
JS_ReportError(cx, "js_cocos2dx_GLView_getViewPortRect : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_GLView_getScaleY(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::GLView* cobj = (cocos2d::GLView *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_getScaleY : Invalid Native Object");
if (argc == 0) {
double ret = cobj->getScaleY();
JS::RootedValue jsret(cx);
jsret = DOUBLE_TO_JSVAL(ret);
args.rval().set(jsret);
return true;
}
JS_ReportError(cx, "js_cocos2dx_GLView_getScaleY : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_GLView_setContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -6207,22 +6225,20 @@ bool js_cocos2dx_GLView_setCursorVisible(JSContext *cx, uint32_t argc, jsval *vp
JS_ReportError(cx, "js_cocos2dx_GLView_setCursorVisible : wrong number of arguments: %d, was expecting %d", argc, 1);
return false;
}
bool js_cocos2dx_GLView_getScaleY(JSContext *cx, uint32_t argc, jsval *vp)
bool js_cocos2dx_GLView_setDefaultIcon(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::GLView* cobj = (cocos2d::GLView *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_getScaleY : Invalid Native Object");
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_setDefaultIcon : Invalid Native Object");
if (argc == 0) {
double ret = cobj->getScaleY();
JS::RootedValue jsret(cx);
jsret = DOUBLE_TO_JSVAL(ret);
args.rval().set(jsret);
cobj->setDefaultIcon();
args.rval().setUndefined();
return true;
}
JS_ReportError(cx, "js_cocos2dx_GLView_getScaleY : wrong number of arguments: %d, was expecting %d", argc, 0);
JS_ReportError(cx, "js_cocos2dx_GLView_setDefaultIcon : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_GLView_getScaleX(JSContext *cx, uint32_t argc, jsval *vp)
@ -6335,6 +6351,42 @@ bool js_cocos2dx_GLView_getDesignResolutionSize(JSContext *cx, uint32_t argc, js
JS_ReportError(cx, "js_cocos2dx_GLView_getDesignResolutionSize : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_GLView_setIcon(JSContext *cx, uint32_t argc, jsval *vp)
{
bool ok = true;
cocos2d::GLView* cobj = nullptr;
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::GLView *)(proxy ? proxy->ptr : nullptr);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_setIcon : Invalid Native Object");
do {
if (argc == 1) {
std::vector<std::string> arg0;
ok &= jsval_to_std_vector_string(cx, args.get(0), &arg0);
if (!ok) { ok = true; break; }
cobj->setIcon(arg0);
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->setIcon(arg0);
args.rval().setUndefined();
return true;
}
} while(0);
JS_ReportError(cx, "js_cocos2dx_GLView_setIcon : wrong number of arguments");
return false;
}
bool js_cocos2dx_GLView_windowShouldClose(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -6683,6 +6735,7 @@ void js_register_cocos2dx_GLView(JSContext *cx, JS::HandleObject global) {
static JSFunctionSpec funcs[] = {
JS_FN("setFrameSize", js_cocos2dx_GLView_setFrameSize, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getViewPortRect", js_cocos2dx_GLView_getViewPortRect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getScaleY", js_cocos2dx_GLView_getScaleY, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setContentScaleFactor", js_cocos2dx_GLView_setContentScaleFactor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getContentScaleFactor", js_cocos2dx_GLView_getContentScaleFactor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setIMEKeyboardState", js_cocos2dx_GLView_setIMEKeyboardState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
@ -6692,13 +6745,14 @@ void js_register_cocos2dx_GLView(JSContext *cx, JS::HandleObject global) {
JS_FN("getViewName", js_cocos2dx_GLView_getViewName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("isOpenGLReady", js_cocos2dx_GLView_isOpenGLReady, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setCursorVisible", js_cocos2dx_GLView_setCursorVisible, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getScaleY", js_cocos2dx_GLView_getScaleY, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setDefaultIcon", js_cocos2dx_GLView_setDefaultIcon, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getScaleX", js_cocos2dx_GLView_getScaleX, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getVisibleOrigin", js_cocos2dx_GLView_getVisibleOrigin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getFrameSize", js_cocos2dx_GLView_getFrameSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setFrameZoomFactor", js_cocos2dx_GLView_setFrameZoomFactor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getFrameZoomFactor", js_cocos2dx_GLView_getFrameZoomFactor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getDesignResolutionSize", js_cocos2dx_GLView_getDesignResolutionSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setIcon", js_cocos2dx_GLView_setIcon, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("windowShouldClose", js_cocos2dx_GLView_windowShouldClose, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setDesignResolutionSize", js_cocos2dx_GLView_setDesignResolutionSize, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getResolutionPolicy", js_cocos2dx_GLView_getResolutionPolicy, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),

View File

@ -306,6 +306,7 @@ void js_register_cocos2dx_GLView(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_GLView_setFrameSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getViewPortRect(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getScaleY(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_setContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_setIMEKeyboardState(JSContext *cx, uint32_t argc, jsval *vp);
@ -315,13 +316,14 @@ bool js_cocos2dx_GLView_setScissorInPoints(JSContext *cx, uint32_t argc, jsval *
bool js_cocos2dx_GLView_getViewName(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_isOpenGLReady(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_setCursorVisible(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getScaleY(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_setDefaultIcon(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getScaleX(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getVisibleOrigin(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getFrameSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_setFrameZoomFactor(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getFrameZoomFactor(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getDesignResolutionSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_setIcon(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_windowShouldClose(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_setDesignResolutionSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getResolutionPolicy(JSContext *cx, uint32_t argc, jsval *vp);

View File

@ -21,6 +21,13 @@
-- @param self
-- @return rect_table#rect_table ret (return value: rect_table)
--------------------------------
-- Get scale factor of the vertical direction.<br>
-- return Scale factor of the vertical direction.
-- @function [parent=#GLView] getScaleY
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
-- Only works on ios platform. Set Content Scale of the Factor.
-- @function [parent=#GLView] setContentScaleFactor
@ -98,11 +105,12 @@
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
-- Get scale factor of the vertical direction.<br>
-- return Scale factor of the vertical direction.
-- @function [parent=#GLView] getScaleY
-- Set default window icon (implemented for windows and linux).<br>
-- On windows it will use icon from .exe file (if included).<br>
-- On linux it will use default window icon.
-- @function [parent=#GLView] setDefaultIcon
-- @param self
-- @return float#float ret (return value: float)
-- @return GLView#GLView self (return value: cc.GLView)
--------------------------------
-- Get scale factor of the horizontal direction.<br>
@ -143,6 +151,14 @@
-- @param self
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
-- @overload self, array_table
-- @overload self, string
-- @function [parent=#GLView] setIcon
-- @param self
-- @param #string filename
-- @return GLView#GLView self (return value: cc.GLView)
--------------------------------
-- When the window is closed, it will return false if the platforms is Ios or Android.<br>
-- If the platforms is windows or Mac,it will return true.<br>

View File

@ -11820,6 +11820,53 @@ int lua_cocos2dx_GLView_getViewPortRect(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_GLView_getScaleY(lua_State* tolua_S)
{
int argc = 0;
cocos2d::GLView* 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.GLView",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::GLView*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLView_getScaleY'", 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_GLView_getScaleY'", nullptr);
return 0;
}
double ret = cobj->getScaleY();
tolua_pushnumber(tolua_S,(lua_Number)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLView:getScaleY",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLView_getScaleY'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_GLView_setContentScaleFactor(lua_State* tolua_S)
{
int argc = 0;
@ -12311,7 +12358,7 @@ int lua_cocos2dx_GLView_getFrameSize(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_GLView_getScaleY(lua_State* tolua_S)
int lua_cocos2dx_GLView_setDefaultIcon(lua_State* tolua_S)
{
int argc = 0;
cocos2d::GLView* cobj = nullptr;
@ -12331,7 +12378,7 @@ int lua_cocos2dx_GLView_getScaleY(lua_State* tolua_S)
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLView_getScaleY'", nullptr);
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLView_setDefaultIcon'", nullptr);
return 0;
}
#endif
@ -12341,19 +12388,19 @@ int lua_cocos2dx_GLView_getScaleY(lua_State* tolua_S)
{
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLView_getScaleY'", nullptr);
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLView_setDefaultIcon'", nullptr);
return 0;
}
double ret = cobj->getScaleY();
tolua_pushnumber(tolua_S,(lua_Number)ret);
cobj->setDefaultIcon();
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLView:getScaleY",argc, 0);
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLView:setDefaultIcon",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLView_getScaleY'.",&tolua_err);
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLView_setDefaultIcon'.",&tolua_err);
#endif
return 0;
@ -12596,6 +12643,61 @@ int lua_cocos2dx_GLView_getDesignResolutionSize(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_GLView_setIcon(lua_State* tolua_S)
{
int argc = 0;
cocos2d::GLView* 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.GLView",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::GLView*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLView_setIcon'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
do{
if (argc == 1) {
std::vector<std::string> arg0;
ok &= luaval_to_std_vector_string(tolua_S, 2, &arg0, "cc.GLView:setIcon");
if (!ok) { break; }
cobj->setIcon(arg0);
lua_settop(tolua_S, 1);
return 1;
}
}while(0);
ok = true;
do{
if (argc == 1) {
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLView:setIcon");
if (!ok) { break; }
cobj->setIcon(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", "cc.GLView:setIcon",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLView_setIcon'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_GLView_windowShouldClose(lua_State* tolua_S)
{
int argc = 0;
@ -13466,6 +13568,7 @@ int lua_register_cocos2dx_GLView(lua_State* tolua_S)
tolua_beginmodule(tolua_S,"GLView");
tolua_function(tolua_S,"setFrameSize",lua_cocos2dx_GLView_setFrameSize);
tolua_function(tolua_S,"getViewPortRect",lua_cocos2dx_GLView_getViewPortRect);
tolua_function(tolua_S,"getScaleY",lua_cocos2dx_GLView_getScaleY);
tolua_function(tolua_S,"setContentScaleFactor",lua_cocos2dx_GLView_setContentScaleFactor);
tolua_function(tolua_S,"getContentScaleFactor",lua_cocos2dx_GLView_getContentScaleFactor);
tolua_function(tolua_S,"setIMEKeyboardState",lua_cocos2dx_GLView_setIMEKeyboardState);
@ -13476,12 +13579,13 @@ int lua_register_cocos2dx_GLView(lua_State* tolua_S)
tolua_function(tolua_S,"isOpenGLReady",lua_cocos2dx_GLView_isOpenGLReady);
tolua_function(tolua_S,"setCursorVisible",lua_cocos2dx_GLView_setCursorVisible);
tolua_function(tolua_S,"getFrameSize",lua_cocos2dx_GLView_getFrameSize);
tolua_function(tolua_S,"getScaleY",lua_cocos2dx_GLView_getScaleY);
tolua_function(tolua_S,"setDefaultIcon",lua_cocos2dx_GLView_setDefaultIcon);
tolua_function(tolua_S,"getScaleX",lua_cocos2dx_GLView_getScaleX);
tolua_function(tolua_S,"getVisibleOrigin",lua_cocos2dx_GLView_getVisibleOrigin);
tolua_function(tolua_S,"setFrameZoomFactor",lua_cocos2dx_GLView_setFrameZoomFactor);
tolua_function(tolua_S,"getFrameZoomFactor",lua_cocos2dx_GLView_getFrameZoomFactor);
tolua_function(tolua_S,"getDesignResolutionSize",lua_cocos2dx_GLView_getDesignResolutionSize);
tolua_function(tolua_S,"setIcon",lua_cocos2dx_GLView_setIcon);
tolua_function(tolua_S,"windowShouldClose",lua_cocos2dx_GLView_windowShouldClose);
tolua_function(tolua_S,"swapBuffers",lua_cocos2dx_GLView_swapBuffers);
tolua_function(tolua_S,"setDesignResolutionSize",lua_cocos2dx_GLView_setDesignResolutionSize);

View File

@ -2287,6 +2287,8 @@ int register_all_cocos2dx(lua_State* tolua_S);