From c6936d877a82e7bdbd41272e48fc335dc15007ff Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 4 Mar 2014 09:12:51 +0000 Subject: [PATCH] [AUTO] : updating jsbinding automatically --- .../auto/api/jsb_cocos2dx_auto_api.js | 108 +++---- .../bindings/auto/jsb_cocos2dx_auto.cpp | 282 +++++++++--------- .../bindings/auto/jsb_cocos2dx_auto.hpp | 12 +- 3 files changed, 201 insertions(+), 201 deletions(-) diff --git a/frameworks/js-bindings/bindings/auto/api/jsb_cocos2dx_auto_api.js b/frameworks/js-bindings/bindings/auto/api/jsb_cocos2dx_auto_api.js index 9c776e9451..d7ad21c9e2 100644 --- a/frameworks/js-bindings/bindings/auto/api/jsb_cocos2dx_auto_api.js +++ b/frameworks/js-bindings/bindings/auto/api/jsb_cocos2dx_auto_api.js @@ -1116,6 +1116,14 @@ bool { }, +/** + * @method removeAllEventListeners + */ +removeAllEventListeners : function ( +) +{ +}, + /** * @method addEventListenerWithSceneGraphPriority * @param {cc.EventListener} arg0 @@ -1138,6 +1146,20 @@ bool { }, +/** + * @method addCustomEventListener + * @param {String} arg0 + * @param {function} arg1 + * @return {cc.EventListenerCustom} + */ +addCustomEventListener : function ( +str, +func +) +{ + return cc.EventListenerCustom; +}, + /** * @method addEventListenerWithFixedPriority * @param {cc.EventListener} arg0 @@ -1151,11 +1173,11 @@ int }, /** - * @method removeEventListener - * @param {cc.EventListener} arg0 + * @method removeEventListenersForType + * @param {cc.EventListener::Type} arg0 */ -removeEventListener : function ( -eventlistener +removeEventListenersForType : function ( +type ) { }, @@ -1208,20 +1230,6 @@ int { }, -/** - * @method addCustomEventListener - * @param {String} arg0 - * @param {function} arg1 - * @return {cc.EventListenerCustom} - */ -addCustomEventListener : function ( -str, -func -) -{ - return cc.EventListenerCustom; -}, - /** * @method dispatchEvent * @param {cc.Event} arg0 @@ -1232,14 +1240,6 @@ event { }, -/** - * @method removeAllEventListeners - */ -removeAllEventListeners : function ( -) -{ -}, - /** * @method removeCustomEventListeners * @param {String} arg0 @@ -1251,23 +1251,23 @@ str }, /** - * @method isEnabled - * @return {bool} + * @method removeEventListener + * @param {cc.EventListener} arg0 */ -isEnabled : function ( +removeEventListener : function ( +eventlistener ) { - return false; }, /** - * @method removeEventListenersForType - * @param {cc.EventListener::Type} arg0 + * @method isEnabled + * @return {bool} */ -removeEventListenersForType : function ( -type +isEnabled : function ( ) { + return false; }, /** @@ -1432,16 +1432,6 @@ float { }, -/** - * @method setLocalZOrder - * @param {int} arg0 - */ -setLocalZOrder : function ( -int -) -{ -}, - /** * @method setScaleZ * @param {float} arg0 @@ -1906,16 +1896,6 @@ getRotation : function ( return 0; }, -/** - * @method getLocalZOrder - * @return {int} - */ -getLocalZOrder : function ( -) -{ - return 0; -}, - /** * @method getAnchorPointInPoints * @return {PointObject} @@ -2018,6 +1998,16 @@ getDisplayedOpacity : function ( return 0; }, +/** + * @method getLocalZOrder + * @return {int} + */ +getLocalZOrder : function ( +) +{ + return 0; +}, + /** * @method getScheduler * @return {cc.Scheduler|cc.Scheduler} @@ -2257,6 +2247,16 @@ getScaleX : function ( return 0; }, +/** + * @method setLocalZOrder + * @param {int} arg0 + */ +setLocalZOrder : function ( +int +) +{ +}, + /** * @method getWorldToNodeAffineTransform * @return {cc.AffineTransform} diff --git a/frameworks/js-bindings/bindings/auto/jsb_cocos2dx_auto.cpp b/frameworks/js-bindings/bindings/auto/jsb_cocos2dx_auto.cpp index e324372942..9aa25c12d6 100644 --- a/frameworks/js-bindings/bindings/auto/jsb_cocos2dx_auto.cpp +++ b/frameworks/js-bindings/bindings/auto/jsb_cocos2dx_auto.cpp @@ -2986,6 +2986,21 @@ bool js_cocos2dx_EventDispatcher_pauseEventListenersForTarget(JSContext *cx, uin JS_ReportError(cx, "js_cocos2dx_EventDispatcher_pauseEventListenersForTarget : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_EventDispatcher_removeAllEventListeners(JSContext *cx, uint32_t argc, jsval *vp) +{ + JSObject *obj = JS_THIS_OBJECT(cx, vp); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::EventDispatcher* cobj = (cocos2d::EventDispatcher *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_EventDispatcher_removeAllEventListeners : Invalid Native Object"); + if (argc == 0) { + cobj->removeAllEventListeners(); + JS_SET_RVAL(cx, vp, JSVAL_VOID); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_EventDispatcher_removeAllEventListeners : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority(JSContext *cx, uint32_t argc, jsval *vp) { jsval *argv = JS_ARGV(cx, vp); @@ -3042,6 +3057,57 @@ bool js_cocos2dx_EventDispatcher_setEnabled(JSContext *cx, uint32_t argc, jsval JS_ReportError(cx, "js_cocos2dx_EventDispatcher_setEnabled : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_EventDispatcher_addCustomEventListener(JSContext *cx, uint32_t argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + bool ok = true; + JSObject *obj = JS_THIS_OBJECT(cx, vp); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::EventDispatcher* cobj = (cocos2d::EventDispatcher *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_EventDispatcher_addCustomEventListener : Invalid Native Object"); + if (argc == 2) { + std::string arg0; + std::function arg1; + ok &= jsval_to_std_string(cx, argv[0], &arg0); + do { + std::shared_ptr func(new JSFunctionWrapper(cx, JS_THIS_OBJECT(cx, vp), argv[1])); + auto lambda = [=](cocos2d::EventCustom* larg0) -> void { + jsval largv[1]; + do { + if (larg0) { + js_proxy_t *proxy = js_get_or_create_proxy(cx, (cocos2d::EventCustom*)larg0); + largv[0] = OBJECT_TO_JSVAL(proxy->obj); + } else { + largv[0] = JSVAL_NULL; + } + } while (0); + jsval rval; + bool ok = func->invoke(1, &largv[0], rval); + if (!ok && JS_IsExceptionPending(cx)) { + JS_ReportPendingException(cx); + } + }; + arg1 = lambda; + } while(0) + ; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventDispatcher_addCustomEventListener : Error processing arguments"); + cocos2d::EventListenerCustom* ret = cobj->addCustomEventListener(arg0, arg1); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *proxy = js_get_or_create_proxy(cx, (cocos2d::EventListenerCustom*)ret); + jsret = OBJECT_TO_JSVAL(proxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + JS_SET_RVAL(cx, vp, jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_EventDispatcher_addCustomEventListener : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} bool js_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority(JSContext *cx, uint32_t argc, jsval *vp) { jsval *argv = JS_ARGV(cx, vp); @@ -3071,31 +3137,24 @@ bool js_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority(JSContext *cx JS_ReportError(cx, "js_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority : wrong number of arguments: %d, was expecting %d", argc, 2); return false; } -bool js_cocos2dx_EventDispatcher_removeEventListener(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_EventDispatcher_removeEventListenersForType(JSContext *cx, uint32_t argc, jsval *vp) { jsval *argv = JS_ARGV(cx, vp); bool ok = true; JSObject *obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); cocos2d::EventDispatcher* cobj = (cocos2d::EventDispatcher *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_EventDispatcher_removeEventListener : Invalid Native Object"); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_EventDispatcher_removeEventListenersForType : Invalid Native Object"); if (argc == 1) { - cocos2d::EventListener* arg0; - do { - if (!argv[0].isObject()) { ok = false; break; } - js_proxy_t *proxy; - JSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]); - proxy = jsb_get_js_proxy(tmpObj); - arg0 = (cocos2d::EventListener*)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventDispatcher_removeEventListener : Error processing arguments"); - cobj->removeEventListener(arg0); + cocos2d::EventListener::Type arg0; + ok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventDispatcher_removeEventListenersForType : Error processing arguments"); + cobj->removeEventListenersForType(arg0); JS_SET_RVAL(cx, vp, JSVAL_VOID); return true; } - JS_ReportError(cx, "js_cocos2dx_EventDispatcher_removeEventListener : wrong number of arguments: %d, was expecting %d", argc, 1); + JS_ReportError(cx, "js_cocos2dx_EventDispatcher_removeEventListenersForType : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } bool js_cocos2dx_EventDispatcher_dispatchCustomEvent(JSContext *cx, uint32_t argc, jsval *vp) @@ -3245,57 +3304,6 @@ bool js_cocos2dx_EventDispatcher_setPriority(JSContext *cx, uint32_t argc, jsval JS_ReportError(cx, "js_cocos2dx_EventDispatcher_setPriority : wrong number of arguments: %d, was expecting %d", argc, 2); return false; } -bool js_cocos2dx_EventDispatcher_addCustomEventListener(JSContext *cx, uint32_t argc, jsval *vp) -{ - jsval *argv = JS_ARGV(cx, vp); - bool ok = true; - JSObject *obj = JS_THIS_OBJECT(cx, vp); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::EventDispatcher* cobj = (cocos2d::EventDispatcher *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_EventDispatcher_addCustomEventListener : Invalid Native Object"); - if (argc == 2) { - std::string arg0; - std::function arg1; - ok &= jsval_to_std_string(cx, argv[0], &arg0); - do { - std::shared_ptr func(new JSFunctionWrapper(cx, JS_THIS_OBJECT(cx, vp), argv[1])); - auto lambda = [=](cocos2d::EventCustom* larg0) -> void { - jsval largv[1]; - do { - if (larg0) { - js_proxy_t *proxy = js_get_or_create_proxy(cx, (cocos2d::EventCustom*)larg0); - largv[0] = OBJECT_TO_JSVAL(proxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); - jsval rval; - bool ok = func->invoke(1, &largv[0], rval); - if (!ok && JS_IsExceptionPending(cx)) { - JS_ReportPendingException(cx); - } - }; - arg1 = lambda; - } while(0) - ; - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventDispatcher_addCustomEventListener : Error processing arguments"); - cocos2d::EventListenerCustom* ret = cobj->addCustomEventListener(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *proxy = js_get_or_create_proxy(cx, (cocos2d::EventListenerCustom*)ret); - jsret = OBJECT_TO_JSVAL(proxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - JS_SET_RVAL(cx, vp, jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_EventDispatcher_addCustomEventListener : wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} bool js_cocos2dx_EventDispatcher_dispatchEvent(JSContext *cx, uint32_t argc, jsval *vp) { jsval *argv = JS_ARGV(cx, vp); @@ -3323,39 +3331,51 @@ bool js_cocos2dx_EventDispatcher_dispatchEvent(JSContext *cx, uint32_t argc, jsv JS_ReportError(cx, "js_cocos2dx_EventDispatcher_dispatchEvent : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_EventDispatcher_removeAllEventListeners(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_EventDispatcher_removeCustomEventListeners(JSContext *cx, uint32_t argc, jsval *vp) { + jsval *argv = JS_ARGV(cx, vp); + bool ok = true; JSObject *obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); cocos2d::EventDispatcher* cobj = (cocos2d::EventDispatcher *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_EventDispatcher_removeAllEventListeners : Invalid Native Object"); - if (argc == 0) { - cobj->removeAllEventListeners(); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_EventDispatcher_removeCustomEventListeners : Invalid Native Object"); + if (argc == 1) { + std::string arg0; + ok &= jsval_to_std_string(cx, argv[0], &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventDispatcher_removeCustomEventListeners : Error processing arguments"); + cobj->removeCustomEventListeners(arg0); JS_SET_RVAL(cx, vp, JSVAL_VOID); return true; } - JS_ReportError(cx, "js_cocos2dx_EventDispatcher_removeAllEventListeners : wrong number of arguments: %d, was expecting %d", argc, 0); + JS_ReportError(cx, "js_cocos2dx_EventDispatcher_removeCustomEventListeners : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_EventDispatcher_removeCustomEventListeners(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_EventDispatcher_removeEventListener(JSContext *cx, uint32_t argc, jsval *vp) { jsval *argv = JS_ARGV(cx, vp); bool ok = true; JSObject *obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); cocos2d::EventDispatcher* cobj = (cocos2d::EventDispatcher *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_EventDispatcher_removeCustomEventListeners : Invalid Native Object"); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_EventDispatcher_removeEventListener : Invalid Native Object"); if (argc == 1) { - std::string arg0; - ok &= jsval_to_std_string(cx, argv[0], &arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventDispatcher_removeCustomEventListeners : Error processing arguments"); - cobj->removeCustomEventListeners(arg0); + cocos2d::EventListener* arg0; + do { + if (!argv[0].isObject()) { ok = false; break; } + js_proxy_t *proxy; + JSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]); + proxy = jsb_get_js_proxy(tmpObj); + arg0 = (cocos2d::EventListener*)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventDispatcher_removeEventListener : Error processing arguments"); + cobj->removeEventListener(arg0); JS_SET_RVAL(cx, vp, JSVAL_VOID); return true; } - JS_ReportError(cx, "js_cocos2dx_EventDispatcher_removeCustomEventListeners : wrong number of arguments: %d, was expecting %d", argc, 1); + JS_ReportError(cx, "js_cocos2dx_EventDispatcher_removeEventListener : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } bool js_cocos2dx_EventDispatcher_isEnabled(JSContext *cx, uint32_t argc, jsval *vp) @@ -3375,26 +3395,6 @@ bool js_cocos2dx_EventDispatcher_isEnabled(JSContext *cx, uint32_t argc, jsval * JS_ReportError(cx, "js_cocos2dx_EventDispatcher_isEnabled : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } -bool js_cocos2dx_EventDispatcher_removeEventListenersForType(JSContext *cx, uint32_t argc, jsval *vp) -{ - jsval *argv = JS_ARGV(cx, vp); - bool ok = true; - JSObject *obj = JS_THIS_OBJECT(cx, vp); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::EventDispatcher* cobj = (cocos2d::EventDispatcher *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_EventDispatcher_removeEventListenersForType : Invalid Native Object"); - if (argc == 1) { - cocos2d::EventListener::Type arg0; - ok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventDispatcher_removeEventListenersForType : Error processing arguments"); - cobj->removeEventListenersForType(arg0); - JS_SET_RVAL(cx, vp, JSVAL_VOID); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_EventDispatcher_removeEventListenersForType : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} bool js_cocos2dx_EventDispatcher_constructor(JSContext *cx, uint32_t argc, jsval *vp) { if (argc == 0) { @@ -3448,20 +3448,20 @@ void js_register_cocos2dx_EventDispatcher(JSContext *cx, JSObject *global) { static JSFunctionSpec funcs[] = { JS_FN("pauseEventListenersForTarget", js_cocos2dx_EventDispatcher_pauseEventListenersForTarget, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("removeAllListeners", js_cocos2dx_EventDispatcher_removeAllEventListeners, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("addEventListenerWithSceneGraphPriority", js_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setEnabled", js_cocos2dx_EventDispatcher_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("addCustomListener", js_cocos2dx_EventDispatcher_addCustomEventListener, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("addEventListenerWithFixedPriority", js_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("removeEventListener", js_cocos2dx_EventDispatcher_removeEventListener, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("removeListeners", js_cocos2dx_EventDispatcher_removeEventListenersForType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("dispatchCustomEvent", js_cocos2dx_EventDispatcher_dispatchCustomEvent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("resumeEventListenersForTarget", js_cocos2dx_EventDispatcher_resumeEventListenersForTarget, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("removeEventListenersForTarget", js_cocos2dx_EventDispatcher_removeEventListenersForTarget, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setPriority", js_cocos2dx_EventDispatcher_setPriority, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("addCustomEventListener", js_cocos2dx_EventDispatcher_addCustomEventListener, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("dispatchEvent", js_cocos2dx_EventDispatcher_dispatchEvent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("removeAllEventListeners", js_cocos2dx_EventDispatcher_removeAllEventListeners, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("removeCustomEventListeners", js_cocos2dx_EventDispatcher_removeCustomEventListeners, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("removeCustomListeners", js_cocos2dx_EventDispatcher_removeCustomEventListeners, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("removeListener", js_cocos2dx_EventDispatcher_removeEventListener, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("isEnabled", js_cocos2dx_EventDispatcher_isEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("removeEventListenersForType", js_cocos2dx_EventDispatcher_removeEventListenersForType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -3877,26 +3877,6 @@ bool js_cocos2dx_Node_setRotation(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_Node_setRotation : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_Node_setLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp) -{ - jsval *argv = JS_ARGV(cx, vp); - bool ok = true; - JSObject *obj = JS_THIS_OBJECT(cx, vp); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setLocalZOrder : Invalid Native Object"); - if (argc == 1) { - int arg0; - ok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setLocalZOrder : Error processing arguments"); - cobj->setLocalZOrder(arg0); - JS_SET_RVAL(cx, vp, JSVAL_VOID); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Node_setLocalZOrder : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} bool js_cocos2dx_Node_setScaleZ(JSContext *cx, uint32_t argc, jsval *vp) { jsval *argv = JS_ARGV(cx, vp); @@ -4871,23 +4851,6 @@ bool js_cocos2dx_Node_getRotation(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_Node_getRotation : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } -bool js_cocos2dx_Node_getLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp) -{ - JSObject *obj = JS_THIS_OBJECT(cx, vp); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_getLocalZOrder : Invalid Native Object"); - if (argc == 0) { - int ret = cobj->getLocalZOrder(); - jsval jsret = JSVAL_NULL; - jsret = int32_to_jsval(cx, ret); - JS_SET_RVAL(cx, vp, jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Node_getLocalZOrder : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} bool js_cocos2dx_Node_getAnchorPointInPoints(JSContext *cx, uint32_t argc, jsval *vp) { JSObject *obj = JS_THIS_OBJECT(cx, vp); @@ -5116,6 +5079,23 @@ bool js_cocos2dx_Node_getDisplayedOpacity(JSContext *cx, uint32_t argc, jsval *v JS_ReportError(cx, "js_cocos2dx_Node_getDisplayedOpacity : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_Node_getLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp) +{ + JSObject *obj = JS_THIS_OBJECT(cx, vp); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_getLocalZOrder : Invalid Native Object"); + if (argc == 0) { + int ret = cobj->getLocalZOrder(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + JS_SET_RVAL(cx, vp, jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Node_getLocalZOrder : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_Node_getScheduler(JSContext *cx, uint32_t argc, jsval *vp) { jsval *argv = JS_ARGV(cx, vp); @@ -5665,6 +5645,26 @@ bool js_cocos2dx_Node_getScaleX(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_Node_getScaleX : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_Node_setLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp) +{ + jsval *argv = JS_ARGV(cx, vp); + bool ok = true; + JSObject *obj = JS_THIS_OBJECT(cx, vp); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setLocalZOrder : Invalid Native Object"); + if (argc == 1) { + int arg0; + ok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setLocalZOrder : Error processing arguments"); + cobj->setLocalZOrder(arg0); + JS_SET_RVAL(cx, vp, JSVAL_VOID); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Node_setLocalZOrder : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_Node_getWorldToNodeAffineTransform(JSContext *cx, uint32_t argc, jsval *vp) { JSObject *obj = JS_THIS_OBJECT(cx, vp); @@ -6287,7 +6287,6 @@ void js_register_cocos2dx_Node(JSContext *cx, JSObject *global) { JS_FN("isIgnoreAnchorPointForPosition", js_cocos2dx_Node_isIgnoreAnchorPointForPosition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("updateDisplayedOpacity", js_cocos2dx_Node_updateDisplayedOpacity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setRotation", js_cocos2dx_Node_setRotation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setZOrder", js_cocos2dx_Node_setLocalZOrder, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setScaleZ", js_cocos2dx_Node_setScaleZ, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setScaleY", js_cocos2dx_Node_setScaleY, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setScaleX", js_cocos2dx_Node_setScaleX, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -6333,7 +6332,6 @@ void js_register_cocos2dx_Node(JSContext *cx, JSObject *global) { JS_FN("visit", js_cocos2dx_Node_visit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setShaderProgram", js_cocos2dx_Node_setShaderProgram, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getRotation", js_cocos2dx_Node_getRotation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getZOrder", js_cocos2dx_Node_getLocalZOrder, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getAnchorPointInPoints", js_cocos2dx_Node_getAnchorPointInPoints, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("runAction", js_cocos2dx_Node_runAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setScheduler", js_cocos2dx_Node_setScheduler, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -6344,6 +6342,7 @@ void js_register_cocos2dx_Node(JSContext *cx, JSObject *global) { JS_FN("getActionByTag", js_cocos2dx_Node_getActionByTag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setAdditionalTransform", js_cocos2dx_Node_setAdditionalTransform, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getDisplayedOpacity", js_cocos2dx_Node_getDisplayedOpacity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLocalZOrder", js_cocos2dx_Node_getLocalZOrder, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getScheduler", js_cocos2dx_Node_getScheduler, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getParentToNodeAffineTransform", js_cocos2dx_Node_getParentToNodeAffineTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getOrderOfArrival", js_cocos2dx_Node_getOrderOfArrival, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -6367,6 +6366,7 @@ void js_register_cocos2dx_Node(JSContext *cx, JSObject *global) { JS_FN("getScaleZ", js_cocos2dx_Node_getScaleZ, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getScaleY", js_cocos2dx_Node_getScaleY, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getScaleX", js_cocos2dx_Node_getScaleX, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setLocalZOrder", js_cocos2dx_Node_setLocalZOrder, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getWorldToNodeAffineTransform", js_cocos2dx_Node_getWorldToNodeAffineTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setCascadeColorEnabled", js_cocos2dx_Node_setCascadeColorEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setOpacity", js_cocos2dx_Node_setOpacity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), diff --git a/frameworks/js-bindings/bindings/auto/jsb_cocos2dx_auto.hpp b/frameworks/js-bindings/bindings/auto/jsb_cocos2dx_auto.hpp index 4686080848..15f6d2727f 100644 --- a/frameworks/js-bindings/bindings/auto/jsb_cocos2dx_auto.hpp +++ b/frameworks/js-bindings/bindings/auto/jsb_cocos2dx_auto.hpp @@ -195,20 +195,20 @@ void js_cocos2dx_EventDispatcher_finalize(JSContext *cx, JSObject *obj); void js_register_cocos2dx_EventDispatcher(JSContext *cx, JSObject *global); void register_all_cocos2dx(JSContext* cx, JSObject* obj); bool js_cocos2dx_EventDispatcher_pauseEventListenersForTarget(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_EventDispatcher_removeAllEventListeners(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_EventDispatcher_setEnabled(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_EventDispatcher_addCustomEventListener(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_EventDispatcher_removeEventListener(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_EventDispatcher_removeEventListenersForType(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_EventDispatcher_dispatchCustomEvent(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_EventDispatcher_resumeEventListenersForTarget(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_EventDispatcher_removeEventListenersForTarget(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_EventDispatcher_setPriority(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_EventDispatcher_addCustomEventListener(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_EventDispatcher_dispatchEvent(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_EventDispatcher_removeAllEventListeners(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_EventDispatcher_removeCustomEventListeners(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_EventDispatcher_removeEventListener(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_EventDispatcher_isEnabled(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_EventDispatcher_removeEventListenersForType(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_EventDispatcher_EventDispatcher(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_Node_class; @@ -232,7 +232,6 @@ bool js_cocos2dx_Node_convertToWorldSpaceAR(JSContext *cx, uint32_t argc, jsval bool js_cocos2dx_Node_isIgnoreAnchorPointForPosition(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_updateDisplayedOpacity(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_setRotation(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Node_setLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_setScaleZ(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_setScaleY(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_setScaleX(JSContext *cx, uint32_t argc, jsval *vp); @@ -278,7 +277,6 @@ bool js_cocos2dx_Node_addComponent(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_visit(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_setShaderProgram(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_getRotation(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Node_getLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_getAnchorPointInPoints(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_runAction(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_setScheduler(JSContext *cx, uint32_t argc, jsval *vp); @@ -289,6 +287,7 @@ bool js_cocos2dx_Node_getDisplayedColor(JSContext *cx, uint32_t argc, jsval *vp) bool js_cocos2dx_Node_getActionByTag(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_setAdditionalTransform(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_getDisplayedOpacity(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Node_getLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_getScheduler(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_getParentToNodeAffineTransform(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_getOrderOfArrival(JSContext *cx, uint32_t argc, jsval *vp); @@ -312,6 +311,7 @@ bool js_cocos2dx_Node_setOrderOfArrival(JSContext *cx, uint32_t argc, jsval *vp) bool js_cocos2dx_Node_getScaleZ(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_getScaleY(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_getScaleX(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Node_setLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_getWorldToNodeAffineTransform(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_setCascadeColorEnabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Node_setOpacity(JSContext *cx, uint32_t argc, jsval *vp);