diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js index bb2ae21de2..95ab779589 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js @@ -10497,6 +10497,18 @@ getVertexAttribsFlags : function ( return 0; }, +/** + * @method applyAutoBinding + * @param {String} arg0 + * @param {String} arg1 + */ +applyAutoBinding : function ( +str, +str +) +{ +}, + /** * @method setUniformVec2 * @param {int|String} int @@ -10543,6 +10555,16 @@ mat4 { }, +/** + * @method getNodeBinding + * @return {cc.Node} + */ +getNodeBinding : function ( +) +{ + return cc.Node; +}, + /** * @method applyGLProgram * @param {mat4_object} arg0 @@ -10553,6 +10575,16 @@ mat4 { }, +/** + * @method setNodeBinding + * @param {cc.Node} arg0 + */ +setNodeBinding : function ( +node +) +{ +}, + /** * @method setUniformInt * @param {int|String} int @@ -10565,6 +10597,18 @@ int { }, +/** + * @method setParameterAutoBinding + * @param {String} arg0 + * @param {String} arg1 + */ +setParameterAutoBinding : function ( +str, +str +) +{ +}, + /** * @method setUniformVec2v * @param {int|String} int diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_video_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_video_auto_api.js new file mode 100644 index 0000000000..56ed6cefae --- /dev/null +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_video_auto_api.js @@ -0,0 +1,172 @@ +/** + * @module cocos2dx_experimental_video + */ +var ccui = ccui || {}; + +/** + * @class VideoPlayer + */ +ccui.VideoPlayer = { + +/** + * @method getFileName + * @return {String} + */ +getFileName : function ( +) +{ + return ; +}, + +/** + * @method getURL + * @return {String} + */ +getURL : function ( +) +{ + return ; +}, + +/** + * @method play + */ +play : function ( +) +{ +}, + +/** + * @method pause + */ +pause : function ( +) +{ +}, + +/** + * @method setKeepAspectRatioEnabled + * @param {bool} arg0 + */ +setKeepAspectRatioEnabled : function ( +bool +) +{ +}, + +/** + * @method resume + */ +resume : function ( +) +{ +}, + +/** + * @method stop + */ +stop : function ( +) +{ +}, + +/** + * @method setFullScreenEnabled + * @param {bool} arg0 + */ +setFullScreenEnabled : function ( +bool +) +{ +}, + +/** + * @method setFileName + * @param {String} arg0 + */ +setFileName : function ( +str +) +{ +}, + +/** + * @method setURL + * @param {String} arg0 + */ +setURL : function ( +str +) +{ +}, + +/** + * @method isKeepAspectRatioEnabled + * @return {bool} + */ +isKeepAspectRatioEnabled : function ( +) +{ + return false; +}, + +/** + * @method onPlayEvent + * @param {int} arg0 + */ +onPlayEvent : function ( +int +) +{ +}, + +/** + * @method isFullScreenEnabled + * @return {bool} + */ +isFullScreenEnabled : function ( +) +{ + return false; +}, + +/** + * @method isPlaying + * @return {bool} + */ +isPlaying : function ( +) +{ + return false; +}, + +/** + * @method seekTo + * @param {float} arg0 + */ +seekTo : function ( +float +) +{ +}, + +/** + * @method create + * @return {cc.experimental::ui::VideoPlayer} + */ +create : function ( +) +{ + return cc.experimental::ui::VideoPlayer; +}, + +/** + * @method VideoPlayer + * @constructor + */ +VideoPlayer : function ( +) +{ +}, + +}; diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index 671517ebd0..545aa3cd07 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -32979,6 +32979,28 @@ bool js_cocos2dx_GLProgramState_getVertexAttribsFlags(JSContext *cx, uint32_t ar JS_ReportError(cx, "js_cocos2dx_GLProgramState_getVertexAttribsFlags : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_GLProgramState_applyAutoBinding(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_applyAutoBinding : Invalid Native Object"); + if (argc == 2) { + std::string arg0; + std::string arg1; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + ok &= jsval_to_std_string(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_applyAutoBinding : Error processing arguments"); + cobj->applyAutoBinding(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_applyAutoBinding : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} bool js_cocos2dx_GLProgramState_setUniformVec2(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -33133,6 +33155,31 @@ bool js_cocos2dx_GLProgramState_apply(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_GLProgramState_apply : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_GLProgramState_getNodeBinding(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_getNodeBinding : Invalid Native Object"); + if (argc == 0) { + cocos2d::Node* ret = cobj->getNodeBinding(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_getNodeBinding : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_GLProgramState_applyGLProgram(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -33153,6 +33200,34 @@ bool js_cocos2dx_GLProgramState_applyGLProgram(JSContext *cx, uint32_t argc, jsv JS_ReportError(cx, "js_cocos2dx_GLProgramState_applyGLProgram : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_GLProgramState_setNodeBinding(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setNodeBinding : Invalid Native Object"); + if (argc == 1) { + cocos2d::Node* arg0; + do { + if (args.get(0).isNull()) { arg0 = nullptr; break; } + if (!args.get(0).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(0).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::Node*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_setNodeBinding : Error processing arguments"); + cobj->setNodeBinding(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setNodeBinding : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_GLProgramState_setUniformInt(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -33195,6 +33270,28 @@ bool js_cocos2dx_GLProgramState_setUniformInt(JSContext *cx, uint32_t argc, jsva JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformInt : wrong number of arguments"); return false; } +bool js_cocos2dx_GLProgramState_setParameterAutoBinding(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setParameterAutoBinding : Invalid Native Object"); + if (argc == 2) { + std::string arg0; + std::string arg1; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + ok &= jsval_to_std_string(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_setParameterAutoBinding : Error processing arguments"); + cobj->setParameterAutoBinding(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setParameterAutoBinding : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} bool js_cocos2dx_GLProgramState_setUniformVec2v(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -33845,12 +33942,16 @@ void js_register_cocos2dx_GLProgramState(JSContext *cx, JS::HandleObject global) static JSFunctionSpec funcs[] = { JS_FN("setUniformCallback", js_cocos2dx_GLProgramState_setUniformCallback, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getVertexAttribsFlags", js_cocos2dx_GLProgramState_getVertexAttribsFlags, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("applyAutoBinding", js_cocos2dx_GLProgramState_applyAutoBinding, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setUniformVec2", js_cocos2dx_GLProgramState_setUniformVec2, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setUniformVec3", js_cocos2dx_GLProgramState_setUniformVec3, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setVertexAttribCallback", js_cocos2dx_GLProgramState_setVertexAttribCallback, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("apply", js_cocos2dx_GLProgramState_apply, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getNodeBinding", js_cocos2dx_GLProgramState_getNodeBinding, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("applyGLProgram", js_cocos2dx_GLProgramState_applyGLProgram, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setNodeBinding", js_cocos2dx_GLProgramState_setNodeBinding, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setUniformInt", js_cocos2dx_GLProgramState_setUniformInt, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setParameterAutoBinding", js_cocos2dx_GLProgramState_setParameterAutoBinding, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setUniformVec2v", js_cocos2dx_GLProgramState_setUniformVec2v, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getUniformCount", js_cocos2dx_GLProgramState_getUniformCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("applyAttributes", js_cocos2dx_GLProgramState_applyAttributes, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp index ceaaf23407..1a0c5560e6 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp @@ -2044,12 +2044,16 @@ void js_register_cocos2dx_GLProgramState(JSContext *cx, JS::HandleObject global) void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); bool js_cocos2dx_GLProgramState_setUniformCallback(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLProgramState_getVertexAttribsFlags(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_applyAutoBinding(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLProgramState_setUniformVec2(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLProgramState_setUniformVec3(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLProgramState_setVertexAttribCallback(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLProgramState_apply(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_getNodeBinding(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLProgramState_applyGLProgram(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setNodeBinding(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLProgramState_setUniformInt(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setParameterAutoBinding(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLProgramState_setUniformVec2v(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLProgramState_getUniformCount(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLProgramState_applyAttributes(JSContext *cx, uint32_t argc, jsval *vp); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp new file mode 100644 index 0000000000..6e506261a7 --- /dev/null +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp @@ -0,0 +1,455 @@ +#include "jsb_cocos2dx_experimental_video_auto.hpp" +#include "cocos2d_specifics.hpp" +#include "UIVideoPlayer.h" + +template +static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedValue initializing(cx); + bool isNewValid = true; + JS::RootedObject global(cx, ScriptingCore::getInstance()->getGlobalObject()); + isNewValid = JS_GetProperty(cx, global, "initializing", &initializing) && initializing.toBoolean(); + if (isNewValid) + { + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject _tmp(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + + args.rval().set(OBJECT_TO_JSVAL(_tmp)); + return true; + } + + JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference."); + return false; +} + +static bool empty_constructor(JSContext *cx, uint32_t argc, jsval *vp) { + return false; +} + +static bool js_is_native_obj(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + args.rval().setBoolean(true); + return true; +} +JSClass *jsb_cocos2d_experimental_ui_VideoPlayer_class; +JSObject *jsb_cocos2d_experimental_ui_VideoPlayer_prototype; + +bool js_cocos2dx_experimental_video_VideoPlayer_getFileName(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::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_getFileName : Invalid Native Object"); + if (argc == 0) { + const std::string& ret = cobj->getFileName(); + jsval jsret = JSVAL_NULL; + jsret = std_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_getFileName : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_getURL(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::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_getURL : Invalid Native Object"); + if (argc == 0) { + const std::string& ret = cobj->getURL(); + jsval jsret = JSVAL_NULL; + jsret = std_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_getURL : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_play(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::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_play : Invalid Native Object"); + if (argc == 0) { + cobj->play(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_play : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_pause(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::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_pause : Invalid Native Object"); + if (argc == 0) { + cobj->pause(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_pause : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled(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::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled : Error processing arguments"); + cobj->setKeepAspectRatioEnabled(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_resume(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::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_resume : Invalid Native Object"); + if (argc == 0) { + cobj->resume(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_resume : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_stop(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::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_stop : Invalid Native Object"); + if (argc == 0) { + cobj->stop(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_stop : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_setFullScreenEnabled(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::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setFullScreenEnabled : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setFullScreenEnabled : Error processing arguments"); + cobj->setFullScreenEnabled(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_setFullScreenEnabled : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_setFileName(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::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setFileName : 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_video_VideoPlayer_setFileName : Error processing arguments"); + cobj->setFileName(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_setFileName : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_setURL(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::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setURL : 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_video_VideoPlayer_setURL : Error processing arguments"); + cobj->setURL(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_setURL : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled(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::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->isKeepAspectRatioEnabled(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_onPlayEvent(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::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_onPlayEvent : Invalid Native Object"); + if (argc == 1) { + int arg0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_onPlayEvent : Error processing arguments"); + cobj->onPlayEvent(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_onPlayEvent : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled(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::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->isFullScreenEnabled(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_isPlaying(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::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_isPlaying : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->isPlaying(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_isPlaying : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_seekTo(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::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_seekTo : Invalid Native Object"); + if (argc == 1) { + double arg0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_seekTo : Error processing arguments"); + cobj->seekTo(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_seekTo : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_experimental_video_VideoPlayer_create(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + if (argc == 0) { + cocos2d::experimental::ui::VideoPlayer* ret = cocos2d::experimental::ui::VideoPlayer::create(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::experimental::ui::VideoPlayer*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_create : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_experimental_video_VideoPlayer_constructor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + cocos2d::experimental::ui::VideoPlayer* cobj = new (std::nothrow) cocos2d::experimental::ui::VideoPlayer(); + cocos2d::Ref *_ccobj = dynamic_cast(cobj); + if (_ccobj) { + _ccobj->autorelease(); + } + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + // JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto); + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + args.rval().set(OBJECT_TO_JSVAL(obj)); + // link the native object with the javascript object + js_proxy_t* p = jsb_new_proxy(cobj, obj); + AddNamedObjectRoot(cx, &p->obj, "cocos2d::experimental::ui::VideoPlayer"); + if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok) + ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args); + return true; +} + + +extern JSObject *jsb_cocos2d_ui_Widget_prototype; + +void js_cocos2d_experimental_ui_VideoPlayer_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (VideoPlayer)", obj); +} + +void js_register_cocos2dx_experimental_video_VideoPlayer(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_experimental_ui_VideoPlayer_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_experimental_ui_VideoPlayer_class->name = "VideoPlayer"; + jsb_cocos2d_experimental_ui_VideoPlayer_class->addProperty = JS_PropertyStub; + jsb_cocos2d_experimental_ui_VideoPlayer_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_experimental_ui_VideoPlayer_class->getProperty = JS_PropertyStub; + jsb_cocos2d_experimental_ui_VideoPlayer_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_experimental_ui_VideoPlayer_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_experimental_ui_VideoPlayer_class->resolve = JS_ResolveStub; + jsb_cocos2d_experimental_ui_VideoPlayer_class->convert = JS_ConvertStub; + jsb_cocos2d_experimental_ui_VideoPlayer_class->finalize = js_cocos2d_experimental_ui_VideoPlayer_finalize; + jsb_cocos2d_experimental_ui_VideoPlayer_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("getFileName", js_cocos2dx_experimental_video_VideoPlayer_getFileName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getURL", js_cocos2dx_experimental_video_VideoPlayer_getURL, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("play", js_cocos2dx_experimental_video_VideoPlayer_play, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("pause", js_cocos2dx_experimental_video_VideoPlayer_pause, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setKeepAspectRatioEnabled", js_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("resume", js_cocos2dx_experimental_video_VideoPlayer_resume, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("stop", js_cocos2dx_experimental_video_VideoPlayer_stop, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setFullScreenEnabled", js_cocos2dx_experimental_video_VideoPlayer_setFullScreenEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setFileName", js_cocos2dx_experimental_video_VideoPlayer_setFileName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setURL", js_cocos2dx_experimental_video_VideoPlayer_setURL, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("isKeepAspectRatioEnabled", js_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("onPlayEvent", js_cocos2dx_experimental_video_VideoPlayer_onPlayEvent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("isFullScreenEnabled", js_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("isPlaying", js_cocos2dx_experimental_video_VideoPlayer_isPlaying, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("seekTo", js_cocos2dx_experimental_video_VideoPlayer_seekTo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("create", js_cocos2dx_experimental_video_VideoPlayer_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_experimental_ui_VideoPlayer_prototype = JS_InitClass( + cx, global, + JS::RootedObject(cx, jsb_cocos2d_ui_Widget_prototype), + jsb_cocos2d_experimental_ui_VideoPlayer_class, + js_cocos2dx_experimental_video_VideoPlayer_constructor, 0, // constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "VideoPlayer", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_experimental_ui_VideoPlayer_class; + p->proto = jsb_cocos2d_experimental_ui_VideoPlayer_prototype; + p->parentProto = jsb_cocos2d_ui_Widget_prototype; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +void register_all_cocos2dx_experimental_video(JSContext* cx, JS::HandleObject obj) { + // Get the ns + JS::RootedObject ns(cx); + get_or_create_js_obj(cx, obj, "ccui", &ns); + + js_register_cocos2dx_experimental_video_VideoPlayer(cx, ns); +} + diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.hpp new file mode 100644 index 0000000000..aa206d254a --- /dev/null +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.hpp @@ -0,0 +1,33 @@ +#ifndef __cocos2dx_experimental_video_h__ +#define __cocos2dx_experimental_video_h__ + +#include "jsapi.h" +#include "jsfriendapi.h" + + +extern JSClass *jsb_cocos2d_experimental_ui_VideoPlayer_class; +extern JSObject *jsb_cocos2d_experimental_ui_VideoPlayer_prototype; + +bool js_cocos2dx_experimental_video_VideoPlayer_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_experimental_video_VideoPlayer_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_experimental_video_VideoPlayer(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx_experimental_video(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_experimental_video_VideoPlayer_getFileName(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_getURL(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_play(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_pause(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_resume(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_stop(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_setFullScreenEnabled(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_setFileName(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_setURL(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_onPlayEvent(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_isPlaying(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_seekTo(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_create(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_video_VideoPlayer_VideoPlayer(JSContext *cx, uint32_t argc, jsval *vp); +#endif + diff --git a/cocos/scripting/lua-bindings/auto/api/GLProgramState.lua b/cocos/scripting/lua-bindings/auto/api/GLProgramState.lua index 3019ac3e3f..fe4782a99f 100644 --- a/cocos/scripting/lua-bindings/auto/api/GLProgramState.lua +++ b/cocos/scripting/lua-bindings/auto/api/GLProgramState.lua @@ -19,6 +19,16 @@ -- @param #vec4_table value -- @return GLProgramState#GLProgramState self (return value: cc.GLProgramState) +-------------------------------- +-- Applies the specified custom auto-binding.
+-- param uniformName Name of the shader uniform.
+-- param autoBinding Name of the auto binding. +-- @function [parent=#GLProgramState] applyAutoBinding +-- @param self +-- @param #string uniformName +-- @param #string autoBinding +-- @return GLProgramState#GLProgramState self (return value: cc.GLProgramState) + -------------------------------- -- @overload self, int, vec2_table -- @overload self, string, vec2_table @@ -45,6 +55,12 @@ -- @param #mat4_table modelView -- @return GLProgramState#GLProgramState self (return value: cc.GLProgramState) +-------------------------------- +-- Returns the Node bound to the GLProgramState +-- @function [parent=#GLProgramState] getNodeBinding +-- @param self +-- @return Node#Node ret (return value: cc.Node) + -------------------------------- -- @overload self, int, long, vec4_table -- @overload self, string, long, vec4_table @@ -63,6 +79,17 @@ -- @param #mat4_table modelView -- @return GLProgramState#GLProgramState self (return value: cc.GLProgramState) +-------------------------------- +-- Sets the node that this render state is bound to.
+-- The specified node is used to apply auto-bindings for the render state.
+-- This is typically set to the node of the model that a material is
+-- applied to.
+-- param node The node to use for applying auto-bindings. +-- @function [parent=#GLProgramState] setNodeBinding +-- @param self +-- @param #cc.Node node +-- @return GLProgramState#GLProgramState self (return value: cc.GLProgramState) + -------------------------------- -- @overload self, int, int -- @overload self, string, int @@ -72,6 +99,19 @@ -- @param #int value -- @return GLProgramState#GLProgramState self (return value: cc.GLProgramState) +-------------------------------- +-- Sets a uniform auto-binding.
+-- This method parses the passed in autoBinding string and attempts to convert it
+-- to an enumeration value. If it matches to one of the predefined strings, it will create a
+-- callback to get the correct value at runtime.
+-- param name The name of the material parameter to store an auto-binding for.
+-- param autoBinding A string matching one of the built-in AutoBinding enum constants. +-- @function [parent=#GLProgramState] setParameterAutoBinding +-- @param self +-- @param #string uniformName +-- @param #string autoBinding +-- @return GLProgramState#GLProgramState self (return value: cc.GLProgramState) + -------------------------------- -- @overload self, int, long, vec2_table -- @overload self, string, long, vec2_table diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 97e3796024..84ff90b5f7 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -43926,6 +43926,59 @@ int lua_cocos2dx_GLProgramState_setUniformVec4(lua_State* tolua_S) return 0; } +int lua_cocos2dx_GLProgramState_applyAutoBinding(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyAutoBinding'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + std::string arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:applyAutoBinding"); + + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.GLProgramState:applyAutoBinding"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_applyAutoBinding'", nullptr); + return 0; + } + cobj->applyAutoBinding(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:applyAutoBinding",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyAutoBinding'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_GLProgramState_setUniformVec2(lua_State* tolua_S) { int argc = 0; @@ -44102,6 +44155,53 @@ int lua_cocos2dx_GLProgramState_apply(lua_State* tolua_S) return 0; } +int lua_cocos2dx_GLProgramState_getNodeBinding(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getNodeBinding'", 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_GLProgramState_getNodeBinding'", nullptr); + return 0; + } + cocos2d::Node* ret = cobj->getNodeBinding(); + object_to_luaval(tolua_S, "cc.Node",(cocos2d::Node*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:getNodeBinding",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getNodeBinding'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_GLProgramState_setUniformVec4v(lua_State* tolua_S) { int argc = 0; @@ -44223,6 +44323,56 @@ int lua_cocos2dx_GLProgramState_applyGLProgram(lua_State* tolua_S) return 0; } +int lua_cocos2dx_GLProgramState_setNodeBinding(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setNodeBinding'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Node* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.GLProgramState:setNodeBinding"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_setNodeBinding'", nullptr); + return 0; + } + cobj->setNodeBinding(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setNodeBinding",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setNodeBinding'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_GLProgramState_setUniformInt(lua_State* tolua_S) { int argc = 0; @@ -44286,6 +44436,59 @@ int lua_cocos2dx_GLProgramState_setUniformInt(lua_State* tolua_S) return 0; } +int lua_cocos2dx_GLProgramState_setParameterAutoBinding(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setParameterAutoBinding'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + std::string arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setParameterAutoBinding"); + + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.GLProgramState:setParameterAutoBinding"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_setParameterAutoBinding'", nullptr); + return 0; + } + cobj->setParameterAutoBinding(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setParameterAutoBinding",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setParameterAutoBinding'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_GLProgramState_setUniformVec2v(lua_State* tolua_S) { int argc = 0; @@ -45230,12 +45433,16 @@ int lua_register_cocos2dx_GLProgramState(lua_State* tolua_S) tolua_beginmodule(tolua_S,"GLProgramState"); tolua_function(tolua_S,"getVertexAttribsFlags",lua_cocos2dx_GLProgramState_getVertexAttribsFlags); tolua_function(tolua_S,"setUniformVec4",lua_cocos2dx_GLProgramState_setUniformVec4); + tolua_function(tolua_S,"applyAutoBinding",lua_cocos2dx_GLProgramState_applyAutoBinding); tolua_function(tolua_S,"setUniformVec2",lua_cocos2dx_GLProgramState_setUniformVec2); tolua_function(tolua_S,"setUniformVec3",lua_cocos2dx_GLProgramState_setUniformVec3); tolua_function(tolua_S,"apply",lua_cocos2dx_GLProgramState_apply); + tolua_function(tolua_S,"getNodeBinding",lua_cocos2dx_GLProgramState_getNodeBinding); tolua_function(tolua_S,"setUniformVec4v",lua_cocos2dx_GLProgramState_setUniformVec4v); tolua_function(tolua_S,"applyGLProgram",lua_cocos2dx_GLProgramState_applyGLProgram); + tolua_function(tolua_S,"setNodeBinding",lua_cocos2dx_GLProgramState_setNodeBinding); tolua_function(tolua_S,"setUniformInt",lua_cocos2dx_GLProgramState_setUniformInt); + tolua_function(tolua_S,"setParameterAutoBinding",lua_cocos2dx_GLProgramState_setParameterAutoBinding); tolua_function(tolua_S,"setUniformVec2v",lua_cocos2dx_GLProgramState_setUniformVec2v); tolua_function(tolua_S,"getUniformCount",lua_cocos2dx_GLProgramState_getUniformCount); tolua_function(tolua_S,"applyAttributes",lua_cocos2dx_GLProgramState_applyAttributes); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index 9d2d5fe682..b0e49095a4 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -2043,6 +2043,10 @@ int register_all_cocos2dx(lua_State* tolua_S); + + + +