mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-05 02:52:39 +08:00
Merge pull request #788 from dumganhar/jsb2.0
attachChild -> attachObject, detachChild -> detachObject, isSame -> strictEquals
This commit is contained in:
@@ -2396,7 +2396,7 @@ static bool js_cocos2dx_Node_setAfterVisitCallback(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Renderer* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -3555,7 +3555,7 @@ static bool js_cocos2dx_Node_setBeforeVisitCallback(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Renderer* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -4238,7 +4238,7 @@ static bool js_cocos2dx_Node_enumerateChildren(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[1]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Node* larg0) -> bool {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -9114,7 +9114,7 @@ static bool js_cocos2dx_EventListenerAcceleration_init(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Acceleration* larg0, cocos2d::Event* larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -10791,7 +10791,7 @@ static bool js_cocos2dx_GLProgramState_setUniformCallback(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[1]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::GLProgram* larg0, cocos2d::Uniform* larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -10834,7 +10834,7 @@ static bool js_cocos2dx_GLProgramState_setUniformCallback(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[1]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::GLProgram* larg0, cocos2d::Uniform* larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -11002,7 +11002,7 @@ static bool js_cocos2dx_GLProgramState_setVertexAttribCallback(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[1]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::VertexAttrib* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -23507,7 +23507,7 @@ static bool js_cocos2dx_MenuItem_initWithCallback(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -23608,7 +23608,7 @@ static bool js_cocos2dx_MenuItem_setCallback(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -23829,7 +23829,7 @@ static bool js_cocos2dx_MenuItemLabel_initWithLabel(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[1]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -23988,7 +23988,7 @@ static bool js_cocos2dx_MenuItemAtlasFont_initWithString(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[5]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -24152,7 +24152,7 @@ static bool js_cocos2dx_MenuItemFont_initWithString(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[1]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -24428,7 +24428,7 @@ static bool js_cocos2dx_MenuItemSprite_initWithNormalSprite(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[3]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -24712,7 +24712,7 @@ static bool js_cocos2dx_MenuItemImage_initWithNormalImage(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[3]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
|
||||
@@ -4400,7 +4400,7 @@ static bool js_cocos2dx_dragonbones_CCArmatureDisplay_setEventCallback(se::State
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](dragonBones::EventObject* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -4465,7 +4465,7 @@ static bool js_cocos2dx_dragonbones_CCArmatureDisplay_addEvent(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[1]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](dragonBones::EventObject* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
|
||||
@@ -235,7 +235,7 @@ static bool js_cocos2dx_experimental_video_VideoPlayer_addEventListener(se::Stat
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0, cocos2d::experimental::ui::VideoPlayer::EventType larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
|
||||
@@ -20,7 +20,7 @@ static bool js_cocos2dx_experimental_webView_WebView_setOnShouldStartLoading(se:
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::experimental::ui::WebView* larg0, const std::basic_string<char> & larg1) -> bool {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -73,7 +73,7 @@ static bool js_cocos2dx_experimental_webView_WebView_setOnDidFailLoading(se::Sta
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::experimental::ui::WebView* larg0, const std::basic_string<char> & larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -311,7 +311,7 @@ static bool js_cocos2dx_experimental_webView_WebView_setOnJSCallback(se::State&
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::experimental::ui::WebView* larg0, const std::basic_string<char> & larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -488,7 +488,7 @@ static bool js_cocos2dx_experimental_webView_WebView_setOnDidFinishLoading(se::S
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::experimental::ui::WebView* larg0, const std::basic_string<char> & larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
|
||||
@@ -753,7 +753,7 @@ static bool js_cocos2dx_extension_AssetsManagerEx_setVerifyCallback(se::State& s
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](const std::basic_string<char> & larg0, cocos2d::extension::ManifestAsset larg1) -> bool {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -839,7 +839,7 @@ static bool js_cocos2dx_extension_AssetsManagerEx_setVersionCompareHandle(se::St
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](const std::basic_string<char> & larg0, const std::basic_string<char> & larg1) -> int {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -1082,7 +1082,7 @@ static bool js_cocos2dx_extension_AssetsManagerEx_constructor(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[2]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](const std::basic_string<char> & larg0, const std::basic_string<char> & larg1) -> int {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -1205,7 +1205,7 @@ static bool js_cocos2dx_extension_EventListenerAssetsManagerEx_init(se::State& s
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[1]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::extension::EventAssetsManagerEx* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
|
||||
@@ -19,7 +19,7 @@ static bool js_cocos2dx_network_Downloader_setOnTaskError(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](const cocos2d::network::DownloadTask & larg0, int larg1, int larg2, const std::basic_string<char> & larg3) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -70,7 +70,7 @@ static bool js_cocos2dx_network_Downloader_setOnTaskProgress(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](const cocos2d::network::DownloadTask & larg0, long long larg1, long long larg2, long long larg3) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -157,7 +157,7 @@ static bool js_cocos2dx_network_Downloader_setOnFileTaskSuccess(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](const cocos2d::network::DownloadTask & larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
|
||||
@@ -882,7 +882,7 @@ static bool js_cocos2dx_spine_SkeletonAnimation_setDisposeListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](spTrackEntry* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -950,7 +950,7 @@ static bool js_cocos2dx_spine_SkeletonAnimation_setEndListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](spTrackEntry* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -1016,7 +1016,7 @@ static bool js_cocos2dx_spine_SkeletonAnimation_setCompleteListener(se::State& s
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](spTrackEntry* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -1091,7 +1091,7 @@ static bool js_cocos2dx_spine_SkeletonAnimation_setEventListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](spTrackEntry* larg0, spEvent* larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -1163,7 +1163,7 @@ static bool js_cocos2dx_spine_SkeletonAnimation_setInterruptListener(se::State&
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](spTrackEntry* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -1266,7 +1266,7 @@ static bool js_cocos2dx_spine_SkeletonAnimation_setStartListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](spTrackEntry* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
|
||||
@@ -752,7 +752,7 @@ static bool js_cocos2dx_ui_Widget_addCCSEventListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0, int larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -1481,7 +1481,7 @@ static bool js_cocos2dx_ui_Widget_addTouchEventListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::Widget::TouchEventType larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -1589,7 +1589,7 @@ static bool js_cocos2dx_ui_Widget_addClickEventListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -4205,7 +4205,7 @@ static bool js_cocos2dx_ui_CheckBox_addEventListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::CheckBox::EventType larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -4409,7 +4409,7 @@ static bool js_cocos2dx_ui_RadioButton_addEventListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::ui::RadioButton* larg0, cocos2d::ui::RadioButton::EventType larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -4719,7 +4719,7 @@ static bool js_cocos2dx_ui_RadioButtonGroup_addEventListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::ui::RadioButton* larg0, int larg1, cocos2d::ui::RadioButtonGroup::EventType larg2) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -6932,7 +6932,7 @@ static bool js_cocos2dx_ui_ScrollView_addEventListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::ScrollView::EventType larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -7937,7 +7937,7 @@ static bool js_cocos2dx_ui_ListView_addEventListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::ListView::EventType larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -8712,7 +8712,7 @@ static bool js_cocos2dx_ui_Slider_addEventListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::Slider::EventType larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -10003,7 +10003,7 @@ static bool js_cocos2dx_ui_TextField_addEventListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::TextField::EventType larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -11084,7 +11084,7 @@ static bool js_cocos2dx_ui_PageView_addEventListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](cocos2d::Ref* larg0, cocos2d::ui::PageView::EventType larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -13189,7 +13189,7 @@ static bool js_cocos2dx_ui_RichText_initWithXML(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[2]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](const std::basic_string<char> & larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -17594,7 +17594,7 @@ static bool js_cocos2dx_ui_TabControl_setTabChangedEventListener(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](int larg0, cocos2d::ui::TabControl::EventType larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
|
||||
@@ -78,14 +78,6 @@ namespace se {
|
||||
|
||||
bool Class::install()
|
||||
{
|
||||
// auto iter = __clsMap.find(_name);
|
||||
// if (iter != __clsMap.end())
|
||||
// {
|
||||
// assert(!iter->second->_parent->isSame(_parent));
|
||||
// }
|
||||
//
|
||||
// __clsMap.emplace(_name, this);
|
||||
|
||||
JsValueRef funcName;
|
||||
_CHECK(JsCreateString(_name.c_str(), _name.length(), &funcName));
|
||||
JsValueRef jsConstructor;
|
||||
|
||||
@@ -590,16 +590,16 @@ namespace se {
|
||||
return _rootCount > 0;
|
||||
}
|
||||
|
||||
bool Object::isSame(Object* o) const
|
||||
bool Object::strictEquals(Object* o) const
|
||||
{
|
||||
bool same = false;
|
||||
_CHECK(JsStrictEquals(_obj, o->_obj, &same));
|
||||
return same;
|
||||
}
|
||||
|
||||
bool Object::attachChild(Object* child)
|
||||
bool Object::attachObject(Object* obj)
|
||||
{
|
||||
assert(child);
|
||||
assert(obj);
|
||||
|
||||
Object* global = ScriptEngine::getInstance()->getGlobalObject();
|
||||
Value jsbVal;
|
||||
@@ -614,14 +614,14 @@ namespace se {
|
||||
|
||||
ValueArray args;
|
||||
args.push_back(Value(this));
|
||||
args.push_back(Value(child));
|
||||
args.push_back(Value(obj));
|
||||
func.toObject()->call(args, global);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Object::detachChild(Object* child)
|
||||
bool Object::detachObject(Object* obj)
|
||||
{
|
||||
assert(child);
|
||||
assert(obj);
|
||||
Object* global = ScriptEngine::getInstance()->getGlobalObject();
|
||||
Value jsbVal;
|
||||
if (!global->getProperty("jsb", &jsbVal))
|
||||
@@ -635,7 +635,7 @@ namespace se {
|
||||
|
||||
ValueArray args;
|
||||
args.push_back(Value(this));
|
||||
args.push_back(Value(child));
|
||||
args.push_back(Value(obj));
|
||||
func.toObject()->call(args, global);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -53,9 +53,9 @@ namespace se {
|
||||
void unroot();
|
||||
bool isRooted() const;
|
||||
|
||||
bool isSame(Object* o) const;
|
||||
bool attachChild(Object* child);
|
||||
bool detachChild(Object* child);
|
||||
bool strictEquals(Object* obj) const;
|
||||
bool attachObject(Object* obj);
|
||||
bool detachObject(Object* obj);
|
||||
|
||||
// Private API used in wrapper
|
||||
static Object* _createJSObject(Class* cls, JsValueRef obj);
|
||||
|
||||
@@ -383,7 +383,7 @@ namespace se {
|
||||
}
|
||||
|
||||
clearException();
|
||||
iterOwner->second->attachChild(iterTarget->second);
|
||||
iterOwner->second->attachObject(iterTarget->second);
|
||||
}
|
||||
|
||||
void ScriptEngine::_releaseScriptObject(void* owner, void* target)
|
||||
@@ -401,7 +401,7 @@ namespace se {
|
||||
}
|
||||
|
||||
clearException();
|
||||
iterOwner->second->detachChild(iterTarget->second);
|
||||
iterOwner->second->detachObject(iterTarget->second);
|
||||
}
|
||||
|
||||
bool ScriptEngine::_onReceiveNodeEvent(void* node, NodeEventType type)
|
||||
|
||||
@@ -572,14 +572,14 @@ namespace se {
|
||||
return _rootCount > 0;
|
||||
}
|
||||
|
||||
bool Object::isSame(Object* o) const
|
||||
bool Object::strictEquals(Object* o) const
|
||||
{
|
||||
return JSValueIsStrictEqual(__cx, _obj, o->_obj);
|
||||
}
|
||||
|
||||
bool Object::attachChild(Object* child)
|
||||
bool Object::attachObject(Object* obj)
|
||||
{
|
||||
assert(child);
|
||||
assert(obj);
|
||||
|
||||
Object* global = ScriptEngine::getInstance()->getGlobalObject();
|
||||
Value jsbVal;
|
||||
@@ -594,14 +594,14 @@ namespace se {
|
||||
|
||||
ValueArray args;
|
||||
args.push_back(Value(this));
|
||||
args.push_back(Value(child));
|
||||
args.push_back(Value(obj));
|
||||
func.toObject()->call(args, global);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Object::detachChild(Object* child)
|
||||
bool Object::detachObject(Object* obj)
|
||||
{
|
||||
assert(child);
|
||||
assert(obj);
|
||||
Object* global = ScriptEngine::getInstance()->getGlobalObject();
|
||||
Value jsbVal;
|
||||
if (!global->getProperty("jsb", &jsbVal))
|
||||
@@ -615,7 +615,7 @@ namespace se {
|
||||
|
||||
ValueArray args;
|
||||
args.push_back(Value(this));
|
||||
args.push_back(Value(child));
|
||||
args.push_back(Value(obj));
|
||||
func.toObject()->call(args, global);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -227,14 +227,14 @@ namespace se {
|
||||
* @param[in] o The object to be tested with this object.
|
||||
* @return true if the two values are strict equal, otherwise false.
|
||||
*/
|
||||
bool isSame(Object* o) const;
|
||||
bool strictEquals(Object* o) const;
|
||||
|
||||
/**
|
||||
* @brief Attaches a child object to an object.
|
||||
* @param[in] child The child object to be attached.
|
||||
* @brief Attaches an object to current object.
|
||||
* @param[in] obj The object to be attached.
|
||||
* @return true if succeed, otherwise false.
|
||||
* @note This method will set child object as a property of this object, therefore the lifecycle of child object will depend on this object,
|
||||
* which means child may be garbage collected only after this object is garbage collected.
|
||||
* @note This method will set `obj` as a property of current object, therefore the lifecycle of child object will depend on current object,
|
||||
* which means `obj` may be garbage collected only after current object is garbage collected.
|
||||
* It's normally used in binding a native callback method. For example:
|
||||
|
||||
```javascript
|
||||
@@ -256,7 +256,7 @@ namespace se {
|
||||
se::Value jsThis(args[1]);
|
||||
se::Value jsFunc(args[0]);
|
||||
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
|
||||
auto lambda = [=]() -> void {
|
||||
...
|
||||
@@ -279,14 +279,15 @@ namespace se {
|
||||
}
|
||||
```
|
||||
*/
|
||||
bool attachChild(Object* child);
|
||||
bool attachObject(Object* obj);
|
||||
|
||||
/**
|
||||
* @brief Detaches a child object from an object.
|
||||
* @param[in] child The child object ot be detached.
|
||||
* @brief Detaches an object from current object.
|
||||
* @param[in] obj The object to be detached.
|
||||
* @return true if succeed, otherwise false.
|
||||
* @note The attached object will not be released if current object is not garbage collected.
|
||||
*/
|
||||
bool detachChild(Object* child);
|
||||
bool detachObject(Object* obj);
|
||||
|
||||
// Private API used in wrapper
|
||||
static Object* _createJSObject(Class* cls, JSObjectRef obj);
|
||||
|
||||
@@ -407,7 +407,7 @@ namespace se {
|
||||
}
|
||||
|
||||
clearException();
|
||||
iterOwner->second->attachChild(iterTarget->second);
|
||||
iterOwner->second->attachObject(iterTarget->second);
|
||||
}
|
||||
|
||||
void ScriptEngine::_releaseScriptObject(void* owner, void* target)
|
||||
@@ -425,7 +425,7 @@ namespace se {
|
||||
}
|
||||
|
||||
clearException();
|
||||
iterOwner->second->detachChild(iterTarget->second);
|
||||
iterOwner->second->detachObject(iterTarget->second);
|
||||
}
|
||||
|
||||
bool ScriptEngine::_onReceiveNodeEvent(void* node, NodeEventType type)
|
||||
|
||||
@@ -515,7 +515,7 @@ namespace se {
|
||||
return _rootCount > 0;
|
||||
}
|
||||
|
||||
bool Object::isSame(Object* o) const
|
||||
bool Object::strictEquals(Object* o) const
|
||||
{
|
||||
JSObject* thisObj = _getJSObject();
|
||||
JSObject* oThisObj = o->_getJSObject();
|
||||
@@ -531,11 +531,11 @@ namespace se {
|
||||
return ok && same;
|
||||
}
|
||||
|
||||
bool Object::attachChild(Object* child)
|
||||
bool Object::attachObject(Object* obj)
|
||||
{
|
||||
assert(child);
|
||||
assert(obj);
|
||||
JSObject* ownerObj = _getJSObject();
|
||||
JSObject* targetObj = child->_getJSObject();
|
||||
JSObject* targetObj = obj->_getJSObject();
|
||||
if (ownerObj == nullptr || targetObj == nullptr)
|
||||
return false;
|
||||
|
||||
@@ -556,11 +556,11 @@ namespace se {
|
||||
return JS_CallFunctionName(__cx, jsbObj, "registerNativeRef", args, &rval);
|
||||
}
|
||||
|
||||
bool Object::detachChild(Object* child)
|
||||
bool Object::detachObject(Object* obj)
|
||||
{
|
||||
assert(child);
|
||||
assert(obj);
|
||||
JSObject* ownerObj = _getJSObject();
|
||||
JSObject* targetObj = child->_getJSObject();
|
||||
JSObject* targetObj = obj->_getJSObject();
|
||||
if (ownerObj == nullptr || targetObj == nullptr)
|
||||
{
|
||||
LOGD("%s: try to detach on invalid object, owner: %p, target: %p\n", __FUNCTION__, ownerObj, targetObj);
|
||||
|
||||
@@ -53,9 +53,9 @@ namespace se {
|
||||
void unroot();
|
||||
bool isRooted() const;
|
||||
|
||||
bool isSame(Object* o) const;
|
||||
bool attachChild(Object* child);
|
||||
bool detachChild(Object* child);
|
||||
bool strictEquals(Object* o) const;
|
||||
bool attachObject(Object* obj);
|
||||
bool detachObject(Object* obj);
|
||||
|
||||
// Private API used in wrapper
|
||||
static Object* _createJSObject(Class* cls, JSObject* obj);
|
||||
|
||||
@@ -671,7 +671,7 @@ namespace se {
|
||||
}
|
||||
|
||||
clearException();
|
||||
iterOwner->second->attachChild(iterTarget->second);
|
||||
iterOwner->second->attachObject(iterTarget->second);
|
||||
}
|
||||
|
||||
void ScriptEngine::_releaseScriptObject(void* owner, void* target)
|
||||
@@ -689,7 +689,7 @@ namespace se {
|
||||
}
|
||||
|
||||
clearException();
|
||||
iterOwner->second->detachChild(iterTarget->second);
|
||||
iterOwner->second->detachObject(iterTarget->second);
|
||||
}
|
||||
|
||||
bool ScriptEngine::_onReceiveNodeEvent(void* node, NodeEventType type)
|
||||
|
||||
@@ -642,15 +642,15 @@ namespace se {
|
||||
return _rootCount > 0;
|
||||
}
|
||||
|
||||
bool Object::isSame(Object *o) const
|
||||
bool Object::strictEquals(Object *o) const
|
||||
{
|
||||
Object* a = const_cast<Object*>(this);
|
||||
return a->_obj.handle(__isolate) == o->_obj.handle(__isolate);
|
||||
}
|
||||
|
||||
bool Object::attachChild(Object *child)
|
||||
bool Object::attachObject(Object* obj)
|
||||
{
|
||||
assert(child);
|
||||
assert(obj);
|
||||
|
||||
Object* global = ScriptEngine::getInstance()->getGlobalObject();
|
||||
Value jsbVal;
|
||||
@@ -665,14 +665,14 @@ namespace se {
|
||||
|
||||
ValueArray args;
|
||||
args.push_back(Value(this));
|
||||
args.push_back(Value(child));
|
||||
args.push_back(Value(obj));
|
||||
func.toObject()->call(args, global);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Object::detachChild(Object *child)
|
||||
bool Object::detachObject(Object* obj)
|
||||
{
|
||||
assert(child);
|
||||
assert(obj);
|
||||
|
||||
Object* global = ScriptEngine::getInstance()->getGlobalObject();
|
||||
Value jsbVal;
|
||||
@@ -687,7 +687,7 @@ namespace se {
|
||||
|
||||
ValueArray args;
|
||||
args.push_back(Value(this));
|
||||
args.push_back(Value(child));
|
||||
args.push_back(Value(obj));
|
||||
func.toObject()->call(args, global);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -60,9 +60,9 @@ namespace se {
|
||||
void unroot();
|
||||
bool isRooted() const;
|
||||
|
||||
bool isSame(Object* o) const;
|
||||
bool attachChild(Object* child);
|
||||
bool detachChild(Object* child);
|
||||
bool strictEquals(Object* o) const;
|
||||
bool attachObject(Object* obj);
|
||||
bool detachObject(Object* obj);
|
||||
|
||||
// Private API used in wrapper
|
||||
static Object* _createJSObject(Class* cls, v8::Local<v8::Object> obj);
|
||||
|
||||
@@ -425,7 +425,7 @@ namespace se {
|
||||
|
||||
clearException();
|
||||
AutoHandleScope hs;
|
||||
iterOwner->second->attachChild(iterTarget->second);
|
||||
iterOwner->second->attachObject(iterTarget->second);
|
||||
}
|
||||
|
||||
void ScriptEngine::_releaseScriptObject(void* owner, void* target)
|
||||
@@ -444,7 +444,7 @@ namespace se {
|
||||
|
||||
clearException();
|
||||
AutoHandleScope hs;
|
||||
iterOwner->second->detachChild(iterTarget->second);
|
||||
iterOwner->second->detachObject(iterTarget->second);
|
||||
}
|
||||
|
||||
bool ScriptEngine::_onReceiveNodeEvent(void* node, NodeEventType type)
|
||||
|
||||
@@ -689,7 +689,7 @@ static bool js_EventListenerAcceleration_create(se::State& s)
|
||||
{
|
||||
se::Value jsThis(obj);
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](Acceleration* acc, Event* event) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -824,7 +824,7 @@ static bool js_EventListenerCustom_create(se::State& s)
|
||||
obj->setPrivateData(ret);
|
||||
s.rval().setObject(obj);
|
||||
|
||||
obj->attachChild(funcVal.toObject());
|
||||
obj->attachObject(funcVal.toObject());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1290,7 +1290,7 @@ static bool js_cocos2dx_CallFunc_init(cocos2d::CallFuncN* nativeObj, se::Object*
|
||||
SE_PRECONDITION2(false, false, "js_cocos2dx_CallFunc_create, args[0](func) isn't a function object");
|
||||
}
|
||||
|
||||
jsobj->attachChild(funcVal.toObject());
|
||||
jsobj->attachObject(funcVal.toObject());
|
||||
|
||||
if (argc >= 2)
|
||||
{
|
||||
@@ -1299,14 +1299,14 @@ static bool js_cocos2dx_CallFunc_init(cocos2d::CallFuncN* nativeObj, se::Object*
|
||||
{
|
||||
SE_PRECONDITION2(false, false, "js_cocos2dx_CallFunc_create, args[1](this) isn't an object");
|
||||
}
|
||||
jsobj->attachChild(thisVal.toObject());
|
||||
jsobj->attachObject(thisVal.toObject());
|
||||
}
|
||||
|
||||
if (argc >= 3)
|
||||
{
|
||||
dataVal = args[2];
|
||||
if (dataVal.isObject())
|
||||
jsobj->attachChild(dataVal.toObject());
|
||||
jsobj->attachObject(dataVal.toObject());
|
||||
}
|
||||
|
||||
bool ok = nativeObj->initWithFunction([=](Node* sender){
|
||||
|
||||
@@ -26,7 +26,7 @@ static bool js_creator_PhysicsContactListener_setPreSolve(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](b2Contact* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -34,8 +34,7 @@ static bool js_creator_PhysicsContactListener_setPreSolve(se::State& s)
|
||||
CC_UNUSED bool ok = true;
|
||||
se::ValueArray args;
|
||||
args.resize(1);
|
||||
bool fromCache = false;
|
||||
ok &= native_ptr_to_rooted_seval<b2Contact>(larg0, __jsb_b2Contact_class, &args[0], &fromCache);
|
||||
ok &= native_ptr_to_rooted_seval<b2Contact>(larg0, __jsb_b2Contact_class, &args[0]);
|
||||
|
||||
se::Value rval;
|
||||
se::Object* thisObj = jsThis.isObject() ? jsThis.toObject() : nullptr;
|
||||
@@ -75,7 +74,7 @@ static bool js_creator_PhysicsContactListener_setPostSolve(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](b2Contact* larg0, const creator::PhysicsContactImpulse* larg1) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -89,7 +88,7 @@ static bool js_creator_PhysicsContactListener_setPostSolve(se::State& s)
|
||||
ok &= native_ptr_to_seval<creator::PhysicsContactImpulse>((creator::PhysicsContactImpulse*)larg1, __jsb_creator_PhysicsContactImpulse_class, &args[1], &fromCache);
|
||||
if (!fromCache)
|
||||
{
|
||||
jsThis.toObject()->attachChild(args[1].toObject());
|
||||
jsThis.toObject()->attachObject(args[1].toObject());
|
||||
}
|
||||
se::Value rval;
|
||||
se::Object* thisObj = jsThis.isObject() ? jsThis.toObject() : nullptr;
|
||||
@@ -130,7 +129,7 @@ static bool js_creator_PhysicsContactListener_setBeginContact(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](b2Contact* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
@@ -185,7 +184,7 @@ static bool js_creator_PhysicsContactListener_setEndContact(se::State& s)
|
||||
{
|
||||
se::Value jsThis(s.thisObject());
|
||||
se::Value jsFunc(args[0]);
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
auto lambda = [=](b2Contact* larg0) -> void {
|
||||
se::ScriptEngine::getInstance()->clearException();
|
||||
se::AutoHandleScope hs;
|
||||
|
||||
@@ -288,7 +288,7 @@ static bool js_cocos2dx_dragonbones_TransformObject_getGlobal(se::State& s)
|
||||
SE_PRECONDITION2(ok, false, "Convert dragonBones::Transform to se::Value failed!");
|
||||
if (!isReturnCached)
|
||||
{
|
||||
s.thisObject()->attachChild(s.rval().toObject());
|
||||
s.thisObject()->attachObject(s.rval().toObject());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -302,7 +302,7 @@ static bool js_cocos2dx_dragonbones_TransformObject_getOrigin(se::State& s)
|
||||
SE_PRECONDITION2(ok, false, "Convert dragonBones::Transform to se::Value failed!");
|
||||
if (!isReturnCached)
|
||||
{
|
||||
s.thisObject()->attachChild(s.rval().toObject());
|
||||
s.thisObject()->attachObject(s.rval().toObject());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -316,7 +316,7 @@ static bool js_cocos2dx_dragonbones_TransformObject_getOffset(se::State& s)
|
||||
SE_PRECONDITION2(ok, false, "Convert dragonBones::Transform to se::Value failed!");
|
||||
if (!isReturnCached)
|
||||
{
|
||||
s.thisObject()->attachChild(s.rval().toObject());
|
||||
s.thisObject()->attachObject(s.rval().toObject());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ static void removeSchedule(uint32_t jsFuncId, uint32_t jsTargetId, bool needDeta
|
||||
se::Object* func = iter->second.getFunc();
|
||||
if (needDetachChild)
|
||||
{
|
||||
target->detachChild(func);
|
||||
target->detachObject(func);
|
||||
}
|
||||
|
||||
func->release();
|
||||
@@ -280,7 +280,7 @@ static void removeScheduleForThis(uint32_t jsTargetId, bool needDetachChild)
|
||||
func = e.second.getFunc();
|
||||
if (needDetachChild)
|
||||
{
|
||||
target->detachChild(func);
|
||||
target->detachObject(func);
|
||||
}
|
||||
|
||||
func->release(); // Release jsFunc
|
||||
@@ -309,8 +309,8 @@ static void removeAllSchedules(bool needDetachChild)
|
||||
func = e.second.getFunc();
|
||||
if (needDetachChild)
|
||||
{
|
||||
CCLOG("detachChild: owner: %p, target: %p", target, func);
|
||||
target->detachChild(func);
|
||||
CCLOG("detachObject: owner: %p, target: %p", target, func);
|
||||
target->detachObject(func);
|
||||
}
|
||||
target->release(); // Release jsThis
|
||||
func->release(); // Release jsFunc
|
||||
@@ -447,7 +447,7 @@ static bool Scheduler_scheduleCommon(Scheduler* scheduler, const se::Value& jsTh
|
||||
assert(jsThis.isObject());
|
||||
assert(jsFunc.isObject());
|
||||
assert(jsFunc.toObject()->isFunction());
|
||||
jsThis.toObject()->attachChild(jsFunc.toObject());
|
||||
jsThis.toObject()->attachObject(jsFunc.toObject());
|
||||
|
||||
std::string key;
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
_eventRegistry[eventName].clear();
|
||||
_eventRegistry[eventName].push_back(callback);
|
||||
_eventRegistry[eventName].push_back(target);
|
||||
target.toObject()->attachChild(callback.toObject());
|
||||
target.toObject()->attachObject(callback.toObject());
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Submodule native/tools/bindings-generator updated: 76c3e5d20f...1865e320c1
Reference in New Issue
Block a user