diff --git a/CHANGELOG.md b/CHANGELOG.md index b1e858891566..101af32100e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ ### Break Changes +- Rename `ax::Ref` ==> `ax::Object` - Remove `ax::log`, use `AXLOGD` instead - Remove cmake function: `ax_uwp_set_all_targets_deploy_min_version` - Remove deprecated pixel formats L8, A8, LA8 in https://github.com/axmolengine/axmol/pull/1839 diff --git a/core/2d/Action.h b/core/2d/Action.h index 258819ee209a..47f20e5af307 100644 --- a/core/2d/Action.h +++ b/core/2d/Action.h @@ -29,7 +29,7 @@ THE SOFTWARE. #ifndef __ACTIONS_CCACTION_H__ #define __ACTIONS_CCACTION_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "base/ScriptSupport.h" @@ -50,7 +50,7 @@ enum /** * @brief Base class for Action objects. */ -class AX_DLL Action : public Ref, public Clonable +class AX_DLL Action : public Object, public Clonable { public: /** Default tag used for all the actions. */ diff --git a/core/2d/ActionCatmullRom.h b/core/2d/ActionCatmullRom.h index 6a30b38c4998..28f7339e3648 100644 --- a/core/2d/ActionCatmullRom.h +++ b/core/2d/ActionCatmullRom.h @@ -55,7 +55,7 @@ class Node; * @ingroup Actions * @js NA */ -class AX_DLL PointArray : public Ref, public Clonable +class AX_DLL PointArray : public Object, public Clonable { public: /** Creates and initializes a Points array with capacity. diff --git a/core/2d/ActionManager.cpp b/core/2d/ActionManager.cpp index 5c02797b4f6a..5bc821fd3c6a 100644 --- a/core/2d/ActionManager.cpp +++ b/core/2d/ActionManager.cpp @@ -215,7 +215,7 @@ void ActionManager::removeAction(Action* action) return; } - Ref* target = action->getOriginalTarget(); + Object* target = action->getOriginalTarget(); auto actionIt = _targets.find(static_cast(target)); if (actionIt != _targets.end()) { diff --git a/core/2d/ActionManager.h b/core/2d/ActionManager.h index 0963f46c8305..28ad0c82ea69 100644 --- a/core/2d/ActionManager.h +++ b/core/2d/ActionManager.h @@ -32,7 +32,7 @@ THE SOFTWARE. #include "2d/Action.h" #include "base/Vector.h" -#include "base/Ref.h" +#include "base/Object.h" NS_AX_BEGIN @@ -61,7 +61,7 @@ struct ActionHandle @since v0.8 */ -class AX_DLL ActionManager : public Ref +class AX_DLL ActionManager : public Object { public: /** diff --git a/core/2d/Animation.h b/core/2d/Animation.h index 9e34506da472..46a4a56107d7 100644 --- a/core/2d/Animation.h +++ b/core/2d/Animation.h @@ -29,7 +29,7 @@ THE SOFTWARE. #define __AX_ANIMATION_H__ #include "platform/PlatformConfig.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Value.h" #include "base/Vector.h" #include "2d/SpriteFrame.h" @@ -55,7 +55,7 @@ class SpriteFrame; @since v2.0 */ -class AX_DLL AnimationFrame : public Ref, public Clonable +class AX_DLL AnimationFrame : public Object, public Clonable { public: /** @struct DisplayedEventInfo @@ -157,7 +157,7 @@ class AX_DLL AnimationFrame : public Ref, public Clonable * sprite->runAction(Animate::create(animation)); * @endcode */ -class AX_DLL Animation : public Ref, public Clonable +class AX_DLL Animation : public Object, public Clonable { public: /** Creates an animation. diff --git a/core/2d/AnimationCache.h b/core/2d/AnimationCache.h index f0ee9ee77e97..1cbe0556199f 100644 --- a/core/2d/AnimationCache.h +++ b/core/2d/AnimationCache.h @@ -29,7 +29,7 @@ THE SOFTWARE. #ifndef __AX_ANIMATION_CACHE_H__ #define __AX_ANIMATION_CACHE_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "base/Map.h" #include "base/Value.h" #include "2d/Animation.h" diff --git a/core/2d/CameraBackgroundBrush.h b/core/2d/CameraBackgroundBrush.h index a6211407611c..ef69c5e0e5e4 100644 --- a/core/2d/CameraBackgroundBrush.h +++ b/core/2d/CameraBackgroundBrush.h @@ -26,7 +26,7 @@ #pragma once #include "base/Types.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/EventListenerCustom.h" #include "3d/Frustum.h" #include "renderer/QuadCommand.h" @@ -54,7 +54,7 @@ class Buffer; * background with given color and depth, Skybox brush clear the background with a skybox. Camera uses depth brush by * default. */ -class AX_DLL CameraBackgroundBrush : public Ref +class AX_DLL CameraBackgroundBrush : public Object { public: /** diff --git a/core/2d/Component.h b/core/2d/Component.h index da54d13e1dc8..d9f000205072 100644 --- a/core/2d/Component.h +++ b/core/2d/Component.h @@ -28,7 +28,7 @@ THE SOFTWARE. /// @cond DO_NOT_SHOW #include -#include "base/Ref.h" +#include "base/Object.h" #include "base/ScriptSupport.h" NS_AX_BEGIN @@ -44,7 +44,7 @@ enum kComponentOnUpdate }; -class AX_DLL Component : public Ref +class AX_DLL Component : public Object { public: static Component* create(); diff --git a/core/2d/FastTMXLayer.h b/core/2d/FastTMXLayer.h index f8510a4405e7..49272fe0c1a6 100644 --- a/core/2d/FastTMXLayer.h +++ b/core/2d/FastTMXLayer.h @@ -394,7 +394,7 @@ class AX_DLL FastTMXLayer : public Node /** @brief TMXTileAnimTask represents the frame-tick task of an animated tile. * It is a assistant class for TMXTileAnimTicker. */ -class AX_DLL TMXTileAnimTask : public Ref +class AX_DLL TMXTileAnimTask : public Object { public: TMXTileAnimTask(FastTMXLayer* layer, TMXTileAnimInfo* animation, const Vec2& tilePos, uint32_t flag = 0); @@ -429,7 +429,7 @@ class AX_DLL TMXTileAnimTask : public Ref /** @brief TMXTileAnimManager controls all tile animation of a layer. */ -class AX_DLL TMXTileAnimManager : public Ref +class AX_DLL TMXTileAnimManager : public Object { public: static TMXTileAnimManager* create(FastTMXLayer* layer); diff --git a/core/2d/Font.h b/core/2d/Font.h index 250f86b45272..39fbf99b6dbc 100644 --- a/core/2d/Font.h +++ b/core/2d/Font.h @@ -37,7 +37,7 @@ NS_AX_BEGIN class FontAtlas; -class AX_DLL Font : public Ref +class AX_DLL Font : public Object { public: virtual FontAtlas* newFontAtlas() = 0; diff --git a/core/2d/FontAtlas.h b/core/2d/FontAtlas.h index 2cde93c60904..8b7e5ef8ea3c 100644 --- a/core/2d/FontAtlas.h +++ b/core/2d/FontAtlas.h @@ -34,7 +34,7 @@ #include #include "platform/PlatformMacros.h" -#include "base/Ref.h" +#include "base/Object.h" #include "platform/StdC.h" // ssize_t on windows #include "renderer/Texture2D.h" @@ -62,7 +62,7 @@ struct FontLetterDefinition bool rotated; }; -class AX_DLL FontAtlas : public Ref +class AX_DLL FontAtlas : public Object { public: static const int CacheTextureWidth; diff --git a/core/2d/FontFNT.h b/core/2d/FontFNT.h index 0b1bd8c3bf66..376ba5ca79b4 100644 --- a/core/2d/FontFNT.h +++ b/core/2d/FontFNT.h @@ -73,7 +73,7 @@ typedef struct _BMFontPadding /** @brief BMFontConfiguration has parsed configuration of the .fnt file @since v0.8 */ -class AX_DLL BMFontConfiguration : public Ref +class AX_DLL BMFontConfiguration : public Object { // FIXME: Creating a public interface so that the bitmapFontArray[] is accessible public: //@public diff --git a/core/2d/Grid.h b/core/2d/Grid.h index 62574b88aebb..41714bdf5ae3 100644 --- a/core/2d/Grid.h +++ b/core/2d/Grid.h @@ -27,7 +27,7 @@ THE SOFTWARE. ****************************************************************************/ #pragma once -#include "base/Ref.h" +#include "base/Object.h" #include "base/Types.h" #include "base/Director.h" #include "renderer/GroupCommand.h" @@ -53,7 +53,7 @@ class RenderTarget; /** Base class for Other grid. */ -class AX_DLL GridBase : public Ref +class AX_DLL GridBase : public Object { public: /** diff --git a/core/2d/MenuItem.h b/core/2d/MenuItem.h index f74f33fbfcd3..2aa7176d4f1e 100644 --- a/core/2d/MenuItem.h +++ b/core/2d/MenuItem.h @@ -38,7 +38,7 @@ THE SOFTWARE. NS_AX_BEGIN -typedef std::function ccMenuCallback; +typedef std::function ccMenuCallback; class Label; class LabelAtlas; diff --git a/core/2d/Node.cpp b/core/2d/Node.cpp index f6ebde6eb357..cab415373cf4 100644 --- a/core/2d/Node.cpp +++ b/core/2d/Node.cpp @@ -763,7 +763,7 @@ void Node::setUserData(void* userData) _userData = userData; } -void Node::setUserObject(Ref* userObject) +void Node::setUserObject(Object* userObject) { #if AX_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); diff --git a/core/2d/Node.h b/core/2d/Node.h index c5b95c5c105a..64c28bafc97f 100644 --- a/core/2d/Node.h +++ b/core/2d/Node.h @@ -114,7 +114,7 @@ Node and override `draw`. */ -class AX_DLL Node : public Ref +class AX_DLL Node : public Object { public: /** Default tag used for all the nodes */ @@ -1031,11 +1031,11 @@ class AX_DLL Node : public Ref * @return A user assigned Object. * @lua NA */ - virtual Ref* getUserObject() { return _userObject; } + virtual Object* getUserObject() { return _userObject; } /** * @lua NA */ - virtual const Ref* getUserObject() const { return _userObject; } + virtual const Object* getUserObject() const { return _userObject; } /** * Returns a user assigned Object. @@ -1047,7 +1047,7 @@ class AX_DLL Node : public Ref * * @param userObject A user assigned Object. */ - virtual void setUserObject(Ref* userObject); + virtual void setUserObject(Object* userObject); /// @} end of Tag & User Data @@ -1972,7 +1972,7 @@ class AX_DLL Node : public Ref uint64_t _hashOfName; ///< hash value of _name, used for speed in getChildByName void* _userData; ///< A user assigned void pointer, Can be point to any cpp object - Ref* _userObject; ///< A user assigned Object + Object* _userObject; ///< A user assigned Object Scheduler* _scheduler; ///< scheduler used to schedule timers and updates diff --git a/core/2d/ParallaxNode.cpp b/core/2d/ParallaxNode.cpp index 8b3a85733461..6b296174f42e 100644 --- a/core/2d/ParallaxNode.cpp +++ b/core/2d/ParallaxNode.cpp @@ -29,7 +29,7 @@ THE SOFTWARE. NS_AX_BEGIN -class PointObject : public Ref +class PointObject : public Object { public: static PointObject* create(Vec2 ratio, Vec2 offset) diff --git a/core/2d/ParallaxNode.h b/core/2d/ParallaxNode.h index c458a3c2fc1b..e0b815b71fce 100644 --- a/core/2d/ParallaxNode.h +++ b/core/2d/ParallaxNode.h @@ -69,13 +69,13 @@ class AX_DLL ParallaxNode : public Node * * @param parallaxArray An array of layers for the Parallax node. */ - void setParallaxArray(Vector parallaxArray) { _parallaxArray = std::move(parallaxArray); } + void setParallaxArray(Vector parallaxArray) { _parallaxArray = std::move(parallaxArray); } /** Returns the array of layers of the Parallax node. * * @return An array of layers for the Parallax node. */ - Vector& getParallaxArray() { return _parallaxArray; } - const Vector& getParallaxArray() const { return _parallaxArray; } + Vector& getParallaxArray() { return _parallaxArray; } + const Vector& getParallaxArray() const { return _parallaxArray; } // // Overrides @@ -102,7 +102,7 @@ class AX_DLL ParallaxNode : public Node Vec2 absolutePosition(); Vec2 _lastPosition; - Vector _parallaxArray; + Vector _parallaxArray; private: AX_DISALLOW_COPY_AND_ASSIGN(ParallaxNode); diff --git a/core/2d/SpriteBatchNode.cpp b/core/2d/SpriteBatchNode.cpp index 48eaa331f6ba..89e44b1818d5 100644 --- a/core/2d/SpriteBatchNode.cpp +++ b/core/2d/SpriteBatchNode.cpp @@ -482,7 +482,7 @@ ssize_t SpriteBatchNode::rebuildIndexInOrder(Sprite* parent, ssize_t index) } // ignore self (batch node) - if (parent != static_cast(this)) + if (parent != static_cast(this)) { parent->setAtlasIndex(static_cast(index)); index++; diff --git a/core/2d/SpriteFrame.h b/core/2d/SpriteFrame.h index 1c7aaac4b6c6..27b9928394c4 100644 --- a/core/2d/SpriteFrame.h +++ b/core/2d/SpriteFrame.h @@ -31,7 +31,7 @@ THE SOFTWARE. #include "2d/Node.h" #include "2d/AutoPolygon.h" -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" NS_AX_BEGIN @@ -56,7 +56,7 @@ class Texture2D; sprite->setSpriteFrame(frame); @endcode */ -class AX_DLL SpriteFrame : public Ref, public Clonable +class AX_DLL SpriteFrame : public Object, public Clonable { public: /** Create a SpriteFrame with a texture filename, rect in points. diff --git a/core/2d/SpriteFrameCache.h b/core/2d/SpriteFrameCache.h index 5599b3b20d6f..6855b3eac424 100644 --- a/core/2d/SpriteFrameCache.h +++ b/core/2d/SpriteFrameCache.h @@ -37,7 +37,7 @@ THE SOFTWARE. #include #include "2d/SpriteFrame.h" #include "2d/SpriteSheetLoader.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Value.h" #include "base/Map.h" #include "base/Data.h" diff --git a/core/2d/SpriteSheetLoader.h b/core/2d/SpriteSheetLoader.h index d26b5e1fe7f2..066920682d7d 100644 --- a/core/2d/SpriteSheetLoader.h +++ b/core/2d/SpriteSheetLoader.h @@ -34,7 +34,7 @@ THE SOFTWARE. #include #include #include "2d/SpriteFrame.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Value.h" #include "base/Map.h" #include "base/Data.h" diff --git a/core/2d/TMXObjectGroup.h b/core/2d/TMXObjectGroup.h index 50a187fe6843..92a9fd16d90b 100644 --- a/core/2d/TMXObjectGroup.h +++ b/core/2d/TMXObjectGroup.h @@ -31,7 +31,7 @@ THE SOFTWARE. #include "math/Math.h" #include "base/Value.h" -#include "base/Ref.h" +#include "base/Object.h" NS_AX_BEGIN @@ -43,7 +43,7 @@ NS_AX_BEGIN /** @brief TMXObjectGroup represents the TMX object group. * @since v0.99.0 */ -class AX_DLL TMXObjectGroup : public Ref +class AX_DLL TMXObjectGroup : public Object { public: /** diff --git a/core/2d/TMXXMLParser.h b/core/2d/TMXXMLParser.h index c239d53743c7..a4a132699f98 100644 --- a/core/2d/TMXXMLParser.h +++ b/core/2d/TMXXMLParser.h @@ -160,7 +160,7 @@ struct AX_DLL TMXTileAnimFlag This information is obtained from the TMX file. */ -struct AX_DLL TMXTileAnimInfo : public Ref +struct AX_DLL TMXTileAnimInfo : public Object { static TMXTileAnimInfo* create(uint32_t tileID); explicit TMXTileAnimInfo(uint32_t tileID); @@ -178,7 +178,7 @@ struct AX_DLL TMXTileAnimInfo : public Ref This information is obtained from the TMX file. */ -class AX_DLL TMXLayerInfo : public Ref +class AX_DLL TMXLayerInfo : public Object { public: /** @@ -214,7 +214,7 @@ class AX_DLL TMXLayerInfo : public Ref This information is obtained from the TMX file. */ -class AX_DLL TMXTilesetInfo : public Ref +class AX_DLL TMXTilesetInfo : public Object { public: std::string _name; @@ -257,7 +257,7 @@ And it also contains: This information is obtained from the TMX file. */ -class AX_DLL TMXMapInfo : public Ref, public SAXDelegator +class AX_DLL TMXMapInfo : public Object, public SAXDelegator { public: /** creates a TMX Format with a tmx file */ diff --git a/core/2d/Transition.h b/core/2d/Transition.h index 7aac9574cdf2..cfeaa208de67 100644 --- a/core/2d/Transition.h +++ b/core/2d/Transition.h @@ -51,7 +51,7 @@ class NodeGrid; @since v0.8.2 @js NA */ -class AX_DLL TransitionEaseScene // : public Ref +class AX_DLL TransitionEaseScene // : public Object { public: /** Constructor. diff --git a/core/3d/Animate3D.h b/core/3d/Animate3D.h index a147627d1dae..430289ac61af 100644 --- a/core/3d/Animate3D.h +++ b/core/3d/Animate3D.h @@ -31,7 +31,7 @@ #include "3d/Animation3D.h" #include "base/Macros.h" -#include "base/Ref.h" +#include "base/Object.h" #include "2d/ActionInterval.h" NS_AX_BEGIN diff --git a/core/3d/Animation3D.h b/core/3d/Animation3D.h index 60bbf1c1d24e..169345c1c05b 100644 --- a/core/3d/Animation3D.h +++ b/core/3d/Animation3D.h @@ -31,7 +31,7 @@ #include "3d/AnimationCurve.h" #include "base/Macros.h" -#include "base/Ref.h" +#include "base/Object.h" #include "3d/Bundle3DData.h" NS_AX_BEGIN @@ -43,7 +43,7 @@ NS_AX_BEGIN /** * @brief static animation data, shared */ -class AX_DLL Animation3D : public Ref +class AX_DLL Animation3D : public Object { friend class Bundle3D; diff --git a/core/3d/AnimationCurve.h b/core/3d/AnimationCurve.h index a29c55dd2c5d..c33326194dd7 100644 --- a/core/3d/AnimationCurve.h +++ b/core/3d/AnimationCurve.h @@ -29,7 +29,7 @@ #include #include "platform/PlatformMacros.h" -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" NS_AX_BEGIN @@ -56,7 +56,7 @@ enum class EvaluateType * @lua NA */ template -class AnimationCurve : public Ref +class AnimationCurve : public Object { public: /**create animation curve*/ diff --git a/core/3d/Bundle3DData.h b/core/3d/Bundle3DData.h index 6dcc686f7140..32cf644fc3b3 100644 --- a/core/3d/Bundle3DData.h +++ b/core/3d/Bundle3DData.h @@ -27,7 +27,7 @@ #ifndef __AX_BUNDLE_3D_DATA_H__ #define __AX_BUNDLE_3D_DATA_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "base/Types.h" #include "math/Math.h" #include "3d/AABB.h" diff --git a/core/3d/BundleReader.h b/core/3d/BundleReader.h index 12a3005bdade..8841ad039723 100644 --- a/core/3d/BundleReader.h +++ b/core/3d/BundleReader.h @@ -29,7 +29,7 @@ #include #include -#include "base/Ref.h" +#include "base/Object.h" #include "platform/PlatformMacros.h" #include "base/Logging.h" @@ -45,7 +45,7 @@ NS_AX_BEGIN * @js NA * @lua NA */ -class BundleReader : public ax::Ref +class BundleReader : public ax::Object { public: /** diff --git a/core/3d/Mesh.h b/core/3d/Mesh.h index 62f7a68305b0..1959c2d5c52e 100644 --- a/core/3d/Mesh.h +++ b/core/3d/Mesh.h @@ -31,7 +31,7 @@ #include "3d/AABB.h" #include "3d/3DProgramInfo.h" -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "renderer/MeshCommand.h" #include "renderer/CustomCommand.h" @@ -60,7 +60,7 @@ class Buffer; /** * @brief Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on */ -class AX_DLL Mesh : public Ref +class AX_DLL Mesh : public Object { friend class MeshRenderer; diff --git a/core/3d/MeshSkin.h b/core/3d/MeshSkin.h index 2da1ee1e9e77..7d756c60687a 100644 --- a/core/3d/MeshSkin.h +++ b/core/3d/MeshSkin.h @@ -27,7 +27,7 @@ #define __CCMESHSKIN_H__ #include "3d/Bundle3DData.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Vector.h" #include "math/Math.h" #include @@ -48,7 +48,7 @@ class Skeleton3D; * @js NA * @lua NA */ -class AX_DLL MeshSkin : public Ref +class AX_DLL MeshSkin : public Object { friend class Mesh; diff --git a/core/3d/MeshVertexIndexData.h b/core/3d/MeshVertexIndexData.h index 0a0865b34311..ee3239af7198 100644 --- a/core/3d/MeshVertexIndexData.h +++ b/core/3d/MeshVertexIndexData.h @@ -31,7 +31,7 @@ #include "3d/AABB.h" #include "3d/3DProgramInfo.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Vector.h" #include "math/Math.h" #include "renderer/MeshCommand.h" @@ -51,7 +51,7 @@ class MeshVertexData; * @js NA * @lua NA */ -class AX_DLL MeshIndexData : public Ref +class AX_DLL MeshIndexData : public Object { public: /** create */ @@ -105,7 +105,7 @@ class AX_DLL MeshIndexData : public Ref * the MeshVertexData class. * @brief the MeshVertexData contain all of the vertices data which mesh need. */ -class AX_DLL MeshVertexData : public Ref +class AX_DLL MeshVertexData : public Object { friend class MeshRenderer; friend class Mesh; diff --git a/core/3d/Skeleton3D.h b/core/3d/Skeleton3D.h index bd430a9917eb..9178bb3d21ec 100644 --- a/core/3d/Skeleton3D.h +++ b/core/3d/Skeleton3D.h @@ -27,7 +27,7 @@ #define __CCSKELETON3D_H__ #include "3d/Bundle3DData.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Vector.h" NS_AX_BEGIN @@ -41,7 +41,7 @@ NS_AX_BEGIN * @brief Defines a basic hierarchical structure of transformation spaces. * @lua NA */ -class AX_DLL Bone3D : public Ref +class AX_DLL Bone3D : public Object { friend class Skeleton3D; friend class MeshSkin; @@ -177,7 +177,7 @@ class AX_DLL Bone3D : public Ref * Skeleton * */ -class AX_DLL Skeleton3D : public Ref +class AX_DLL Skeleton3D : public Object { public: /** diff --git a/core/3d/VertexAttribBinding.h b/core/3d/VertexAttribBinding.h index 9e4a99740c37..4ac3ee8842fb 100644 --- a/core/3d/VertexAttribBinding.h +++ b/core/3d/VertexAttribBinding.h @@ -24,7 +24,7 @@ #include -#include "base/Ref.h" +#include "base/Object.h" #include "renderer/backend/ProgramState.h" #include "renderer/backend/Types.h" #include "renderer/Pass.h" @@ -54,7 +54,7 @@ class VertexAttribValue; * arrays, since it is slower than the server-side VAOs used by OpenGL * (when creating a VertexAttribBinding between a Mesh and Effect). */ -class AX_DLL VertexAttribBinding : public Ref +class AX_DLL VertexAttribBinding : public Object { public: /** diff --git a/core/audio/AudioEngineImpl.h b/core/audio/AudioEngineImpl.h index 91e549d15374..62dbf1296874 100644 --- a/core/audio/AudioEngineImpl.h +++ b/core/audio/AudioEngineImpl.h @@ -32,7 +32,7 @@ # include # include -# include "base/Ref.h" +# include "base/Object.h" # include "audio/AudioMacros.h" # include "audio/AudioCache.h" # include "audio/AudioPlayer.h" @@ -41,7 +41,7 @@ NS_AX_BEGIN class Scheduler; -class AX_DLL AudioEngineImpl : public ax::Ref +class AX_DLL AudioEngineImpl : public ax::Object { public: AudioEngineImpl(); diff --git a/core/axmol.h b/core/axmol.h index d328ec4a9db4..0dd1cea1dac3 100644 --- a/core/axmol.h +++ b/core/axmol.h @@ -50,7 +50,7 @@ THE SOFTWARE. #include "base/NS.h" #include "base/Profiling.h" #include "base/Properties.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/RefPtr.h" #include "base/Scheduler.h" #include "base/UserDefault.h" diff --git a/core/base/AutoreleasePool.cpp b/core/base/AutoreleasePool.cpp index f0770b4aa0c3..8eee2498eddd 100644 --- a/core/base/AutoreleasePool.cpp +++ b/core/base/AutoreleasePool.cpp @@ -56,7 +56,7 @@ AutoreleasePool::~AutoreleasePool() PoolManager::getInstance()->pop(); } -void AutoreleasePool::addObject(Ref* object) +void AutoreleasePool::addObject(Object* object) { _managedObjectArray.emplace_back(object); } @@ -66,7 +66,7 @@ void AutoreleasePool::clear() #if defined(_AX_DEBUG) && (_AX_DEBUG > 0) _isClearing = true; #endif - std::vector releasings; + std::vector releasings; releasings.swap(_managedObjectArray); for (const auto& obj : releasings) { @@ -77,7 +77,7 @@ void AutoreleasePool::clear() #endif } -bool AutoreleasePool::contains(Ref* object) const +bool AutoreleasePool::contains(Object* object) const { for (const auto& obj : _managedObjectArray) { @@ -145,7 +145,7 @@ AutoreleasePool* PoolManager::getCurrentPool() const return _releasePoolStack.back(); } -bool PoolManager::isObjectInPools(Ref* obj) const +bool PoolManager::isObjectInPools(Object* obj) const { for (const auto& pool : _releasePoolStack) { diff --git a/core/base/AutoreleasePool.h b/core/base/AutoreleasePool.h index 242410f9d8b4..5493df54ce25 100644 --- a/core/base/AutoreleasePool.h +++ b/core/base/AutoreleasePool.h @@ -28,7 +28,7 @@ THE SOFTWARE. #include #include -#include "base/Ref.h" +#include "base/Object.h" /** * @addtogroup base @@ -70,14 +70,14 @@ class AX_DLL AutoreleasePool * Add a given object to this autorelease pool. * * The same object may be added several times to an autorelease pool. When the - * pool is destructed, the object's `Ref::release()` method will be called + * pool is destructed, the object's `Object::release()` method will be called * the same times as it was added. * * @param object The object to be added into the autorelease pool. * @js NA * @lua NA */ - void addObject(Ref* object); + void addObject(Object* object); /** * Clear the autorelease pool. @@ -109,7 +109,7 @@ class AX_DLL AutoreleasePool * @js NA * @lua NA */ - bool contains(Ref* object) const; + bool contains(Object* object) const; /** * Dump the objects that are put into the autorelease pool. It is used for debugging. @@ -127,12 +127,12 @@ class AX_DLL AutoreleasePool * The underlying array of object managed by the pool. * * Although Array retains the object once when an object is added, proper - * Ref::release() is called outside the array to make sure that the pool + * Object::release() is called outside the array to make sure that the pool * does not affect the managed object's reference count. So an object can - * be destructed properly by calling Ref::release() even if the object + * be destructed properly by calling Object::release() even if the object * is in the pool. */ - std::vector _managedObjectArray; + std::vector _managedObjectArray; std::string _name; #if defined(_AX_DEBUG) && (_AX_DEBUG > 0) @@ -161,7 +161,7 @@ class AX_DLL PoolManager */ AutoreleasePool* getCurrentPool() const; - bool isObjectInPools(Ref* obj) const; + bool isObjectInPools(Object* obj) const; friend class AutoreleasePool; diff --git a/core/base/CMakeLists.txt b/core/base/CMakeLists.txt index d8905b9de8f7..e16296b0cc69 100644 --- a/core/base/CMakeLists.txt +++ b/core/base/CMakeLists.txt @@ -41,7 +41,7 @@ set(_AX_BASE_HEADER base/Enums.h base/AsyncTaskPool.h base/Random.h - base/Ref.h + base/Object.h base/Profiling.h base/ObjectFactory.h base/Properties.h @@ -113,7 +113,7 @@ set(_AX_BASE_SRC base/NS.cpp base/Profiling.cpp base/Properties.cpp - base/Ref.cpp + base/Object.cpp base/Scheduler.cpp base/ScriptSupport.cpp base/Touch.cpp diff --git a/core/base/Configuration.h b/core/base/Configuration.h index f457959b2f1c..e2574526545f 100644 --- a/core/base/Configuration.h +++ b/core/base/Configuration.h @@ -31,7 +31,7 @@ THE SOFTWARE. #include -#include "base/Ref.h" +#include "base/Object.h" #include "base/Value.h" #include "3d/Animate3D.h" diff --git a/core/base/Console.h b/core/base/Console.h index eea35aa75303..acd2b0aec7dd 100644 --- a/core/base/Console.h +++ b/core/base/Console.h @@ -46,7 +46,7 @@ typedef SSIZE_T ssize_t; #include #include "yasio/io_watcher.hpp" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Macros.h" NS_AX_BEGIN @@ -61,7 +61,7 @@ NS_AX_BEGIN ``` */ -class AX_DLL Console : public Ref +class AX_DLL Console : public Object { public: /** Console Utils */ diff --git a/core/base/Director.h b/core/base/Director.h index 68479b1823bc..93e2b97a4513 100644 --- a/core/base/Director.h +++ b/core/base/Director.h @@ -33,7 +33,7 @@ THE SOFTWARE. #include #include "platform/PlatformMacros.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Vector.h" #include "2d/Scene.h" #include "math/Math.h" diff --git a/core/base/Event.h b/core/base/Event.h index 1738146a8183..ebc78b61fc13 100644 --- a/core/base/Event.h +++ b/core/base/Event.h @@ -26,7 +26,7 @@ #ifndef __CCEVENT_H__ #define __CCEVENT_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "platform/PlatformMacros.h" /** @@ -41,7 +41,7 @@ class Node; /** @class Event * @brief Base class of all kinds of events. */ -class AX_DLL Event : public Ref +class AX_DLL Event : public Object { public: /** Type Event type.*/ diff --git a/core/base/EventDispatcher.h b/core/base/EventDispatcher.h index e9af0373ee22..3f26e8aaeaf3 100644 --- a/core/base/EventDispatcher.h +++ b/core/base/EventDispatcher.h @@ -60,7 +60,7 @@ from within an EventListener, while events are being dispatched. @js NA */ -class AX_DLL EventDispatcher : public Ref +class AX_DLL EventDispatcher : public Object { public: // Adds event listener. diff --git a/core/base/EventListener.h b/core/base/EventListener.h index 0015c8661282..9cf325cff3c2 100644 --- a/core/base/EventListener.h +++ b/core/base/EventListener.h @@ -31,7 +31,7 @@ #include #include "platform/PlatformMacros.h" -#include "base/Ref.h" +#include "base/Object.h" /** * @addtogroup base @@ -49,7 +49,7 @@ class Node; * For instance, you could refer to EventListenerAcceleration, EventListenerKeyboard, EventListenerTouchOneByOne, * EventListenerCustom. */ -class AX_DLL EventListener : public Ref +class AX_DLL EventListener : public Object { public: /** Type Event type.*/ diff --git a/core/base/Map.h b/core/base/Map.h index 48534f46a744..f80b4203dc74 100644 --- a/core/base/Map.h +++ b/core/base/Map.h @@ -30,7 +30,7 @@ #define USE_ROBIN_MAP 1 #include "base/Macros.h" -#include "base/Ref.h" +#include "base/Object.h" #include #if USE_STD_UNORDERED_MAP @@ -47,8 +47,8 @@ NS_AX_BEGIN /** * Similar to std::unordered_map, but it will manage reference count automatically internally. - * Which means it will invoke Ref::retain() when adding an element, and invoke Ref::release() when removing an element. - * @warning The element should be `Ref` or its sub-class. + * Which means it will invoke Object::retain() when adding an element, and invoke Object::release() when removing an element. + * @warning The element should be `Object` or its sub-class. * @js NA * @lua NA */ @@ -89,14 +89,14 @@ class Map /** Default constructor */ Map() : _data() { - static_assert(std::is_convertible::value, "Invalid Type for ax::Map!"); + static_assert(std::is_convertible::value, "Invalid Type for ax::Map!"); AXLOGINFO("In the default constructor of Map!"); } /** Constructor with capacity. */ explicit Map(ssize_t capacity) : _data() { - static_assert(std::is_convertible::value, "Invalid Type for ax::Map!"); + static_assert(std::is_convertible::value, "Invalid Type for ax::Map!"); AXLOGINFO("In the constructor with capacity of Map!"); _data.reserve(capacity); } @@ -104,7 +104,7 @@ class Map /** Copy constructor. */ Map(const Map& other) { - static_assert(std::is_convertible::value, "Invalid Type for ax::Map!"); + static_assert(std::is_convertible::value, "Invalid Type for ax::Map!"); AXLOGINFO("In the copy constructor of Map!"); _data = other._data; addRefForAllObjects(); @@ -113,7 +113,7 @@ class Map /** Move constructor. */ Map(Map&& other) { - static_assert(std::is_convertible::value, "Invalid Type for ax::Map!"); + static_assert(std::is_convertible::value, "Invalid Type for ax::Map!"); AXLOGINFO("In the move constructor of Map!"); _data = std::move(other._data); } diff --git a/core/base/Ref.cpp b/core/base/Object.cpp similarity index 81% rename from core/base/Ref.cpp rename to core/base/Object.cpp index 6c1551e18904..cdcd53eeda16 100644 --- a/core/base/Ref.cpp +++ b/core/base/Object.cpp @@ -25,12 +25,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "base/Ref.h" +#include "base/Object.h" #include "base/AutoreleasePool.h" #include "base/Macros.h" #include "base/ScriptSupport.h" -#if AX_REF_LEAK_DETECTION +#if AX_OBJECT_LEAK_DETECTION # include // std::find # include # include @@ -39,13 +39,13 @@ THE SOFTWARE. NS_AX_BEGIN -#if AX_REF_LEAK_DETECTION -static void trackRef(Ref* ref); -static void untrackRef(Ref* ref); +#if AX_OBJECT_LEAK_DETECTION +static void trackRef(Object* ref); +static void untrackRef(Object* ref); #endif -Ref::Ref() - : _referenceCount(1) // when the Ref is created, the reference count of it is 1 +Object::Object() + : _referenceCount(1) // when the Object is created, the reference count of it is 1 #if AX_ENABLE_SCRIPT_BINDING , _luaID(0) , _scriptObject(nullptr) @@ -57,12 +57,12 @@ Ref::Ref() _ID = ++uObjectCount; #endif -#if AX_REF_LEAK_DETECTION +#if AX_OBJECT_LEAK_DETECTION trackRef(this); #endif } -Ref::~Ref() +Object::~Object() { #if AX_ENABLE_SCRIPT_BINDING ScriptEngineProtocol* pEngine = ScriptEngineManager::getInstance()->getScriptEngine(); @@ -73,19 +73,19 @@ Ref::~Ref() } #endif // AX_ENABLE_SCRIPT_BINDING -#if AX_REF_LEAK_DETECTION +#if AX_OBJECT_LEAK_DETECTION if (_referenceCount != 0) untrackRef(this); #endif } -void Ref::retain() +void Object::retain() { AXASSERT(_referenceCount > 0, "reference count should be greater than 0"); ++_referenceCount; } -void Ref::release() +void Object::release() { AXASSERT(_referenceCount > 0, "reference count should be greater than 0"); --_referenceCount; @@ -96,19 +96,19 @@ void Ref::release() auto poolManager = PoolManager::getInstance(); if (!poolManager->getCurrentPool()->isClearing() && poolManager->isObjectInPools(this)) { - // Trigger an assert if the reference count is 0 but the Ref is still in autorelease pool. + // Trigger an assert if the reference count is 0 but the Object is still in autorelease pool. // This happens when 'autorelease/release' were not used in pairs with 'new/retain'. // // Wrong usage (1): // - // auto obj = Node::create(); // Ref = 1, but it's an autorelease Ref which means it was in the + // auto obj = Node::create(); // Object = 1, but it's an autorelease Object which means it was in the // autorelease pool. obj->autorelease(); // Wrong: If you wish to invoke autorelease several times, you // should retain `obj` first. // // Wrong usage (2): // // auto obj = Node::create(); - // obj->release(); // Wrong: obj is an autorelease Ref, it will be released when clearing current pool. + // obj->release(); // Wrong: obj is an autorelease Object, it will be released when clearing current pool. // // Correct usage (1): // @@ -128,52 +128,52 @@ void Ref::release() } #endif -#if AX_REF_LEAK_DETECTION +#if AX_OBJECT_LEAK_DETECTION untrackRef(this); #endif delete this; } } -Ref* Ref::autorelease() +Object* Object::autorelease() { PoolManager::getInstance()->getCurrentPool()->addObject(this); return this; } -unsigned int Ref::getReferenceCount() const +unsigned int Object::getReferenceCount() const { return _referenceCount; } -#if AX_REF_LEAK_DETECTION +#if AX_OBJECT_LEAK_DETECTION -static std::vector __refAllocationList; +static std::vector __refAllocationList; static std::mutex __refMutex; -void Ref::printLeaks() +void Object::printLeaks() { std::lock_guard refLockGuard(__refMutex); - // Dump Ref object memory leaks + // Dump Object object memory leaks if (__refAllocationList.empty()) { - AXLOGI("[memory] All Ref objects successfully cleaned up (no leaks detected).\n"); + AXLOGI("[memory] All Object objects successfully cleaned up (no leaks detected).\n"); } else { - AXLOGI("[memory] WARNING: {} Ref objects still active in memory.\n", (int)__refAllocationList.size()); + AXLOGI("[memory] WARNING: {} objects still active in memory.\n", (int)__refAllocationList.size()); for (const auto& ref : __refAllocationList) { AX_ASSERT(ref); const char* type = typeid(*ref).name(); - AXLOGI("[memory] LEAK: Ref object '{}' still active with reference count {}.\n", (type ? type : ""), + AXLOGI("[memory] LEAK: object '{}' still active with reference count {}.\n", (type ? type : ""), ref->getReferenceCount()); } } } -static void trackRef(Ref* ref) +static void trackRef(Object* ref) { std::lock_guard refLockGuard(__refMutex); AXASSERT(ref, "Invalid parameter, ref should not be null!"); @@ -182,7 +182,7 @@ static void trackRef(Ref* ref) __refAllocationList.emplace_back(ref); } -static void untrackRef(Ref* ref) +static void untrackRef(Object* ref) { std::lock_guard refLockGuard(__refMutex); auto iter = std::find(__refAllocationList.begin(), __refAllocationList.end(), ref); @@ -195,6 +195,6 @@ static void untrackRef(Ref* ref) __refAllocationList.erase(iter); } -#endif // #if AX_REF_LEAK_DETECTION +#endif // #if AX_OBJECT_LEAK_DETECTION NS_AX_END diff --git a/core/base/Ref.h b/core/base/Object.h similarity index 74% rename from core/base/Ref.h rename to core/base/Object.h index 7a444ff52bc4..d042e4f27365 100644 --- a/core/base/Ref.h +++ b/core/base/Object.h @@ -2,6 +2,7 @@ Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2013-2017 Chukong Technologies Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. +Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). https://axmolengine.github.io/ @@ -24,13 +25,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __BASE_CCREF_H__ -#define __BASE_CCREF_H__ +#ifndef __BASE_OBJECT_H__ +#define __BASE_OBJECT_H__ #include "platform/PlatformMacros.h" #include "base/Config.h" -#define AX_REF_LEAK_DETECTION 0 +#define AX_OBJECT_LEAK_DETECTION 0 /** * @addtogroup base @@ -38,17 +39,17 @@ THE SOFTWARE. */ NS_AX_BEGIN -class Ref; +class Object; /** - * Interface that defines how to clone an Ref. + * Interface that defines how to clone an Object. * @lua NA * @js NA */ class AX_DLL Clonable { public: - /** Returns a copy of the Ref. */ + /** Returns a copy of the Object. */ virtual Clonable* clone() const = 0; /** @@ -59,17 +60,17 @@ class AX_DLL Clonable }; /** - * Ref is used for reference count management. If a class inherits from Ref, + * Object is used for reference count management. If a class inherits from Object, * then it is easy to be shared in different places. * @js NA */ -class AX_DLL Ref +class AX_DLL Object { public: /** * Retains the ownership. * - * This increases the Ref's reference count. + * This increases the Object's reference count. * * @see release, autorelease * @js NA @@ -79,9 +80,9 @@ class AX_DLL Ref /** * Releases the ownership immediately. * - * This decrements the Ref's reference count. + * This decrements the Object's reference count. * - * If the reference count reaches 0 after the decrement, this Ref is + * If the reference count reaches 0 after the decrement, this Object is * destructed. * * @see retain, autorelease @@ -92,24 +93,24 @@ class AX_DLL Ref /** * Releases the ownership sometime soon automatically. * - * This decrements the Ref's reference count at the end of current + * This decrements the Object's reference count at the end of current * autorelease pool block. * - * If the reference count reaches 0 after the decrement, this Ref is + * If the reference count reaches 0 after the decrement, this Object is * destructed. * - * @returns The Ref itself. + * @returns The Object itself. * * @see AutoreleasePool, retain, release * @js NA * @lua NA */ - Ref* autorelease(); + Object* autorelease(); /** - * Returns the Ref's current reference count. + * Returns the Object's current reference count. * - * @returns The Ref's reference count. + * @returns The Object's reference count. * @js NA */ unsigned int getReferenceCount() const; @@ -118,10 +119,10 @@ class AX_DLL Ref /** * Constructor * - * The Ref's reference count is 1 after construction. + * The Object's reference count is 1 after construction. * @js NA */ - Ref(); + Object(); public: /** @@ -130,7 +131,7 @@ class AX_DLL Ref * @js NA * @lua NA */ - virtual ~Ref(); + virtual ~Object(); protected: /// count of references @@ -153,8 +154,8 @@ class AX_DLL Ref bool _rooted; #endif - // Memory leak diagnostic data (only included when AX_REF_LEAK_DETECTION is defined and its value isn't zero) -#if AX_REF_LEAK_DETECTION + // Memory leak diagnostic data (only included when AX_OBJECT_LEAK_DETECTION is defined and its value isn't zero) +#if AX_OBJECT_LEAK_DETECTION public: static void printLeaks(); #endif @@ -162,12 +163,12 @@ class AX_DLL Ref class Node; -typedef void (Ref::*SEL_CallFunc)(); -typedef void (Ref::*SEL_CallFuncN)(Node*); -typedef void (Ref::*SEL_CallFuncND)(Node*, void*); -typedef void (Ref::*SEL_CallFuncO)(Ref*); -typedef void (Ref::*SEL_MenuHandler)(Ref*); -typedef void (Ref::*SEL_SCHEDULE)(float); +typedef void (Object::*SEL_CallFunc)(); +typedef void (Object::*SEL_CallFuncN)(Node*); +typedef void (Object::*SEL_CallFuncND)(Node*, void*); +typedef void (Object::*SEL_CallFuncO)(Object*); +typedef void (Object::*SEL_MenuHandler)(Object*); +typedef void (Object::*SEL_SCHEDULE)(float); #define AX_CALLFUNC_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) #define AX_CALLFUNCN_SELECTOR(_SELECTOR) static_cast(&_SELECTOR) diff --git a/core/base/ObjectFactory.cpp b/core/base/ObjectFactory.cpp index e58a41d9d1cc..4fa7a3b95c6a 100644 --- a/core/base/ObjectFactory.cpp +++ b/core/base/ObjectFactory.cpp @@ -85,9 +85,9 @@ void ObjectFactory::destroyInstance() AX_SAFE_DELETE(_sharedFactory); } -Ref* ObjectFactory::createObject(std::string_view name) +Object* ObjectFactory::createObject(std::string_view name) { - Ref* o = nullptr; + Object* o = nullptr; do { // const TInfo t = _typeMap[name.data]; diff --git a/core/base/ObjectFactory.h b/core/base/ObjectFactory.h index b71b31eb0815..46614c027968 100644 --- a/core/base/ObjectFactory.h +++ b/core/base/ObjectFactory.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include #include #include -#include "base/Ref.h" +#include "base/Object.h" #include "platform/PlatformMacros.h" NS_AX_BEGIN @@ -37,8 +37,8 @@ NS_AX_BEGIN class AX_DLL ObjectFactory { public: - typedef ax::Ref* (*Instance)(void); - typedef std::function InstanceFunc; + typedef ax::Object* (*Instance)(void); + typedef std::function InstanceFunc; struct AX_DLL TInfo { TInfo(); @@ -55,7 +55,7 @@ class AX_DLL ObjectFactory static ObjectFactory* getInstance(); static void destroyInstance(); - ax::Ref* createObject(std::string_view name); + ax::Object* createObject(std::string_view name); void registerType(const TInfo& t); void removeAll(); diff --git a/core/base/Profiling.h b/core/base/Profiling.h index 38b87f66aa8b..20be4397a741 100644 --- a/core/base/Profiling.h +++ b/core/base/Profiling.h @@ -33,7 +33,7 @@ THE SOFTWARE. #include #include #include "base/Config.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Map.h" NS_AX_BEGIN @@ -96,7 +96,7 @@ class AX_DLL Profiler Map _activeTimers; }; -class ProfilingTimer : public Ref +class ProfilingTimer : public Object { public: /** diff --git a/core/base/Properties.h b/core/base/Properties.h index 35f5ad406fc7..67a3d1f49b58 100644 --- a/core/base/Properties.h +++ b/core/base/Properties.h @@ -30,7 +30,7 @@ #include "renderer/Texture2D.h" #include "platform/PlatformMacros.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Types.h" #include "base/Vector.h" diff --git a/core/base/RefPtr.h b/core/base/RefPtr.h index 93e7829f98c1..42e1777e1423 100644 --- a/core/base/RefPtr.h +++ b/core/base/RefPtr.h @@ -28,7 +28,7 @@ #define __AX_REF_PTR_H__ /// @cond DO_NOT_SHOW -#include "base/Ref.h" +#include "base/Object.h" #include "base/Macros.h" #include #include @@ -45,7 +45,7 @@ NS_AX_BEGIN { \ if (ptr) \ { \ - const_cast(static_cast(ptr))->retain(); \ + const_cast(static_cast(ptr))->retain(); \ } \ \ } while (0); @@ -56,7 +56,7 @@ NS_AX_BEGIN { \ if (ptr) \ { \ - const_cast(static_cast(ptr))->release(); \ + const_cast(static_cast(ptr))->release(); \ } \ \ } while (0); @@ -67,7 +67,7 @@ NS_AX_BEGIN { \ if (ptr) \ { \ - const_cast(static_cast(ptr))->release(); \ + const_cast(static_cast(ptr))->release(); \ ptr = nullptr; \ } \ \ @@ -81,7 +81,7 @@ struct ReferencedObject }; /** - * Wrapper class which maintains a strong reference to a cocos2dx ax::Ref* type object. + * Wrapper class which maintains a strong reference to a cocos2dx ax::Object* type object. * Similar in concept to a boost smart pointer. * * Enables the use of the RAII idiom with Cocos2dx objects and helps automate some of the more @@ -249,8 +249,8 @@ class RefPtr private: T* _ptr; - // NOTE: We can ensure T is derived from ax::Ref at compile time here. - static_assert(std::is_base_of::type>::value, "T must be derived from Ref"); + // NOTE: We can ensure T is derived from ax::Object at compile time here. + static_assert(std::is_base_of::type>::value, "T must be derived from Object"); }; template diff --git a/core/base/Scheduler.cpp b/core/base/Scheduler.cpp index a0fcf02a1ac0..eb6f61c0edec 100644 --- a/core/base/Scheduler.cpp +++ b/core/base/Scheduler.cpp @@ -122,7 +122,7 @@ TimerTargetSelector::TimerTargetSelector() : _target(nullptr), _selector(nullptr bool TimerTargetSelector::initWithSelector(Scheduler* scheduler, SEL_SCHEDULE selector, - Ref* target, + Object* target, float seconds, unsigned int repeat, float delay) @@ -868,7 +868,7 @@ void Scheduler::update(float dt) } void Scheduler::schedule(SEL_SCHEDULE selector, - Ref* target, + Object* target, float interval, unsigned int repeat, float delay, @@ -916,17 +916,17 @@ void Scheduler::schedule(SEL_SCHEDULE selector, timer->release(); } -void Scheduler::schedule(SEL_SCHEDULE selector, Ref* target, float interval, bool paused) +void Scheduler::schedule(SEL_SCHEDULE selector, Object* target, float interval, bool paused) { this->schedule(selector, target, interval, AX_REPEAT_FOREVER, 0.0f, paused); } -bool Scheduler::isScheduled(SEL_SCHEDULE selector, const Ref* target) const +bool Scheduler::isScheduled(SEL_SCHEDULE selector, const Object* target) const { AXASSERT(selector, "Argument selector must be non-nullptr"); AXASSERT(target, "Argument target must be non-nullptr"); - auto timerIt = _timersMap.find(const_cast(target)); + auto timerIt = _timersMap.find(const_cast(target)); if (timerIt == _timersMap.end()) { return false; @@ -942,7 +942,7 @@ bool Scheduler::isScheduled(SEL_SCHEDULE selector, const Ref* target) const return found; } -void Scheduler::unschedule(SEL_SCHEDULE selector, Ref* target) +void Scheduler::unschedule(SEL_SCHEDULE selector, Object* target) { // explicit handle nil arguments when removing an object if (target == nullptr || selector == nullptr) diff --git a/core/base/Scheduler.h b/core/base/Scheduler.h index 270189fc2dfa..7c69fa73b3a9 100644 --- a/core/base/Scheduler.h +++ b/core/base/Scheduler.h @@ -33,7 +33,7 @@ THE SOFTWARE. #include #include #include "base/axstd.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Vector.h" NS_AX_BEGIN @@ -45,7 +45,7 @@ typedef std::function ccSchedulerFunc; /** * @cond */ -class AX_DLL Timer : public Ref +class AX_DLL Timer : public Object { protected: Timer(); @@ -83,7 +83,7 @@ class AX_DLL TimerTargetSelector : public Timer * delay in seconds. */ bool initWithSelector(Scheduler* scheduler, SEL_SCHEDULE selector, - Ref* target, + Object* target, float seconds, unsigned int repeat, float delay); @@ -94,7 +94,7 @@ class AX_DLL TimerTargetSelector : public Timer virtual void cancel() override; protected: - Ref* _target; + Object* _target; SEL_SCHEDULE _selector; }; @@ -192,7 +192,7 @@ The 'custom selectors' should be avoided when possible. It is faster, and consum selector'. */ -class AX_DLL Scheduler : public Ref +class AX_DLL Scheduler : public Object { public: /** Priority level reserved for system services. @@ -303,7 +303,7 @@ class AX_DLL Scheduler : public Ref @param paused Whether or not to pause the schedule. @since v3.0 */ - void schedule(SEL_SCHEDULE selector, Ref* target, float interval, unsigned int repeat, float delay, bool paused); + void schedule(SEL_SCHEDULE selector, Object* target, float interval, unsigned int repeat, float delay, bool paused); /** The scheduled method will be called every `interval` seconds for ever. @param selector The callback function. @@ -312,7 +312,7 @@ class AX_DLL Scheduler : public Ref frame. @param paused Whether or not to pause the schedule. */ - void schedule(SEL_SCHEDULE selector, Ref* target, float interval, bool paused); + void schedule(SEL_SCHEDULE selector, Object* target, float interval, bool paused); /** Schedules the 'update' selector for a given target with a given priority. The 'update' selector will be called every frame. @@ -357,7 +357,7 @@ class AX_DLL Scheduler : public Ref @param target The target of the unscheduled selector. @since v3.0 */ - void unschedule(SEL_SCHEDULE selector, Ref* target); + void unschedule(SEL_SCHEDULE selector, Object* target); /** Unschedules the update selector for a given target @param target The target to be unscheduled. @@ -414,7 +414,7 @@ class AX_DLL Scheduler : public Ref @return True if the specified selector is invoked, false if not. @since v3.0 */ - bool isScheduled(SEL_SCHEDULE selector, const Ref* target) const; + bool isScheduled(SEL_SCHEDULE selector, const Object* target) const; ///////////////////////////////////// diff --git a/core/base/ScriptSupport.h b/core/base/ScriptSupport.h index 37416136fbce..0402688da9db 100644 --- a/core/base/ScriptSupport.h +++ b/core/base/ScriptSupport.h @@ -65,7 +65,7 @@ enum ccScriptType * unique id * @js NA */ -class ScriptHandlerEntry : public Ref +class ScriptHandlerEntry : public Object { public: /** @@ -486,7 +486,7 @@ struct KeypadScriptData /** * For Lua, the CommonScriptData is used to find the Lua function pointer by the handler, then call the Lua function by * push the eventName, eventSource(if it not nullptr), eventSourceClassName(if it is nullptr or "", and the eventSource - * is not nullptr,would give the default string "cc.Ref") into the Lua stack as the parameter when the common event such + * is not nullptr,would give the default string "cc.Object") into the Lua stack as the parameter when the common event such * as is triggered. * @js NA */ @@ -512,7 +512,7 @@ struct CommonScriptData * @lua NA * @js NA */ - Ref* eventSource; + Object* eventSource; /** * The class name of source object trigger the event, could be nullptr. * @@ -527,7 +527,7 @@ struct CommonScriptData * @lua NA * @js NA */ - CommonScriptData(int inHandler, const char* inName, Ref* inSource = nullptr, const char* inClassName = nullptr) + CommonScriptData(int inHandler, const char* inName, Object* inSource = nullptr, const char* inClassName = nullptr) : handler(inHandler), eventSource(inSource) { if (nullptr == inName) @@ -619,22 +619,22 @@ class AX_DLL ScriptEngineProtocol /** * Reflect the retain relationship to script scope */ - virtual void retainScriptObject(Ref* /*owner*/, Ref* /*target*/) {} + virtual void retainScriptObject(Object* /*owner*/, Object* /*target*/) {} /** * Add the script object to root object */ - virtual void rootScriptObject(Ref* /*target*/) {} + virtual void rootScriptObject(Object* /*target*/) {} /** * Reflect the release relationship to script scope */ - virtual void releaseScriptObject(Ref* /*owner*/, Ref* /*target*/) {} + virtual void releaseScriptObject(Object* /*owner*/, Object* /*target*/) {} /** * Remove the script object from root object */ - virtual void unrootScriptObject(Ref* /*target*/) {} + virtual void unrootScriptObject(Object* /*target*/) {} /** * Release all children native refs for the given node in script scope @@ -644,7 +644,7 @@ class AX_DLL ScriptEngineProtocol /** * Release all native refs for the given owner in script scope */ - virtual void releaseAllNativeRefs(ax::Ref* /*owner*/) {} + virtual void releaseAllNativeRefs(ax::Object* /*owner*/) {} /** * Remove script object,The specific meaning should refer to the ScriptType. @@ -653,7 +653,7 @@ class AX_DLL ScriptEngineProtocol * @lua NA * @js NA */ - virtual void removeScriptObjectByObject(Ref* /*obj*/) {} + virtual void removeScriptObjectByObject(Object* /*obj*/) {} /** * Remove script function handler, only LuaEngine class need to implement this function. @@ -761,16 +761,16 @@ class AX_DLL ScriptEngineProtocol /** Root a Reference. It tells the Garbage Collector that the associated Scripting object should not be collected */ - virtual void rootObject(Ref* /*obj*/) {} + virtual void rootObject(Object* /*obj*/) {} /** Unroot a Reference. It tells the Garbage Collector that the associated Scripting object can be collected */ - virtual void unrootObject(Ref* /*obj*/) {} + virtual void unrootObject(Object* /*obj*/) {} /** Remove proxy for a native object */ - virtual void removeObjectProxy(Ref* obj) {} + virtual void removeObjectProxy(Object* obj) {} /** Triggers the garbage collector */ virtual void garbageCollect() {} diff --git a/core/base/Touch.h b/core/base/Touch.h index 705b27109079..98ca9df4488f 100644 --- a/core/base/Touch.h +++ b/core/base/Touch.h @@ -27,7 +27,7 @@ THE SOFTWARE. #ifndef __AX_TOUCH_H__ #define __AX_TOUCH_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" NS_AX_BEGIN @@ -41,7 +41,7 @@ NS_AX_BEGIN * @brief Encapsulates the Touch information, such as touch point, id and so on, and provides the methods that commonly used. */ -class AX_DLL Touch : public Ref +class AX_DLL Touch : public Object { public: /** diff --git a/core/base/Types.h b/core/base/Types.h index c99f2a0adc8a..867483a6ca56 100644 --- a/core/base/Types.h +++ b/core/base/Types.h @@ -31,7 +31,7 @@ THE SOFTWARE. #include #include "math/Math.h" -#include "base/Ref.h" +#include "base/Object.h" #include "renderer/backend/Types.h" #include "Enums.h" @@ -414,7 +414,7 @@ struct AX_DLL FontDefinition /** @struct Acceleration * The device accelerometer reports values for each axis in units of g-force. */ -class AX_DLL Acceleration : public Ref +class AX_DLL Acceleration : public Object { public: double x = 0; diff --git a/core/base/Utils.h b/core/base/Utils.h index 3bca25fbb7ae..348bf5106c2c 100644 --- a/core/base/Utils.h +++ b/core/base/Utils.h @@ -276,7 +276,7 @@ AX_DLL void killCurrentProcess(); * Create a Game Object, like CREATE_FUNC, but more powerful * @return Returns a RefPtr game object -* @remark Auto manage ax::Ref reference count, use std::unique_ptr +* @remark Auto manage ax::Object reference count, use std::unique_ptr * @limition The init function finit must be public */ template @@ -294,7 +294,7 @@ static RefPtr makeInstance(F&& memf, Ts&&... args) * Create a Game Object with 'bool T::init()', like CREATE_FUNC, but more powerful * @return Returns a autorelease game object -* @remark Auto manage ax::Ref reference count, use std::unique_ptr +* @remark Auto manage ax::Object reference count, use std::unique_ptr * @limition The init function finit must be public */ template @@ -307,7 +307,7 @@ inline static RefPtr makeInstance() * Create a Game Object, like CREATE_FUNC, but more powerful * @return Returns a autorelease game object -* @remark Auto manage ax::Ref reference count, use AutoReleasePool +* @remark Auto manage ax::Object reference count, use AutoReleasePool * @limition The init function finit must be public */ template @@ -328,7 +328,7 @@ inline T* createInstance(F&& finit, Ts&&... args) * Create a Game Object with 'bool T::init()', like CREATE_FUNC, but more powerful * @return Returns a autorelease game object -* @remark Auto manage ax::Ref reference count, use AutoReleasePool +* @remark Auto manage ax::Object reference count, use AutoReleasePool * @limition The init function finit must be public */ template diff --git a/core/base/Vector.h b/core/base/Vector.h index e3fff71e7a85..860140bd98b0 100644 --- a/core/base/Vector.h +++ b/core/base/Vector.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __CCVECTOR_H__ #include "base/Macros.h" -#include "base/Ref.h" +#include "base/Object.h" #include #include #include // for std::find @@ -41,8 +41,8 @@ NS_AX_BEGIN /* * Similar to std::vector, but it will manage reference count automatically internally. - * Which means it will invoke Ref::retain() when adding an element, and invoke Ref::release() when removing an element. - * @warn The element should be `Ref` or its sub-class. + * Which means it will invoke Object::retain() when adding an element, and invoke Object::release() when removing an element. + * @warn The element should be `Object` or its sub-class. * @lua NA */ template @@ -110,7 +110,7 @@ class Vector /** Constructor. */ Vector() : _data() { - static_assert(std::is_convertible::value, "Invalid Type for ax::Vector!"); + static_assert(std::is_convertible::value, "Invalid Type for ax::Vector!"); } /** @@ -119,7 +119,7 @@ class Vector */ explicit Vector(ssize_t capacity) : _data() { - static_assert(std::is_convertible::value, "Invalid Type for ax::Vector!"); + static_assert(std::is_convertible::value, "Invalid Type for ax::Vector!"); AXLOGINFO("In the default constructor with capacity of Vector."); reserve(capacity); } @@ -143,7 +143,7 @@ class Vector /** Copy constructor. */ Vector(const Vector& other) { - static_assert(std::is_convertible::value, "Invalid Type for ax::Vector!"); + static_assert(std::is_convertible::value, "Invalid Type for ax::Vector!"); AXLOGINFO("In the copy constructor!"); _data = other._data; addRefForAllObjects(); @@ -152,7 +152,7 @@ class Vector /** Constructor with std::move semantic. */ Vector(Vector&& other) { - static_assert(std::is_convertible::value, "Invalid Type for ax::Vector!"); + static_assert(std::is_convertible::value, "Invalid Type for ax::Vector!"); AXLOGINFO("In the move constructor of Vector!"); _data = std::move(other._data); } diff --git a/core/cocos2d.h b/core/cocos2d.h index 58fb5285c438..9276d06607c6 100644 --- a/core/cocos2d.h +++ b/core/cocos2d.h @@ -44,6 +44,7 @@ using Sprite3D = MeshRenderer; using Sprite3DMaterial = MeshMaterial; using Sprite3DCache = MeshRendererCache; using Sprite3DMaterialCache = MeshMaterialCache; +using Ref = Object; #define setDisplayStats setStatsDisplay @@ -51,45 +52,45 @@ NS_AX_END namespace cocos2d = ax; -#define USING_NS_CC USING_NS_AX +#define USING_NS_CC USING_NS_AX -#define CC_SAFE_RELEASE AX_SAFE_RELEASE -#define CC_SAFE_RELEASE_NULL AX_SAFE_RELEASE_NULL -#define CC_SAFE_DELETE AX_SAFE_DELETE -#define CCASSERT AXASSERT -#define CC_ASSERT AX_ASSERT -#define CC_CONSTRUCTOR_ACCESS public +#define CC_SAFE_RELEASE AX_SAFE_RELEASE +#define CC_SAFE_RELEASE_NULL AX_SAFE_RELEASE_NULL +#define CC_SAFE_DELETE AX_SAFE_DELETE +#define CCASSERT AXASSERT +#define CC_ASSERT AX_ASSERT +#define CC_CONSTRUCTOR_ACCESS public -#define CCLOG AXLOG -#define CCLOGINFO AXLOGINFO -#define CCLOGWARN AXLOGWARN -#define CCLOGERROR AXLOGERROR +#define CCLOG AXLOG +#define CCLOGINFO AXLOGINFO +#define CCLOGWARN AXLOGWARN +#define CCLOGERROR AXLOGERROR -#define CC_DEPRECATED_ATTRIBUTE AX_DEPRECATED_ATTRIBUTE +#define CC_DEPRECATED_ATTRIBUTE AX_DEPRECATED_ATTRIBUTE -#define CC_SAFE_RETAIN AX_SAFE_RETAIN +#define CC_SAFE_RETAIN AX_SAFE_RETAIN -#define CC_SYNTHESIZE_READONLY AX_SYNTHESIZE_READONLY -#define CC_SYNTHESIZE AX_SYNTHESIZE -#define CC_PROPERTY AX_PROPERTY +#define CC_SYNTHESIZE_READONLY AX_SYNTHESIZE_READONLY +#define CC_SYNTHESIZE AX_SYNTHESIZE +#define CC_PROPERTY AX_PROPERTY -#define CC_USE_CULLING AX_USE_CULLING +#define CC_USE_CULLING AX_USE_CULLING -#define CC_CALLBACK_0 AX_CALLBACK_0 -#define CC_CALLBACK_1 AX_CALLBACK_1 -#define CC_CALLBACK_2 AX_CALLBACK_2 +#define CC_CALLBACK_0 AX_CALLBACK_0 +#define CC_CALLBACK_1 AX_CALLBACK_1 +#define CC_CALLBACK_2 AX_CALLBACK_2 -#define CC_SCHEDULE_SELECTOR AX_SCHEDULE_SELECTOR +#define CC_SCHEDULE_SELECTOR AX_SCHEDULE_SELECTOR -#define CC_INVALID_INDEX AX_INVALID_INDEX +#define CC_INVALID_INDEX AX_INVALID_INDEX -#define CC_TARGET_PLATFORM AX_TARGET_PLATFORM -#define CC_PLATFORM_UNKNOWN AX_PLATFORM_UNKNOWN -#define CC_PLATFORM_IOS AX_PLATFORM_IOS -#define CC_PLATFORM_ANDROID AX_PLATFORM_ANDROID -#define CC_PLATFORM_WIN32 AX_PLATFORM_WIN32 -#define CC_PLATFORM_LINUX AX_PLATFORM_LINUX -#define CC_PLATFORM_MAC AX_PLATFORM_MAC +#define CC_TARGET_PLATFORM AX_TARGET_PLATFORM +#define CC_PLATFORM_UNKNOWN AX_PLATFORM_UNKNOWN +#define CC_PLATFORM_IOS AX_PLATFORM_IOS +#define CC_PLATFORM_ANDROID AX_PLATFORM_ANDROID +#define CC_PLATFORM_WIN32 AX_PLATFORM_WIN32 +#define CC_PLATFORM_LINUX AX_PLATFORM_LINUX +#define CC_PLATFORM_MAC AX_PLATFORM_MAC #define CC_REQUIRES_NULL_TERMINATION AX_REQUIRES_NULL_TERMINATION diff --git a/core/navmesh/NavMesh.h b/core/navmesh/NavMesh.h index 9158f4d39281..5827f0692970 100644 --- a/core/navmesh/NavMesh.h +++ b/core/navmesh/NavMesh.h @@ -30,7 +30,7 @@ #include "base/Config.h" #if defined(AX_ENABLE_NAVMESH) -# include "base/Ref.h" +# include "base/Object.h" # include "math/Vec3.h" # include "recast/DetourNavMesh.h" # include "recast/DetourNavMeshQuery.h" @@ -52,7 +52,7 @@ NS_AX_BEGIN */ class Renderer; /** @brief NavMesh: The NavMesh information container, include mesh, tileCache, and so on. */ -class AX_DLL NavMesh : public Ref +class AX_DLL NavMesh : public Object { public: /** diff --git a/core/navmesh/NavMeshAgent.h b/core/navmesh/NavMeshAgent.h index ac531810ee61..b2e019c0327d 100644 --- a/core/navmesh/NavMeshAgent.h +++ b/core/navmesh/NavMeshAgent.h @@ -31,7 +31,7 @@ #if defined(AX_ENABLE_NAVMESH) # include "2d/Component.h" -# include "base/Ref.h" +# include "base/Object.h" # include "math/Vec3.h" # include "recast/DetourCrowd.h" diff --git a/core/navmesh/NavMeshObstacle.h b/core/navmesh/NavMeshObstacle.h index 7d5fddc30e47..1a1a03d8ed91 100644 --- a/core/navmesh/NavMeshObstacle.h +++ b/core/navmesh/NavMeshObstacle.h @@ -32,7 +32,7 @@ # include "2d/Component.h" -# include "base/Ref.h" +# include "base/Object.h" # include "math/Vec3.h" # include "recast/DetourNavMesh.h" # include "recast/DetourTileCache.h" diff --git a/core/network/HttpRequest.h b/core/network/HttpRequest.h index 079746d364a5..74a50d3e22d3 100644 --- a/core/network/HttpRequest.h +++ b/core/network/HttpRequest.h @@ -32,7 +32,7 @@ #include #include #include -#include "base/Ref.h" +#include "base/Object.h" #include "base/Macros.h" #include "yasio/byte_buffer.hpp" @@ -60,7 +60,7 @@ typedef std::function ccHttpRe * @lua NA */ -class AX_DLL HttpRequest : public Ref +class AX_DLL HttpRequest : public Object { friend class HttpClient; @@ -96,9 +96,9 @@ class AX_DLL HttpRequest : public Ref * Override autorelease method to avoid developers to call it. * If this function was called, it would trigger assert in debug mode * - * @return Ref* always return nullptr. + * @return Object* always return nullptr. */ - Ref* autorelease() + Object* autorelease() { AXASSERT(false, "HttpResponse is used between network thread and ui thread \ diff --git a/core/network/HttpResponse.h b/core/network/HttpResponse.h index 9d05677b20d0..f686d1109895 100644 --- a/core/network/HttpResponse.h +++ b/core/network/HttpResponse.h @@ -51,7 +51,7 @@ class HttpClient; * @since v2.0.2. * @lua NA */ -class AX_DLL HttpResponse : public ax::Ref +class AX_DLL HttpResponse : public ax::Object { friend class HttpClient; @@ -85,9 +85,9 @@ class AX_DLL HttpResponse : public ax::Ref /** * Override autorelease method to prevent developers from calling it. * If this method is called , it would trigger AXASSERT. - * @return ax::Ref* always return nullptr. + * @return ax::Object* always return nullptr. */ - ax::Ref* autorelease() + ax::Object* autorelease() { AXASSERT(false, "HttpResponse is used between network thread and ui thread \ diff --git a/core/network/WebSocket-wasm.h b/core/network/WebSocket-wasm.h index bd4676b22376..5b0f1a952a88 100644 --- a/core/network/WebSocket-wasm.h +++ b/core/network/WebSocket-wasm.h @@ -2,7 +2,7 @@ #include "platform/PlatformMacros.h" #include -#include "base/Ref.h" +#include "base/Object.h" #include "yasio/byte_buffer.hpp" #include diff --git a/core/network/WebSocket.h b/core/network/WebSocket.h index a9c352532d32..a0b8d830e596 100644 --- a/core/network/WebSocket.h +++ b/core/network/WebSocket.h @@ -111,7 +111,7 @@ class AX_DLL WebSocket CLOSED, /** < value 3 */ }; - class Event : public ax::Ref + class Event : public ax::Object { public: enum class Type diff --git a/core/physics/PhysicsContact.h b/core/physics/PhysicsContact.h index 873440c625e1..68df28e7264d 100644 --- a/core/physics/PhysicsContact.h +++ b/core/physics/PhysicsContact.h @@ -30,7 +30,7 @@ #include "base/Config.h" #if defined(AX_ENABLE_PHYSICS) -# include "base/Ref.h" +# include "base/Object.h" # include "math/Math.h" # include "base/EventListenerCustom.h" # include "base/Event.h" diff --git a/core/physics/PhysicsJoint.h b/core/physics/PhysicsJoint.h index 1b895071c6d5..df9e40397f8e 100644 --- a/core/physics/PhysicsJoint.h +++ b/core/physics/PhysicsJoint.h @@ -32,7 +32,7 @@ #include "base/Config.h" #if defined(AX_ENABLE_PHYSICS) -# include "base/Ref.h" +# include "base/Object.h" # include "math/Math.h" struct cpConstraint; diff --git a/core/physics/PhysicsShape.h b/core/physics/PhysicsShape.h index 8957d69b3521..9c7269b938c2 100644 --- a/core/physics/PhysicsShape.h +++ b/core/physics/PhysicsShape.h @@ -30,7 +30,7 @@ #include "base/Config.h" #if defined(AX_ENABLE_PHYSICS) -# include "base/Ref.h" +# include "base/Object.h" # include "math/Math.h" struct cpShape; @@ -66,7 +66,7 @@ const PhysicsMaterial PHYSICSSHAPE_MATERIAL_DEFAULT; * @brief A shape for body. You do not create PhysicsWorld objects directly, instead, you can view PhysicsBody to see * how to create it. */ -class AX_DLL PhysicsShape : public Ref +class AX_DLL PhysicsShape : public Object { public: enum class Type diff --git a/core/physics3d/Physics3DConstraint.h b/core/physics3d/Physics3DConstraint.h index f21d284eb3fe..669df939ccdf 100644 --- a/core/physics3d/Physics3DConstraint.h +++ b/core/physics3d/Physics3DConstraint.h @@ -28,7 +28,7 @@ #define __PHYSICS_3D_CONSTRAINT_H__ #include "math/Math.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Config.h" #if defined(AX_ENABLE_3D_PHYSICS) @@ -48,7 +48,7 @@ class Physics3DRigidBody; /** @brief Physics3DConstraint: Constraint affects the movement of physics object, it usually connect one or two physics * object. There are some types of physics constraints. */ -class AX_DLL Physics3DConstraint : public Ref +class AX_DLL Physics3DConstraint : public Object { public: enum class ConstraintType diff --git a/core/physics3d/Physics3DDebugDrawer.h b/core/physics3d/Physics3DDebugDrawer.h index fb7574735633..e84a4b84f8ae 100644 --- a/core/physics3d/Physics3DDebugDrawer.h +++ b/core/physics3d/Physics3DDebugDrawer.h @@ -28,7 +28,7 @@ #define __PHYSICS_3D_VIEWER_H__ #include "math/Math.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Types.h" #include "base/Config.h" #include "renderer/CustomCommand.h" diff --git a/core/physics3d/Physics3DObject.h b/core/physics3d/Physics3DObject.h index dcc6f5a2ab52..b95c0d189c2a 100644 --- a/core/physics3d/Physics3DObject.h +++ b/core/physics3d/Physics3DObject.h @@ -28,7 +28,7 @@ #define __PHYSICS_3D_OBJECT_H__ #include "math/Math.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Config.h" #include @@ -71,9 +71,9 @@ struct AX_DLL Physics3DCollisionInfo std::vector collisionPointList; }; /** - * @brief Inherit from Ref, base class + * @brief Inherit from Object, base class */ -class AX_DLL Physics3DObject : public Ref +class AX_DLL Physics3DObject : public Object { public: typedef std::function CollisionCallbackFunc; diff --git a/core/physics3d/Physics3DShape.h b/core/physics3d/Physics3DShape.h index 11fd613bb90d..e7031997593e 100644 --- a/core/physics3d/Physics3DShape.h +++ b/core/physics3d/Physics3DShape.h @@ -27,7 +27,7 @@ #ifndef __PHYSICS_3D_SHAPE_H__ #define __PHYSICS_3D_SHAPE_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "base/Config.h" #include "math/Math.h" @@ -46,7 +46,7 @@ NS_AX_BEGIN /** * @brief Create a physical shape(box, sphere, cylinder, capsule, convexhull, mesh and heightfield) */ -class AX_DLL Physics3DShape : public Ref +class AX_DLL Physics3DShape : public Object { public: enum class ShapeType diff --git a/core/physics3d/Physics3DWorld.h b/core/physics3d/Physics3DWorld.h index 603b5829811c..065c6eead0d6 100644 --- a/core/physics3d/Physics3DWorld.h +++ b/core/physics3d/Physics3DWorld.h @@ -28,7 +28,7 @@ #define __PHYSICS_3D_WORLD_H__ #include "math/Math.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Config.h" #if defined(AX_ENABLE_3D_PHYSICS) @@ -75,7 +75,7 @@ struct AX_DLL Physics3DWorldDes * @brief The physics information container, include Physics3DObjects, Physics3DConstraints, collision information and * so on. */ -class AX_DLL Physics3DWorld : public Ref +class AX_DLL Physics3DWorld : public Object { friend class Physics3DComponent; diff --git a/core/platform/GLView.h b/core/platform/GLView.h index 244266369070..7d029e34b68e 100644 --- a/core/platform/GLView.h +++ b/core/platform/GLView.h @@ -106,7 +106,7 @@ class Director; /** * @brief By GLView you can operate the frame information of EGL view through some function. */ -class AX_DLL GLView : public Ref +class AX_DLL GLView : public Object { friend class Director; public: diff --git a/core/platform/GLViewImpl.h b/core/platform/GLViewImpl.h index d32292e3afd4..0e7667467b0a 100644 --- a/core/platform/GLViewImpl.h +++ b/core/platform/GLViewImpl.h @@ -27,7 +27,7 @@ THE SOFTWARE. // Implement GLView based on GLFW for targets: win32,osx,web(wasm) #pragma once #include "platform/GL.h" -#include "base/Ref.h" +#include "base/Object.h" #include "platform/Common.h" #include "platform/GLView.h" #include diff --git a/core/platform/Image.h b/core/platform/Image.h index b3d9fc400515..5c0fc386978a 100644 --- a/core/platform/Image.h +++ b/core/platform/Image.h @@ -28,7 +28,7 @@ THE SOFTWARE. #ifndef __AX_IMAGE_H__ #define __AX_IMAGE_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "renderer/Texture2D.h" #include "base/Data.h" @@ -63,7 +63,7 @@ typedef struct _MipmapInfo } MipmapInfo; /** The Image class for loading all images supported by axmol . */ -class AX_DLL Image : public Ref +class AX_DLL Image : public Object { public: friend class TextureCache; diff --git a/core/platform/android/GLViewImpl-android.h b/core/platform/android/GLViewImpl-android.h index b4d969d501db..3aa2654ef7d9 100644 --- a/core/platform/android/GLViewImpl-android.h +++ b/core/platform/android/GLViewImpl-android.h @@ -25,7 +25,7 @@ THE SOFTWARE. ****************************************************************************/ #pragma once -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "platform/GLView.h" diff --git a/core/platform/ios/GLViewImpl-ios.h b/core/platform/ios/GLViewImpl-ios.h index baf532610f52..bfe94a58261a 100644 --- a/core/platform/ios/GLViewImpl-ios.h +++ b/core/platform/ios/GLViewImpl-ios.h @@ -25,7 +25,7 @@ ****************************************************************************/ #pragma once -#include "base/Ref.h" +#include "base/Object.h" #include "platform/Common.h" #include "platform/GLView.h" diff --git a/core/renderer/GroupCommand.h b/core/renderer/GroupCommand.h index b2b0fa0b5180..b05035fb0387 100644 --- a/core/renderer/GroupCommand.h +++ b/core/renderer/GroupCommand.h @@ -29,7 +29,7 @@ #include #include -#include "base/Ref.h" +#include "base/Object.h" #include "renderer/RenderCommand.h" /** @@ -40,7 +40,7 @@ NS_AX_BEGIN // Used for internal -class GroupCommandManager : public Ref +class GroupCommandManager : public Object { public: int getGroupID(); diff --git a/core/renderer/Material.cpp b/core/renderer/Material.cpp index 2743768bc0d3..68830a8d2dca 100644 --- a/core/renderer/Material.cpp +++ b/core/renderer/Material.cpp @@ -127,7 +127,7 @@ bool Material::initWithProgramState(backend::ProgramState* state) bool Material::initWithFile(std::string_view validfilename) { - // Warning: properties is not a "Ref" object, must be manually deleted + // Warning: properties is not a "Object" object, must be manually deleted Properties* properties = Properties::createNonRefCounted(validfilename); // get the first material diff --git a/core/renderer/Material.h b/core/renderer/Material.h index 648c2d91365d..197b733bdbe6 100644 --- a/core/renderer/Material.h +++ b/core/renderer/Material.h @@ -35,7 +35,7 @@ #include "renderer/RenderState.h" #include "renderer/Technique.h" #include "renderer/CustomCommand.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Vector.h" #include "math/Vec2.h" #include "math/Vec3.h" @@ -58,7 +58,7 @@ class ProgramState; } /// Material -class AX_DLL Material : public Ref +class AX_DLL Material : public Object { friend class Node; friend class Technique; diff --git a/core/renderer/Pass.h b/core/renderer/Pass.h index 700c7324c0e8..a1d8785c1cdf 100644 --- a/core/renderer/Pass.h +++ b/core/renderer/Pass.h @@ -51,7 +51,7 @@ class ProgramState; class Buffer; } // namespace backend -class AX_DLL Pass : public Ref +class AX_DLL Pass : public Object { friend class Material; friend class Technique; diff --git a/core/renderer/RenderState.h b/core/renderer/RenderState.h index 038a082c191b..7f9467af6407 100644 --- a/core/renderer/RenderState.h +++ b/core/renderer/RenderState.h @@ -31,7 +31,7 @@ #include #include "platform/PlatformMacros.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Types.h" #include "base/Vector.h" @@ -52,7 +52,7 @@ using DepthFunction = backend::CompareFunction; /** * Defines the rendering state of the graphics device. */ -class AX_DLL RenderState : public Ref +class AX_DLL RenderState : public Object { friend class Material; friend class Technique; @@ -71,7 +71,7 @@ class AX_DLL RenderState : public Ref * Defines a block of fixed-function render states that can be applied to a * RenderState object. */ - class AX_DLL StateBlock // : public Ref + class AX_DLL StateBlock // : public Object { friend class RenderState; friend class Pass; diff --git a/core/renderer/Technique.h b/core/renderer/Technique.h index 87b76f98a1bc..1807ff515da9 100644 --- a/core/renderer/Technique.h +++ b/core/renderer/Technique.h @@ -31,7 +31,7 @@ #include #include "renderer/RenderState.h" -#include "base/Ref.h" +#include "base/Object.h" #include "platform/PlatformMacros.h" #include "base/Vector.h" @@ -46,7 +46,7 @@ class ProgramState; } /// Technique -class AX_DLL Technique : public Ref +class AX_DLL Technique : public Object { friend class Material; friend class Renderer; diff --git a/core/renderer/Texture2D.h b/core/renderer/Texture2D.h index 27fc99228f29..546036fd7990 100644 --- a/core/renderer/Texture2D.h +++ b/core/renderer/Texture2D.h @@ -31,7 +31,7 @@ THE SOFTWARE. #include #include -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "base/Types.h" #include "renderer/CustomCommand.h" @@ -71,7 +71,7 @@ class ProgramState; * texture dimensions i.e. "contentSize" != (pixelsWide, pixelsHigh) and (maxS, maxT) != (1.0, 1.0). Be aware that the * content of the generated textures will be upside-down! */ -class AX_DLL Texture2D : public Ref +class AX_DLL Texture2D : public Object { public: struct PixelFormatInfo diff --git a/core/renderer/TextureAtlas.h b/core/renderer/TextureAtlas.h index 36b8bf0b2d02..cfddfa204d5c 100644 --- a/core/renderer/TextureAtlas.h +++ b/core/renderer/TextureAtlas.h @@ -30,7 +30,7 @@ THE SOFTWARE. #include #include "base/Types.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Config.h" NS_AX_BEGIN @@ -59,7 +59,7 @@ To render the quads using an interleaved vertex array list, you should modify th @warning If you want to use TextureAtlas, you'd better setup GL status before it's rendered. Otherwise, the effect of TextureAtlas will be affected by the GL status of other nodes. */ -class AX_DLL TextureAtlas : public Ref +class AX_DLL TextureAtlas : public Object { public: /** Creates a TextureAtlas with an filename and with an initial capacity for Quads. diff --git a/core/renderer/TextureCache.h b/core/renderer/TextureCache.h index 75b9fa346097..f4d0740c850b 100644 --- a/core/renderer/TextureCache.h +++ b/core/renderer/TextureCache.h @@ -38,7 +38,7 @@ THE SOFTWARE. #include #include -#include "base/Ref.h" +#include "base/Object.h" #include "renderer/Texture2D.h" #include "platform/Image.h" @@ -61,7 +61,7 @@ NS_AX_BEGIN * Once the texture is loaded, the next time it will return. * A reference of the previously loaded texture reducing GPU & CPU memory. */ -class AX_DLL TextureCache : public Ref +class AX_DLL TextureCache : public Object { public: // ETC1 ALPHA supports. diff --git a/core/renderer/TextureCube.h b/core/renderer/TextureCube.h index cc2d37fae68a..1a4a979f7316 100644 --- a/core/renderer/TextureCube.h +++ b/core/renderer/TextureCube.h @@ -44,7 +44,7 @@ NS_AX_BEGIN TextureCube is a collection of six separate square textures that are put onto the faces of an imaginary cube. */ -class AX_DLL TextureCube : public Ref +class AX_DLL TextureCube : public Object { public: /** create cube texture from 6 textures. diff --git a/core/renderer/backend/Buffer.h b/core/renderer/backend/Buffer.h index f6db9fc9d68c..574408e2b0a2 100644 --- a/core/renderer/backend/Buffer.h +++ b/core/renderer/backend/Buffer.h @@ -26,7 +26,7 @@ #include "Macros.h" #include "Types.h" -#include "base/Ref.h" +#include "base/Object.h" NS_AX_BEGIN @@ -44,7 +44,7 @@ NS_AX_BACKEND_BEGIN /** * @brief Used to store vertex and index data data. */ -class Buffer : public ax::Ref +class Buffer : public ax::Object { public: /** diff --git a/core/renderer/backend/CommandBuffer.h b/core/renderer/backend/CommandBuffer.h index 2d5b85379725..679596b24297 100644 --- a/core/renderer/backend/CommandBuffer.h +++ b/core/renderer/backend/CommandBuffer.h @@ -26,7 +26,7 @@ #include -#include "base/Ref.h" +#include "base/Object.h" #include "base/Data.h" #include "Macros.h" @@ -63,7 +63,7 @@ struct DepthStencilDescriptor; * @brief Store encoded commands for the GPU to execute. * A command buffer stores encoded commands until the buffer is committed for execution by the GPU */ -class CommandBuffer : public ax::Ref +class CommandBuffer : public ax::Object { public: /** diff --git a/core/renderer/backend/DepthStencilState.h b/core/renderer/backend/DepthStencilState.h index ebf1c04ce8cf..aa5d46798245 100644 --- a/core/renderer/backend/DepthStencilState.h +++ b/core/renderer/backend/DepthStencilState.h @@ -27,7 +27,7 @@ #include "Macros.h" #include "Types.h" -#include "base/Ref.h" +#include "base/Object.h" NS_AX_BACKEND_BEGIN @@ -69,7 +69,7 @@ struct DepthStencilDescriptor /** * Store Depth and stencil status. */ -class DepthStencilState : public ax::Ref +class DepthStencilState : public ax::Object { public: virtual void update(const DepthStencilDescriptor& desc); diff --git a/core/renderer/backend/DriverBase.h b/core/renderer/backend/DriverBase.h index ca389d91d3bf..77bd234e6582 100644 --- a/core/renderer/backend/DriverBase.h +++ b/core/renderer/backend/DriverBase.h @@ -32,7 +32,7 @@ #include "DepthStencilState.h" #include "ShaderCache.h" -#include "base/Ref.h" +#include "base/Object.h" #include diff --git a/core/renderer/backend/Program.h b/core/renderer/backend/Program.h index f6dea94eab82..24c345c4790d 100644 --- a/core/renderer/backend/Program.h +++ b/core/renderer/backend/Program.h @@ -25,7 +25,7 @@ #pragma once #include "Macros.h" -#include "base/Ref.h" +#include "base/Object.h" #include "platform/PlatformMacros.h" #include "Types.h" #include "ShaderCache.h" @@ -69,7 +69,7 @@ enum class VertexLayoutType /** * A program. */ -class AX_DLL Program : public Ref +class AX_DLL Program : public Object { public: ~Program(); diff --git a/core/renderer/backend/ProgramManager.h b/core/renderer/backend/ProgramManager.h index e477e75aaeef..30f7321d0d91 100644 --- a/core/renderer/backend/ProgramManager.h +++ b/core/renderer/backend/ProgramManager.h @@ -26,7 +26,7 @@ #pragma once #include "Macros.h" -#include "base/Ref.h" +#include "base/Object.h" #include "platform/PlatformMacros.h" #include "Program.h" diff --git a/core/renderer/backend/ProgramState.h b/core/renderer/backend/ProgramState.h index aa49dde8ff57..5fcd855ee35b 100644 --- a/core/renderer/backend/ProgramState.h +++ b/core/renderer/backend/ProgramState.h @@ -31,7 +31,7 @@ #include #include #include "platform/PlatformMacros.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/EventListenerCustom.h" #include "renderer/backend/Types.h" #include "renderer/backend/Program.h" @@ -84,7 +84,7 @@ struct AX_DLL TextureInfo * A program state object can create or reuse a program. * Each program state object keep its own unifroms and textures data. */ -class AX_DLL ProgramState : public Ref +class AX_DLL ProgramState : public Object { public: using UniformCallback = std::function; diff --git a/core/renderer/backend/ProgramStateRegistry.h b/core/renderer/backend/ProgramStateRegistry.h index a9a0a63f7db5..7c2805753c11 100644 --- a/core/renderer/backend/ProgramStateRegistry.h +++ b/core/renderer/backend/ProgramStateRegistry.h @@ -1,6 +1,6 @@ #pragma once #include "Macros.h" -#include "base/Ref.h" +#include "base/Object.h" #include "platform/PlatformMacros.h" #include "Program.h" #include "ProgramState.h" diff --git a/core/renderer/backend/RenderPipeline.h b/core/renderer/backend/RenderPipeline.h index facfbefb2806..458bf3992b07 100644 --- a/core/renderer/backend/RenderPipeline.h +++ b/core/renderer/backend/RenderPipeline.h @@ -26,7 +26,7 @@ #include "Macros.h" #include "Types.h" -#include "base/Ref.h" +#include "base/Object.h" #include "renderer/PipelineDescriptor.h" #include "renderer/backend/RenderPassDescriptor.h" @@ -40,7 +40,7 @@ class RenderTarget; /** * Render pipeline */ -class RenderPipeline : public ax::Ref +class RenderPipeline : public ax::Object { public: virtual void update(const RenderTarget*, const PipelineDescriptor& pipelineDescirptor) = 0; diff --git a/core/renderer/backend/RenderTarget.h b/core/renderer/backend/RenderTarget.h index 782ab7232d5b..e9277847030e 100644 --- a/core/renderer/backend/RenderTarget.h +++ b/core/renderer/backend/RenderTarget.h @@ -1,12 +1,12 @@ #pragma once -#include "base/Ref.h" +#include "base/Object.h" #include "Texture.h" #include NS_AX_BACKEND_BEGIN -class RenderTarget : public ax::Ref +class RenderTarget : public ax::Object { public: struct RenderBuffer diff --git a/core/renderer/backend/ShaderCache.h b/core/renderer/backend/ShaderCache.h index 8c8194df286b..271c542a5beb 100644 --- a/core/renderer/backend/ShaderCache.h +++ b/core/renderer/backend/ShaderCache.h @@ -25,7 +25,7 @@ #pragma once #include "Macros.h" -#include "base/Ref.h" +#include "base/Object.h" #include "platform/PlatformMacros.h" #include "renderer/backend/ShaderModule.h" diff --git a/core/renderer/backend/ShaderModule.h b/core/renderer/backend/ShaderModule.h index 3bf1b4acf136..cb914169ea53 100644 --- a/core/renderer/backend/ShaderModule.h +++ b/core/renderer/backend/ShaderModule.h @@ -26,7 +26,7 @@ #include "Macros.h" #include "Types.h" -#include "base/Ref.h" +#include "base/Object.h" #include @@ -67,7 +67,7 @@ enum Attribute : uint32_t /** * Create shader. */ -class AX_DLL ShaderModule : public ax::Ref +class AX_DLL ShaderModule : public ax::Object { public: /** diff --git a/core/renderer/backend/Texture.h b/core/renderer/backend/Texture.h index 71d790a0d92c..770663f6f61f 100644 --- a/core/renderer/backend/Texture.h +++ b/core/renderer/backend/Texture.h @@ -26,7 +26,7 @@ #pragma once #include "Types.h" -#include "base/Ref.h" +#include "base/Object.h" #include #include @@ -54,7 +54,7 @@ struct TextureDescriptor /** * A base texture */ -class TextureBackend : public Ref +class TextureBackend : public Object { public: /** diff --git a/core/renderer/backend/VertexLayout.h b/core/renderer/backend/VertexLayout.h index 839a7a7917e0..6e2b2ce20193 100644 --- a/core/renderer/backend/VertexLayout.h +++ b/core/renderer/backend/VertexLayout.h @@ -26,7 +26,7 @@ #include "Macros.h" #include "Types.h" -#include "base/Ref.h" +#include "base/Object.h" #include #include diff --git a/core/renderer/backend/opengl/ProgramGL.h b/core/renderer/backend/opengl/ProgramGL.h index 90bfffd7f1d7..e362621888d8 100644 --- a/core/renderer/backend/opengl/ProgramGL.h +++ b/core/renderer/backend/opengl/ProgramGL.h @@ -27,7 +27,7 @@ #include "../Macros.h" #include "../Types.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/EventListenerCustom.h" #include "platform/GL.h" #include "../Program.h" diff --git a/core/ui/GUIDefine.h b/core/ui/GUIDefine.h index ef12f1aff21a..9ec59cfeab72 100644 --- a/core/ui/GUIDefine.h +++ b/core/ui/GUIDefine.h @@ -37,10 +37,10 @@ #define DECLARE_CLASS_GUI_INFO \ public: \ static ax::ObjectFactory::TInfo __Type; \ - static ax::Ref* createInstance(); + static ax::Object* createInstance(); #define IMPLEMENT_CLASS_GUI_INFO(className) \ - ax::Ref* className::createInstance() { return className::create(); } \ + ax::Object* className::createInstance() { return className::create(); } \ ax::ObjectFactory::TInfo className::__Type(#className, &className::createInstance); #define CREATE_CLASS_GUI_INFO(className) ax::ObjectFactory::TInfo(#className, &className::createInstance) @@ -52,10 +52,10 @@ public: \ #define DECLARE_CLASS_WIDGET_READER_INFO \ public: \ static ax::ObjectFactory::TInfo __Type; \ - static ax::Ref* createInstance(); + static ax::Object* createInstance(); #define IMPLEMENT_CLASS_WIDGET_READER_INFO(className) \ - ax::Ref* className::createInstance() { return className::getInstance(); } \ + ax::Object* className::createInstance() { return className::getInstance(); } \ ax::ObjectFactory::TInfo className::__Type(#className, &className::createInstance); #define CREATE_CLASS_WIDGET_READER_INFO(className) ax::ObjectFactory::TInfo(#className, &className::createInstance) diff --git a/core/ui/UICheckBox.h b/core/ui/UICheckBox.h index 759a03f4842f..83331cd38e86 100644 --- a/core/ui/UICheckBox.h +++ b/core/ui/UICheckBox.h @@ -60,7 +60,7 @@ class AX_GUI_DLL CheckBox : public AbstractCheckButton * A callback which will be called after certain CheckBox event issue. * @see `CheckBox::EventType` */ - typedef std::function ccCheckBoxCallback; + typedef std::function ccCheckBoxCallback; /** * Default constructor. @@ -131,7 +131,7 @@ class AX_GUI_DLL CheckBox : public AbstractCheckButton protected: // if you use the old event callback, it will retain the _checkBoxEventListener - Ref* _checkBoxEventListener; + Object* _checkBoxEventListener; ccCheckBoxCallback _checkBoxEventCallback; }; diff --git a/core/ui/UILayoutManager.h b/core/ui/UILayoutManager.h index 2198437ceb50..400bea900e46 100644 --- a/core/ui/UILayoutManager.h +++ b/core/ui/UILayoutManager.h @@ -26,7 +26,7 @@ #ifndef __cocos2d_libs__CCLayoutManager__ #define __cocos2d_libs__CCLayoutManager__ -#include "base/Ref.h" +#include "base/Object.h" #include "base/Vector.h" #include "ui/GUIExport.h" @@ -47,7 +47,7 @@ class RelativeLayoutParameter; *@brief Base class for managing layout. * All the concrete layout manager should inherit from this class. */ -class AX_GUI_DLL LayoutManager : public Ref +class AX_GUI_DLL LayoutManager : public Object { public: virtual ~LayoutManager(){} diff --git a/core/ui/UILayoutParameter.h b/core/ui/UILayoutParameter.h index 1f2ef5cb65f1..5b000929d763 100644 --- a/core/ui/UILayoutParameter.h +++ b/core/ui/UILayoutParameter.h @@ -27,7 +27,7 @@ #define __LAYOUTPARMETER_H__ #include -#include "base/Ref.h" +#include "base/Object.h" #include "ui/GUIExport.h" /** @@ -113,7 +113,7 @@ class AX_GUI_DLL Margin /** *@brief Base class for various LayoutParameter. */ -class AX_GUI_DLL LayoutParameter : public Ref +class AX_GUI_DLL LayoutParameter : public Object { public: /** diff --git a/core/ui/UIListView.h b/core/ui/UIListView.h index edaae387adaf..0836c302f816 100644 --- a/core/ui/UIListView.h +++ b/core/ui/UIListView.h @@ -93,7 +93,7 @@ class AX_GUI_DLL ListView : public ScrollView /** * ListView item click callback. */ - typedef std::function ccListViewCallback; + typedef std::function ccListViewCallback; /** * Default constructor diff --git a/core/ui/UIMediaPlayer.cpp b/core/ui/UIMediaPlayer.cpp index 5247f722acaa..a0a31e88c1fd 100644 --- a/core/ui/UIMediaPlayer.cpp +++ b/core/ui/UIMediaPlayer.cpp @@ -641,7 +641,7 @@ void BasicMediaController::createControls() _playButton = MediaPlayerControl::create(SpriteFrame::createWithTexture( g_mediaControlsTexture, g_mediaControlTextureRegions[MediaControlButtonId::Play])); - _playButton->addClickEventListener([this](Ref* ref) { + _playButton->addClickEventListener([this](Object* ref) { if (_controlPanel->getOpacity() <= 50) return; _playRate = 1.f; @@ -657,7 +657,7 @@ void BasicMediaController::createControls() _stopButton = MediaPlayerControl::create(SpriteFrame::createWithTexture( g_mediaControlsTexture, g_mediaControlTextureRegions[MediaControlButtonId::Stop])); - _stopButton->addClickEventListener([this](Ref* ref) { + _stopButton->addClickEventListener([this](Object* ref) { if (_controlPanel->getOpacity() <= 50) return; _playRate = 1.f; @@ -673,7 +673,7 @@ void BasicMediaController::createControls() _pauseButton = MediaPlayerControl::create(SpriteFrame::createWithTexture( g_mediaControlsTexture, g_mediaControlTextureRegions[MediaControlButtonId::Pause])); - _pauseButton->addClickEventListener([this](Ref* ref) { + _pauseButton->addClickEventListener([this](Object* ref) { if (_controlPanel->getOpacity() <= 50) return; _playRate = 1.f; @@ -689,7 +689,7 @@ void BasicMediaController::createControls() _fullScreenEnterButton = MediaPlayerControl::create(SpriteFrame::createWithTexture( g_mediaControlsTexture, g_mediaControlTextureRegions[MediaControlButtonId::EnterFullscreen])); - _fullScreenEnterButton->addClickEventListener([this](Ref* ref) { + _fullScreenEnterButton->addClickEventListener([this](Object* ref) { if (_controlPanel->getOpacity() <= 50) return; _mediaPlayer->setFullScreenEnabled(true); @@ -705,7 +705,7 @@ void BasicMediaController::createControls() _fullScreenExitButton = MediaPlayerControl::create(SpriteFrame::createWithTexture( g_mediaControlsTexture, g_mediaControlTextureRegions[MediaControlButtonId::ExitFullscreen])); - _fullScreenExitButton->addClickEventListener([this](Ref* ref) { + _fullScreenExitButton->addClickEventListener([this](Object* ref) { if (_controlPanel->getOpacity() <= 50) return; _mediaPlayer->setFullScreenEnabled(false); diff --git a/core/ui/UIMediaPlayer.h b/core/ui/UIMediaPlayer.h index 367fc59b6781..8b9e573d0dfd 100644 --- a/core/ui/UIMediaPlayer.h +++ b/core/ui/UIMediaPlayer.h @@ -182,7 +182,7 @@ class AX_GUI_DLL MediaPlayer : public ax::ui::Widget /** * A callback which will be called after specific MediaPlayer event happens. */ - typedef std::function ccVideoPlayerCallback; + typedef std::function ccVideoPlayerCallback; /** *Static create method for instancing a MediaPlayer. diff --git a/core/ui/UIPageView.cpp b/core/ui/UIPageView.cpp index fae923984106..45cf5f47e37b 100644 --- a/core/ui/UIPageView.cpp +++ b/core/ui/UIPageView.cpp @@ -295,7 +295,7 @@ void PageView::pageTurningEvent() void PageView::addEventListener(const ccPageViewCallback& callback) { _eventCallback = callback; - ccScrollViewCallback scrollViewCallback = [this](Ref* /*ref*/, ScrollView::EventType type) -> void { + ccScrollViewCallback scrollViewCallback = [this](Object* /*ref*/, ScrollView::EventType type) -> void { if (type == ScrollView::EventType::AUTOSCROLL_ENDED && _previousPageIndex != _currentPageIndex) { pageTurningEvent(); diff --git a/core/ui/UIPageView.h b/core/ui/UIPageView.h index b52b067644cf..b9053090204c 100644 --- a/core/ui/UIPageView.h +++ b/core/ui/UIPageView.h @@ -72,7 +72,7 @@ class AX_GUI_DLL PageView : public ListView /** * PageView page turn event callback. */ - typedef std::function ccPageViewCallback; + typedef std::function ccPageViewCallback; /** * Default constructor diff --git a/core/ui/UIRichText.h b/core/ui/UIRichText.h index 497dac700909..ecdbcbff0599 100644 --- a/core/ui/UIRichText.h +++ b/core/ui/UIRichText.h @@ -44,7 +44,7 @@ namespace ui *@brief Rich text element base class. * It defines the basic common properties for all rich text element. */ -class AX_GUI_DLL RichElement : public Ref +class AX_GUI_DLL RichElement : public Object { public: /** diff --git a/core/ui/UIScrollView.h b/core/ui/UIScrollView.h index 413e4c39bc2e..0665aa87ffb0 100644 --- a/core/ui/UIScrollView.h +++ b/core/ui/UIScrollView.h @@ -88,7 +88,7 @@ class AX_GUI_DLL ScrollView : public Layout /** * A callback which would be called when a ScrollView is scrolling. */ - typedef std::function ccScrollViewCallback; + typedef std::function ccScrollViewCallback; /** * Default constructor @@ -713,7 +713,7 @@ class AX_GUI_DLL ScrollView : public Layout ScrollViewBar* _verticalScrollBar; ScrollViewBar* _horizontalScrollBar; - Ref* _scrollViewEventListener; + Object* _scrollViewEventListener; ccScrollViewCallback _eventCallback; float _scrollTime; diff --git a/core/ui/UISlider.h b/core/ui/UISlider.h index 2d567d8b1971..af7ec2ce0a09 100644 --- a/core/ui/UISlider.h +++ b/core/ui/UISlider.h @@ -48,7 +48,7 @@ typedef enum SLIDER_PERCENTCHANGED } SliderEventType; -typedef void (Ref::*SEL_SlidPercentChangedEvent)(Ref*, SliderEventType); +typedef void (Object::*SEL_SlidPercentChangedEvent)(Object*, SliderEventType); #define sliderpercentchangedselector(_SELECTOR) (SEL_SlidPercentChangedEvent)(&_SELECTOR) /** @@ -70,7 +70,7 @@ class AX_GUI_DLL Slider : public Widget ON_SLIDEBALL_UP, ON_SLIDEBALL_CANCEL }; - typedef std::function ccSliderCallback; + typedef std::function ccSliderCallback; /** * Default constructor. * @js ctor @@ -336,7 +336,7 @@ class AX_GUI_DLL Slider : public Widget Rect _capInsetsBarRenderer; Rect _capInsetsProgressBarRenderer; - Ref* _sliderEventListener; + Object* _sliderEventListener; ccSliderCallback _eventCallback; diff --git a/core/ui/UITextField.h b/core/ui/UITextField.h index 0c38f7855e52..5c038d8af151 100644 --- a/core/ui/UITextField.h +++ b/core/ui/UITextField.h @@ -242,7 +242,7 @@ class AX_GUI_DLL TextField : public Widget /** * A callback which would be called when a TextField event happens. */ - typedef std::function ccTextFieldCallback; + typedef std::function ccTextFieldCallback; /** * @brief Default constructor. @@ -627,7 +627,7 @@ class AX_GUI_DLL TextField : public Widget float _touchHeight; bool _useTouchArea; - Ref* _textFieldEventListener; + Object* _textFieldEventListener; ccTextFieldCallback _eventCallback; bool _textFieldRendererAdaptDirty; diff --git a/core/ui/UIWidget.h b/core/ui/UIWidget.h index 01dbe442061b..08816dffdfa1 100644 --- a/core/ui/UIWidget.h +++ b/core/ui/UIWidget.h @@ -118,16 +118,16 @@ class AX_GUI_DLL Widget : public ProtectedNode, public LayoutParameterProtocol /** * Widget touch event callback. */ - typedef std::function ccWidgetTouchCallback; + typedef std::function ccWidgetTouchCallback; /** * Widget click event callback. */ - typedef std::function ccWidgetClickCallback; + typedef std::function ccWidgetClickCallback; /** * Widget custom event callback. * It is mainly used together with Cocos Studio. */ - typedef std::function ccWidgetEventCallback; + typedef std::function ccWidgetEventCallback; /** * Default constructor * @js ctor @@ -825,7 +825,7 @@ class AX_GUI_DLL Widget : public ProtectedNode, public LayoutParameterProtocol */ static Widget* _focusedWidget; // both layout & widget will be stored in this variable - Ref* _touchEventListener; + Object* _touchEventListener; ccWidgetTouchCallback _touchEventCallback; ccWidgetClickCallback _clickEventListener; ccWidgetEventCallback _ccEventCallback; diff --git a/extensions/Effekseer/EffekseerForCocos2d-x/EffekseerForCocos2d-x.h b/extensions/Effekseer/EffekseerForCocos2d-x/EffekseerForCocos2d-x.h index 950c095693cc..6f46e328a23f 100644 --- a/extensions/Effekseer/EffekseerForCocos2d-x/EffekseerForCocos2d-x.h +++ b/extensions/Effekseer/EffekseerForCocos2d-x/EffekseerForCocos2d-x.h @@ -27,7 +27,7 @@ class InternalManager; \~Japanese 1.41以降、autoreleaseにより自動的に解放されます。 */ -class Effect : public cocos2d::Ref +class Effect : public cocos2d::Object { private: ::Effekseer::EffectRef effect = nullptr; @@ -307,7 +307,7 @@ class EffectEmitter : public cocos2d::Node void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& parentTransform, uint32_t parentFlags) override; }; -class EffectManager : public cocos2d::Ref +class EffectManager : public cocos2d::Object { friend class EffectEmitter; @@ -435,7 +435,7 @@ class EffectManager : public cocos2d::Ref Effekseer::RefPtr<::EffekseerRenderer::CommandList> getInternalCommandList() { return commandList_; } }; -class NetworkServer : public cocos2d::Ref +class NetworkServer : public cocos2d::Object { private: InternalManager* internalManager_ = nullptr; diff --git a/extensions/GUI/src/GUI/ControlExtension/Control.cpp b/extensions/GUI/src/GUI/ControlExtension/Control.cpp index 6bc0228c6345..8a7a1765ed88 100644 --- a/extensions/GUI/src/GUI/ControlExtension/Control.cpp +++ b/extensions/GUI/src/GUI/ControlExtension/Control.cpp @@ -128,7 +128,7 @@ void Control::sendActionsForControlEvents(EventType controlEvents) } release(); } -void Control::addTargetWithActionForControlEvents(Ref* target, Handler action, EventType controlEvents) +void Control::addTargetWithActionForControlEvents(Object* target, Handler action, EventType controlEvents) { // For each control events for (int i = 0; i < kControlEventTotalNumber; i++) @@ -154,7 +154,7 @@ void Control::addTargetWithActionForControlEvents(Ref* target, Handler action, E * @param controlEvent A control event for which the action message is sent. * See "CCControlEvent" for constants. */ -void Control::addTargetWithActionForControlEvent(Ref* target, Handler action, EventType controlEvent) +void Control::addTargetWithActionForControlEvent(Object* target, Handler action, EventType controlEvent) { // Create the invocation object Invocation* invocation = Invocation::create(target, action, controlEvent); @@ -164,7 +164,7 @@ void Control::addTargetWithActionForControlEvent(Ref* target, Handler action, Ev eventInvocationList.pushBack(invocation); } -void Control::removeTargetWithActionForControlEvents(Ref* target, Handler action, EventType controlEvents) +void Control::removeTargetWithActionForControlEvents(Object* target, Handler action, EventType controlEvents) { // For each control events for (int i = 0; i < kControlEventTotalNumber; i++) @@ -177,7 +177,7 @@ void Control::removeTargetWithActionForControlEvents(Ref* target, Handler action } } -void Control::removeTargetWithActionForControlEvent(Ref* target, Handler action, EventType controlEvent) +void Control::removeTargetWithActionForControlEvent(Object* target, Handler action, EventType controlEvent) { // Retrieve all invocations for the given control event auto& eventInvocationList = this->dispatchListforControlEvent(controlEvent); diff --git a/extensions/GUI/src/GUI/ControlExtension/Control.h b/extensions/GUI/src/GUI/ControlExtension/Control.h index 66d33c3f6025..f12ccafe2fe0 100644 --- a/extensions/GUI/src/GUI/ControlExtension/Control.h +++ b/extensions/GUI/src/GUI/ControlExtension/Control.h @@ -81,7 +81,7 @@ class AX_EX_DLL Control : public Layer // different values. }; - typedef void (Ref::*Handler)(Ref*, EventType); + typedef void (Object::*Handler)(Object*, EventType); /** The possible state for a control. */ enum class State @@ -139,7 +139,7 @@ class AX_EX_DLL Control : public Layer * @param controlEvents A bitmask specifying the control events for which the * action message is sent. See "CCControlEvent" for bitmask constants. */ - virtual void addTargetWithActionForControlEvents(Ref* target, Handler action, EventType controlEvents); + virtual void addTargetWithActionForControlEvents(Object* target, Handler action, EventType controlEvents); /** * Removes a target and action for a particular event (or events) from an @@ -153,7 +153,7 @@ class AX_EX_DLL Control : public Layer * @param controlEvents A bitmask specifying the control events associated with * target and action. See "CCControlEvent" for bitmask constants. */ - virtual void removeTargetWithActionForControlEvents(Ref* target, Handler action, EventType controlEvents); + virtual void removeTargetWithActionForControlEvents(Object* target, Handler action, EventType controlEvents); /** * Returns a point corresponding to the touch location converted into the @@ -207,7 +207,7 @@ class AX_EX_DLL Control : public Layer * @return an Invocation object able to construct messages using a given * target-action pair. */ - Invocation* invocationWithTargetAndActionForControlEvent(Ref* target, Handler action, EventType controlEvent); + Invocation* invocationWithTargetAndActionForControlEvent(Object* target, Handler action, EventType controlEvent); /** * Returns the Invocation list for the given control event. If the list does @@ -233,7 +233,7 @@ class AX_EX_DLL Control : public Layer * @param controlEvent A control event for which the action message is sent. * See "CCControlEvent" for constants. */ - void addTargetWithActionForControlEvent(Ref* target, Handler action, EventType controlEvent); + void addTargetWithActionForControlEvent(Object* target, Handler action, EventType controlEvent); /** * Removes a target and action for a particular event from an internal dispatch @@ -247,7 +247,7 @@ class AX_EX_DLL Control : public Layer * @param controlEvent A control event for which the action message is sent. * See "CCControlEvent" for constants. */ - void removeTargetWithActionForControlEvent(Ref* target, Handler action, EventType controlEvent); + void removeTargetWithActionForControlEvent(Object* target, Handler action, EventType controlEvent); bool _enabled; bool _selected; diff --git a/extensions/GUI/src/GUI/ControlExtension/ControlColourPicker.cpp b/extensions/GUI/src/GUI/ControlExtension/ControlColourPicker.cpp index e84326b178ed..32dd56aa1be6 100644 --- a/extensions/GUI/src/GUI/ControlExtension/ControlColourPicker.cpp +++ b/extensions/GUI/src/GUI/ControlExtension/ControlColourPicker.cpp @@ -163,7 +163,7 @@ void ControlColourPicker::updateHueAndControlPicker() _colourPicker->updateDraggerWithHSV(_hsv); } -void ControlColourPicker::hueSliderValueChanged(Ref* sender, Control::EventType /*controlEvent*/) +void ControlColourPicker::hueSliderValueChanged(Object* sender, Control::EventType /*controlEvent*/) { _hsv.h = ((ControlHuePicker*)sender)->getHue(); @@ -177,7 +177,7 @@ void ControlColourPicker::hueSliderValueChanged(Ref* sender, Control::EventType updateControlPicker(); } -void ControlColourPicker::colourSliderValueChanged(Ref* sender, Control::EventType /*controlEvent*/) +void ControlColourPicker::colourSliderValueChanged(Object* sender, Control::EventType /*controlEvent*/) { _hsv.s = ((ControlSaturationBrightnessPicker*)sender)->getSaturation(); _hsv.v = ((ControlSaturationBrightnessPicker*)sender)->getBrightness(); diff --git a/extensions/GUI/src/GUI/ControlExtension/ControlColourPicker.h b/extensions/GUI/src/GUI/ControlExtension/ControlColourPicker.h index 7c4f656c420b..63602cf022a1 100644 --- a/extensions/GUI/src/GUI/ControlExtension/ControlColourPicker.h +++ b/extensions/GUI/src/GUI/ControlExtension/ControlColourPicker.h @@ -70,8 +70,8 @@ class AX_EX_DLL ControlColourPicker : public Control virtual void setEnabled(bool bEnabled) override; // virtual ~ControlColourPicker(); - void hueSliderValueChanged(Ref* sender, Control::EventType controlEvent); - void colourSliderValueChanged(Ref* sender, Control::EventType controlEvent); + void hueSliderValueChanged(Object* sender, Control::EventType controlEvent); + void colourSliderValueChanged(Object* sender, Control::EventType controlEvent); protected: void updateControlPicker(); diff --git a/extensions/GUI/src/GUI/ControlExtension/ControlUtils.h b/extensions/GUI/src/GUI/ControlExtension/ControlUtils.h index adefabb61d58..9298f771a0b7 100644 --- a/extensions/GUI/src/GUI/ControlExtension/ControlUtils.h +++ b/extensions/GUI/src/GUI/ControlExtension/ControlUtils.h @@ -65,7 +65,7 @@ typedef struct */ // helper class to store Color3B's in mutable arrays -class AX_EX_DLL Color3bObject : public Ref +class AX_EX_DLL Color3bObject : public Object { public: Color3B value; diff --git a/extensions/GUI/src/GUI/ControlExtension/Invocation.cpp b/extensions/GUI/src/GUI/ControlExtension/Invocation.cpp index 7dfdbaf9cdc5..4ded4ac6e1ad 100644 --- a/extensions/GUI/src/GUI/ControlExtension/Invocation.cpp +++ b/extensions/GUI/src/GUI/ControlExtension/Invocation.cpp @@ -30,21 +30,21 @@ NS_AX_EXT_BEGIN -Invocation* Invocation::create(Ref* target, Control::Handler action, Control::EventType controlEvent) +Invocation* Invocation::create(Object* target, Control::Handler action, Control::EventType controlEvent) { Invocation* pRet = new Invocation(target, action, controlEvent); pRet->autorelease(); return pRet; } -Invocation::Invocation(Ref* target, Control::Handler action, Control::EventType controlEvent) +Invocation::Invocation(Object* target, Control::Handler action, Control::EventType controlEvent) { _target = target; _action = action; _controlEvent = controlEvent; } -void Invocation::invoke(Ref* sender) +void Invocation::invoke(Object* sender) { if (_target && _action) { diff --git a/extensions/GUI/src/GUI/ControlExtension/Invocation.h b/extensions/GUI/src/GUI/ControlExtension/Invocation.h index ac00f5021634..3392cfa8e031 100644 --- a/extensions/GUI/src/GUI/ControlExtension/Invocation.h +++ b/extensions/GUI/src/GUI/ControlExtension/Invocation.h @@ -33,7 +33,7 @@ #ifndef __CCINVOCATION_H__ #define __CCINVOCATION_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "../../ExtensionMacros.h" #include "extensions/ExtensionExport.h" #include "Control.h" @@ -49,28 +49,28 @@ NS_AX_EXT_BEGIN #define cccontrol_selector(_SELECTOR) static_cast(&_SELECTOR) -class AX_EX_DLL Invocation : public Ref +class AX_EX_DLL Invocation : public Object { public: /** * @js NA * @lua NA */ - static Invocation* create(Ref* target, Control::Handler action, Control::EventType controlEvent); + static Invocation* create(Object* target, Control::Handler action, Control::EventType controlEvent); /** * @js NA * @lua NA */ - Invocation(Ref* target, Control::Handler action, Control::EventType controlEvent); + Invocation(Object* target, Control::Handler action, Control::EventType controlEvent); /** * @js NA * @lua NA */ - void invoke(Ref* sender); + void invoke(Object* sender); protected: AX_SYNTHESIZE_READONLY(Control::Handler, _action, Action); - AX_SYNTHESIZE_READONLY(Ref*, _target, Target); + AX_SYNTHESIZE_READONLY(Object*, _target, Target); AX_SYNTHESIZE_READONLY(Control::EventType, _controlEvent, ControlEvent); }; diff --git a/extensions/GUI/src/GUI/ScrollView/ScrollView.cpp b/extensions/GUI/src/GUI/ScrollView/ScrollView.cpp index 79c6874b5ca5..05c6e05cf3fd 100644 --- a/extensions/GUI/src/GUI/ScrollView/ScrollView.cpp +++ b/extensions/GUI/src/GUI/ScrollView/ScrollView.cpp @@ -150,7 +150,7 @@ bool ScrollView::isNodeVisible(Node* node) return viewRect.intersectsRect(node->getBoundingBox()); } -void ScrollView::pause(Ref* /*sender*/) +void ScrollView::pause(Object* /*sender*/) { _container->pause(); @@ -161,7 +161,7 @@ void ScrollView::pause(Ref* /*sender*/) } } -void ScrollView::resume(Ref* /*sender*/) +void ScrollView::resume(Object* /*sender*/) { auto& children = _container->getChildren(); for (const auto& child : children) diff --git a/extensions/GUI/src/GUI/ScrollView/ScrollView.h b/extensions/GUI/src/GUI/ScrollView/ScrollView.h index 62e23e22cb49..a738d8a59c95 100644 --- a/extensions/GUI/src/GUI/ScrollView/ScrollView.h +++ b/extensions/GUI/src/GUI/ScrollView/ScrollView.h @@ -182,12 +182,12 @@ class AX_EX_DLL ScrollView : public Layer, public ActionTweenDelegate * Provided to make scroll view compatible with SWLayer's pause method */ using Layer::pause; // fix warning - void pause(Ref* sender); + void pause(Object* sender); /** * Provided to make scroll view compatible with SWLayer's resume method */ using Layer::resume; // fix warning - void resume(Ref* sender); + void resume(Object* sender); void setTouchEnabled(bool enabled); bool isTouchEnabled() const; diff --git a/extensions/GUI/src/GUI/ScrollView/TableView.cpp b/extensions/GUI/src/GUI/ScrollView/TableView.cpp index 2c130f449830..f734b4ae579f 100644 --- a/extensions/GUI/src/GUI/ScrollView/TableView.cpp +++ b/extensions/GUI/src/GUI/ScrollView/TableView.cpp @@ -516,7 +516,7 @@ void TableView::scrollViewDidScroll(ScrollView* /*view*/) } #if 0 // For Testing. - Ref* pObj; + Object* pObj; int i = 0; CCARRAY_FOREACH(_cellsUsed, pObj) { diff --git a/extensions/ImGui/src/ImGui/ImGuiPresenter.cpp b/extensions/ImGui/src/ImGui/ImGuiPresenter.cpp index 66789ffd6cad..6e8263691e89 100644 --- a/extensions/ImGui/src/ImGui/ImGuiPresenter.cpp +++ b/extensions/ImGui/src/ImGui/ImGuiPresenter.cpp @@ -880,7 +880,7 @@ void ImGuiPresenter::mergeFontGlyphs(ImFont* dst, ImFont* src, ImWchar start, Im dst->BuildLookupTable(); } -int ImGuiPresenter::getCCRefId(Ref* p) +int ImGuiPresenter::getCCRefId(Object* p) { int id = 0; const auto it = usedCCRefIdMap.find(p); diff --git a/extensions/ImGui/src/ImGui/ImGuiPresenter.h b/extensions/ImGui/src/ImGui/ImGuiPresenter.h index a76319b9dbe2..1c6294c14347 100644 --- a/extensions/ImGui/src/ImGui/ImGuiPresenter.h +++ b/extensions/ImGui/src/ImGui/ImGuiPresenter.h @@ -126,7 +126,7 @@ class ImGuiPresenter ImWchar* addGlyphRanges(std::string_view key, const std::vector& ranges); static void mergeFontGlyphs(ImFont* dst, ImFont* src, ImWchar start, ImWchar end); - int getCCRefId(Ref* p); + int getCCRefId(Object* p); private: static void loadCustomFonts(void*); @@ -148,9 +148,9 @@ class ImGuiPresenter std::unordered_map _renderLoops; - std::unordered_map usedCCRefIdMap; + std::unordered_map usedCCRefIdMap; // cocos objects should be retained until next frame - Vector usedCCRef; + Vector usedCCRef; hlookup::string_map> glyphRanges; float _contentZoomFactor = 1.0f; diff --git a/extensions/ImGui/src/ImGui/imgui/imgui.cpp b/extensions/ImGui/src/ImGui/imgui/imgui.cpp index d74843d7d286..a5cac58b7127 100644 --- a/extensions/ImGui/src/ImGui/imgui/imgui.cpp +++ b/extensions/ImGui/src/ImGui/imgui/imgui.cpp @@ -2544,7 +2544,7 @@ void* ImGuiStorage::GetVoidPtr(ImGuiID key) const return it->val_p; } -// References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer. +// References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Object() function invalidates the pointer. int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val) { ImGuiStoragePair* it = LowerBound(Data, key); @@ -11544,9 +11544,9 @@ void ImGui::ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to // Trim the stack unless the popup is a direct parent of the reference window (the reference window is often the NavWindow) // - Clicking/Focusing Window2 won't close Popup1: - // Window -> Popup1 -> Window2(Ref) + // Window -> Popup1 -> Window2(Object) // - Clicking/focusing Popup1 will close Popup2 and Popup3: - // Window -> Popup1(Ref) -> Popup2 -> Popup3 + // Window -> Popup1(Object) -> Popup2 -> Popup3 // - Each popups may contain child windows, which is why we compare ->RootWindowDockTree! // Window -> Popup1 -> Popup1_Child -> Popup2 -> Popup2_Child // We step through every popup from bottom to top to validate their position relative to reference window. @@ -20667,7 +20667,7 @@ void ImGui::DebugNodeDockNode(ImGuiDockNode* node, const char* label) { IM_ASSERT(node->ChildNodes[0] == NULL || node->ChildNodes[0]->ParentNode == node); IM_ASSERT(node->ChildNodes[1] == NULL || node->ChildNodes[1]->ParentNode == node); - BulletText("Pos (%.0f,%.0f), Size (%.0f, %.0f) Ref (%.0f, %.0f)", + BulletText("Pos (%.0f,%.0f), Size (%.0f, %.0f) Object (%.0f, %.0f)", node->Pos.x, node->Pos.y, node->Size.x, node->Size.y, node->SizeRef.x, node->SizeRef.y); DebugNodeWindow(node->HostWindow, "HostWindow"); DebugNodeWindow(node->VisibleWindow, "VisibleWindow"); diff --git a/extensions/ImGui/src/ImGui/imgui/imgui.h b/extensions/ImGui/src/ImGui/imgui/imgui.h index 147644125fd7..9f13d73daa04 100644 --- a/extensions/ImGui/src/ImGui/imgui/imgui.h +++ b/extensions/ImGui/src/ImGui/imgui/imgui.h @@ -2554,8 +2554,8 @@ struct ImGuiStorage IMGUI_API void* GetVoidPtr(ImGuiID key) const; // default_val is NULL IMGUI_API void SetVoidPtr(ImGuiID key, void* val); - // - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set. - // - References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer. + // - Get***Object() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set. + // - References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Object() function invalidates the pointer. // - A typical use case where this is convenient for quick hacking (e.g. add storage during a live Edit&Continue session if you can't modify existing struct) // float* pvar = ImGui::GetFloatRef(key); ImGui::SliderFloat("var", pvar, 0, 100.0f); some_var += *pvar; IMGUI_API int* GetIntRef(ImGuiID key, int default_val = 0); diff --git a/extensions/ImGui/src/ImGui/imgui/imgui_demo.cpp b/extensions/ImGui/src/ImGui/imgui/imgui_demo.cpp index cbbc3c0714ec..b66ce5a7d4d3 100644 --- a/extensions/ImGui/src/ImGui/imgui/imgui_demo.cpp +++ b/extensions/ImGui/src/ImGui/imgui/imgui_demo.cpp @@ -2089,7 +2089,7 @@ static void ShowDemoWindowWidgets() if (side_preview) { ImGui::SameLine(); - ImGui::Checkbox("With Ref Color", &ref_color); + ImGui::Checkbox("With Object Color", &ref_color); if (ref_color) { ImGui::SameLine(); @@ -6669,10 +6669,10 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) { bool border = (style.PopupBorderSize > 0.0f); if (ImGui::Checkbox("PopupBorder", &border)) { style.PopupBorderSize = border ? 1.0f : 0.0f; } } // Save/Revert button - if (ImGui::Button("Save Ref")) + if (ImGui::Button("Save Object")) *ref = ref_saved_style = style; ImGui::SameLine(); - if (ImGui::Button("Revert Ref")) + if (ImGui::Button("Revert Object")) style = *ref; ImGui::SameLine(); HelpMarker( diff --git a/extensions/ImGui/src/ImGui/imgui_impl_ax.cpp b/extensions/ImGui/src/ImGui/imgui_impl_ax.cpp index 8fcf09092479..a5feec720fb7 100644 --- a/extensions/ImGui/src/ImGui/imgui_impl_ax.cpp +++ b/extensions/ImGui/src/ImGui/imgui_impl_ax.cpp @@ -1885,7 +1885,7 @@ IMGUI_IMPL_API void ImGui_ImplAx_RenderDrawData(ImDrawData* draw_data) auto bd = ImGui_ImplGlfw_GetBackendData(); - if (typeid(*((Ref*)pcmd->TextureId)) == typeid(Texture2D)) + if (typeid(*((Object*)pcmd->TextureId)) == typeid(Texture2D)) { auto tex = AX_PTR_CAST(pcmd->TextureId, Texture2D*); auto cmd = std::make_shared(); diff --git a/extensions/ImGui/src/ImGui/imgui_impl_ax_android.cpp b/extensions/ImGui/src/ImGui/imgui_impl_ax_android.cpp index 281d269d62f4..d2d4dae1270e 100644 --- a/extensions/ImGui/src/ImGui/imgui_impl_ax_android.cpp +++ b/extensions/ImGui/src/ImGui/imgui_impl_ax_android.cpp @@ -656,7 +656,7 @@ IMGUI_IMPL_API void ImGui_ImplAx_RenderDrawData(ImDrawData* draw_data) auto bd = ImGui_ImplAndroid_GetBackendData(); - if (typeid(*((Ref*)pcmd->TextureId)) == typeid(Texture2D)) + if (typeid(*((Object*)pcmd->TextureId)) == typeid(Texture2D)) { auto tex = AX_PTR_CAST(pcmd->TextureId, Texture2D*); auto cmd = std::make_shared(); diff --git a/extensions/Particle3D/src/Particle3D/PU/PUAffector.h b/extensions/Particle3D/src/Particle3D/PU/PUAffector.h index fa99bfb8619e..1ab25b57d097 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUAffector.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUAffector.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_AFFECTOR_H__ #define __AX_PU_PARTICLE_3D_AFFECTOR_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/Particle3DAffector.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUAffectorManager.h b/extensions/Particle3D/src/Particle3D/PU/PUAffectorManager.h index 3ad5c5c96673..b9f1f7d7ca89 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUAffectorManager.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUAffectorManager.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ #define __AX_PU_PARTICLE_3D_AFFECTOR_MANAGER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "Particle3D/PU/PUScriptTranslator.h" #include "Particle3D/PU/PUAffector.h" #include "Particle3D/PU/PUAlignAffectorTranslator.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PUBeamRender.h b/extensions/Particle3D/src/Particle3D/PU/PUBeamRender.h index bb5ee8cb63c6..6e2a1f01d48c 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUBeamRender.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUBeamRender.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_BEAM_RENDER_H__ #define __AX_PU_PARTICLE_3D_BEAM_RENDER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/Particle3DRender.h" #include "Particle3D/PU/PUListener.h" @@ -37,7 +37,7 @@ NS_AX_BEGIN -class PUParticle3DBeamVisualData : public Ref +class PUParticle3DBeamVisualData : public Object { public: PUParticle3DBeamVisualData(size_t index, PUBillboardChain* bbChain) diff --git a/extensions/Particle3D/src/Particle3D/PU/PUBehaviour.h b/extensions/Particle3D/src/Particle3D/PU/PUBehaviour.h index 7a0907ed9790..725799a937e3 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUBehaviour.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUBehaviour.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_BEHAVIOUR_H__ #define __AX_PU_PARTICLE_3D_BEHAVIOUR_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUParticleSystem3D.h" #include @@ -38,7 +38,7 @@ NS_AX_BEGIN struct PUParticle3D; class PUParticleSystem3D; -class AX_EX_DLL PUBehaviour : public Ref +class AX_EX_DLL PUBehaviour : public Object { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/src/Particle3D/PU/PUBehaviourManager.h b/extensions/Particle3D/src/Particle3D/PU/PUBehaviourManager.h index e6b798f2cd5e..1cd716d2a393 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUBehaviourManager.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUBehaviourManager.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__ #define __AX_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "Particle3D/PU/PUScriptTranslator.h" #include "Particle3D/PU/PUBehaviour.h" #include "Particle3D/PU/PUSlaveBehaviourTranslator.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PUBillboardChain.h b/extensions/Particle3D/src/Particle3D/PU/PUBillboardChain.h index b097b005074a..def59aece1ff 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUBillboardChain.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUBillboardChain.h @@ -31,7 +31,7 @@ #include "renderer/MeshCommand.h" #include "renderer/CallbackCommand.h" #include "renderer/backend/Buffer.h" -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" NS_AX_BEGIN diff --git a/extensions/Particle3D/src/Particle3D/PU/PUDoAffectorEventHandler.h b/extensions/Particle3D/src/Particle3D/PU/PUDoAffectorEventHandler.h index 4c6ba19e100d..8cea0798ebfb 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUDoAffectorEventHandler.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUDoAffectorEventHandler.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_H__ #define __AX_PU_PARTICLE_3D_DO_AFFECTOR_EVENT_HANDLER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUEventHandler.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUDoEnableComponentEventHandler.h b/extensions/Particle3D/src/Particle3D/PU/PUDoEnableComponentEventHandler.h index 8c83f16ab42d..5af9a48fa70d 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUDoEnableComponentEventHandler.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUDoEnableComponentEventHandler.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_H__ #define __AX_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUParticleSystem3D.h" #include "Particle3D/PU/PUEventHandler.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PUDoExpireEventHandler.h b/extensions/Particle3D/src/Particle3D/PU/PUDoExpireEventHandler.h index a5bca0d92ac4..05334e68a58d 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUDoExpireEventHandler.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUDoExpireEventHandler.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_H__ #define __AX_PU_PARTICLE_3D_DO_EXPIRE_EVENT_HANDLER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUEventHandler.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUDoFreezeEventHandler.h b/extensions/Particle3D/src/Particle3D/PU/PUDoFreezeEventHandler.h index 30bd661e04b1..2aad751a439b 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUDoFreezeEventHandler.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUDoFreezeEventHandler.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_H__ #define __AX_PU_PARTICLE_3D_DO_FREEZE_EVENT_HANDLER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUEventHandler.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUDoPlacementParticleEventHandler.h b/extensions/Particle3D/src/Particle3D/PU/PUDoPlacementParticleEventHandler.h index bc63baa5a173..78a12bd5d128 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUDoPlacementParticleEventHandler.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUDoPlacementParticleEventHandler.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_H__ #define __AX_PU_PARTICLE_3D_DO_PLACEMENT_PARTICLE_EVENT_HANDLER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUListener.h" #include "Particle3D/PU/PUEventHandler.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PUDoScaleEventHandler.h b/extensions/Particle3D/src/Particle3D/PU/PUDoScaleEventHandler.h index d776c3538cd3..c9895848811b 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUDoScaleEventHandler.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUDoScaleEventHandler.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_H__ #define __AX_PU_PARTICLE_3D_DO_SCALE_EVENT_HANDLER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUEventHandler.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUDoStopSystemEventHandler.h b/extensions/Particle3D/src/Particle3D/PU/PUDoStopSystemEventHandler.h index b54eea95bd46..43d9139cee20 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUDoStopSystemEventHandler.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUDoStopSystemEventHandler.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_DO_STOP_SYSTEM_EVENT_HANDLER_H__ #define __AX_PU_PARTICLE_3D_DO_STOP_SYSTEM_EVENT_HANDLER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUEventHandler.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUDynamicAttribute.h b/extensions/Particle3D/src/Particle3D/PU/PUDynamicAttribute.h index 6a3f6a7675ad..295f21235dc9 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUDynamicAttribute.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUDynamicAttribute.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_H__ #define __AX_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "PUSimpleSpline.h" #include @@ -57,7 +57,7 @@ struct PUControlPointSorter but where implementation of this behaviour may not be scattered or duplicated within the application that needs it. */ -class AX_EX_DLL PUDynamicAttribute : public Ref +class AX_EX_DLL PUDynamicAttribute : public Object { public: enum DynamicAttributeType diff --git a/extensions/Particle3D/src/Particle3D/PU/PUEmitter.cpp b/extensions/Particle3D/src/Particle3D/PU/PUEmitter.cpp index b19b6aa76baa..67c021341051 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUEmitter.cpp +++ b/extensions/Particle3D/src/Particle3D/PU/PUEmitter.cpp @@ -891,7 +891,7 @@ bool PUEmitter::isEmitterDone() const return !(_isEnabled || _dynRepeatDelaySet); } -Ref* PUEmitter::getEmitsEntityPtr() const +Object* PUEmitter::getEmitsEntityPtr() const { return _emitsEntity; } diff --git a/extensions/Particle3D/src/Particle3D/PU/PUEmitter.h b/extensions/Particle3D/src/Particle3D/PU/PUEmitter.h index 5557baa071e0..fc19e73852f8 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUEmitter.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUEmitter.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_EMITTER_H__ #define __AX_PU_PARTICLE_3D_EMITTER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/Particle3DEmitter.h" #include "Particle3D/PU/PUDynamicAttribute.h" @@ -192,7 +192,7 @@ class AX_EX_DLL PUEmitter : public Particle3DEmitter void setEmitsName(std::string_view emitsName); PUParticle3D::ParticleType getEmitsType() const { return _emitsType; } void setEmitsType(PUParticle3D::ParticleType type) { _emitsType = type; }; - Ref* getEmitsEntityPtr() const; + Object* getEmitsEntityPtr() const; bool isMarkedForEmission() const { return _isMarkedForEmission; }; void setMarkedForEmission(bool isMarked) { _isMarkedForEmission = isMarked; }; @@ -571,7 +571,7 @@ class AX_EX_DLL PUEmitter : public Particle3DEmitter bool _originEnabledSet; PUParticle3D::ParticleType _emitsType; - Ref* _emitsEntity; + Object* _emitsEntity; bool _isMarkedForEmission; }; diff --git a/extensions/Particle3D/src/Particle3D/PU/PUEmitterManager.h b/extensions/Particle3D/src/Particle3D/PU/PUEmitterManager.h index c37d0fb57fbd..0555f12424b5 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUEmitterManager.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUEmitterManager.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_EMITTER_MANAGER_H__ #define __AX_PU_PARTICLE_3D_EMITTER_MANAGER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "Particle3D/PU/PUScriptTranslator.h" #include "Particle3D/PU/PUEmitter.h" #include "Particle3D/PU/PUBoxEmitterTranslator.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PUEventHandler.h b/extensions/Particle3D/src/Particle3D/PU/PUEventHandler.h index aa791188abb4..cca538a674e6 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUEventHandler.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUEventHandler.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_EVENT_HANDLER_H__ #define __AX_PU_PARTICLE_3D_EVENT_HANDLER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include #include @@ -39,7 +39,7 @@ struct PUParticle3D; class PUObserver; class PUParticleSystem3D; -class AX_EX_DLL PUEventHandler : public Ref +class AX_EX_DLL PUEventHandler : public Object { public: /** Todo diff --git a/extensions/Particle3D/src/Particle3D/PU/PUEventHandlerManager.h b/extensions/Particle3D/src/Particle3D/PU/PUEventHandlerManager.h index 281606836ca6..61f416695c03 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUEventHandlerManager.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUEventHandlerManager.h @@ -26,7 +26,7 @@ #ifndef __AX_PU_PARTICLE_3D_EVENT_HANDLER_MANAGER_H__ #define __AX_PU_PARTICLE_3D_EVENT_HANDLER_MANAGER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "Particle3D/PU/PUScriptTranslator.h" #include "Particle3D/PU/PUEventHandler.h" #include "Particle3D/PU/PUDoAffectorEventHandlerTranslator.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PUForceField.h b/extensions/Particle3D/src/Particle3D/PU/PUForceField.h index be5d75d4205d..3f516337925d 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUForceField.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUForceField.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_FORCE_FIELD_H__ #define __AX_PU_PARTICLE_3D_FORCE_FIELD_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "PUNoise.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PUListener.h b/extensions/Particle3D/src/Particle3D/PU/PUListener.h index f56ddbcb830a..e7124e49650d 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUListener.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUListener.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_LISTENER_H__ #define __AX_PU_PARTICLE_3D_LISTENER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUMaterialManager.h b/extensions/Particle3D/src/Particle3D/PU/PUMaterialManager.h index 5050a657b3d0..95e26300a80b 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUMaterialManager.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUMaterialManager.h @@ -33,7 +33,7 @@ NS_AX_BEGIN -class AX_EX_DLL PUMaterial : public Ref +class AX_EX_DLL PUMaterial : public Object { public: PUMaterial(); diff --git a/extensions/Particle3D/src/Particle3D/PU/PUNoise.h b/extensions/Particle3D/src/Particle3D/PU/PUNoise.h index a63579e3aeb1..7df4c9e61c28 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUNoise.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUNoise.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_NOISE_H__ #define __AX_PU_PARTICLE_3D_NOISE_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" NS_AX_BEGIN diff --git a/extensions/Particle3D/src/Particle3D/PU/PUObserver.h b/extensions/Particle3D/src/Particle3D/PU/PUObserver.h index 21c7c4497ee1..7f796ee857e0 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUObserver.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUObserver.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_OBSERVER_H__ #define __AX_PU_PARTICLE_3D_OBSERVER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUParticleSystem3D.h" #include @@ -46,7 +46,7 @@ enum PUComparisionOperator CO_GREATER_THAN }; -class AX_EX_DLL PUObserver : public Ref +class AX_EX_DLL PUObserver : public Object { friend class PUParticleSystem3D; diff --git a/extensions/Particle3D/src/Particle3D/PU/PUObserverManager.h b/extensions/Particle3D/src/Particle3D/PU/PUObserverManager.h index 1396f23b0ecc..9aef6f05dd3c 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUObserverManager.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUObserverManager.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_OBSERVER_MANAGER_H__ #define __AX_PU_PARTICLE_3D_OBSERVER_MANAGER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "Particle3D/PU/PUScriptTranslator.h" #include "Particle3D/PU/PUObserver.h" #include "Particle3D/PU/PUOnClearObserverTranslator.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PUOnClearObserver.h b/extensions/Particle3D/src/Particle3D/PU/PUOnClearObserver.h index 36618c244dd2..04e76a0a33b7 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUOnClearObserver.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUOnClearObserver.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_H__ #define __AX_PU_PARTICLE_3D_ON_CLEAR_OBSERVER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUObserver.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUOnCollisionObserver.h b/extensions/Particle3D/src/Particle3D/PU/PUOnCollisionObserver.h index dfe4c5e02ea2..21dbcf81b76d 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUOnCollisionObserver.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUOnCollisionObserver.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_H__ #define __AX_PU_PARTICLE_3D_ON_COLLISION_OBSERVER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUObserver.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUOnCountObserver.h b/extensions/Particle3D/src/Particle3D/PU/PUOnCountObserver.h index b3340be3a909..91a437c6c396 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUOnCountObserver.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUOnCountObserver.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_H__ #define __AX_PU_PARTICLE_3D_ON_COUNT_OBSERVER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUObserver.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUOnEmissionObserver.h b/extensions/Particle3D/src/Particle3D/PU/PUOnEmissionObserver.h index 9602845c5eb3..5c74c588a8f9 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUOnEmissionObserver.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUOnEmissionObserver.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_H__ #define __AX_PU_PARTICLE_3D_ON_EMISSION_OBSERVER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUObserver.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUOnEventFlagObserver.h b/extensions/Particle3D/src/Particle3D/PU/PUOnEventFlagObserver.h index fe42e5e61205..c26148134a04 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUOnEventFlagObserver.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUOnEventFlagObserver.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_H__ #define __AX_PU_PARTICLE_3D_ON_EVENT_FLAG_OBSERVER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUObserver.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUOnExpireObserver.h b/extensions/Particle3D/src/Particle3D/PU/PUOnExpireObserver.h index 42bb99817113..8e7ff227aef1 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUOnExpireObserver.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUOnExpireObserver.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_H__ #define __AX_PU_PARTICLE_3D_ON_EXPIRE_OBSERVER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUObserver.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUOnPositionObserver.h b/extensions/Particle3D/src/Particle3D/PU/PUOnPositionObserver.h index 095cde8372c0..db6ef03f7056 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUOnPositionObserver.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUOnPositionObserver.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_H__ #define __AX_PU_PARTICLE_3D_ON_POSITION_OBSERVER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUObserver.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUOnQuotaObserver.h b/extensions/Particle3D/src/Particle3D/PU/PUOnQuotaObserver.h index 872593d769fb..5975e2ef919c 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUOnQuotaObserver.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUOnQuotaObserver.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_H__ #define __AX_PU_PARTICLE_3D_ON_QUOTA_OBSERVER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUObserver.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUOnRandomObserver.h b/extensions/Particle3D/src/Particle3D/PU/PUOnRandomObserver.h index beebaf3f869e..93b9feb8a994 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUOnRandomObserver.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUOnRandomObserver.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_H__ #define __AX_PU_PARTICLE_3D_ON_RANDOM_OBSERVER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUObserver.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUOnTimeObserver.h b/extensions/Particle3D/src/Particle3D/PU/PUOnTimeObserver.h index a47de225ac71..cd1fd1a520a8 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUOnTimeObserver.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUOnTimeObserver.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_H__ #define __AX_PU_PARTICLE_3D_ON_TIME_OBSERVER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUObserver.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUOnVelocityObserver.h b/extensions/Particle3D/src/Particle3D/PU/PUOnVelocityObserver.h index 448e1df43627..9143ccc50f4f 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUOnVelocityObserver.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUOnVelocityObserver.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_ON_VELOCITY_OBSERVER_H__ #define __AX_PU_PARTICLE_3D_ON_VELOCITY_OBSERVER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUObserver.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUParticleSystem3D.h b/extensions/Particle3D/src/Particle3D/PU/PUParticleSystem3D.h index 6e9d36830000..d8d87c6a8d65 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUParticleSystem3D.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUParticleSystem3D.h @@ -85,10 +85,10 @@ struct AX_EX_DLL PUParticle3D : public Particle3D PEF_COLLIDED = 1 << 2 }; - Ref* particleEntityPtr; + Object* particleEntityPtr; PUEmitter* parentEmitter; - Ref* visualData; + Object* visualData; ParticleType particleType; // Values that are assigned as soon as the particle is emitted (non-transformed) diff --git a/extensions/Particle3D/src/Particle3D/PU/PUPlane.h b/extensions/Particle3D/src/Particle3D/PU/PUPlane.h index bb5d75a0aebd..85ac3df648ed 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUPlane.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUPlane.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_PLANE_H__ #define __AX_PU_PARTICLE_3D_PLANE_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "3d/AABB.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PURender.h b/extensions/Particle3D/src/Particle3D/PU/PURender.h index 24675bc14823..ea49e9f133c5 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PURender.h +++ b/extensions/Particle3D/src/Particle3D/PU/PURender.h @@ -28,7 +28,7 @@ #include -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/Particle3DRender.h" #include "renderer/RenderState.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PURibbonTrail.h b/extensions/Particle3D/src/Particle3D/PU/PURibbonTrail.h index ac8115e1999c..e376ff3e5535 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PURibbonTrail.h +++ b/extensions/Particle3D/src/Particle3D/PU/PURibbonTrail.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_RIBBON_TRAIL_H__ #define __AX_PU_PARTICLE_3D_RIBBON_TRAIL_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUBillboardChain.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PURibbonTrailRender.h b/extensions/Particle3D/src/Particle3D/PU/PURibbonTrailRender.h index 90c01a62229b..2659850be4fc 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PURibbonTrailRender.h +++ b/extensions/Particle3D/src/Particle3D/PU/PURibbonTrailRender.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_RIBBON_TRAIL_RENDER_H__ #define __AX_PU_PARTICLE_3D_RIBBON_TRAIL_RENDER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/Particle3DRender.h" #include "Particle3D/PU/PUListener.h" @@ -38,7 +38,7 @@ NS_AX_BEGIN -class PURibbonTrailVisualData : public Ref +class PURibbonTrailVisualData : public Object { public: // Constructor diff --git a/extensions/Particle3D/src/Particle3D/PU/PUScriptCompiler.h b/extensions/Particle3D/src/Particle3D/PU/PUScriptCompiler.h index fd19f1f21715..98eb18e869f4 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUScriptCompiler.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUScriptCompiler.h @@ -26,7 +26,7 @@ #ifndef __AX_PU_SCRIPT_COMPILER_H__ #define __AX_PU_SCRIPT_COMPILER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "Particle3D/PU/PUScriptParser.h" #include @@ -55,7 +55,7 @@ class AX_EX_DLL PUAbstractNode unsigned int line; PUAbstractNodeType type; PUAbstractNode* parent; - Ref* context; + Object* context; // contextd// // Any context; // A holder for translation context data diff --git a/extensions/Particle3D/src/Particle3D/PU/PUScriptLexer.h b/extensions/Particle3D/src/Particle3D/PU/PUScriptLexer.h index 0d77aefbd2be..cf2b99a9eac6 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUScriptLexer.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUScriptLexer.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_SCRIPT_LEXER_H__ #define __AX_PU_SCRIPT_LEXER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include #include #include "extensions/ExtensionExport.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PUScriptParser.h b/extensions/Particle3D/src/Particle3D/PU/PUScriptParser.h index 0eff9f901532..80ed022262ab 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUScriptParser.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUScriptParser.h @@ -32,7 +32,7 @@ #include #include -#include "base/Ref.h" +#include "base/Object.h" #include "Particle3D/PU/PUScriptLexer.h" NS_AX_BEGIN diff --git a/extensions/Particle3D/src/Particle3D/PU/PUScriptTranslator.h b/extensions/Particle3D/src/Particle3D/PU/PUScriptTranslator.h index 15b3836e1d8b..c05377fac78a 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUScriptTranslator.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUScriptTranslator.h @@ -29,7 +29,7 @@ #include -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUScriptCompiler.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PUSimpleSpline.h b/extensions/Particle3D/src/Particle3D/PU/PUSimpleSpline.h index f86bedc79c71..97ea60269553 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUSimpleSpline.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUSimpleSpline.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_SIMPLE_SPLINE_H__ #define __AX_PU_PARTICLE_3D_SIMPLE_SPLINE_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include #include "extensions/ExtensionExport.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PUSlaveBehaviour.h b/extensions/Particle3D/src/Particle3D/PU/PUSlaveBehaviour.h index 8179a7bbdb7a..851cb8456ea2 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUSlaveBehaviour.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUSlaveBehaviour.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__ #define __AX_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "Particle3D/PU/PUParticleSystem3D.h" #include "Particle3D/PU/PUBehaviour.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PUSphere.h b/extensions/Particle3D/src/Particle3D/PU/PUSphere.h index 3cff321efa28..794faaf66351 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUSphere.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUSphere.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_SPHERE_H__ #define __AX_PU_PARTICLE_3D_SPHERE_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "3d/AABB.h" #include diff --git a/extensions/Particle3D/src/Particle3D/PU/PUTranslateManager.h b/extensions/Particle3D/src/Particle3D/PU/PUTranslateManager.h index 0d938eff4de5..416ff3b21058 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUTranslateManager.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUTranslateManager.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ #define __AX_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "Particle3D/PU/PUParticleSystem3DTranslator.h" #include "Particle3D/PU/PUTechniqueTranslator.h" #include "Particle3D/PU/PURendererTranslator.h" diff --git a/extensions/Particle3D/src/Particle3D/PU/PUUtil.h b/extensions/Particle3D/src/Particle3D/PU/PUUtil.h index cf00a425ecec..4910a43b4e3f 100644 --- a/extensions/Particle3D/src/Particle3D/PU/PUUtil.h +++ b/extensions/Particle3D/src/Particle3D/PU/PUUtil.h @@ -27,7 +27,7 @@ #ifndef __AX_PU_PARTICLE_3D_UTIL_H__ #define __AX_PU_PARTICLE_3D_UTIL_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include diff --git a/extensions/Particle3D/src/Particle3D/Particle3DAffector.h b/extensions/Particle3D/src/Particle3D/Particle3DAffector.h index 04d3d6f6bf0a..bd99d6568789 100644 --- a/extensions/Particle3D/src/Particle3D/Particle3DAffector.h +++ b/extensions/Particle3D/src/Particle3D/Particle3DAffector.h @@ -26,7 +26,7 @@ #ifndef __AX_PARTICLE_3D_AFFECTOR_H__ #define __AX_PARTICLE_3D_AFFECTOR_H__ -#include "base/Ref.h" +#include "base/Object.h" #include #include "extensions/ExtensionExport.h" @@ -35,7 +35,7 @@ NS_AX_BEGIN class ParticleSystem3D; struct Particle3D; -class AX_EX_DLL Particle3DAffector : public Ref +class AX_EX_DLL Particle3DAffector : public Object { friend class ParticleSystem3D; diff --git a/extensions/Particle3D/src/Particle3D/Particle3DEmitter.h b/extensions/Particle3D/src/Particle3D/Particle3DEmitter.h index 746a47fc479d..7fe2c2325af1 100644 --- a/extensions/Particle3D/src/Particle3D/Particle3DEmitter.h +++ b/extensions/Particle3D/src/Particle3D/Particle3DEmitter.h @@ -26,7 +26,7 @@ #ifndef __AX_PARTICLE_3D_EMITTER_H__ #define __AX_PARTICLE_3D_EMITTER_H__ -#include "base/Ref.h" +#include "base/Object.h" #include #include "extensions/ExtensionExport.h" @@ -37,7 +37,7 @@ struct Particle3D; /** * 3d particle emitter */ -class AX_EX_DLL Particle3DEmitter : public Ref +class AX_EX_DLL Particle3DEmitter : public Object { friend class ParticleSystem3D; diff --git a/extensions/Particle3D/src/Particle3D/Particle3DRender.h b/extensions/Particle3D/src/Particle3D/Particle3DRender.h index 6f846c8b09e5..f387072760c0 100644 --- a/extensions/Particle3D/src/Particle3D/Particle3DRender.h +++ b/extensions/Particle3D/src/Particle3D/Particle3DRender.h @@ -32,7 +32,7 @@ #include "renderer/MeshCommand.h" #include "renderer/CallbackCommand.h" #include "renderer/backend/Buffer.h" -#include "base/Ref.h" +#include "base/Object.h" #include "math/Math.h" #include "extensions/ExtensionExport.h" @@ -50,7 +50,7 @@ class Texture2D; /** * 3d particle render */ -class AX_EX_DLL Particle3DRender : public Ref +class AX_EX_DLL Particle3DRender : public Object { friend class ParticleSystem3D; diff --git a/extensions/assets-manager/src/assets-manager/AssetsManagerEx.h b/extensions/assets-manager/src/assets-manager/AssetsManagerEx.h index b12cb001ab6f..04a03f8deea5 100644 --- a/extensions/assets-manager/src/assets-manager/AssetsManagerEx.h +++ b/extensions/assets-manager/src/assets-manager/AssetsManagerEx.h @@ -48,7 +48,7 @@ NS_AX_EXT_BEGIN /** * @brief This class is used to auto update resources, such as pictures or scripts. */ -class AX_EX_DLL AssetsManagerEx : public Ref +class AX_EX_DLL AssetsManagerEx : public Object { public: //! Update states diff --git a/extensions/assets-manager/src/assets-manager/Manifest.h b/extensions/assets-manager/src/assets-manager/Manifest.h index 22ca155a9525..2dca14c09dfb 100644 --- a/extensions/assets-manager/src/assets-manager/Manifest.h +++ b/extensions/assets-manager/src/assets-manager/Manifest.h @@ -58,7 +58,7 @@ struct ManifestAsset typedef hlookup::string_map DownloadUnits; -class AX_EX_DLL Manifest : public Ref +class AX_EX_DLL Manifest : public Object { public: friend class AssetsManagerEx; diff --git a/extensions/cocostudio/src/cocostudio/ActionFrame.h b/extensions/cocostudio/src/cocostudio/ActionFrame.h index 34124914b4f3..f97843406fd3 100644 --- a/extensions/cocostudio/src/cocostudio/ActionFrame.h +++ b/extensions/cocostudio/src/cocostudio/ActionFrame.h @@ -94,7 +94,7 @@ enum class FrameEaseType * @js NA * @lua NA */ -class CCS_DLL ActionFrame : public ax::Ref +class CCS_DLL ActionFrame : public ax::Object { public: diff --git a/extensions/cocostudio/src/cocostudio/ActionFrameEasing.h b/extensions/cocostudio/src/cocostudio/ActionFrameEasing.h index 2c2e39fe2242..11d907bc5c0e 100644 --- a/extensions/cocostudio/src/cocostudio/ActionFrameEasing.h +++ b/extensions/cocostudio/src/cocostudio/ActionFrameEasing.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __ActionFrameEasing_H__ #define __ActionFrameEasing_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "CocosStudioExport.h" namespace cocostudio @@ -58,7 +58,7 @@ enum FrameEasingType * @js NA * @lua NA */ -class CCS_DLL ActionFrameEasing : public ax::Ref +class CCS_DLL ActionFrameEasing : public ax::Object { protected: FrameEasingType _type; diff --git a/extensions/cocostudio/src/cocostudio/ActionManagerEx.cpp b/extensions/cocostudio/src/cocostudio/ActionManagerEx.cpp index 383b373fcf48..ddf3d1031873 100644 --- a/extensions/cocostudio/src/cocostudio/ActionManagerEx.cpp +++ b/extensions/cocostudio/src/cocostudio/ActionManagerEx.cpp @@ -57,7 +57,7 @@ ActionManagerEx::~ActionManagerEx() _actionDic.clear(); } -void ActionManagerEx::initWithDictionary(const char* jsonName, const rapidjson::Value& dic, Ref* root, int version) +void ActionManagerEx::initWithDictionary(const char* jsonName, const rapidjson::Value& dic, Object* root, int version) { std::string path = jsonName; this->_studioVersionNumber = version; @@ -77,7 +77,7 @@ void ActionManagerEx::initWithDictionary(const char* jsonName, const rapidjson:: } void ActionManagerEx::initWithBinary(const char* file, - ax::Ref* root, + ax::Object* root, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) { diff --git a/extensions/cocostudio/src/cocostudio/ActionManagerEx.h b/extensions/cocostudio/src/cocostudio/ActionManagerEx.h index 935c8b857cbc..e0f9723ca12a 100644 --- a/extensions/cocostudio/src/cocostudio/ActionManagerEx.h +++ b/extensions/cocostudio/src/cocostudio/ActionManagerEx.h @@ -35,7 +35,7 @@ namespace cocostudio class CocoLoader; struct stExpCocoNode; -class CCS_DLL ActionManagerEx : public ax::Ref +class CCS_DLL ActionManagerEx : public ax::Object { public: /** @@ -110,8 +110,8 @@ class CCS_DLL ActionManagerEx : public ax::Ref ActionObject* stopActionByName(const char* jsonName, const char* actionName); /*init properties with json dictionary*/ - void initWithDictionary(const char* jsonName, const rapidjson::Value& dic, Ref* root, int version = 1600); - void initWithBinary(const char* file, Ref* root, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode); + void initWithDictionary(const char* jsonName, const rapidjson::Value& dic, Object* root, int version = 1600); + void initWithBinary(const char* file, Object* root, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode); /** * Release all actions. diff --git a/extensions/cocostudio/src/cocostudio/ActionNode.cpp b/extensions/cocostudio/src/cocostudio/ActionNode.cpp index 87494a0cc955..93f4d739a2d8 100644 --- a/extensions/cocostudio/src/cocostudio/ActionNode.cpp +++ b/extensions/cocostudio/src/cocostudio/ActionNode.cpp @@ -76,7 +76,7 @@ ActionNode::~ActionNode() _frameArray.clear(); } -void ActionNode::initWithDictionary(const rapidjson::Value& dic, Ref* root) +void ActionNode::initWithDictionary(const rapidjson::Value& dic, Object* root) { Widget* rw = dynamic_cast(root); if (nullptr == rw) @@ -209,7 +209,7 @@ float ActionNode::valueToFloat(std::string_view value) return utils::atof(value.data()); } -void ActionNode::initWithBinary(CocoLoader* cocoLoader, stExpCocoNode* cocoNode, ax::Ref* root) +void ActionNode::initWithBinary(CocoLoader* cocoLoader, stExpCocoNode* cocoNode, ax::Object* root) { stExpCocoNode* stChildNode = cocoNode; @@ -359,7 +359,7 @@ void ActionNode::initWithBinary(CocoLoader* cocoLoader, stExpCocoNode* cocoNode, initActionNodeFromRoot(root); } -void ActionNode::initActionNodeFromRoot(Ref* root) +void ActionNode::initActionNodeFromRoot(Object* root) { Widget* rootWidget = dynamic_cast(root); if (rootWidget != nullptr) @@ -393,14 +393,14 @@ int ActionNode::getActionTag() return _actionTag; } -void ActionNode::setObject(Ref* node) +void ActionNode::setObject(Object* node) { AX_SAFE_RELEASE(_object); _object = node; AX_SAFE_RETAIN(_object); } -Ref* ActionNode::getObject() +Object* ActionNode::getObject() { return _object; } diff --git a/extensions/cocostudio/src/cocostudio/ActionNode.h b/extensions/cocostudio/src/cocostudio/ActionNode.h index 60a69e5916c2..41b33eb1d3d5 100644 --- a/extensions/cocostudio/src/cocostudio/ActionNode.h +++ b/extensions/cocostudio/src/cocostudio/ActionNode.h @@ -38,7 +38,7 @@ struct stExpCocoNode; * @js NA * @lua NA */ -class CCS_DLL ActionNode : public ax::Ref +class CCS_DLL ActionNode : public ax::Object { public: /** @@ -82,14 +82,14 @@ class CCS_DLL ActionNode : public ax::Ref * * @param node which will run a action */ - void setObject(ax::Ref* node); + void setObject(ax::Object* node); /** * Gets node which will run a action. * * @return node which will run a action */ - ax::Ref* getObject(); + ax::Object* getObject(); /** * Insets a ActionFrame to ActionNode. @@ -151,8 +151,8 @@ class CCS_DLL ActionNode : public ax::Ref virtual void stopAction(); /*init properties with a json dictionary*/ - virtual void initWithDictionary(const rapidjson::Value& dic, ax::Ref* root); - virtual void initWithBinary(CocoLoader* cocoLoader, stExpCocoNode* pCocoNode, Ref* root); + virtual void initWithDictionary(const rapidjson::Value& dic, ax::Object* root); + virtual void initWithBinary(CocoLoader* cocoLoader, stExpCocoNode* pCocoNode, Object* root); /** * Gets if the action is done once time. @@ -174,7 +174,7 @@ class CCS_DLL ActionNode : public ax::Ref int _actionTag; ax::Spawn* _actionSpawn; ax::Action* _action; - ax::Ref* _object; + ax::Object* _object; std::vector*> _frameArray; int _frameArrayNum; @@ -183,7 +183,7 @@ class CCS_DLL ActionNode : public ax::Ref virtual ax::Node* getActionNode(); virtual ax::Spawn* refreshActionProperty(); virtual void runAction(); - virtual void initActionNodeFromRoot(ax::Ref* root); + virtual void initActionNodeFromRoot(ax::Object* root); virtual void easingToFrame(float duration, float delayTime, ActionFrame* srcFrame, ActionFrame* destFrame); }; diff --git a/extensions/cocostudio/src/cocostudio/ActionObject.cpp b/extensions/cocostudio/src/cocostudio/ActionObject.cpp index 11cd5facaff7..2f5c2c1d851c 100644 --- a/extensions/cocostudio/src/cocostudio/ActionObject.cpp +++ b/extensions/cocostudio/src/cocostudio/ActionObject.cpp @@ -109,7 +109,7 @@ bool ActionObject::isPlaying() return _bPlaying; } -void ActionObject::initWithDictionary(const rapidjson::Value& dic, Ref* root) +void ActionObject::initWithDictionary(const rapidjson::Value& dic, Object* root) { setName(DICTOOL->getStringValue_json(dic, "name")); setLoop(DICTOOL->getBooleanValue_json(dic, "loop")); @@ -132,7 +132,7 @@ void ActionObject::initWithDictionary(const rapidjson::Value& dic, Ref* root) _fTotalTime = maxLength * _fUnitTime; } -void ActionObject::initWithBinary(CocoLoader* cocoLoader, stExpCocoNode* cocoNode, ax::Ref* root) +void ActionObject::initWithBinary(CocoLoader* cocoLoader, stExpCocoNode* cocoNode, ax::Object* root) { stExpCocoNode* stChildNode = cocoNode->GetChildArray(cocoLoader); stExpCocoNode* actionNodeList = nullptr; diff --git a/extensions/cocostudio/src/cocostudio/ActionObject.h b/extensions/cocostudio/src/cocostudio/ActionObject.h index 5f881d99e28f..6ab7cf073c15 100644 --- a/extensions/cocostudio/src/cocostudio/ActionObject.h +++ b/extensions/cocostudio/src/cocostudio/ActionObject.h @@ -40,7 +40,7 @@ struct stExpCocoNode; * @js NA * @lua NA */ -class CCS_DLL ActionObject : public ax::Ref +class CCS_DLL ActionObject : public ax::Object { public: /** @@ -163,9 +163,9 @@ class CCS_DLL ActionObject : public ax::Ref void updateToFrameByTime(float fTime); /*init properties with a json dictionary*/ - void initWithDictionary(const rapidjson::Value& dic, ax::Ref* root); + void initWithDictionary(const rapidjson::Value& dic, ax::Object* root); - void initWithBinary(CocoLoader* cocoLoader, stExpCocoNode* pCocoNode, ax::Ref* root); + void initWithBinary(CocoLoader* cocoLoader, stExpCocoNode* pCocoNode, ax::Object* root); /*scheduler update function*/ void simulationActionUpdate(float dt); diff --git a/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimeline.h b/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimeline.h index 6a640e429112..e089cf7bc099 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimeline.h +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimeline.h @@ -51,7 +51,7 @@ typedef struct AnimationInfo } AnimationClip; #if 0 -class CCS_DLL ActionTimelineData : public ax::Ref +class CCS_DLL ActionTimelineData : public ax::Object { public: static ActionTimelineData* create(int actionTag); diff --git a/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineData.h b/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineData.h index 1d0e4821c989..26ec453350e1 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineData.h +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineData.h @@ -7,7 +7,7 @@ NS_TIMELINE_BEGIN -class CCS_DLL ActionTimelineData : public ax::Ref +class CCS_DLL ActionTimelineData : public ax::Object { public: static ActionTimelineData* create(int actionTag); diff --git a/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.h b/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.h index 04698bbb97ef..7a532048bc39 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.h +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.h @@ -65,7 +65,7 @@ class ActionTimelineNode; NS_AX_BEGIN -typedef std::function ccNodeLoadCallback; +typedef std::function ccNodeLoadCallback; class CCS_DLL CSLoader { diff --git a/extensions/cocostudio/src/cocostudio/ActionTimeline/Frame.h b/extensions/cocostudio/src/cocostudio/ActionTimeline/Frame.h index 941a35b128bb..3cb2c2953a78 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/Frame.h +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/Frame.h @@ -26,7 +26,7 @@ THE SOFTWARE. #define __CCFRAME_H__ #include -#include "base/Ref.h" +#include "base/Object.h" #include "base/Vector.h" #include "2d/Node.h" #include "2d/Sprite.h" @@ -39,7 +39,7 @@ NS_TIMELINE_BEGIN class Timeline; class ActionTimeline; -class CCS_DLL Frame : public ax::Ref +class CCS_DLL Frame : public ax::Object { public: virtual void setFrameIndex(unsigned int frameIndex) { _frameIndex = frameIndex; } diff --git a/extensions/cocostudio/src/cocostudio/ActionTimeline/TimeLine.h b/extensions/cocostudio/src/cocostudio/ActionTimeline/TimeLine.h index 1f8a636bdb99..331fc7ffb15c 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/TimeLine.h +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/TimeLine.h @@ -33,7 +33,7 @@ NS_TIMELINE_BEGIN class ActionTimeline; -class CCS_DLL Timeline : public ax::Ref +class CCS_DLL Timeline : public ax::Object { public: static Timeline* create(); diff --git a/extensions/cocostudio/src/cocostudio/ArmatureAnimation.cpp b/extensions/cocostudio/src/cocostudio/ArmatureAnimation.cpp index e67ff4117e7d..456667a3a96a 100644 --- a/extensions/cocostudio/src/cocostudio/ArmatureAnimation.cpp +++ b/extensions/cocostudio/src/cocostudio/ArmatureAnimation.cpp @@ -456,13 +456,13 @@ std::string ArmatureAnimation::getCurrentMovementID() const return _movementID; } -void ArmatureAnimation::setMovementEventCallFunc(Ref* target, SEL_MovementEventCallFunc callFunc) +void ArmatureAnimation::setMovementEventCallFunc(Object* target, SEL_MovementEventCallFunc callFunc) { _movementEventTarget = target; _movementEventCallFunc = callFunc; } -void ArmatureAnimation::setFrameEventCallFunc(Ref* target, SEL_FrameEventCallFunc callFunc) +void ArmatureAnimation::setFrameEventCallFunc(Object* target, SEL_FrameEventCallFunc callFunc) { _frameEventTarget = target; _frameEventCallFunc = callFunc; @@ -480,7 +480,7 @@ void ArmatureAnimation::setFrameEventCallFunc( _frameEventListener = listener; } -void ArmatureAnimation::setUserObject(Ref* pUserObject) +void ArmatureAnimation::setUserObject(Object* pUserObject) { AX_SAFE_RETAIN(pUserObject); AX_SAFE_RELEASE(_userObject); diff --git a/extensions/cocostudio/src/cocostudio/ArmatureAnimation.h b/extensions/cocostudio/src/cocostudio/ArmatureAnimation.h index 7cfb3a31286e..160e12085ee9 100644 --- a/extensions/cocostudio/src/cocostudio/ArmatureAnimation.h +++ b/extensions/cocostudio/src/cocostudio/ArmatureAnimation.h @@ -43,8 +43,8 @@ enum MovementEventType class Armature; class Bone; -typedef void (ax::Ref::*SEL_MovementEventCallFunc)(Armature*, MovementEventType, std::string_view); -typedef void (ax::Ref::*SEL_FrameEventCallFunc)(Bone*, std::string_view, int, int); +typedef void (ax::Object::*SEL_MovementEventCallFunc)(Armature*, MovementEventType, std::string_view); +typedef void (ax::Object::*SEL_FrameEventCallFunc)(Bone*, std::string_view, int, int); #define movementEvent_selector(_SELECTOR) (cocostudio::SEL_MovementEventCallFunc)(&_SELECTOR) #define frameEvent_selector(_SELECTOR) (cocostudio::SEL_FrameEventCallFunc)(&_SELECTOR) @@ -183,13 +183,13 @@ class CCS_DLL ArmatureAnimation : public ProcessBase * Set armature's movement event callback function * To disconnect this event, just setMovementEventCallFunc(nullptr, nullptr); */ - AX_DEPRECATED_ATTRIBUTE void setMovementEventCallFunc(ax::Ref* target, SEL_MovementEventCallFunc callFunc); + AX_DEPRECATED_ATTRIBUTE void setMovementEventCallFunc(ax::Object* target, SEL_MovementEventCallFunc callFunc); /** * Set armature's frame event callback function * To disconnect this event, just setFrameEventCallFunc(nullptr, nullptr); */ - AX_DEPRECATED_ATTRIBUTE void setFrameEventCallFunc(ax::Ref* target, SEL_FrameEventCallFunc callFunc); + AX_DEPRECATED_ATTRIBUTE void setFrameEventCallFunc(ax::Object* target, SEL_FrameEventCallFunc callFunc); void setMovementEventCallFunc( std::function listener); @@ -217,12 +217,12 @@ class CCS_DLL ArmatureAnimation : public ProcessBase * @js NA * @lua NA */ - virtual Ref* getUserObject() { return _userObject; } + virtual Object* getUserObject() { return _userObject; } /** * @js NA * @lua NA */ - virtual const Ref* getUserObject() const { return _userObject; } + virtual const Object* getUserObject() const { return _userObject; } /** * Returns a user assigned Object @@ -234,7 +234,7 @@ class CCS_DLL ArmatureAnimation : public ProcessBase * * @param userObject A user assigned Object */ - virtual void setUserObject(Ref* userObject); + virtual void setUserObject(Object* userObject); protected: /** @@ -298,7 +298,7 @@ class CCS_DLL ArmatureAnimation : public ProcessBase unsigned int _movementIndex; int _movementListDurationTo; - ax::Ref* _userObject; + ax::Object* _userObject; protected: /** @@ -318,8 +318,8 @@ class CCS_DLL ArmatureAnimation : public ProcessBase */ SEL_FrameEventCallFunc _frameEventCallFunc; - ax::Ref* _movementEventTarget; - ax::Ref* _frameEventTarget; + ax::Object* _movementEventTarget; + ax::Object* _frameEventTarget; std::function _movementEventListener; diff --git a/extensions/cocostudio/src/cocostudio/ArmatureDataManager.cpp b/extensions/cocostudio/src/cocostudio/ArmatureDataManager.cpp index 8968134a0c37..af2e9c95cbbb 100644 --- a/extensions/cocostudio/src/cocostudio/ArmatureDataManager.cpp +++ b/extensions/cocostudio/src/cocostudio/ArmatureDataManager.cpp @@ -188,7 +188,7 @@ void ArmatureDataManager::addArmatureFileInfo(std::string_view configFilePath) DataReaderHelper::getInstance()->addDataFromFile(configFilePath); } -void ArmatureDataManager::addArmatureFileInfoAsync(std::string_view configFilePath, Ref* target, SEL_SCHEDULE selector) +void ArmatureDataManager::addArmatureFileInfoAsync(std::string_view configFilePath, Object* target, SEL_SCHEDULE selector) { addRelativeData(configFilePath); @@ -210,7 +210,7 @@ void ArmatureDataManager::addArmatureFileInfo(std::string_view imagePath, void ArmatureDataManager::addArmatureFileInfoAsync(std::string_view imagePath, std::string_view plistPath, std::string_view configFilePath, - Ref* target, + Object* target, SEL_SCHEDULE selector) { addRelativeData(configFilePath); diff --git a/extensions/cocostudio/src/cocostudio/ArmatureDataManager.h b/extensions/cocostudio/src/cocostudio/ArmatureDataManager.h index 7de604d61939..ac05443fd08b 100644 --- a/extensions/cocostudio/src/cocostudio/ArmatureDataManager.h +++ b/extensions/cocostudio/src/cocostudio/ArmatureDataManager.h @@ -43,7 +43,7 @@ struct RelativeData /** * @brief format and manage armature configuration and armature animation */ -class CCS_DLL ArmatureDataManager : public ax::Ref +class CCS_DLL ArmatureDataManager : public ax::Object { public: /** @deprecated Use getInstance() instead */ @@ -145,7 +145,7 @@ class CCS_DLL ArmatureDataManager : public ax::Ref * It will load data in a new thread */ void addArmatureFileInfoAsync(std::string_view configFilePath, - ax::Ref* target, + ax::Object* target, ax::SEL_SCHEDULE selector); /** @@ -160,7 +160,7 @@ class CCS_DLL ArmatureDataManager : public ax::Ref void addArmatureFileInfoAsync(std::string_view imagePath, std::string_view plistPath, std::string_view configFilePath, - ax::Ref* target, + ax::Object* target, ax::SEL_SCHEDULE selector); /** diff --git a/extensions/cocostudio/src/cocostudio/ColliderDetector.h b/extensions/cocostudio/src/cocostudio/ColliderDetector.h index 6df524209724..aca993a4e80c 100644 --- a/extensions/cocostudio/src/cocostudio/ColliderDetector.h +++ b/extensions/cocostudio/src/cocostudio/ColliderDetector.h @@ -87,7 +87,7 @@ class CCS_DLL ColliderFilter #endif }; -class CCS_DLL ColliderBody : public ax::Ref +class CCS_DLL ColliderBody : public ax::Object { public: ColliderBody(ContourData* contourData); @@ -131,7 +131,7 @@ class CCS_DLL ColliderBody : public ax::Ref * @js NA * @lua NA */ -class CCS_DLL ColliderDetector : public ax::Ref +class CCS_DLL ColliderDetector : public ax::Object { public: static ColliderDetector* create(); diff --git a/extensions/cocostudio/src/cocostudio/ComBase.h b/extensions/cocostudio/src/cocostudio/ComBase.h index 2900d238eb6d..94507cebfc21 100644 --- a/extensions/cocostudio/src/cocostudio/ComBase.h +++ b/extensions/cocostudio/src/cocostudio/ComBase.h @@ -34,10 +34,10 @@ THE SOFTWARE. #define DECLARE_CLASS_COMPONENT_INFO \ public: \ static ax::ObjectFactory::TInfo Type; \ - static ax::Ref* createInstance(void); + static ax::Object* createInstance(void); #define IMPLEMENT_CLASS_COMPONENT_INFO(className) \ - ax::Ref* className::createInstance(void) { return className::create(); } \ + ax::Object* className::createInstance(void) { return className::create(); } \ ax::ObjectFactory::TInfo className::Type(#className, &className::createInstance); #define CREATE_CLASS_COMPONENT_INFO(className) ax::ObjectFactory::TInfo(#className, &className::createInstance) diff --git a/extensions/cocostudio/src/cocostudio/DataReaderHelper.cpp b/extensions/cocostudio/src/cocostudio/DataReaderHelper.cpp index 5abdb7d11d3d..aa7535eec991 100644 --- a/extensions/cocostudio/src/cocostudio/DataReaderHelper.cpp +++ b/extensions/cocostudio/src/cocostudio/DataReaderHelper.cpp @@ -318,7 +318,7 @@ void DataReaderHelper::addDataFromFile(std::string_view filePath) void DataReaderHelper::addDataFromFileAsync(std::string_view imagePath, std::string_view plistPath, std::string_view filePath, - Ref* target, + Object* target, SEL_SCHEDULE selector) { /* @@ -459,7 +459,7 @@ void DataReaderHelper::addDataAsyncCallBack(float /*dt*/) pDataInfo->configFileQueue.pop(); } - Ref* target = pAsyncStruct->target; + Object* target = pAsyncStruct->target; SEL_SCHEDULE selector = pAsyncStruct->selector; --_asyncRefCount; diff --git a/extensions/cocostudio/src/cocostudio/DataReaderHelper.h b/extensions/cocostudio/src/cocostudio/DataReaderHelper.h index 3a4534e54a69..23eb414ca00c 100644 --- a/extensions/cocostudio/src/cocostudio/DataReaderHelper.h +++ b/extensions/cocostudio/src/cocostudio/DataReaderHelper.h @@ -50,7 +50,7 @@ struct stExpCocoNode; * @js NA * @lua NA */ -class CCS_DLL DataReaderHelper : ax::Ref +class CCS_DLL DataReaderHelper : ax::Object { protected: enum ConfigType @@ -66,7 +66,7 @@ class CCS_DLL DataReaderHelper : ax::Ref std::string fileContent; ConfigType configType; std::string baseFilePath; - ax::Ref* target; + ax::Object* target; ax::SEL_SCHEDULE selector; bool autoLoadSpriteFile; @@ -118,7 +118,7 @@ class CCS_DLL DataReaderHelper : ax::Ref void addDataFromFileAsync(std::string_view imagePath, std::string_view plistPath, std::string_view filePath, - ax::Ref* target, + ax::Object* target, ax::SEL_SCHEDULE selector); void addDataAsyncCallBack(float dt); diff --git a/extensions/cocostudio/src/cocostudio/Datas.h b/extensions/cocostudio/src/cocostudio/Datas.h index 6693e935e36c..fad46dd75320 100644 --- a/extensions/cocostudio/src/cocostudio/Datas.h +++ b/extensions/cocostudio/src/cocostudio/Datas.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CCARMATURE_DATAS_H__ #define __CCARMATURE_DATAS_H__ -#include "base/Ref.h" +#include "base/Object.h" #include "base/Types.h" #include "base/Vector.h" #include "base/Map.h" @@ -66,7 +66,7 @@ namespace cocostudio * @js NA * @lua NA */ -class CCS_DLL BaseData : public ax::Ref +class CCS_DLL BaseData : public ax::Object { public: AX_CREATE_NO_PARAM_NO_INIT(BaseData) @@ -135,7 +135,7 @@ enum DisplayType * @js NA * @lua NA */ -class CCS_DLL DisplayData : public ax::Ref +class CCS_DLL DisplayData : public ax::Object { public: AX_CREATE_NO_PARAM_NO_INIT(DisplayData) @@ -265,7 +265,7 @@ class CCS_DLL BoneData : public BaseData * @js NA * @lua NA */ -class CCS_DLL ArmatureData : public ax::Ref +class CCS_DLL ArmatureData : public ax::Object { public: AX_CREATE_NO_PARAM(ArmatureData) @@ -360,7 +360,7 @@ class CCS_DLL FrameData : public BaseData * @js NA * @lua NA */ -class CCS_DLL MovementBoneData : public ax::Ref +class CCS_DLL MovementBoneData : public ax::Object { public: AX_CREATE_NO_PARAM(MovementBoneData) @@ -393,7 +393,7 @@ class CCS_DLL MovementBoneData : public ax::Ref * @js NA * @lua NA */ -class CCS_DLL MovementData : public ax::Ref +class CCS_DLL MovementData : public ax::Object { public: AX_CREATE_NO_PARAM_NO_INIT(MovementData) @@ -456,7 +456,7 @@ class CCS_DLL MovementData : public ax::Ref * @js NA * @lua NA */ -class CCS_DLL AnimationData : public ax::Ref +class CCS_DLL AnimationData : public ax::Object { public: AX_CREATE_NO_PARAM_NO_INIT(AnimationData) @@ -486,7 +486,7 @@ class CCS_DLL AnimationData : public ax::Ref * @js NA * @lua NA */ -class CCS_DLL ContourData : public ax::Ref +class CCS_DLL ContourData : public ax::Object { public: AX_CREATE_NO_PARAM(ContourData) @@ -513,7 +513,7 @@ class CCS_DLL ContourData : public ax::Ref * @js NA * @lua NA */ -class CCS_DLL TextureData : public ax::Ref +class CCS_DLL TextureData : public ax::Object { public: AX_CREATE_NO_PARAM(TextureData) diff --git a/extensions/cocostudio/src/cocostudio/DecorativeDisplay.h b/extensions/cocostudio/src/cocostudio/DecorativeDisplay.h index deef304d78e5..d5092a709a25 100644 --- a/extensions/cocostudio/src/cocostudio/DecorativeDisplay.h +++ b/extensions/cocostudio/src/cocostudio/DecorativeDisplay.h @@ -44,7 +44,7 @@ namespace cocostudio * @js NA * @lua NA */ -class CCS_DLL DecorativeDisplay : public ax::Ref +class CCS_DLL DecorativeDisplay : public ax::Object { public: static DecorativeDisplay* create(); diff --git a/extensions/cocostudio/src/cocostudio/DisplayManager.h b/extensions/cocostudio/src/cocostudio/DisplayManager.h index 855f4ccd5226..409b7aa14932 100644 --- a/extensions/cocostudio/src/cocostudio/DisplayManager.h +++ b/extensions/cocostudio/src/cocostudio/DisplayManager.h @@ -39,7 +39,7 @@ class Bone; * @js NA * @lua NA */ -class CCS_DLL DisplayManager : public ax::Ref +class CCS_DLL DisplayManager : public ax::Object { public: static DisplayManager* create(Bone* bone); diff --git a/extensions/cocostudio/src/cocostudio/ProcessBase.h b/extensions/cocostudio/src/cocostudio/ProcessBase.h index fef85d534731..b0c9f2fb6897 100644 --- a/extensions/cocostudio/src/cocostudio/ProcessBase.h +++ b/extensions/cocostudio/src/cocostudio/ProcessBase.h @@ -51,7 +51,7 @@ enum AnimationType * @js NA * @lua NA */ -class CCS_DLL ProcessBase : public ax::Ref +class CCS_DLL ProcessBase : public ax::Object { public: ProcessBase(void); diff --git a/extensions/cocostudio/src/cocostudio/SGUIReader.cpp b/extensions/cocostudio/src/cocostudio/SGUIReader.cpp index d0cb86377e23..a97a3118a5c2 100644 --- a/extensions/cocostudio/src/cocostudio/SGUIReader.cpp +++ b/extensions/cocostudio/src/cocostudio/SGUIReader.cpp @@ -162,7 +162,7 @@ ax::Size GUIReader::getFileDesignSize(const char* fileName) const void GUIReader::registerTypeAndCallBack(std::string_view classType, ObjectFactory::Instance ins, - Ref* object, + Object* object, SEL_ParseEvent callBack) { ObjectFactory* factoryCreate = ObjectFactory::getInstance(); @@ -183,7 +183,7 @@ void GUIReader::registerTypeAndCallBack(std::string_view classType, void GUIReader::registerTypeAndCallBack(std::string_view classType, ObjectFactory::InstanceFunc ins, - Ref* object, + Object* object, SEL_ParseEvent callBack) { ObjectFactory* factoryCreate = ObjectFactory::getInstance(); @@ -346,14 +346,14 @@ ax::ui::Widget* WidgetPropertiesReader::createGUI(std::string_view classname) { std::string name = this->getGUIClassName(classname); - Ref* object = ObjectFactory::getInstance()->createObject(name); + Object* object = ObjectFactory::getInstance()->createObject(name); return dynamic_cast(object); } WidgetReaderProtocol* WidgetPropertiesReader::createWidgetReaderProtocol(std::string_view classname) { - Ref* object = ObjectFactory::getInstance()->createObject(classname); + Object* object = ObjectFactory::getInstance()->createObject(classname); return dynamic_cast(object); } @@ -535,7 +535,7 @@ Widget* WidgetPropertiesReader0250::createWidget(const rapidjson::Value& data, // ActionManager::getInstance()->releaseActions(); /* ********************** */ // AXLOG("file name == [%s]",fileName); - Ref* rootWidget = (Ref*)widget; + Object* rootWidget = (Object*)widget; ActionManagerEx::getInstance()->initWithDictionary(fileName, actions, rootWidget); return widget; } @@ -1312,7 +1312,7 @@ Widget* WidgetPropertiesReader0300::createWidget(const rapidjson::Value& data, // ActionManager::getInstance()->releaseActions(); /* ********************** */ // AXLOG("file name == [%s]",fileName); - Ref* rootWidget = (Ref*)widget; + Object* rootWidget = (Object*)widget; ActionManagerEx::getInstance()->initWithDictionary(fileName, actions, rootWidget); return widget; } @@ -1389,7 +1389,7 @@ ax::ui::Widget* WidgetPropertiesReader0300::createWidgetFromBinary(CocoLoader* c std::string key = optionChildNode[k].GetName(cocoLoader); if (key == "animation") { - Ref* rootWidget = (Ref*)widget; + Object* rootWidget = (Object*)widget; ActionManagerEx::getInstance()->initWithBinary(fileName, rootWidget, cocoLoader, &optionChildNode[k]); break; } @@ -1647,8 +1647,8 @@ void WidgetPropertiesReader0300::setPropsForAllCustomWidgetFromJsonDictionary(st { GUIReader* guiReader = GUIReader::getInstance(); - hlookup::string_map* object_map = guiReader->getParseObjectMap(); - Ref* object = (*object_map)[classType]; + hlookup::string_map* object_map = guiReader->getParseObjectMap(); + Object* object = (*object_map)[classType]; hlookup::string_map* selector_map = guiReader->getParseCallBackMap(); SEL_ParseEvent selector = (*selector_map)[classType]; diff --git a/extensions/cocostudio/src/cocostudio/SGUIReader.h b/extensions/cocostudio/src/cocostudio/SGUIReader.h index c369b05c993c..749ca4845430 100644 --- a/extensions/cocostudio/src/cocostudio/SGUIReader.h +++ b/extensions/cocostudio/src/cocostudio/SGUIReader.h @@ -50,10 +50,10 @@ struct stExpCocoNode; #define kCCSVersion 1.0 -typedef void (ax::Ref::*SEL_ParseEvent)(std::string_view, ax::Ref*, const rapidjson::Value&); +typedef void (ax::Object::*SEL_ParseEvent)(std::string_view, ax::Object*, const rapidjson::Value&); #define parseselector(_SELECTOR) (SEL_ParseEvent)(&_SELECTOR) -class CCS_DLL GUIReader : public ax::Ref +class CCS_DLL GUIReader : public ax::Object { public: AX_DEPRECATED_ATTRIBUTE static GUIReader* shareReader() { return GUIReader::getInstance(); }; @@ -81,12 +81,12 @@ class CCS_DLL GUIReader : public ax::Ref void registerTypeAndCallBack(std::string_view classType, ax::ObjectFactory::Instance ins, - Ref* object, + Object* object, SEL_ParseEvent callBack); void registerTypeAndCallBack(std::string_view classType, ax::ObjectFactory::InstanceFunc ins, - Ref* object, + Object* object, SEL_ParseEvent callBack); protected: @@ -98,7 +98,7 @@ class CCS_DLL GUIReader : public ax::Ref typedef hlookup::string_map ParseCallBackMap; ParseCallBackMap _mapParseSelector; - typedef hlookup::string_map ParseObjectMap; + typedef hlookup::string_map ParseObjectMap; ParseObjectMap _mapObject; public: @@ -106,7 +106,7 @@ class CCS_DLL GUIReader : public ax::Ref ParseObjectMap* getParseObjectMap() { return &_mapObject; }; }; -class CCS_DLL WidgetPropertiesReader : public ax::Ref +class CCS_DLL WidgetPropertiesReader : public ax::Object { public: virtual ax::ui::Widget* createWidget(const rapidjson::Value& dic, diff --git a/extensions/cocostudio/src/cocostudio/SSceneReader.cpp b/extensions/cocostudio/src/cocostudio/SSceneReader.cpp index dd9d1d86ef35..cf1c9f27d36c 100644 --- a/extensions/cocostudio/src/cocostudio/SSceneReader.cpp +++ b/extensions/cocostudio/src/cocostudio/SSceneReader.cpp @@ -212,7 +212,7 @@ Node* SceneReader::nodeByTag(Node* parent, int tag) ax::Component* SceneReader::createComponent(std::string_view classname) { std::string name = this->getComponentClassName(classname); - Ref* object = ObjectFactory::getInstance()->createObject(name); + Object* object = ObjectFactory::getInstance()->createObject(name); return dynamic_cast(object); } @@ -455,7 +455,7 @@ ax::Node* SceneReader::createObject(CocoLoader* cocoLoader, return nullptr; } -void SceneReader::setTarget(const std::function& selector) +void SceneReader::setTarget(const std::function& selector) { _fnSelector = selector; } diff --git a/extensions/cocostudio/src/cocostudio/SSceneReader.h b/extensions/cocostudio/src/cocostudio/SSceneReader.h index 1033cecd1ac2..70dc59170ba1 100644 --- a/extensions/cocostudio/src/cocostudio/SSceneReader.h +++ b/extensions/cocostudio/src/cocostudio/SSceneReader.h @@ -63,7 +63,7 @@ class CCS_DLL SceneReader static const char* sceneReaderVersion(); ax::Node* createNodeWithSceneFile(std::string_view fileName, AttachComponentType attachComponent = AttachComponentType::EMPTY_NODE); - void setTarget(const std::function& selector); + void setTarget(const std::function& selector); ax::Node* getNodeByTag(int nTag); inline AttachComponentType getAttachComponentType() { return _attachComponent; } SceneReader(); @@ -90,7 +90,7 @@ class CCS_DLL SceneReader private: static SceneReader* s_sharedReader; - std::function _fnSelector; + std::function _fnSelector; ax::Node* _node; AttachComponentType _attachComponent; }; diff --git a/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.h b/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.h index 3d127fd341d1..400cfe4e3f80 100644 --- a/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.h +++ b/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.h @@ -10,7 +10,7 @@ class CCS_DLL SpineSkeletonDataCache { public: - class SkeletonData : public ax::Ref + class SkeletonData : public ax::Object { public: SkeletonData(spine::SkeletonData* d, spine::AttachmentLoader* loader) : data(d), attachmentLoader(loader) {} @@ -47,7 +47,7 @@ class CCS_DLL SpineSkeletonDataCache class SpineSkeletonDataCache { public: - class SkeletonData : public ax::Ref + class SkeletonData : public ax::Object { public: SkeletonData(spSkeletonData* d, spAttachmentLoader* loader) : data(d), attachmentLoader(loader) {} diff --git a/extensions/cocostudio/src/cocostudio/TriggerBase.h b/extensions/cocostudio/src/cocostudio/TriggerBase.h index 2b70202dd6a6..35e0f0f4c413 100644 --- a/extensions/cocostudio/src/cocostudio/TriggerBase.h +++ b/extensions/cocostudio/src/cocostudio/TriggerBase.h @@ -34,10 +34,10 @@ THE SOFTWARE. #define DECLARE_CLASS_INFO \ public: \ static ax::ObjectFactory::TInfo Type; \ - static ax::Ref* createInstance(void); + static ax::Object* createInstance(void); #define IMPLEMENT_CLASS_INFO(className) \ - ax::Ref* className::createInstance(void) \ + ax::Object* className::createInstance(void) \ { \ auto ret = new className; \ ret->autorelease(); \ diff --git a/extensions/cocostudio/src/cocostudio/TriggerMng.cpp b/extensions/cocostudio/src/cocostudio/TriggerMng.cpp index 65b385ee984a..4e256a418ec2 100644 --- a/extensions/cocostudio/src/cocostudio/TriggerMng.cpp +++ b/extensions/cocostudio/src/cocostudio/TriggerMng.cpp @@ -403,7 +403,7 @@ void TriggerMng::buildJson(rapidjson::Document& document, } } -void TriggerMng::addArmatureMovementCallBack(Armature* pAr, Ref* pTarget, SEL_MovementEventCallFunc mecf) +void TriggerMng::addArmatureMovementCallBack(Armature* pAr, Object* pTarget, SEL_MovementEventCallFunc mecf) { if (pAr == nullptr || _movementDispatches == nullptr || pTarget == nullptr || mecf == nullptr) { @@ -428,7 +428,7 @@ void TriggerMng::addArmatureMovementCallBack(Armature* pAr, Ref* pTarget, SEL_Mo } } -void TriggerMng::removeArmatureMovementCallBack(Armature* pAr, Ref* pTarget, SEL_MovementEventCallFunc mecf) +void TriggerMng::removeArmatureMovementCallBack(Armature* pAr, Object* pTarget, SEL_MovementEventCallFunc mecf) { if (pAr == nullptr || _movementDispatches == nullptr || pTarget == nullptr || mecf == nullptr) { @@ -494,7 +494,7 @@ void TriggerMng::addEventListenerWithFixedPriority(ax::EventListener* listener, ArmatureMovementDispatcher::ArmatureMovementDispatcher(void) : _mapEventAnimation(nullptr) { - _mapEventAnimation = new std::unordered_map; + _mapEventAnimation = new std::unordered_map; } ArmatureMovementDispatcher::~ArmatureMovementDispatcher(void) @@ -513,12 +513,12 @@ void ArmatureMovementDispatcher::animationEvent(Armature* armature, } } -void ArmatureMovementDispatcher::addAnimationEventCallBack(Ref* pTarget, SEL_MovementEventCallFunc mecf) +void ArmatureMovementDispatcher::addAnimationEventCallBack(Object* pTarget, SEL_MovementEventCallFunc mecf) { _mapEventAnimation->emplace(pTarget, mecf); } -void ArmatureMovementDispatcher::removeAnnimationEventCallBack(Ref* pTarget, SEL_MovementEventCallFunc /*mecf*/) +void ArmatureMovementDispatcher::removeAnnimationEventCallBack(Object* pTarget, SEL_MovementEventCallFunc /*mecf*/) { _mapEventAnimation->erase(pTarget); } diff --git a/extensions/cocostudio/src/cocostudio/TriggerMng.h b/extensions/cocostudio/src/cocostudio/TriggerMng.h index f615b3516602..318e2f1cf66e 100644 --- a/extensions/cocostudio/src/cocostudio/TriggerMng.h +++ b/extensions/cocostudio/src/cocostudio/TriggerMng.h @@ -36,19 +36,19 @@ namespace cocostudio class TriggerObj; -class CCS_DLL ArmatureMovementDispatcher : public ax::Ref +class CCS_DLL ArmatureMovementDispatcher : public ax::Object { public: ArmatureMovementDispatcher(void); ~ArmatureMovementDispatcher(void); public: - void addAnimationEventCallBack(ax::Ref* pTarget, SEL_MovementEventCallFunc mecf); - void removeAnnimationEventCallBack(ax::Ref* pTarget, SEL_MovementEventCallFunc mecf); + void addAnimationEventCallBack(ax::Object* pTarget, SEL_MovementEventCallFunc mecf); + void removeAnnimationEventCallBack(ax::Object* pTarget, SEL_MovementEventCallFunc mecf); void animationEvent(Armature* armature, MovementEventType movementType, std::string_view movementID); private: - std::unordered_map* _mapEventAnimation; + std::unordered_map* _mapEventAnimation; }; class CCS_DLL TriggerMng @@ -72,8 +72,8 @@ class CCS_DLL TriggerMng bool removeTriggerObj(unsigned int id); bool isEmpty(void) const; - void addArmatureMovementCallBack(Armature* pAr, ax::Ref* pTarget, SEL_MovementEventCallFunc mecf); - void removeArmatureMovementCallBack(Armature* pAr, ax::Ref* pTarget, SEL_MovementEventCallFunc mecf); + void addArmatureMovementCallBack(Armature* pAr, ax::Object* pTarget, SEL_MovementEventCallFunc mecf); + void removeArmatureMovementCallBack(Armature* pAr, ax::Object* pTarget, SEL_MovementEventCallFunc mecf); void removeArmatureAllMovementCallBack(Armature* pAr); void removeAllArmatureMovementCallBack(); void dispatchEvent(ax::EventCustom* tEvent); diff --git a/extensions/cocostudio/src/cocostudio/TriggerObj.h b/extensions/cocostudio/src/cocostudio/TriggerObj.h index 50c5733645b5..8e585a2cb16a 100644 --- a/extensions/cocostudio/src/cocostudio/TriggerObj.h +++ b/extensions/cocostudio/src/cocostudio/TriggerObj.h @@ -32,7 +32,7 @@ THE SOFTWARE. namespace cocostudio { -class CCS_DLL BaseTriggerCondition : public ax::Ref +class CCS_DLL BaseTriggerCondition : public ax::Object { protected: BaseTriggerCondition(void); @@ -46,7 +46,7 @@ class CCS_DLL BaseTriggerCondition : public ax::Ref virtual void removeAll(); }; -class CCS_DLL BaseTriggerAction : public ax::Ref +class CCS_DLL BaseTriggerAction : public ax::Object { protected: BaseTriggerAction(void); @@ -60,7 +60,7 @@ class CCS_DLL BaseTriggerAction : public ax::Ref virtual void removeAll(); }; -class CCS_DLL TriggerObj : public ax::Ref +class CCS_DLL TriggerObj : public ax::Object { public: TriggerObj(void); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h index e72e569167aa..f318db83db3a 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h @@ -37,7 +37,7 @@ instance->registReaderObject("ArmatureNodeReader", (ObjectFactory::Instance)Cust * * *****************************************/ -class ArmatureNodeReader : public ax::Ref, public cocostudio::NodeReaderProtocol +class ArmatureNodeReader : public ax::Object, public cocostudio::NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h index eb82ea70fb32..a8e93c56ef91 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h @@ -25,7 +25,7 @@ #ifndef __cocos2d_libs__ComAudioReader__ #define __cocos2d_libs__ComAudioReader__ -#include "base/Ref.h" +#include "base/Object.h" #include "2d/Component.h" #include "2d/Node.h" #include "cocostudio/CocosStudioExport.h" @@ -33,7 +33,7 @@ namespace cocostudio { -class CCS_DLL ComAudioReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL ComAudioReader : public ax::Object, public NodeReaderProtocol { public: diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/GameMapReader/GameMapReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/GameMapReader/GameMapReader.h index 252ca5d748d2..70704358ea6e 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/GameMapReader/GameMapReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/GameMapReader/GameMapReader.h @@ -31,7 +31,7 @@ namespace cocostudio { -class CCS_DLL GameMapReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL GameMapReader : public ax::Object, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h index 8076dc5060f6..c0a2ee6b2bc2 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h @@ -32,7 +32,7 @@ namespace cocostudio { -class CCS_DLL GameNode3DReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL GameNode3DReader : public ax::Object, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.h index ec0bb4e6a34b..ecba32560b26 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.h @@ -31,7 +31,7 @@ namespace cocostudio { -class CCS_DLL Light3DReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL Light3DReader : public ax::Object, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.h index 2c2a7babe593..9e0e01e8bf55 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.h @@ -32,7 +32,7 @@ namespace cocostudio { -class CCS_DLL MeshReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL MeshReader : public ax::Object, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.h index 86efa736c43b..2229f3cb38d3 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.h @@ -32,7 +32,7 @@ namespace cocostudio { -class CCS_DLL Node3DReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL Node3DReader : public ax::Object, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReader/NodeReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReader/NodeReader.h index 919c4effaa58..1f4ea61e3241 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReader/NodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReader/NodeReader.h @@ -31,7 +31,7 @@ namespace cocostudio { -class CCS_DLL NodeReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL NodeReader : public ax::Object, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReaderDefine.h b/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReaderDefine.h index d89759f2a76d..e88174e4ea0a 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReaderDefine.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReaderDefine.h @@ -35,10 +35,10 @@ #define DECLARE_CLASS_NODE_READER_INFO \ public: \ static ax::ObjectFactory::TInfo __Type; \ - static ax::Ref* createInstance(void); + static ax::Object* createInstance(void); #define IMPLEMENT_CLASS_NODE_READER_INFO(className) \ - ax::Ref* className::createInstance(void) { return className::getInstance(); } \ + ax::Object* className::createInstance(void) { return className::getInstance(); } \ ax::ObjectFactory::TInfo className::__Type(#className, &className::createInstance); #define CREATE_CLASS_NODE_READER_INFO(className) ax::ObjectFactory::TInfo(#className, &className::createInstance) diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h index f35cc26f32c9..a3cf9a09fa66 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h @@ -31,7 +31,7 @@ namespace cocostudio { -class CCS_DLL Particle3DReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL Particle3DReader : public ax::Object, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.h index 5cbc48816d24..18ee8e363cf1 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.h @@ -31,7 +31,7 @@ namespace cocostudio { -class CCS_DLL ParticleReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL ParticleReader : public ax::Object, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h index 99aa2f493ed1..5c108d77add8 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h @@ -25,13 +25,13 @@ #ifndef __cocos2d_libs__ProjectNodeReader__ #define __cocos2d_libs__ProjectNodeReader__ -#include "base/Ref.h" +#include "base/Object.h" #include "cocostudio/CocosStudioExport.h" #include "cocostudio/WidgetReader/NodeReaderProtocol.h" namespace cocostudio { -class CCS_DLL ProjectNodeReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL ProjectNodeReader : public ax::Object, public NodeReaderProtocol { public: diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h index d27ddb833c98..ce6e6fa5f96f 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h @@ -31,7 +31,7 @@ namespace cocostudio { -class CCS_DLL SingleNodeReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL SingleNodeReader : public ax::Object, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h index ca16c05a1e40..eae7ca0f4f4c 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h @@ -28,7 +28,7 @@ THE SOFTWARE. #include "cocostudio/WidgetReader/NodeReaderProtocol.h" #include "cocostudio/WidgetReader/NodeReaderDefine.h" -class BoneNodeReader : public ax::Ref, public cocostudio::NodeReaderProtocol +class BoneNodeReader : public ax::Object, public cocostudio::NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h index d84bac7fa7e4..c9eb728acfb2 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h @@ -33,7 +33,7 @@ namespace cocostudio { -class CCS_DLL SpineSkeletonReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL SpineSkeletonReader : public ax::Object, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.h index 646cbe0e895b..05faea8ab3e6 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.h @@ -31,7 +31,7 @@ namespace cocostudio { -class CCS_DLL SpriteReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL SpriteReader : public ax::Object, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/TabControlReader/TabControlReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/TabControlReader/TabControlReader.h index 517131a8a0dd..651b38c25c6c 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/TabControlReader/TabControlReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/TabControlReader/TabControlReader.h @@ -29,7 +29,7 @@ #include "cocostudio/WidgetReader/NodeReaderDefine.h" #include "cocostudio/WidgetReader/TabControlReader/CSTabControl_generated.h" -class TabControlReader : public ax::Ref, public cocostudio::NodeReaderProtocol +class TabControlReader : public ax::Object, public cocostudio::NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO @@ -52,7 +52,7 @@ class TabControlReader : public ax::Ref, public cocostudio::NodeReaderProtocol static TabControlReader* _tabReaderInstance; }; -class TabHeaderReader : public ax::Ref, public cocostudio::NodeReaderProtocol +class TabHeaderReader : public ax::Object, public cocostudio::NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO @@ -77,7 +77,7 @@ class TabHeaderReader : public ax::Ref, public cocostudio::NodeReaderProtocol int getResourceType(std::string_view key); }; -class TabItemReader : public ax::Ref, public cocostudio::NodeReaderProtocol +class TabItemReader : public ax::Object, public cocostudio::NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h index bdbfb0b2a795..4c4b6e9d31a4 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h @@ -30,7 +30,7 @@ namespace cocostudio { -class CCS_DLL TextFieldExReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL TextFieldExReader : public ax::Object, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h index bd8e2f0770ae..3796848c9145 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h @@ -32,7 +32,7 @@ namespace cocostudio { -class CCS_DLL UserCameraReader : public ax::Ref, public NodeReaderProtocol +class CCS_DLL UserCameraReader : public ax::Object, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.h index aa721503d066..8b705049b454 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.h @@ -37,7 +37,7 @@ namespace cocostudio class CocoLoader; struct stExpCocoNode; -class CCS_DLL WidgetReader : public ax::Ref, public WidgetReaderProtocol, public NodeReaderProtocol +class CCS_DLL WidgetReader : public ax::Object, public WidgetReaderProtocol, public NodeReaderProtocol { DECLARE_CLASS_NODE_READER_INFO diff --git a/extensions/fairygui/src/fairygui/GTreeNode.h b/extensions/fairygui/src/fairygui/GTreeNode.h index 5c4b3302891e..cacbb3f051d5 100644 --- a/extensions/fairygui/src/fairygui/GTreeNode.h +++ b/extensions/fairygui/src/fairygui/GTreeNode.h @@ -9,7 +9,7 @@ NS_FGUI_BEGIN class GTree; class GComponent; -class GTreeNode : public ax::Ref +class GTreeNode : public ax::Object { public: static GTreeNode* create(bool isFolder = false, const std::string& resURL = ax::STD_STRING_EMPTY); diff --git a/extensions/fairygui/src/fairygui/PackageItem.h b/extensions/fairygui/src/fairygui/PackageItem.h index d98dce8b5fb5..a4ce4427c164 100644 --- a/extensions/fairygui/src/fairygui/PackageItem.h +++ b/extensions/fairygui/src/fairygui/PackageItem.h @@ -13,7 +13,7 @@ class BitmapFont; class PixelHitTestData; class ByteBuffer; -class PackageItem : public ax::Ref +class PackageItem : public ax::Object { public: PackageItem(); diff --git a/extensions/fairygui/src/fairygui/PopupMenu.h b/extensions/fairygui/src/fairygui/PopupMenu.h index d43b372b22fd..059d202b1460 100644 --- a/extensions/fairygui/src/fairygui/PopupMenu.h +++ b/extensions/fairygui/src/fairygui/PopupMenu.h @@ -12,7 +12,7 @@ class GComponent; class GButton; class GList; -class PopupMenu : public ax::Ref +class PopupMenu : public ax::Object { public: static PopupMenu* create(const std::string& resourceURL); diff --git a/extensions/fairygui/src/fairygui/ScrollPane.h b/extensions/fairygui/src/fairygui/ScrollPane.h index 67091e4026a7..39fe78c9fb3f 100644 --- a/extensions/fairygui/src/fairygui/ScrollPane.h +++ b/extensions/fairygui/src/fairygui/ScrollPane.h @@ -17,7 +17,7 @@ class EventContext; class ByteBuffer; class GTweener; -class ScrollPane : public ax::Ref +class ScrollPane : public ax::Object { public: ScrollPane(GComponent* owner); diff --git a/extensions/fairygui/src/fairygui/Transition.h b/extensions/fairygui/src/fairygui/Transition.h index d35c5b8322fb..5d910f13fc83 100644 --- a/extensions/fairygui/src/fairygui/Transition.h +++ b/extensions/fairygui/src/fairygui/Transition.h @@ -12,7 +12,7 @@ class TransitionItem; class GTweener; class ByteBuffer; -class Transition : public ax::Ref +class Transition : public ax::Object { public: typedef std::function PlayCompleteCallback; diff --git a/extensions/fairygui/src/fairygui/UIPackage.h b/extensions/fairygui/src/fairygui/UIPackage.h index f216c759083b..0e182bd08192 100644 --- a/extensions/fairygui/src/fairygui/UIPackage.h +++ b/extensions/fairygui/src/fairygui/UIPackage.h @@ -11,7 +11,7 @@ NS_FGUI_BEGIN struct AtlasSprite; class ByteBuffer; -class UIPackage : public ax::Ref +class UIPackage : public ax::Object { public: UIPackage(); diff --git a/extensions/fairygui/src/fairygui/Window.h b/extensions/fairygui/src/fairygui/Window.h index 54f0ed94731c..8830528c9deb 100644 --- a/extensions/fairygui/src/fairygui/Window.h +++ b/extensions/fairygui/src/fairygui/Window.h @@ -7,7 +7,7 @@ NS_FGUI_BEGIN -class IUISource : public ax::Ref +class IUISource : public ax::Object { public: virtual const std::string& getFileName() = 0; diff --git a/extensions/fairygui/src/fairygui/display/FUIInput.cpp b/extensions/fairygui/src/fairygui/display/FUIInput.cpp index e1ae39f49ce1..9d901990a673 100644 --- a/extensions/fairygui/src/fairygui/display/FUIInput.cpp +++ b/extensions/fairygui/src/fairygui/display/FUIInput.cpp @@ -94,7 +94,7 @@ void FUIInput::continueInit() this->addTouchEventListener(AX_CALLBACK_2(FUIInput::_touchDownAction, this)); } -void FUIInput::_touchDownAction(ax::Ref *sender, ax::ui::Widget::TouchEventType controlEvent) +void FUIInput::_touchDownAction(ax::Object *sender, ax::ui::Widget::TouchEventType controlEvent) { //do nothing } diff --git a/extensions/fairygui/src/fairygui/display/FUIInput.h b/extensions/fairygui/src/fairygui/display/FUIInput.h index 325cc06b37cb..89bc0c201627 100644 --- a/extensions/fairygui/src/fairygui/display/FUIInput.h +++ b/extensions/fairygui/src/fairygui/display/FUIInput.h @@ -36,7 +36,7 @@ class FUIInput : public ax::ui::EditBox private: void continueInit(); - void _touchDownAction(ax::Ref *sender, ax::ui::Widget::TouchEventType controlEvent); + void _touchDownAction(ax::Object *sender, ax::ui::Widget::TouchEventType controlEvent); TextFormat* _textFormat; bool _password; diff --git a/extensions/fairygui/src/fairygui/event/EventContext.h b/extensions/fairygui/src/fairygui/event/EventContext.h index 6006185af5a0..db42f3c93d2e 100644 --- a/extensions/fairygui/src/fairygui/event/EventContext.h +++ b/extensions/fairygui/src/fairygui/event/EventContext.h @@ -17,7 +17,7 @@ class EventContext ~EventContext(); int getType() const { return _type; } - ax::Ref* getSender() const { return _sender; } + ax::Object* getSender() const { return _sender; } InputEvent* getInput() const { return _inputEvent; } void stopPropagation() { _isStopped = true; } void preventDefault() { _defaultPrevented = true; } @@ -29,7 +29,7 @@ class EventContext void* getData() const { return _data; } private: - ax::Ref* _sender; + ax::Object* _sender; InputEvent* _inputEvent; ax::Value _dataValue; void* _data; diff --git a/extensions/fairygui/src/fairygui/event/UIEventDispatcher.h b/extensions/fairygui/src/fairygui/event/UIEventDispatcher.h index 80a8e3efd5ce..af1c87c6812b 100644 --- a/extensions/fairygui/src/fairygui/event/UIEventDispatcher.h +++ b/extensions/fairygui/src/fairygui/event/UIEventDispatcher.h @@ -40,7 +40,7 @@ class EventTag class InputProcessor; -class UIEventDispatcher : public ax::Ref +class UIEventDispatcher : public ax::Object { public: UIEventDispatcher(); diff --git a/extensions/fairygui/src/fairygui/tween/GTween.cpp b/extensions/fairygui/src/fairygui/tween/GTween.cpp index c4bf4bca1a94..02b42da394ce 100644 --- a/extensions/fairygui/src/fairygui/tween/GTween.cpp +++ b/extensions/fairygui/src/fairygui/tween/GTween.cpp @@ -44,17 +44,17 @@ GTweener* GTween::shake(const ax::Vec2& startValue, float amplitude, float durat return TweenManager::createTween()->_shake(startValue, amplitude, duration); } -bool GTween::isTweening(ax::Ref* target, TweenPropType propType/* = TweenPropType::None*/) +bool GTween::isTweening(ax::Object* target, TweenPropType propType/* = TweenPropType::None*/) { return TweenManager::isTweening(target, propType); } -void GTween::kill(ax::Ref* target, TweenPropType propType/* = TweenPropType::None*/, bool complete/* = false*/) +void GTween::kill(ax::Object* target, TweenPropType propType/* = TweenPropType::None*/, bool complete/* = false*/) { TweenManager::killTweens(target, propType, complete); } -GTweener* GTween::getTween(ax::Ref* target, TweenPropType propType/* = TweenPropType::None*/) +GTweener* GTween::getTween(ax::Object* target, TweenPropType propType/* = TweenPropType::None*/) { return TweenManager::getTween(target, propType); } diff --git a/extensions/fairygui/src/fairygui/tween/GTween.h b/extensions/fairygui/src/fairygui/tween/GTween.h index 2e31f367c7ab..feb89288f209 100644 --- a/extensions/fairygui/src/fairygui/tween/GTween.h +++ b/extensions/fairygui/src/fairygui/tween/GTween.h @@ -26,9 +26,9 @@ class GTween static GTweener* toDouble(double startValue, double endValue, float duration); static GTweener* delayedCall(float delay); static GTweener* shake(const ax::Vec2& startValue, float amplitude, float duration); - static bool isTweening(ax::Ref* target, TweenPropType propType = TweenPropType::None); - static void kill(ax::Ref* target, TweenPropType propType = TweenPropType::None, bool complete = false); - static GTweener* getTween(ax::Ref* target, TweenPropType propType = TweenPropType::None); + static bool isTweening(ax::Object* target, TweenPropType propType = TweenPropType::None); + static void kill(ax::Object* target, TweenPropType propType = TweenPropType::None, bool complete = false); + static GTweener* getTween(ax::Object* target, TweenPropType propType = TweenPropType::None); static void clean(); }; diff --git a/extensions/fairygui/src/fairygui/tween/GTweener.cpp b/extensions/fairygui/src/fairygui/tween/GTweener.cpp index 342c8d6f0dea..d1a2ab5939e9 100644 --- a/extensions/fairygui/src/fairygui/tween/GTweener.cpp +++ b/extensions/fairygui/src/fairygui/tween/GTweener.cpp @@ -84,7 +84,7 @@ GTweener* GTweener::setTargetAny(void* value) return this; } -GTweener* GTweener::setTarget(ax::Ref* target, TweenPropType propType/* = TweenPropType::None*/) +GTweener* GTweener::setTarget(ax::Object* target, TweenPropType propType/* = TweenPropType::None*/) { AX_SAFE_RELEASE(_refTarget); _target = _refTarget = target; diff --git a/extensions/fairygui/src/fairygui/tween/GTweener.h b/extensions/fairygui/src/fairygui/tween/GTweener.h index 3eb43b18d737..c4691e82c739 100644 --- a/extensions/fairygui/src/fairygui/tween/GTweener.h +++ b/extensions/fairygui/src/fairygui/tween/GTweener.h @@ -11,7 +11,7 @@ NS_FGUI_BEGIN class GPath; -class GTweener : public ax::Ref +class GTweener : public ax::Object { public: typedef std::function GTweenCallback; @@ -32,7 +32,7 @@ class GTweener : public ax::Ref GTweener* setTimeScale(float value); GTweener* setSnapping(bool value); GTweener* setTargetAny(void* value); - GTweener* setTarget(ax::Ref* target, TweenPropType propType = TweenPropType::None); + GTweener* setTarget(ax::Object* target, TweenPropType propType = TweenPropType::None); void* getTarget() const { return _target; } GTweener* setUserData(const ax::Value& value); GTweener* setPath(GPath* path); @@ -72,7 +72,7 @@ class GTweener : public ax::Ref private: void* _target; - ax::Ref* _refTarget; + ax::Object* _refTarget; TweenPropType _propType; bool _killed; bool _paused; diff --git a/extensions/fairygui/src/fairygui/tween/TweenManager.cpp b/extensions/fairygui/src/fairygui/tween/TweenManager.cpp index 2955cc5e35db..cd6fecd5c9c1 100644 --- a/extensions/fairygui/src/fairygui/tween/TweenManager.cpp +++ b/extensions/fairygui/src/fairygui/tween/TweenManager.cpp @@ -50,7 +50,7 @@ GTweener* TweenManager::createTween() return tweener; } -bool TweenManager::isTweening(ax::Ref* target, TweenPropType propType) +bool TweenManager::isTweening(ax::Object* target, TweenPropType propType) { if (target == nullptr) return false; @@ -66,7 +66,7 @@ bool TweenManager::isTweening(ax::Ref* target, TweenPropType propType) return false; } -bool TweenManager::killTweens(ax::Ref* target, TweenPropType propType, bool completed) +bool TweenManager::killTweens(ax::Object* target, TweenPropType propType, bool completed) { if (target == nullptr) return false; @@ -87,7 +87,7 @@ bool TweenManager::killTweens(ax::Ref* target, TweenPropType propType, bool comp return flag; } -GTweener* TweenManager::getTween(ax::Ref* target, TweenPropType propType) +GTweener* TweenManager::getTween(ax::Object* target, TweenPropType propType) { if (target == nullptr) return nullptr; diff --git a/extensions/fairygui/src/fairygui/tween/TweenManager.h b/extensions/fairygui/src/fairygui/tween/TweenManager.h index 5c5000738d9f..ece6cc71f0a6 100644 --- a/extensions/fairygui/src/fairygui/tween/TweenManager.h +++ b/extensions/fairygui/src/fairygui/tween/TweenManager.h @@ -13,9 +13,9 @@ class TweenManager { public: static GTweener* createTween(); - static bool isTweening(ax::Ref* target, TweenPropType propType); - static bool killTweens(ax::Ref* target, TweenPropType propType, bool completed); - static GTweener* getTween(ax::Ref* target, TweenPropType propType); + static bool isTweening(ax::Object* target, TweenPropType propType); + static bool killTweens(ax::Object* target, TweenPropType propType, bool completed); + static GTweener* getTween(ax::Object* target, TweenPropType propType); static void update(float dt); static void clean(); static void init(); diff --git a/extensions/scripting/lua-bindings/auto/axlua_3d_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_3d_auto.cpp index 389773b18da3..95293bc07efe 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_3d_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_3d_auto.cpp @@ -253,7 +253,7 @@ static int lua_ax_3d_Animation3D_finalize(lua_State* tolua_S) int lua_register_ax_3d_Animation3D(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Animation3D"); - tolua_cclass(tolua_S,"Animation3D","ax.Animation3D","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Animation3D","ax.Animation3D","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Animation3D"); tolua_function(tolua_S,"new",lua_ax_3d_Animation3D_constructor); @@ -1417,7 +1417,7 @@ static int lua_ax_3d_TextureCube_finalize(lua_State* tolua_S) int lua_register_ax_3d_TextureCube(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.TextureCube"); - tolua_cclass(tolua_S,"TextureCube","ax.TextureCube","ax.Ref",nullptr); + tolua_cclass(tolua_S,"TextureCube","ax.TextureCube","ax.Object",nullptr); tolua_beginmodule(tolua_S,"TextureCube"); tolua_function(tolua_S,"new",lua_ax_3d_TextureCube_constructor); @@ -3110,7 +3110,7 @@ static int lua_ax_3d_Mesh_finalize(lua_State* tolua_S) int lua_register_ax_3d_Mesh(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Mesh"); - tolua_cclass(tolua_S,"Mesh","ax.Mesh","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Mesh","ax.Mesh","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Mesh"); tolua_function(tolua_S,"new",lua_ax_3d_Mesh_constructor); @@ -3629,7 +3629,7 @@ static int lua_ax_3d_Skeleton3D_finalize(lua_State* tolua_S) int lua_register_ax_3d_Skeleton3D(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Skeleton3D"); - tolua_cclass(tolua_S,"Skeleton3D","ax.Skeleton3D","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Skeleton3D","ax.Skeleton3D","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Skeleton3D"); tolua_function(tolua_S,"new",lua_ax_3d_Skeleton3D_constructor); diff --git a/extensions/scripting/lua-bindings/auto/axlua_backend_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_backend_auto.cpp index 019fc4ce59ff..027dbddf6892 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_backend_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_backend_auto.cpp @@ -1033,7 +1033,7 @@ static int lua_ax_backend_Program_finalize(lua_State* tolua_S) int lua_register_ax_backend_Program(lua_State* tolua_S) { tolua_usertype(tolua_S,"axb.Program"); - tolua_cclass(tolua_S,"Program","axb.Program","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Program","axb.Program","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Program"); tolua_function(tolua_S,"getUniformLocation",lua_ax_backend_Program_getUniformLocation); @@ -1834,7 +1834,7 @@ static int lua_ax_backend_ProgramState_finalize(lua_State* tolua_S) int lua_register_ax_backend_ProgramState(lua_State* tolua_S) { tolua_usertype(tolua_S,"axb.ProgramState"); - tolua_cclass(tolua_S,"ProgramState","axb.ProgramState","ax.Ref",nullptr); + tolua_cclass(tolua_S,"ProgramState","axb.ProgramState","ax.Object",nullptr); tolua_beginmodule(tolua_S,"ProgramState"); tolua_function(tolua_S,"new",lua_ax_backend_ProgramState_constructor); @@ -2420,7 +2420,7 @@ static int lua_ax_backend_TextureBackend_finalize(lua_State* tolua_S) int lua_register_ax_backend_TextureBackend(lua_State* tolua_S) { tolua_usertype(tolua_S,"axb.TextureBackend"); - tolua_cclass(tolua_S,"TextureBackend","axb.TextureBackend","ax.Ref",nullptr); + tolua_cclass(tolua_S,"TextureBackend","axb.TextureBackend","ax.Object",nullptr); tolua_beginmodule(tolua_S,"TextureBackend"); tolua_function(tolua_S,"updateSamplerDescriptor",lua_ax_backend_TextureBackend_updateSamplerDescriptor); diff --git a/extensions/scripting/lua-bindings/auto/axlua_base_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_base_auto.cpp index a2f130b14306..ac3d2e744ebc 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_base_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_base_auto.cpp @@ -12,7 +12,7 @@ int lua_ax_base_Ref_retain(lua_State* tolua_S) { int argc = 0; - ax::Ref* cobj = nullptr; + ax::Object* cobj = nullptr; bool ok = true; #if _AX_DEBUG >= 1 @@ -21,10 +21,10 @@ int lua_ax_base_Ref_retain(lua_State* tolua_S) #if _AX_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ax.Ref",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"ax.Object",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (ax::Ref*)tolua_tousertype(tolua_S,1,0); + cobj = (ax::Object*)tolua_tousertype(tolua_S,1,0); #if _AX_DEBUG >= 1 if (!cobj) @@ -46,7 +46,7 @@ int lua_ax_base_Ref_retain(lua_State* tolua_S) lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Ref:retain",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Object:retain",argc, 0); return 0; #if _AX_DEBUG >= 1 @@ -59,7 +59,7 @@ int lua_ax_base_Ref_retain(lua_State* tolua_S) int lua_ax_base_Ref_release(lua_State* tolua_S) { int argc = 0; - ax::Ref* cobj = nullptr; + ax::Object* cobj = nullptr; bool ok = true; #if _AX_DEBUG >= 1 @@ -68,10 +68,10 @@ int lua_ax_base_Ref_release(lua_State* tolua_S) #if _AX_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ax.Ref",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"ax.Object",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (ax::Ref*)tolua_tousertype(tolua_S,1,0); + cobj = (ax::Object*)tolua_tousertype(tolua_S,1,0); #if _AX_DEBUG >= 1 if (!cobj) @@ -93,7 +93,7 @@ int lua_ax_base_Ref_release(lua_State* tolua_S) lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Ref:release",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Object:release",argc, 0); return 0; #if _AX_DEBUG >= 1 @@ -106,7 +106,7 @@ int lua_ax_base_Ref_release(lua_State* tolua_S) int lua_ax_base_Ref_getReferenceCount(lua_State* tolua_S) { int argc = 0; - ax::Ref* cobj = nullptr; + ax::Object* cobj = nullptr; bool ok = true; #if _AX_DEBUG >= 1 @@ -115,10 +115,10 @@ int lua_ax_base_Ref_getReferenceCount(lua_State* tolua_S) #if _AX_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ax.Ref",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"ax.Object",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (ax::Ref*)tolua_tousertype(tolua_S,1,0); + cobj = (ax::Object*)tolua_tousertype(tolua_S,1,0); #if _AX_DEBUG >= 1 if (!cobj) @@ -140,7 +140,7 @@ int lua_ax_base_Ref_getReferenceCount(lua_State* tolua_S) tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Ref:getReferenceCount",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Object:getReferenceCount",argc, 0); return 0; #if _AX_DEBUG >= 1 @@ -152,23 +152,23 @@ int lua_ax_base_Ref_getReferenceCount(lua_State* tolua_S) } static int lua_ax_base_Ref_finalize(lua_State* tolua_S) { - printf("luabindings: finalizing LUA object (Ref)"); + printf("luabindings: finalizing LUA object (Object)"); return 0; } int lua_register_ax_base_Ref(lua_State* tolua_S) { - tolua_usertype(tolua_S,"ax.Ref"); - tolua_cclass(tolua_S,"Ref","ax.Ref","",nullptr); + tolua_usertype(tolua_S,"ax.Object"); + tolua_cclass(tolua_S,"Object","ax.Object","",nullptr); - tolua_beginmodule(tolua_S,"Ref"); + tolua_beginmodule(tolua_S,"Object"); tolua_function(tolua_S,"retain",lua_ax_base_Ref_retain); tolua_function(tolua_S,"release",lua_ax_base_Ref_release); tolua_function(tolua_S,"getReferenceCount",lua_ax_base_Ref_getReferenceCount); tolua_endmodule(tolua_S); - auto typeName = typeid(ax::Ref).name(); // rtti is literal storage - g_luaType[reinterpret_cast(typeName)] = "ax.Ref"; - g_typeCast[typeName] = "ax.Ref"; + auto typeName = typeid(ax::Object).name(); // rtti is literal storage + g_luaType[reinterpret_cast(typeName)] = "ax.Object"; + g_typeCast[typeName] = "ax.Object"; return 1; } @@ -372,7 +372,7 @@ static int lua_ax_base_EventListener_finalize(lua_State* tolua_S) int lua_register_ax_base_EventListener(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.EventListener"); - tolua_cclass(tolua_S,"EventListener","ax.EventListener","ax.Ref",nullptr); + tolua_cclass(tolua_S,"EventListener","ax.EventListener","ax.Object",nullptr); tolua_beginmodule(tolua_S,"EventListener"); tolua_function(tolua_S,"checkAvailable",lua_ax_base_EventListener_checkAvailable); @@ -2658,7 +2658,7 @@ static int lua_ax_base_Texture2D_finalize(lua_State* tolua_S) int lua_register_ax_base_Texture2D(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Texture2D"); - tolua_cclass(tolua_S,"Texture2D","ax.Texture2D","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Texture2D","ax.Texture2D","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Texture2D"); tolua_function(tolua_S,"new",lua_ax_base_Texture2D_constructor); @@ -3296,7 +3296,7 @@ static int lua_ax_base_Touch_finalize(lua_State* tolua_S) int lua_register_ax_base_Touch(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Touch"); - tolua_cclass(tolua_S,"Touch","ax.Touch","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Touch","ax.Touch","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Touch"); tolua_function(tolua_S,"new",lua_ax_base_Touch_constructor); @@ -3555,7 +3555,7 @@ static int lua_ax_base_Event_finalize(lua_State* tolua_S) int lua_register_ax_base_Event(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Event"); - tolua_cclass(tolua_S,"Event","ax.Event","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Event","ax.Event","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Event"); tolua_function(tolua_S,"new",lua_ax_base_Event_constructor); @@ -4314,7 +4314,7 @@ static int lua_ax_base_Component_finalize(lua_State* tolua_S) int lua_register_ax_base_Component(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Component"); - tolua_cclass(tolua_S,"Component","ax.Component","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Component","ax.Component","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Component"); tolua_function(tolua_S,"init",lua_ax_base_Component_init); @@ -7643,9 +7643,9 @@ int lua_ax_base_Node_setUserObject(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - ax::Ref* arg0; + ax::Object* arg0; - ok &= luaval_to_object(tolua_S, 2, "ax.Ref",&arg0, "ax.Node:setUserObject"); + ok &= luaval_to_object(tolua_S, 2, "ax.Object",&arg0, "ax.Node:setUserObject"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_ax_base_Node_setUserObject'", nullptr); @@ -11763,7 +11763,7 @@ static int lua_ax_base_Node_finalize(lua_State* tolua_S) int lua_register_ax_base_Node(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Node"); - tolua_cclass(tolua_S,"Node","ax.Node","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Node","ax.Node","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Node"); tolua_function(tolua_S,"new",lua_ax_base_Node_constructor); @@ -14350,7 +14350,7 @@ static int lua_ax_base_GLView_finalize(lua_State* tolua_S) int lua_register_ax_base_GLView(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.GLView"); - tolua_cclass(tolua_S,"GLView","ax.GLView","ax.Ref",nullptr); + tolua_cclass(tolua_S,"GLView","ax.GLView","ax.Object",nullptr); tolua_beginmodule(tolua_S,"GLView"); tolua_function(tolua_S,"endToLua",lua_ax_base_GLView_end); @@ -18246,7 +18246,7 @@ static int lua_ax_base_Timer_finalize(lua_State* tolua_S) int lua_register_ax_base_Timer(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Timer"); - tolua_cclass(tolua_S,"Timer","ax.Timer","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Timer","ax.Timer","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Timer"); tolua_function(tolua_S,"setupTimerWithInterval",lua_ax_base_Timer_setupTimerWithInterval); @@ -18507,7 +18507,7 @@ static int lua_ax_base_Scheduler_finalize(lua_State* tolua_S) int lua_register_ax_base_Scheduler(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Scheduler"); - tolua_cclass(tolua_S,"Scheduler","ax.Scheduler","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Scheduler","ax.Scheduler","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Scheduler"); tolua_function(tolua_S,"new",lua_ax_base_Scheduler_constructor); @@ -19518,7 +19518,7 @@ static int lua_ax_base_Action_finalize(lua_State* tolua_S) int lua_register_ax_base_Action(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Action"); - tolua_cclass(tolua_S,"Action","ax.Action","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Action","ax.Action","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Action"); tolua_function(tolua_S,"clone",lua_ax_base_Action_clone); @@ -21262,7 +21262,7 @@ static int lua_ax_base_Image_finalize(lua_State* tolua_S) int lua_register_ax_base_Image(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Image"); - tolua_cclass(tolua_S,"Image","ax.Image","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Image","ax.Image","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Image"); tolua_function(tolua_S,"new",lua_ax_base_Image_constructor); @@ -23337,7 +23337,7 @@ static int lua_ax_base_SpriteFrame_finalize(lua_State* tolua_S) int lua_register_ax_base_SpriteFrame(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.SpriteFrame"); - tolua_cclass(tolua_S,"SpriteFrame","ax.SpriteFrame","ax.Ref",nullptr); + tolua_cclass(tolua_S,"SpriteFrame","ax.SpriteFrame","ax.Object",nullptr); tolua_beginmodule(tolua_S,"SpriteFrame"); tolua_function(tolua_S,"new",lua_ax_base_SpriteFrame_constructor); @@ -23855,7 +23855,7 @@ static int lua_ax_base_AnimationFrame_finalize(lua_State* tolua_S) int lua_register_ax_base_AnimationFrame(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.AnimationFrame"); - tolua_cclass(tolua_S,"AnimationFrame","ax.AnimationFrame","ax.Ref",nullptr); + tolua_cclass(tolua_S,"AnimationFrame","ax.AnimationFrame","ax.Object",nullptr); tolua_beginmodule(tolua_S,"AnimationFrame"); tolua_function(tolua_S,"new",lua_ax_base_AnimationFrame_constructor); @@ -24928,7 +24928,7 @@ static int lua_ax_base_Animation_finalize(lua_State* tolua_S) int lua_register_ax_base_Animation(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Animation"); - tolua_cclass(tolua_S,"Animation","ax.Animation","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Animation","ax.Animation","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Animation"); tolua_function(tolua_S,"new",lua_ax_base_Animation_constructor); @@ -35561,7 +35561,7 @@ static int lua_ax_base_EventDispatcher_finalize(lua_State* tolua_S) int lua_register_ax_base_EventDispatcher(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.EventDispatcher"); - tolua_cclass(tolua_S,"EventDispatcher","ax.EventDispatcher","ax.Ref",nullptr); + tolua_cclass(tolua_S,"EventDispatcher","ax.EventDispatcher","ax.Object",nullptr); tolua_beginmodule(tolua_S,"EventDispatcher"); tolua_function(tolua_S,"new",lua_ax_base_EventDispatcher_constructor); @@ -47548,7 +47548,7 @@ static int lua_ax_base_ActionManager_finalize(lua_State* tolua_S) int lua_register_ax_base_ActionManager(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.ActionManager"); - tolua_cclass(tolua_S,"ActionManager","ax.ActionManager","ax.Ref",nullptr); + tolua_cclass(tolua_S,"ActionManager","ax.ActionManager","ax.Object",nullptr); tolua_beginmodule(tolua_S,"ActionManager"); tolua_function(tolua_S,"new",lua_ax_base_ActionManager_constructor); @@ -63572,7 +63572,7 @@ int lua_ax_base_MenuItemLabel_initWithLabel(lua_State* tolua_S) if (argc == 2) { ax::Node* arg0; - std::function arg1; + std::function arg1; ok &= luaval_to_object(tolua_S, 2, "ax.Node",&arg0, "ax.MenuItemLabel:initWithLabel"); @@ -63697,7 +63697,7 @@ int lua_ax_base_MenuItemAtlasFont_initWithString(lua_State* tolua_S) int arg2; int arg3; int32_t arg4; - std::function arg5; + std::function arg5; ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.MenuItemAtlasFont:initWithString"); @@ -64014,7 +64014,7 @@ int lua_ax_base_MenuItemFont_initWithString(lua_State* tolua_S) if (argc == 2) { std::string_view arg0; - std::function arg1; + std::function arg1; ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.MenuItemFont:initWithString"); @@ -64714,7 +64714,7 @@ int lua_ax_base_MenuItemSprite_initWithNormalSprite(lua_State* tolua_S) ax::Node* arg0; ax::Node* arg1; ax::Node* arg2; - std::function arg3; + std::function arg3; ok &= luaval_to_object(tolua_S, 2, "ax.Node",&arg0, "ax.MenuItemSprite:initWithNormalSprite"); @@ -65041,7 +65041,7 @@ int lua_ax_base_MenuItemImage_initWithNormalImage(lua_State* tolua_S) std::string_view arg0; std::string_view arg1; std::string_view arg2; - std::function arg3; + std::function arg3; ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.MenuItemImage:initWithNormalImage"); @@ -91455,7 +91455,7 @@ static int lua_ax_base_CameraBackgroundBrush_finalize(lua_State* tolua_S) int lua_register_ax_base_CameraBackgroundBrush(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.CameraBackgroundBrush"); - tolua_cclass(tolua_S,"CameraBackgroundBrush","ax.CameraBackgroundBrush","ax.Ref",nullptr); + tolua_cclass(tolua_S,"CameraBackgroundBrush","ax.CameraBackgroundBrush","ax.Object",nullptr); tolua_beginmodule(tolua_S,"CameraBackgroundBrush"); tolua_function(tolua_S,"new",lua_ax_base_CameraBackgroundBrush_constructor); @@ -93206,7 +93206,7 @@ static int lua_ax_base_GridBase_finalize(lua_State* tolua_S) int lua_register_ax_base_GridBase(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.GridBase"); - tolua_cclass(tolua_S,"GridBase","ax.GridBase","ax.Ref",nullptr); + tolua_cclass(tolua_S,"GridBase","ax.GridBase","ax.Object",nullptr); tolua_beginmodule(tolua_S,"GridBase"); tolua_function(tolua_S,"beforeBlit",lua_ax_base_GridBase_beforeBlit); @@ -95249,7 +95249,7 @@ static int lua_ax_base_RenderState_finalize(lua_State* tolua_S) int lua_register_ax_base_RenderState(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.RenderState"); - tolua_cclass(tolua_S,"RenderState","ax.RenderState","ax.Ref",nullptr); + tolua_cclass(tolua_S,"RenderState","ax.RenderState","ax.Object",nullptr); tolua_beginmodule(tolua_S,"RenderState"); tolua_function(tolua_S,"getName",lua_ax_base_RenderState_getName); @@ -95682,7 +95682,7 @@ static int lua_ax_base_Technique_finalize(lua_State* tolua_S) int lua_register_ax_base_Technique(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Technique"); - tolua_cclass(tolua_S,"Technique","ax.Technique","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Technique","ax.Technique","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Technique"); tolua_function(tolua_S,"addPass",lua_ax_base_Technique_addPass); @@ -96712,7 +96712,7 @@ static int lua_ax_base_Material_finalize(lua_State* tolua_S) int lua_register_ax_base_Material(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Material"); - tolua_cclass(tolua_S,"Material","ax.Material","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Material","ax.Material","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Material"); tolua_function(tolua_S,"draw",lua_ax_base_Material_draw); @@ -98147,7 +98147,7 @@ static int lua_ax_base_Pass_finalize(lua_State* tolua_S) int lua_register_ax_base_Pass(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Pass"); - tolua_cclass(tolua_S,"Pass","ax.Pass","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Pass","ax.Pass","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Pass"); tolua_function(tolua_S,"getProgramState",lua_ax_base_Pass_getProgramState); @@ -102172,7 +102172,7 @@ static int lua_ax_base_TextureCache_finalize(lua_State* tolua_S) int lua_register_ax_base_TextureCache(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.TextureCache"); - tolua_cclass(tolua_S,"TextureCache","ax.TextureCache","ax.Ref",nullptr); + tolua_cclass(tolua_S,"TextureCache","ax.TextureCache","ax.Object",nullptr); tolua_beginmodule(tolua_S,"TextureCache"); tolua_function(tolua_S,"new",lua_ax_base_TextureCache_constructor); @@ -105613,7 +105613,7 @@ static int lua_ax_base_TMXObjectGroup_finalize(lua_State* tolua_S) int lua_register_ax_base_TMXObjectGroup(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.TMXObjectGroup"); - tolua_cclass(tolua_S,"TMXObjectGroup","ax.TMXObjectGroup","ax.Ref",nullptr); + tolua_cclass(tolua_S,"TMXObjectGroup","ax.TMXObjectGroup","ax.Object",nullptr); tolua_beginmodule(tolua_S,"TMXObjectGroup"); tolua_function(tolua_S,"new",lua_ax_base_TMXObjectGroup_constructor); @@ -105777,7 +105777,7 @@ static int lua_ax_base_TMXLayerInfo_finalize(lua_State* tolua_S) int lua_register_ax_base_TMXLayerInfo(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.TMXLayerInfo"); - tolua_cclass(tolua_S,"TMXLayerInfo","ax.TMXLayerInfo","ax.Ref",nullptr); + tolua_cclass(tolua_S,"TMXLayerInfo","ax.TMXLayerInfo","ax.Object",nullptr); tolua_beginmodule(tolua_S,"TMXLayerInfo"); tolua_function(tolua_S,"new",lua_ax_base_TMXLayerInfo_constructor); @@ -105886,7 +105886,7 @@ static int lua_ax_base_TMXTilesetInfo_finalize(lua_State* tolua_S) int lua_register_ax_base_TMXTilesetInfo(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.TMXTilesetInfo"); - tolua_cclass(tolua_S,"TMXTilesetInfo","ax.TMXTilesetInfo","ax.Ref",nullptr); + tolua_cclass(tolua_S,"TMXTilesetInfo","ax.TMXTilesetInfo","ax.Object",nullptr); tolua_beginmodule(tolua_S,"TMXTilesetInfo"); tolua_function(tolua_S,"new",lua_ax_base_TMXTilesetInfo_constructor); @@ -109837,7 +109837,7 @@ static int lua_ax_base_TMXTileAnimTask_finalize(lua_State* tolua_S) int lua_register_ax_base_TMXTileAnimTask(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.TMXTileAnimTask"); - tolua_cclass(tolua_S,"TMXTileAnimTask","ax.TMXTileAnimTask","ax.Ref",nullptr); + tolua_cclass(tolua_S,"TMXTileAnimTask","ax.TMXTileAnimTask","ax.Object",nullptr); tolua_beginmodule(tolua_S,"TMXTileAnimTask"); tolua_function(tolua_S,"new",lua_ax_base_TMXTileAnimTask_constructor); @@ -110078,7 +110078,7 @@ static int lua_ax_base_TMXTileAnimManager_finalize(lua_State* tolua_S) int lua_register_ax_base_TMXTileAnimManager(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.TMXTileAnimManager"); - tolua_cclass(tolua_S,"TMXTileAnimManager","ax.TMXTileAnimManager","ax.Ref",nullptr); + tolua_cclass(tolua_S,"TMXTileAnimManager","ax.TMXTileAnimManager","ax.Object",nullptr); tolua_beginmodule(tolua_S,"TMXTileAnimManager"); tolua_function(tolua_S,"new",lua_ax_base_TMXTileAnimManager_constructor); diff --git a/extensions/scripting/lua-bindings/auto/axlua_csloader_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_csloader_auto.cpp index 7b067136796f..5daaa804da39 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_csloader_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_csloader_auto.cpp @@ -642,7 +642,7 @@ int lua_ax_csloader_CSLoader_createNodeWithVisibleSize(lua_State* tolua_S) std::string_view arg0; ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.CSLoader:createNodeWithVisibleSize"); if (!ok) { break; } - std::function arg1; + std::function arg1; do { // Lambda binding for lua is not supported. assert(false); diff --git a/extensions/scripting/lua-bindings/auto/axlua_extension_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_extension_auto.cpp index 49d980b2b7f2..9c7d5892cb19 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_extension_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_extension_auto.cpp @@ -715,9 +715,9 @@ int lua_ax_extension_ScrollView_pause(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - ax::Ref* arg0; + ax::Object* arg0; - ok &= luaval_to_object(tolua_S, 2, "ax.Ref",&arg0, "ax.ScrollView:pause"); + ok &= luaval_to_object(tolua_S, 2, "ax.Object",&arg0, "ax.ScrollView:pause"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_ax_extension_ScrollView_pause'", nullptr); @@ -765,9 +765,9 @@ int lua_ax_extension_ScrollView_resume(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - ax::Ref* arg0; + ax::Object* arg0; - ok &= luaval_to_object(tolua_S, 2, "ax.Ref",&arg0, "ax.ScrollView:resume"); + ok &= luaval_to_object(tolua_S, 2, "ax.Object",&arg0, "ax.ScrollView:resume"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_ax_extension_ScrollView_resume'", nullptr); @@ -4694,7 +4694,7 @@ static int lua_ax_extension_Manifest_finalize(lua_State* tolua_S) int lua_register_ax_extension_Manifest(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Manifest"); - tolua_cclass(tolua_S,"Manifest","ax.Manifest","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Manifest","ax.Manifest","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Manifest"); tolua_function(tolua_S,"isVersionLoaded",lua_ax_extension_Manifest_isVersionLoaded); @@ -5335,7 +5335,7 @@ static int lua_ax_extension_AssetsManagerEx_finalize(lua_State* tolua_S) int lua_register_ax_extension_AssetsManagerEx(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.AssetsManagerEx"); - tolua_cclass(tolua_S,"AssetsManagerEx","ax.AssetsManagerEx","ax.Ref",nullptr); + tolua_cclass(tolua_S,"AssetsManagerEx","ax.AssetsManagerEx","ax.Object",nullptr); tolua_beginmodule(tolua_S,"AssetsManagerEx"); tolua_function(tolua_S,"new",lua_ax_extension_AssetsManagerEx_constructor); diff --git a/extensions/scripting/lua-bindings/auto/axlua_fairygui_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_fairygui_auto.cpp index 0d4ad87c84c3..08f8029567c2 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_fairygui_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_fairygui_auto.cpp @@ -814,7 +814,7 @@ int lua_ax_fairygui_EventContext_getSender(lua_State* tolua_S) return 0; } auto&& ret = cobj->getSender(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.EventContext:getSender",argc, 0); @@ -1493,7 +1493,7 @@ static int lua_ax_fairygui_UIEventDispatcher_finalize(lua_State* tolua_S) int lua_register_ax_fairygui_UIEventDispatcher(lua_State* tolua_S) { tolua_usertype(tolua_S,"fgui.UIEventDispatcher"); - tolua_cclass(tolua_S,"UIEventDispatcher","fgui.UIEventDispatcher","ax.Ref",nullptr); + tolua_cclass(tolua_S,"UIEventDispatcher","fgui.UIEventDispatcher","ax.Object",nullptr); tolua_beginmodule(tolua_S,"UIEventDispatcher"); tolua_function(tolua_S,"new",lua_ax_fairygui_UIEventDispatcher_constructor); @@ -7743,7 +7743,7 @@ static int lua_ax_fairygui_UIPackage_finalize(lua_State* tolua_S) int lua_register_ax_fairygui_UIPackage(lua_State* tolua_S) { tolua_usertype(tolua_S,"fgui.UIPackage"); - tolua_cclass(tolua_S,"UIPackage","fgui.UIPackage","ax.Ref",nullptr); + tolua_cclass(tolua_S,"UIPackage","fgui.UIPackage","ax.Object",nullptr); tolua_beginmodule(tolua_S,"UIPackage"); tolua_function(tolua_S,"new",lua_ax_fairygui_UIPackage_constructor); @@ -16609,7 +16609,7 @@ static int lua_ax_fairygui_ScrollPane_finalize(lua_State* tolua_S) int lua_register_ax_fairygui_ScrollPane(lua_State* tolua_S) { tolua_usertype(tolua_S,"fgui.ScrollPane"); - tolua_cclass(tolua_S,"ScrollPane","fgui.ScrollPane","ax.Ref",nullptr); + tolua_cclass(tolua_S,"ScrollPane","fgui.ScrollPane","ax.Object",nullptr); tolua_beginmodule(tolua_S,"ScrollPane"); tolua_function(tolua_S,"new",lua_ax_fairygui_ScrollPane_constructor); @@ -17683,7 +17683,7 @@ static int lua_ax_fairygui_Transition_finalize(lua_State* tolua_S) int lua_register_ax_fairygui_Transition(lua_State* tolua_S) { tolua_usertype(tolua_S,"fgui.Transition"); - tolua_cclass(tolua_S,"Transition","fgui.Transition","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Transition","fgui.Transition","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Transition"); tolua_function(tolua_S,"new",lua_ax_fairygui_Transition_constructor); @@ -30541,7 +30541,7 @@ static int lua_ax_fairygui_PopupMenu_finalize(lua_State* tolua_S) int lua_register_ax_fairygui_PopupMenu(lua_State* tolua_S) { tolua_usertype(tolua_S,"fgui.PopupMenu"); - tolua_cclass(tolua_S,"PopupMenu","fgui.PopupMenu","ax.Ref",nullptr); + tolua_cclass(tolua_S,"PopupMenu","fgui.PopupMenu","ax.Object",nullptr); tolua_beginmodule(tolua_S,"PopupMenu"); tolua_function(tolua_S,"new",lua_ax_fairygui_PopupMenu_constructor); @@ -31687,9 +31687,9 @@ int lua_ax_fairygui_GTweener_setTarget(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - ax::Ref* arg0; + ax::Object* arg0; - ok &= luaval_to_object(tolua_S, 2, "ax.Ref",&arg0, "fgui.GTweener:setTarget"); + ok &= luaval_to_object(tolua_S, 2, "ax.Object",&arg0, "fgui.GTweener:setTarget"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_ax_fairygui_GTweener_setTarget'", nullptr); @@ -31701,10 +31701,10 @@ int lua_ax_fairygui_GTweener_setTarget(lua_State* tolua_S) } if (argc == 2) { - ax::Ref* arg0; + ax::Object* arg0; fairygui::TweenPropType arg1; - ok &= luaval_to_object(tolua_S, 2, "ax.Ref",&arg0, "fgui.GTweener:setTarget"); + ok &= luaval_to_object(tolua_S, 2, "ax.Object",&arg0, "fgui.GTweener:setTarget"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fgui.GTweener:setTarget"); if(!ok) @@ -32268,7 +32268,7 @@ static int lua_ax_fairygui_GTweener_finalize(lua_State* tolua_S) int lua_register_ax_fairygui_GTweener(lua_State* tolua_S) { tolua_usertype(tolua_S,"fgui.GTweener"); - tolua_cclass(tolua_S,"GTweener","fgui.GTweener","ax.Ref",nullptr); + tolua_cclass(tolua_S,"GTweener","fgui.GTweener","ax.Object",nullptr); tolua_beginmodule(tolua_S,"GTweener"); tolua_function(tolua_S,"new",lua_ax_fairygui_GTweener_constructor); @@ -32636,8 +32636,8 @@ int lua_ax_fairygui_GTween_isTweening(lua_State* tolua_S) if (argc == 1) { - ax::Ref* arg0; - ok &= luaval_to_object(tolua_S, 2, "ax.Ref",&arg0, "fgui.GTween:isTweening"); + ax::Object* arg0; + ok &= luaval_to_object(tolua_S, 2, "ax.Object",&arg0, "fgui.GTween:isTweening"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_ax_fairygui_GTween_isTweening'", nullptr); @@ -32649,9 +32649,9 @@ int lua_ax_fairygui_GTween_isTweening(lua_State* tolua_S) } if (argc == 2) { - ax::Ref* arg0; + ax::Object* arg0; fairygui::TweenPropType arg1; - ok &= luaval_to_object(tolua_S, 2, "ax.Ref",&arg0, "fgui.GTween:isTweening"); + ok &= luaval_to_object(tolua_S, 2, "ax.Object",&arg0, "fgui.GTween:isTweening"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fgui.GTween:isTweening"); if(!ok) { @@ -32687,8 +32687,8 @@ int lua_ax_fairygui_GTween_kill(lua_State* tolua_S) if (argc == 1) { - ax::Ref* arg0; - ok &= luaval_to_object(tolua_S, 2, "ax.Ref",&arg0, "fgui.GTween:kill"); + ax::Object* arg0; + ok &= luaval_to_object(tolua_S, 2, "ax.Object",&arg0, "fgui.GTween:kill"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_ax_fairygui_GTween_kill'", nullptr); @@ -32700,9 +32700,9 @@ int lua_ax_fairygui_GTween_kill(lua_State* tolua_S) } if (argc == 2) { - ax::Ref* arg0; + ax::Object* arg0; fairygui::TweenPropType arg1; - ok &= luaval_to_object(tolua_S, 2, "ax.Ref",&arg0, "fgui.GTween:kill"); + ok &= luaval_to_object(tolua_S, 2, "ax.Object",&arg0, "fgui.GTween:kill"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fgui.GTween:kill"); if(!ok) { @@ -32715,10 +32715,10 @@ int lua_ax_fairygui_GTween_kill(lua_State* tolua_S) } if (argc == 3) { - ax::Ref* arg0; + ax::Object* arg0; fairygui::TweenPropType arg1; bool arg2; - ok &= luaval_to_object(tolua_S, 2, "ax.Ref",&arg0, "fgui.GTween:kill"); + ok &= luaval_to_object(tolua_S, 2, "ax.Object",&arg0, "fgui.GTween:kill"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fgui.GTween:kill"); ok &= luaval_to_boolean(tolua_S, 4,&arg2, "fgui.GTween:kill"); if(!ok) @@ -32755,8 +32755,8 @@ int lua_ax_fairygui_GTween_getTween(lua_State* tolua_S) if (argc == 1) { - ax::Ref* arg0; - ok &= luaval_to_object(tolua_S, 2, "ax.Ref",&arg0, "fgui.GTween:getTween"); + ax::Object* arg0; + ok &= luaval_to_object(tolua_S, 2, "ax.Object",&arg0, "fgui.GTween:getTween"); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_ax_fairygui_GTween_getTween'", nullptr); @@ -32768,9 +32768,9 @@ int lua_ax_fairygui_GTween_getTween(lua_State* tolua_S) } if (argc == 2) { - ax::Ref* arg0; + ax::Object* arg0; fairygui::TweenPropType arg1; - ok &= luaval_to_object(tolua_S, 2, "ax.Ref",&arg0, "fgui.GTween:getTween"); + ok &= luaval_to_object(tolua_S, 2, "ax.Object",&arg0, "fgui.GTween:getTween"); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fgui.GTween:getTween"); if(!ok) { diff --git a/extensions/scripting/lua-bindings/auto/axlua_navmesh_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_navmesh_auto.cpp index d1b37f82047e..523fcd4da03a 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_navmesh_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_navmesh_auto.cpp @@ -2517,7 +2517,7 @@ static int lua_ax_navmesh_NavMesh_finalize(lua_State* tolua_S) int lua_register_ax_navmesh_NavMesh(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.NavMesh"); - tolua_cclass(tolua_S,"NavMesh","ax.NavMesh","ax.Ref",nullptr); + tolua_cclass(tolua_S,"NavMesh","ax.NavMesh","ax.Object",nullptr); tolua_beginmodule(tolua_S,"NavMesh"); tolua_function(tolua_S,"new",lua_ax_navmesh_NavMesh_constructor); diff --git a/extensions/scripting/lua-bindings/auto/axlua_physics3d_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_physics3d_auto.cpp index 58e7fd92f9eb..114dfd01af33 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_physics3d_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_physics3d_auto.cpp @@ -536,7 +536,7 @@ static int lua_ax_physics3d_Physics3DShape_finalize(lua_State* tolua_S) int lua_register_ax_physics3d_Physics3DShape(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Physics3DShape"); - tolua_cclass(tolua_S,"Physics3DShape","ax.Physics3DShape","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Physics3DShape","ax.Physics3DShape","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Physics3DShape"); tolua_function(tolua_S,"new",lua_ax_physics3d_Physics3DShape_constructor); @@ -1047,7 +1047,7 @@ static int lua_ax_physics3d_Physics3DObject_finalize(lua_State* tolua_S) int lua_register_ax_physics3d_Physics3DObject(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Physics3DObject"); - tolua_cclass(tolua_S,"Physics3DObject","ax.Physics3DObject","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Physics3DObject","ax.Physics3DObject","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Physics3DObject"); tolua_function(tolua_S,"getObjType",lua_ax_physics3d_Physics3DObject_getObjType); @@ -5016,7 +5016,7 @@ static int lua_ax_physics3d_Physics3DWorld_finalize(lua_State* tolua_S) int lua_register_ax_physics3d_Physics3DWorld(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Physics3DWorld"); - tolua_cclass(tolua_S,"Physics3DWorld","ax.Physics3DWorld","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Physics3DWorld","ax.Physics3DWorld","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Physics3DWorld"); tolua_function(tolua_S,"new",lua_ax_physics3d_Physics3DWorld_constructor); @@ -5628,7 +5628,7 @@ static int lua_ax_physics3d_Physics3DConstraint_finalize(lua_State* tolua_S) int lua_register_ax_physics3d_Physics3DConstraint(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.Physics3DConstraint"); - tolua_cclass(tolua_S,"Physics3DConstraint","ax.Physics3DConstraint","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Physics3DConstraint","ax.Physics3DConstraint","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Physics3DConstraint"); tolua_function(tolua_S,"getBreakingImpulse",lua_ax_physics3d_Physics3DConstraint_getBreakingImpulse); diff --git a/extensions/scripting/lua-bindings/auto/axlua_physics_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_physics_auto.cpp index e969c86c5e0d..5fd37a3cf639 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_physics_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_physics_auto.cpp @@ -1509,7 +1509,7 @@ static int lua_ax_physics_PhysicsShape_finalize(lua_State* tolua_S) int lua_register_ax_physics_PhysicsShape(lua_State* tolua_S) { tolua_usertype(tolua_S,"ax.PhysicsShape"); - tolua_cclass(tolua_S,"PhysicsShape","ax.PhysicsShape","ax.Ref",nullptr); + tolua_cclass(tolua_S,"PhysicsShape","ax.PhysicsShape","ax.Object",nullptr); tolua_beginmodule(tolua_S,"PhysicsShape"); tolua_function(tolua_S,"getBody",lua_ax_physics_PhysicsShape_getBody); diff --git a/extensions/scripting/lua-bindings/auto/axlua_studio_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_studio_auto.cpp index e30159bac866..b4906090a423 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_studio_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_studio_auto.cpp @@ -548,7 +548,7 @@ static int lua_ax_studio_ActionFrame_finalize(lua_State* tolua_S) int lua_register_ax_studio_ActionFrame(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.ActionFrame"); - tolua_cclass(tolua_S,"ActionFrame","ccs.ActionFrame","ax.Ref",nullptr); + tolua_cclass(tolua_S,"ActionFrame","ccs.ActionFrame","ax.Object",nullptr); tolua_beginmodule(tolua_S,"ActionFrame"); tolua_function(tolua_S,"new",lua_ax_studio_ActionFrame_constructor); @@ -2585,7 +2585,7 @@ static int lua_ax_studio_ActionObject_finalize(lua_State* tolua_S) int lua_register_ax_studio_ActionObject(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.ActionObject"); - tolua_cclass(tolua_S,"ActionObject","ccs.ActionObject","ax.Ref",nullptr); + tolua_cclass(tolua_S,"ActionObject","ccs.ActionObject","ax.Object",nullptr); tolua_beginmodule(tolua_S,"ActionObject"); tolua_function(tolua_S,"new",lua_ax_studio_ActionObject_constructor); @@ -2957,7 +2957,7 @@ static int lua_ax_studio_ActionManagerEx_finalize(lua_State* tolua_S) int lua_register_ax_studio_ActionManagerEx(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.ActionManagerEx"); - tolua_cclass(tolua_S,"ActionManagerEx","ccs.ActionManagerEx","ax.Ref",nullptr); + tolua_cclass(tolua_S,"ActionManagerEx","ccs.ActionManagerEx","ax.Object",nullptr); tolua_beginmodule(tolua_S,"ActionManagerEx"); tolua_function(tolua_S,"getActionByName",lua_ax_studio_ActionManagerEx_getActionByName); @@ -3151,7 +3151,7 @@ static int lua_ax_studio_BaseData_finalize(lua_State* tolua_S) int lua_register_ax_studio_BaseData(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.BaseData"); - tolua_cclass(tolua_S,"BaseData","ccs.BaseData","ax.Ref",nullptr); + tolua_cclass(tolua_S,"BaseData","ccs.BaseData","ax.Object",nullptr); tolua_beginmodule(tolua_S,"BaseData"); tolua_function(tolua_S,"new",lua_ax_studio_BaseData_constructor); @@ -3331,7 +3331,7 @@ static int lua_ax_studio_DisplayData_finalize(lua_State* tolua_S) int lua_register_ax_studio_DisplayData(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.DisplayData"); - tolua_cclass(tolua_S,"DisplayData","ccs.DisplayData","ax.Ref",nullptr); + tolua_cclass(tolua_S,"DisplayData","ccs.DisplayData","ax.Object",nullptr); tolua_beginmodule(tolua_S,"DisplayData"); tolua_function(tolua_S,"new",lua_ax_studio_DisplayData_constructor); @@ -4141,7 +4141,7 @@ static int lua_ax_studio_ArmatureData_finalize(lua_State* tolua_S) int lua_register_ax_studio_ArmatureData(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.ArmatureData"); - tolua_cclass(tolua_S,"ArmatureData","ccs.ArmatureData","ax.Ref",nullptr); + tolua_cclass(tolua_S,"ArmatureData","ccs.ArmatureData","ax.Object",nullptr); tolua_beginmodule(tolua_S,"ArmatureData"); tolua_function(tolua_S,"new",lua_ax_studio_ArmatureData_constructor); @@ -4526,7 +4526,7 @@ static int lua_ax_studio_MovementBoneData_finalize(lua_State* tolua_S) int lua_register_ax_studio_MovementBoneData(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.MovementBoneData"); - tolua_cclass(tolua_S,"MovementBoneData","ccs.MovementBoneData","ax.Ref",nullptr); + tolua_cclass(tolua_S,"MovementBoneData","ccs.MovementBoneData","ax.Object",nullptr); tolua_beginmodule(tolua_S,"MovementBoneData"); tolua_function(tolua_S,"new",lua_ax_studio_MovementBoneData_constructor); @@ -4721,7 +4721,7 @@ static int lua_ax_studio_MovementData_finalize(lua_State* tolua_S) int lua_register_ax_studio_MovementData(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.MovementData"); - tolua_cclass(tolua_S,"MovementData","ccs.MovementData","ax.Ref",nullptr); + tolua_cclass(tolua_S,"MovementData","ccs.MovementData","ax.Object",nullptr); tolua_beginmodule(tolua_S,"MovementData"); tolua_function(tolua_S,"new",lua_ax_studio_MovementData_constructor); @@ -4962,7 +4962,7 @@ static int lua_ax_studio_AnimationData_finalize(lua_State* tolua_S) int lua_register_ax_studio_AnimationData(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.AnimationData"); - tolua_cclass(tolua_S,"AnimationData","ccs.AnimationData","ax.Ref",nullptr); + tolua_cclass(tolua_S,"AnimationData","ccs.AnimationData","ax.Object",nullptr); tolua_beginmodule(tolua_S,"AnimationData"); tolua_function(tolua_S,"new",lua_ax_studio_AnimationData_constructor); @@ -5154,7 +5154,7 @@ static int lua_ax_studio_ContourData_finalize(lua_State* tolua_S) int lua_register_ax_studio_ContourData(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.ContourData"); - tolua_cclass(tolua_S,"ContourData","ccs.ContourData","ax.Ref",nullptr); + tolua_cclass(tolua_S,"ContourData","ccs.ContourData","ax.Object",nullptr); tolua_beginmodule(tolua_S,"ContourData"); tolua_function(tolua_S,"new",lua_ax_studio_ContourData_constructor); @@ -5395,7 +5395,7 @@ static int lua_ax_studio_TextureData_finalize(lua_State* tolua_S) int lua_register_ax_studio_TextureData(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.TextureData"); - tolua_cclass(tolua_S,"TextureData","ccs.TextureData","ax.Ref",nullptr); + tolua_cclass(tolua_S,"TextureData","ccs.TextureData","ax.Object",nullptr); tolua_beginmodule(tolua_S,"TextureData"); tolua_function(tolua_S,"new",lua_ax_studio_TextureData_constructor); @@ -6799,7 +6799,7 @@ static int lua_ax_studio_DisplayManager_finalize(lua_State* tolua_S) int lua_register_ax_studio_DisplayManager(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.DisplayManager"); - tolua_cclass(tolua_S,"DisplayManager","ccs.DisplayManager","ax.Ref",nullptr); + tolua_cclass(tolua_S,"DisplayManager","ccs.DisplayManager","ax.Object",nullptr); tolua_beginmodule(tolua_S,"DisplayManager"); tolua_function(tolua_S,"new",lua_ax_studio_DisplayManager_constructor); @@ -10698,7 +10698,7 @@ static int lua_ax_studio_ArmatureDataManager_finalize(lua_State* tolua_S) int lua_register_ax_studio_ArmatureDataManager(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.ArmatureDataManager"); - tolua_cclass(tolua_S,"ArmatureDataManager","ccs.ArmatureDataManager","ax.Ref",nullptr); + tolua_cclass(tolua_S,"ArmatureDataManager","ccs.ArmatureDataManager","ax.Object",nullptr); tolua_beginmodule(tolua_S,"ArmatureDataManager"); tolua_function(tolua_S,"init",lua_ax_studio_ArmatureDataManager_init); @@ -12897,7 +12897,7 @@ int lua_ax_studio_ComAttribute_createInstance(lua_State* tolua_S) return 0; } auto&& ret = cocostudio::ComAttribute::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "ccs.ComAttribute:createInstance",argc, 0); @@ -14385,7 +14385,7 @@ int lua_ax_studio_ComAudio_createInstance(lua_State* tolua_S) return 0; } auto&& ret = cocostudio::ComAudio::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "ccs.ComAudio:createInstance",argc, 0); @@ -14502,7 +14502,7 @@ int lua_ax_studio_ComController_createInstance(lua_State* tolua_S) return 0; } auto&& ret = cocostudio::ComController::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "ccs.ComController:createInstance",argc, 0); @@ -14726,7 +14726,7 @@ int lua_ax_studio_ComRender_createInstance(lua_State* tolua_S) return 0; } auto&& ret = cocostudio::ComRender::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "ccs.ComRender:createInstance",argc, 0); @@ -15132,7 +15132,7 @@ static int lua_ax_studio_GUIReader_finalize(lua_State* tolua_S) int lua_register_ax_studio_GUIReader(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.GUIReader"); - tolua_cclass(tolua_S,"GUIReader","ccs.GUIReader","ax.Ref",nullptr); + tolua_cclass(tolua_S,"GUIReader","ccs.GUIReader","ax.Object",nullptr); tolua_beginmodule(tolua_S,"GUIReader"); tolua_function(tolua_S,"widgetFromJsonFile",lua_ax_studio_GUIReader_widgetFromJsonFile); @@ -15244,7 +15244,7 @@ int lua_ax_studio_SceneReader_setTarget(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - std::function arg0; + std::function arg0; do { // Lambda binding for lua is not supported. @@ -16831,7 +16831,7 @@ static int lua_ax_studio_Frame_finalize(lua_State* tolua_S) int lua_register_ax_studio_Frame(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.Frame"); - tolua_cclass(tolua_S,"Frame","ccs.Frame","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Frame","ccs.Frame","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Frame"); tolua_function(tolua_S,"setFrameIndex",lua_ax_studio_Frame_setFrameIndex); @@ -21234,7 +21234,7 @@ static int lua_ax_studio_Timeline_finalize(lua_State* tolua_S) int lua_register_ax_studio_Timeline(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.Timeline"); - tolua_cclass(tolua_S,"Timeline","ccs.Timeline","ax.Ref",nullptr); + tolua_cclass(tolua_S,"Timeline","ccs.Timeline","ax.Object",nullptr); tolua_beginmodule(tolua_S,"Timeline"); tolua_function(tolua_S,"new",lua_ax_studio_Timeline_constructor); @@ -21488,7 +21488,7 @@ static int lua_ax_studio_ActionTimelineData_finalize(lua_State* tolua_S) int lua_register_ax_studio_ActionTimelineData(lua_State* tolua_S) { tolua_usertype(tolua_S,"ccs.ActionTimelineData"); - tolua_cclass(tolua_S,"ActionTimelineData","ccs.ActionTimelineData","ax.Ref",nullptr); + tolua_cclass(tolua_S,"ActionTimelineData","ccs.ActionTimelineData","ax.Object",nullptr); tolua_beginmodule(tolua_S,"ActionTimelineData"); tolua_function(tolua_S,"new",lua_ax_studio_ActionTimelineData_constructor); @@ -25146,7 +25146,7 @@ int lua_ax_studio_ComExtensionData_createInstance(lua_State* tolua_S) return 0; } auto&& ret = cocostudio::ComExtensionData::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "ccs.ComExtensionData:createInstance",argc, 0); diff --git a/extensions/scripting/lua-bindings/auto/axlua_ui_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_ui_auto.cpp index c126de64e120..4307d81c8608 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_ui_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_ui_auto.cpp @@ -274,7 +274,7 @@ static int lua_ax_ui_LayoutParameter_finalize(lua_State* tolua_S) int lua_register_ax_ui_LayoutParameter(lua_State* tolua_S) { tolua_usertype(tolua_S,"axui.LayoutParameter"); - tolua_cclass(tolua_S,"LayoutParameter","axui.LayoutParameter","ax.Ref",nullptr); + tolua_cclass(tolua_S,"LayoutParameter","axui.LayoutParameter","ax.Object",nullptr); tolua_beginmodule(tolua_S,"LayoutParameter"); tolua_function(tolua_S,"new",lua_ax_ui_LayoutParameter_constructor); @@ -5913,7 +5913,7 @@ int lua_ax_ui_Layout_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::Layout::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.Layout:createInstance",argc, 0); @@ -8127,7 +8127,7 @@ int lua_ax_ui_Button_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::Button::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.Button:createInstance",argc, 0); @@ -9587,7 +9587,7 @@ int lua_ax_ui_CheckBox_addEventListener(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - std::function arg0; + std::function arg0; do { // Lambda binding for lua is not supported. @@ -9636,7 +9636,7 @@ int lua_ax_ui_CheckBox_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::CheckBox::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.CheckBox:createInstance",argc, 0); @@ -9904,7 +9904,7 @@ int lua_ax_ui_RadioButton_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::RadioButton::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.RadioButton:createInstance",argc, 0); @@ -11295,7 +11295,7 @@ int lua_ax_ui_ImageView_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::ImageView::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.ImageView:createInstance",argc, 0); @@ -13174,7 +13174,7 @@ int lua_ax_ui_Text_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::Text::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.Text:createInstance",argc, 0); @@ -13652,7 +13652,7 @@ int lua_ax_ui_TextAtlas_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::TextAtlas::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.TextAtlas:createInstance",argc, 0); @@ -14310,7 +14310,7 @@ int lua_ax_ui_LoadingBar_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::LoadingBar::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.LoadingBar:createInstance",argc, 0); @@ -16252,7 +16252,7 @@ int lua_ax_ui_ScrollView_addEventListener(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - std::function arg0; + std::function arg0; do { // Lambda binding for lua is not supported. @@ -17684,7 +17684,7 @@ int lua_ax_ui_ScrollView_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::ScrollView::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.ScrollView:createInstance",argc, 0); @@ -19864,7 +19864,7 @@ int lua_ax_ui_ListView_addEventListener(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - std::function arg0; + std::function arg0; do { // Lambda binding for lua is not supported. @@ -19913,7 +19913,7 @@ int lua_ax_ui_ListView_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::ListView::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.ListView:createInstance",argc, 0); @@ -21112,7 +21112,7 @@ int lua_ax_ui_Slider_addEventListener(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - std::function arg0; + std::function arg0; do { // Lambda binding for lua is not supported. @@ -21681,7 +21681,7 @@ int lua_ax_ui_Slider_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::Slider::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.Slider:createInstance",argc, 0); @@ -23480,7 +23480,7 @@ int lua_ax_ui_TextField_addEventListener(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - std::function arg0; + std::function arg0; do { // Lambda binding for lua is not supported. @@ -24067,7 +24067,7 @@ int lua_ax_ui_TextField_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::TextField::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.TextField:createInstance",argc, 0); @@ -24544,7 +24544,7 @@ int lua_ax_ui_TextBMFont_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::TextBMFont::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.TextBMFont:createInstance",argc, 0); @@ -25161,7 +25161,7 @@ int lua_ax_ui_PageView_addEventListener(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - std::function arg0; + std::function arg0; do { // Lambda binding for lua is not supported. @@ -26200,7 +26200,7 @@ int lua_ax_ui_PageView_createInstance(lua_State* tolua_S) return 0; } auto&& ret = ax::ui::PageView::createInstance(); - object_to_luaval(tolua_S, "ax.Ref",(ax::Ref*)ret); + object_to_luaval(tolua_S, "ax.Object",(ax::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "axui.PageView:createInstance",argc, 0); @@ -26826,7 +26826,7 @@ static int lua_ax_ui_RichElement_finalize(lua_State* tolua_S) int lua_register_ax_ui_RichElement(lua_State* tolua_S) { tolua_usertype(tolua_S,"axui.RichElement"); - tolua_cclass(tolua_S,"RichElement","axui.RichElement","ax.Ref",nullptr); + tolua_cclass(tolua_S,"RichElement","axui.RichElement","ax.Object",nullptr); tolua_beginmodule(tolua_S,"RichElement"); tolua_function(tolua_S,"init",lua_ax_ui_RichElement_init); diff --git a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h index 992a0c51a51b..40915e2dc146 100644 --- a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -496,7 +496,7 @@ AX_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L * @param L the current lua_State. * @param argc the numbers of Lua values in the stack. * @param ret a ax::Vector of type T objects. - * @return Return false if argc equal to 0 , L equal to nullptr or the Lua userdata at the index isn't `ax.Ref` type, + * @return Return false if argc equal to 0 , L equal to nullptr or the Lua userdata at the index isn't `ax.Object` type, * otherwise return true. */ template @@ -513,7 +513,7 @@ bool luavals_variadic_to_ccvector(lua_State* L, int argc, ax::Vector* ret) { tolua_Error err; - if (!tolua_isusertype(L, i + 2, "ax.Ref", 0, &err)) + if (!tolua_isusertype(L, i + 2, "ax.Object", 0, &err)) { ok = false; break; @@ -1090,7 +1090,7 @@ const char* getLuaTypeName(T* ret, const char* defaultTypeName) /** * Push a table converted from a ax::Vector object into the Lua stack. * The format of table as follows: {userdata1, userdata2, ..., userdataVectorSize} - * The object in the ax::Vector which would be pushed into the table should be Ref type. + * The object in the ax::Vector which would be pushed into the table should be Object type. * * @param L the current lua_State. * @param inValue a ax::Vector object. @@ -1109,7 +1109,7 @@ void ccvector_to_luaval(lua_State* L, const ax::Vector& inValue) if (nullptr == obj) continue; - if (nullptr != dynamic_cast(obj)) + if (nullptr != dynamic_cast(obj)) { auto luaTypeName = getLuaTypeName(obj, nullptr); if (luaTypeName) @@ -1128,7 +1128,7 @@ void ccvector_to_luaval(lua_State* L, const ax::Vector& inValue) /** * Push a table converted from a ax::Map object into the Lua stack. * The format of table as follows: {name1=userdata1, name2=userdata2, ..., nameMapSize=userdataMapSize} - * The object in the ax::Map which would be pushed into the table should be Ref type. + * The object in the ax::Map which would be pushed into the table should be Object type. * * @param L the current lua_State. * @param v a ax::Map object. @@ -1145,7 +1145,7 @@ void ccmap_string_key_to_luaval(lua_State* L, const ax::StringMap& v) { auto& key = iter->first; T obj = iter->second; - if (nullptr != dynamic_cast(obj)) + if (nullptr != dynamic_cast(obj)) { auto name = reinterpret_cast(typeid(*obj).name()); auto typeIter = g_luaType.find(name); @@ -1220,10 +1220,10 @@ void object_to_luaval(lua_State* L, const char* type, T* ret) { if (nullptr != ret) { - if (std::is_base_of::value) + if (std::is_base_of::value) { // use c style cast, T may not polymorphic - ax::Ref* dynObject = (ax::Ref*)(ret); + ax::Object* dynObject = (ax::Object*)(ret); int ID = (int)(dynObject->_ID); int* luaID = &(dynObject->_luaID); toluafix_pushusertype_ccobject(L, ID, luaID, (void*)ret, type); diff --git a/extensions/scripting/lua-bindings/manual/LuaEngine.cpp b/extensions/scripting/lua-bindings/manual/LuaEngine.cpp index e13d9e313835..d06459ba27cc 100644 --- a/extensions/scripting/lua-bindings/manual/LuaEngine.cpp +++ b/extensions/scripting/lua-bindings/manual/LuaEngine.cpp @@ -73,7 +73,7 @@ void LuaEngine::addLuaLoader(lua_CFunction func) _stack->addLuaLoader(func); } -void LuaEngine::removeScriptObjectByObject(Ref* pObj) +void LuaEngine::removeScriptObjectByObject(Object* pObj) { _stack->removeScriptObjectByObject(pObj); ScriptHandlerMgr::getInstance()->removeObjectAllHandlers(pObj); @@ -115,7 +115,7 @@ int LuaEngine::executeMenuItemEvent(MenuItem* pMenuItem) return 0; } -int LuaEngine::executeCallFuncActionEvent(CallFunc* pAction, Ref* pTarget /* = NULL*/) +int LuaEngine::executeCallFuncActionEvent(CallFunc* pAction, Object* pTarget /* = NULL*/) { return 0; } @@ -147,13 +147,13 @@ int LuaEngine::executeAccelerometerEvent(Layer* pLayer, Acceleration* pAccelerat int LuaEngine::executeEvent(int nHandler, const char* pEventName, - Ref* pEventSource /* = NULL*/, + Object* pEventSource /* = NULL*/, const char* pEventSourceClassName /* = NULL*/) { _stack->pushString(pEventName); if (pEventSource) { - _stack->pushObject(pEventSource, pEventSourceClassName ? pEventSourceClassName : "ax.Ref"); + _stack->pushObject(pEventSource, pEventSourceClassName ? pEventSourceClassName : "ax.Object"); } int ret = _stack->executeFunctionByHandler(nHandler, pEventSource ? 2 : 1); _stack->clean(); @@ -304,7 +304,7 @@ int LuaEngine::handleCallFuncActionEvent(void* data) if (0 == handler) return 0; - Ref* target = static_cast(basicScriptData->value); + Object* target = static_cast(basicScriptData->value); if (NULL != target) { _stack->pushObject(target, "ax.Node"); @@ -404,7 +404,7 @@ int LuaEngine::handleCommonEvent(void* data) } else { - _stack->pushObject(commonInfo->eventSource, "ax.Ref"); + _stack->pushObject(commonInfo->eventSource, "ax.Object"); } } int ret = _stack->executeFunctionByHandler(commonInfo->handler, commonInfo->eventSource ? 2 : 1); @@ -546,7 +546,7 @@ int LuaEngine::handlerControlEvent(void* data) if (0 != handler) { - _stack->pushObject((Ref*)basicScriptData->nativeObject, "ax.Ref"); + _stack->pushObject((Object*)basicScriptData->nativeObject, "ax.Object"); _stack->pushInt(controlEvents); ret = _stack->executeFunctionByHandler(handler, 2); _stack->clean(); @@ -836,7 +836,7 @@ int LuaEngine::handleTableViewEvent(ScriptHandlerMgr::HandlerType type, void* da if (0 == handler) return 0; - Ref* obj = static_cast(eventData->nativeObject); + Object* obj = static_cast(eventData->nativeObject); if (nullptr == obj) return 0; @@ -855,7 +855,7 @@ int LuaEngine::handleTableViewEvent(ScriptHandlerMgr::HandlerType type, void* da case ScriptHandlerMgr::HandlerType::TABLECELL_UNHIGHLIGHT: case ScriptHandlerMgr::HandlerType::TABLECELL_WILL_RECYCLE: { - Ref* cellObject = static_cast(tableViewData->value); + Object* cellObject = static_cast(tableViewData->value); if (nullptr == cellObject) { break; @@ -891,7 +891,7 @@ int LuaEngine::handleTableViewEvent(ScriptHandlerMgr::HandlerType handlerType, if (0 == handler) return 0; - Ref* obj = static_cast(eventData->nativeObject); + Object* obj = static_cast(eventData->nativeObject); if (nullptr == obj) return 0; diff --git a/extensions/scripting/lua-bindings/manual/LuaEngine.h b/extensions/scripting/lua-bindings/manual/LuaEngine.h index 7c3566c35451..ced868dde097 100644 --- a/extensions/scripting/lua-bindings/manual/LuaEngine.h +++ b/extensions/scripting/lua-bindings/manual/LuaEngine.h @@ -111,17 +111,17 @@ class AX_LUA_DLL LuaEngine : public ScriptEngineProtocol virtual int reload(const char* moduleFileName); /** - * Remove the related reference about the Ref object stored in the Lua table by set the value of corresponding key + * Remove the related reference about the Object object stored in the Lua table by set the value of corresponding key * nil: The related Lua tables are toluafix_refid_ptr_mapping,toluafix_refid_type_mapping,tolua_value_root and * object_Metatable["tolua_ubox"] or tolua_ubox. Meanwhile set the corresponding userdata nullptr and remove the all * the lua function reference corresponding to this object. * - * In current mechanism, this function is called in the destructor of Ref object, developer don't call this + * In current mechanism, this function is called in the destructor of Object object, developer don't call this * functions. * * @param object the key object to remove script object. */ - virtual void removeScriptObjectByObject(Ref* object) override; + virtual void removeScriptObjectByObject(Object* object) override; /** * Remove Lua function reference by nHandler by setting toluafix_refid_function_mapping[nHandle] nil. @@ -164,14 +164,14 @@ class AX_LUA_DLL LuaEngine : public ScriptEngineProtocol virtual int executeGlobalFunction(const char* functionName) override; virtual int executeNodeEvent(Node* pNode, int nAction); virtual int executeMenuItemEvent(MenuItem* pMenuItem); - virtual int executeCallFuncActionEvent(CallFunc* pAction, Ref* pTarget = NULL); + virtual int executeCallFuncActionEvent(CallFunc* pAction, Object* pTarget = NULL); virtual int executeSchedule(int nHandler, float dt, Node* pNode = NULL); virtual int executeLayerTouchEvent(Layer* pLayer, int eventType, Touch* pTouch); virtual int executeLayerKeypadEvent(Layer* pLayer, int eventType); virtual int executeAccelerometerEvent(Layer* pLayer, Acceleration* pAccelerationValue); virtual int executeEvent(int nHandler, const char* pEventName, - Ref* pEventSource = NULL, + Object* pEventSource = NULL, const char* pEventSourceClassName = NULL); /** * Handle the assert message. diff --git a/extensions/scripting/lua-bindings/manual/LuaStack.cpp b/extensions/scripting/lua-bindings/manual/LuaStack.cpp index f3537fafce8e..66f2430696a6 100644 --- a/extensions/scripting/lua-bindings/manual/LuaStack.cpp +++ b/extensions/scripting/lua-bindings/manual/LuaStack.cpp @@ -223,7 +223,7 @@ void LuaStack::addLuaLoader(lua_CFunction func) lua_pop(_state, 1); } -void LuaStack::removeScriptObjectByObject(Ref* pObj) +void LuaStack::removeScriptObjectByObject(Object* pObj) { toluafix_remove_ccobject_by_refid(_state, pObj->_luaID); } @@ -309,7 +309,7 @@ void LuaStack::pushNil() lua_pushnil(_state); } -void LuaStack::pushObject(Ref* objectValue, const char* typeName) +void LuaStack::pushObject(Object* objectValue, const char* typeName) { toluafix_pushusertype_ccobject(_state, objectValue->_ID, &objectValue->_luaID, objectValue, typeName); } diff --git a/extensions/scripting/lua-bindings/manual/LuaStack.h b/extensions/scripting/lua-bindings/manual/LuaStack.h index a4014c1b3b4f..b9754a4e4631 100644 --- a/extensions/scripting/lua-bindings/manual/LuaStack.h +++ b/extensions/scripting/lua-bindings/manual/LuaStack.h @@ -47,7 +47,7 @@ NS_AX_BEGIN * @lua NA * @js NA */ -class LuaStack : public Ref +class LuaStack : public Object { public: /** @@ -94,17 +94,17 @@ class LuaStack : public Ref virtual int reload(const char* moduleFileName); /** - * Remove the related reference about the Ref object stored in the Lua table by set the value of corresponding key + * Remove the related reference about the Object object stored in the Lua table by set the value of corresponding key * nil: The related Lua tables are toluafix_refid_ptr_mapping,toluafix_refid_type_mapping,tolua_value_root and * object_Metatable["tolua_ubox"] or tolua_ubox. Meanwhile set the corresponding userdata nullptr and remove the all * the lua function reference corresponding to this object. * - * In current mechanism, this function is called in the destructor of Ref object, developer don't call this + * In current mechanism, this function is called in the destructor of Object object, developer don't call this * functions. * * @param object the key object to remove script object. */ - virtual void removeScriptObjectByObject(Ref* object); + virtual void removeScriptObjectByObject(Object* object); /** * Remove Lua function reference by nHandler by setting toluafix_refid_function_mapping[nHandle] nil. @@ -200,11 +200,11 @@ class LuaStack : public Ref virtual void pushNil(); /** - * Pushes a Ref object onto the stack. + * Pushes a Object object onto the stack. * * @see toluafix_pushusertype_ccobject. */ - virtual void pushObject(Ref* objectValue, const char* typeName); + virtual void pushObject(Object* objectValue, const char* typeName); /** * According to the type of LuaValue, it would called the other push function in the internal. diff --git a/extensions/scripting/lua-bindings/manual/LuaValue.cpp b/extensions/scripting/lua-bindings/manual/LuaValue.cpp index dcafcc5b211e..7c28f53f01fd 100644 --- a/extensions/scripting/lua-bindings/manual/LuaValue.cpp +++ b/extensions/scripting/lua-bindings/manual/LuaValue.cpp @@ -84,7 +84,7 @@ const LuaValue LuaValue::arrayValue(const LuaValueArray& arrayValue) return value; } -const LuaValue LuaValue::ccobjectValue(Ref* ccobjectValue, const char* objectTypename) +const LuaValue LuaValue::ccobjectValue(Object* ccobjectValue, const char* objectTypename) { LuaValue value; value._type = LuaValueTypeObject; @@ -94,7 +94,7 @@ const LuaValue LuaValue::ccobjectValue(Ref* ccobjectValue, const char* objectTyp return value; } -const LuaValue LuaValue::ccobjectValue(Ref* ccobjectValue, std::string_view objectTypename) +const LuaValue LuaValue::ccobjectValue(Object* ccobjectValue, std::string_view objectTypename) { return LuaValue::ccobjectValue(ccobjectValue, objectTypename.data()); } diff --git a/extensions/scripting/lua-bindings/manual/LuaValue.h b/extensions/scripting/lua-bindings/manual/LuaValue.h index c0439f69a5d9..c531e0aaf4af 100644 --- a/extensions/scripting/lua-bindings/manual/LuaValue.h +++ b/extensions/scripting/lua-bindings/manual/LuaValue.h @@ -36,7 +36,7 @@ extern "C" { } #include "base/Types.h" -#include "base/Ref.h" +#include "base/Object.h" #if AX_TARGET_PLATFORM == AX_PLATFORM_BLACKBERRY using std::memcpy; @@ -83,13 +83,13 @@ typedef union std::string* stringValue; LuaValueDict* dictValue; LuaValueArray* arrayValue; - Ref* ccobjectValue; + Object* ccobjectValue; } LuaValueField; /// @endcond /** * Wrap different general types of data into a same specific type named LuaValue. - * The general types supported as follows:int,float,bool,std::string,const char*,LuaValueDict,LuaValueArray,Ref. + * The general types supported as follows:int,float,bool,std::string,const char*,LuaValueDict,LuaValueArray,Object. * * @lua NA * @js NA @@ -154,22 +154,22 @@ class LuaValue static const LuaValue arrayValue(const LuaValueArray& arrayValue); /** - * Construct a LuaValue object by a Ref object. + * Construct a LuaValue object by a Object object. * - * @param ccobjectValue a Ref object. + * @param ccobjectValue a Object object. * @param objectTypename a string pointer point to the typename of object. * @return a LuaValue object. */ - static const LuaValue ccobjectValue(Ref* ccobjectValue, const char* objectTypename); + static const LuaValue ccobjectValue(Object* ccobjectValue, const char* objectTypename); /** - * Construct a LuaValue object by a Ref object. + * Construct a LuaValue object by a Object object. * - * @param ccobjectValue a Ref object. + * @param ccobjectValue a Object object. * @param objectTypename a std::string object represent the typename of object. * @return a LuaValue object. */ - static const LuaValue ccobjectValue(Ref* ccobjectValue, std::string_view objectTypename); + static const LuaValue ccobjectValue(Object* ccobjectValue, std::string_view objectTypename); /** * Default constructor of LuaValue. @@ -200,7 +200,7 @@ class LuaValue LuaValueType getType() const { return _type; } /** - * Get the typename of the Ref object. + * Get the typename of the Object object. * * @return the reference of _ccobjectType. */ @@ -249,11 +249,11 @@ class LuaValue const LuaValueArray& arrayValue() const { return *_field.arrayValue; } /** - * Get the Ref object of LuaValue object. + * Get the Object object of LuaValue object. * - * @return the pointer point to a Ref object. + * @return the pointer point to a Object object. */ - Ref* ccobjectValue() const { return _field.ccobjectValue; } + Object* ccobjectValue() const { return _field.ccobjectValue; } private: LuaValueField _field; diff --git a/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.cpp b/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.cpp index 31cf5bcd4cbb..d5adca571134 100644 --- a/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.cpp +++ b/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.cpp @@ -264,7 +264,7 @@ static int tolua_Cocos2d_ScriptHandlerMgr_registerScriptHandler00(lua_State* tol #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isusertype(tolua_S, 1, "ScriptHandlerMgr", 0, &tolua_err) || - !tolua_isusertype(tolua_S, 2, "ax.Ref", 0, &tolua_err) || + !tolua_isusertype(tolua_S, 2, "ax.Object", 0, &tolua_err) || !toluafix_isfunction(tolua_S, 3, "LUA_FUNCTION", 0, &tolua_err) || !tolua_isnumber(tolua_S, 4, 0, &tolua_err) || !tolua_isnoobj(tolua_S, 5, &tolua_err)) goto tolua_lerror; @@ -301,7 +301,7 @@ static int tolua_Cocos2d_ScriptHandlerMgr_unregisterScriptHandler00(lua_State* t #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isusertype(tolua_S, 1, "ScriptHandlerMgr", 0, &tolua_err) || - !tolua_isusertype(tolua_S, 2, "ax.Ref", 0, &tolua_err) || !tolua_isnumber(tolua_S, 3, 0, &tolua_err) || + !tolua_isusertype(tolua_S, 2, "ax.Object", 0, &tolua_err) || !tolua_isnumber(tolua_S, 3, 0, &tolua_err) || !tolua_isnoobj(tolua_S, 4, &tolua_err)) goto tolua_lerror; else @@ -336,7 +336,7 @@ static int tolua_Cocos2d_ScriptHandlerMgr_removeObjectAllHandlers00(lua_State* t #ifndef TOLUA_RELEASE tolua_Error tolua_err; if (!tolua_isusertype(tolua_S, 1, "ScriptHandlerMgr", 0, &tolua_err) || - !tolua_isusertype(tolua_S, 2, "ax.Ref", 0, &tolua_err) || !tolua_isnoobj(tolua_S, 3, &tolua_err)) + !tolua_isusertype(tolua_S, 2, "ax.Object", 0, &tolua_err) || !tolua_isnoobj(tolua_S, 3, &tolua_err)) goto tolua_lerror; else #endif diff --git a/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.h b/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.h index 279e78aae8e8..2352c339a234 100644 --- a/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.h +++ b/extensions/scripting/lua-bindings/manual/base/LuaScriptHandlerMgr.h @@ -26,7 +26,7 @@ #define __LUA_SCRIPT_HANDLER_MGR_H__ #include "tolua++.h" -#include "base/Ref.h" +#include "base/Object.h" #include "base/Macros.h" #include "2d/ActionInstant.h" #include @@ -45,7 +45,7 @@ class ScheduleHandlerDelegate; typedef std::vector VecShedule; typedef std::map MapNodeSchedules; -class ScheduleHandlerDelegate : public ax::Ref +class ScheduleHandlerDelegate : public ax::Object { public: ScheduleHandlerDelegate() : _isUpdateSchedule(false) {} @@ -107,9 +107,9 @@ class LuaCallFunc : public ax::CallFuncN /** * In order to reduce the coupling of lua script engine and native c++ engine. - * In the current mechanism, for the class derived from the Ref, we construct a mapping relationship among c++ Ref + * In the current mechanism, for the class derived from the Object, we construct a mapping relationship among c++ Object * object, HandlerType and the reference index corresponding to the pointer of Lua function. Then, using the - * ScriptHandlerMgr to manager uniformly. By this mechanism, when native c++ Ref object wants to call the Lua function, + * ScriptHandlerMgr to manager uniformly. By this mechanism, when native c++ Object object wants to call the Lua function, * we didn't insert the processing code in the native c++ class. */ class ScriptHandlerMgr @@ -256,10 +256,10 @@ class ScriptHandlerMgr static void destroyInstance(void); /** - * Construct or update the mapping relationship among c++ Ref object ,HandlerType and the reference index + * Construct or update the mapping relationship among c++ Object object ,HandlerType and the reference index * corresponding to the pointer of Lua function. * - * @param object a Ref object. + * @param object a Object object. * @param handler a reference index corresponding to the pointer of Lua function. * @param handlerType ScriptHandlerMgr::HandlerType. * @lua registerScriptHandler @@ -272,7 +272,7 @@ class ScriptHandlerMgr * If found, remove the reference of Lua function corresponding to this index in the * 'toluafix_refid_function_mapping' table. * - * @param object a Ref object. + * @param object a Object object. * @param handlerType ScriptHandlerMgr::HandlerType. * @lua unregisterScriptHandler * @js NA @@ -282,7 +282,7 @@ class ScriptHandlerMgr /** * By the handlerType and object, find the correct reference index corresponding to the pointer of Lua function. * - * @param object a Ref object. + * @param object a Object object. * @param handlerType ScriptHandlerMgr::HandlerType. * @return index corresponding to the pointer of Lua function,otherwise 0. * @lua NA @@ -295,19 +295,19 @@ class ScriptHandlerMgr * Lua function. Meanwhile, remove the reference of Lua function corresponding to the indexs the object has in the * 'toluafix_refid_function_mapping' table. * - * @param object the Ref object. + * @param object the Object object. * @js NA */ void removeObjectAllHandlers(void* object); /** - * Add customizable relationship among c++ Ref object, HandlerType and the reference index corresponding to the + * Add customizable relationship among c++ Object object, HandlerType and the reference index corresponding to the * pointer of Lua function. In the customizable relationship, we don't pass the HandlerType, it will obtain the * HandlerType by auto-increasing. The HandlerTypes used to customizable relationship are between * EVENT_CUSTOM_BEGAN(10000) and EVENT_CUSTOM_ENDED(11000). If the HandlerType increased more than 12,it would * trigger assert. * - * @param object the Ref object. + * @param object the Object object. * @param handler a reference index corresponding to the pointer of Lua function. * @return ScriptHandlerMgr::HandlerType the value of current ScriptHandlerMgr::HandlerType after adding. * @lua NA diff --git a/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp b/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp index fa0833916a65..d6e59eac532f 100644 --- a/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp +++ b/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp @@ -39,12 +39,12 @@ CustomGUIReader* CustomGUIReader::create(std::string& className, int createFunc, return reader; } -Ref* CustomGUIReader::createInstance() +Object* CustomGUIReader::createInstance() { - Ref* result = nullptr; + Object* result = nullptr; LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); stack->executeFunction(_createFunc, 0, 1, [&result](lua_State* L, int numReturn) { - result = static_cast(tolua_tousertype(L, -1, nullptr)); + result = static_cast(tolua_tousertype(L, -1, nullptr)); lua_pop(L, 1); }); return result; @@ -86,7 +86,7 @@ void CustomGUIReader::init(std::string& className, int createFunc, int setPropsF } void CustomGUIReader::setCustomProps(std::string_view classType, - ax::Ref* widget, + ax::Object* widget, const rapidjson::Value& customOptions) { if (_setPropsFunc != 0) @@ -97,7 +97,7 @@ void CustomGUIReader::setCustomProps(std::string_view classType, auto stack = LuaEngine::getInstance()->getLuaStack(); stack->pushString(classType); - stack->pushObject(widget, "ax.Ref"); + stack->pushObject(widget, "ax.Object"); stack->pushString(buffer.GetString(), static_cast(buffer.GetSize())); stack->executeFunctionByHandler(_setPropsFunc, 3); } diff --git a/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.h b/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.h index adf8fd2b6249..06cf97d15370 100644 --- a/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.h +++ b/extensions/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.h @@ -31,7 +31,7 @@ USING_NS_AX; namespace cocostudio { -class CustomGUIReader : public Ref +class CustomGUIReader : public Object { public: CustomGUIReader(); @@ -41,9 +41,9 @@ class CustomGUIReader : public Ref void init(std::string& className, int createFunc, int setPropsFunc); - Ref* createInstance(); + Object* createInstance(); - void setCustomProps(std::string_view classType, ax::Ref* widget, const rapidjson::Value& customOptions); + void setCustomProps(std::string_view classType, ax::Object* widget, const rapidjson::Value& customOptions); private: std::string _className; diff --git a/extensions/scripting/lua-bindings/manual/cocostudio/axlua_cocostudio_manual.cpp b/extensions/scripting/lua-bindings/manual/cocostudio/axlua_cocostudio_manual.cpp index aba693c32497..125dda7f011a 100644 --- a/extensions/scripting/lua-bindings/manual/cocostudio/axlua_cocostudio_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/cocostudio/axlua_cocostudio_manual.cpp @@ -38,7 +38,7 @@ using namespace cocostudio; -class LuaArmatureWrapper : public Ref +class LuaArmatureWrapper : public Object { public: LuaArmatureWrapper(); @@ -575,7 +575,7 @@ int lua_register_axis_coco_studio_CustomGUIReader(lua_State* L) tolua_beginmodule(L, "ccs"); tolua_usertype(L, "ccs.CustomGUIReader"); - tolua_cclass(L, "CustomGUIReader", "ccs.CustomGUIReader", "ax.Ref", nullptr); + tolua_cclass(L, "CustomGUIReader", "ccs.CustomGUIReader", "ax.Object", nullptr); tolua_beginmodule(L, "CustomGUIReader"); tolua_function(L, "create", axlua_CustomGUIReader_create); diff --git a/extensions/scripting/lua-bindings/manual/cocostudio/axlua_cocostudio_manual.hpp b/extensions/scripting/lua-bindings/manual/cocostudio/axlua_cocostudio_manual.hpp index 682471e6ffa8..04b46d6d4b66 100644 --- a/extensions/scripting/lua-bindings/manual/cocostudio/axlua_cocostudio_manual.hpp +++ b/extensions/scripting/lua-bindings/manual/cocostudio/axlua_cocostudio_manual.hpp @@ -33,7 +33,7 @@ extern "C" { } #endif -#include "base/Ref.h" +#include "base/Object.h" #include TOLUA_API int register_all_ax_coco_studio_manual(lua_State* L); @@ -74,23 +74,23 @@ struct LuaArmatureWrapperEventData struct LuaArmatureMovementEventData { - ax::Ref* objTarget; + ax::Object* objTarget; int movementType; std::string movementID; - LuaArmatureMovementEventData(ax::Ref* _objTarget, int _movementType,std::string_view _movementID):objTarget(_objTarget),movementType(_movementType),movementID(_movementID) + LuaArmatureMovementEventData(ax::Object* _objTarget, int _movementType,std::string_view _movementID):objTarget(_objTarget),movementType(_movementType),movementID(_movementID) { } }; struct LuaArmatureFrameEventData { - ax::Ref* objTarget; + ax::Object* objTarget; std::string frameEventName; int originFrameIndex; int currentFrameIndex; - LuaArmatureFrameEventData( ax::Ref* _objTarget, std::string_view _frameEventName, int _originFrameIndex, int _currentFrameIndex):objTarget(_objTarget), frameEventName(_frameEventName),originFrameIndex(_originFrameIndex), currentFrameIndex(_currentFrameIndex) + LuaArmatureFrameEventData( ax::Object* _objTarget, std::string_view _frameEventName, int _originFrameIndex, int _currentFrameIndex):objTarget(_objTarget), frameEventName(_frameEventName),originFrameIndex(_originFrameIndex), currentFrameIndex(_currentFrameIndex) { } }; diff --git a/extensions/scripting/lua-bindings/manual/cocostudio/axlua_csloader_manual.cpp b/extensions/scripting/lua-bindings/manual/cocostudio/axlua_csloader_manual.cpp index f73aee8cc62f..ebafb6c421fc 100644 --- a/extensions/scripting/lua-bindings/manual/cocostudio/axlua_csloader_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/cocostudio/axlua_csloader_manual.cpp @@ -102,11 +102,11 @@ int axlua_csloader_CSLoader_createNode(lua_State* tolua_S) #endif LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 3, 0)); - auto callback = [handler](ax::Ref* ref) { + auto callback = [handler](ax::Object* ref) { if (nullptr == ref) return; auto stack = LuaEngine::getInstance()->getLuaStack(); - toluafix_pushusertype_ccobject(stack->getLuaState(), ref->_ID, &(ref->_luaID), (void*)ref, "ax.Ref"); + toluafix_pushusertype_ccobject(stack->getLuaState(), ref->_ID, &(ref->_luaID), (void*)ref, "ax.Object"); stack->executeFunctionByHandler(handler, 1); }; diff --git a/extensions/scripting/lua-bindings/manual/cocostudio/axlua_csloader_manual.hpp b/extensions/scripting/lua-bindings/manual/cocostudio/axlua_csloader_manual.hpp index 64f492decb44..2ab62ca8b852 100644 --- a/extensions/scripting/lua-bindings/manual/cocostudio/axlua_csloader_manual.hpp +++ b/extensions/scripting/lua-bindings/manual/cocostudio/axlua_csloader_manual.hpp @@ -33,7 +33,7 @@ extern "C" { } #endif -#include "base/Ref.h" +#include "base/Object.h" #include TOLUA_API int register_all_ax_csloader_manual(lua_State* L); diff --git a/extensions/scripting/lua-bindings/manual/extension/axlua_extension_manual.cpp b/extensions/scripting/lua-bindings/manual/extension/axlua_extension_manual.cpp index 359324927801..eaf2b87630c3 100644 --- a/extensions/scripting/lua-bindings/manual/extension/axlua_extension_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/extension/axlua_extension_manual.cpp @@ -36,10 +36,10 @@ USING_NS_AX; USING_NS_AX_EXT; -class LuaRefMap : public Ref +class LuaRefMap : public Object { protected: - ax::Map __map; + ax::Map __map; public: LuaRefMap() { @@ -51,7 +51,7 @@ class LuaRefMap : public Ref AXLOGINFO("deallocing LuaRefMap: %p", this); __map.clear(); } - void setObject(Ref* pObject, const std::string& key) { + void setObject(Object* pObject, const std::string& key) { __map.insert(key, pObject); } @@ -59,8 +59,8 @@ class LuaRefMap : public Ref void removeAllObjects() { __map.clear(); } - Ref* objectForKey(const std::string& key) { - Ref* pRetObject = nullptr; + Object* objectForKey(const std::string& key) { + Object* pRetObject = nullptr; pRetObject = __map.at(key); return pRetObject; } @@ -77,7 +77,7 @@ class LuaRefMap : public Ref }; -class LuaAssetsManagerDelegateProtocol : public Ref, public AssetsManagerDelegateProtocol +class LuaAssetsManagerDelegateProtocol : public Object, public AssetsManagerDelegateProtocol { public: virtual ~LuaAssetsManagerDelegateProtocol() {} @@ -409,7 +409,7 @@ static void extendParticlePool(lua_State* tolua_S) -class LuaScrollViewDelegate:public Ref, public ScrollViewDelegate +class LuaScrollViewDelegate:public Object, public ScrollViewDelegate { public: virtual ~LuaScrollViewDelegate() @@ -609,7 +609,7 @@ static void extendScrollView(lua_State* tolua_S) #define KEY_TABLEVIEW_DATA_SOURCE "TableViewDataSource" #define KEY_TABLEVIEW_DELEGATE "TableViewDelegate" -class LUA_TableViewDelegate:public Ref, public TableViewDelegate +class LUA_TableViewDelegate:public Object, public TableViewDelegate { public: LUA_TableViewDelegate(){} @@ -761,7 +761,7 @@ static int axlua_extension_TableView_setDelegate(lua_State* L) #endif } -class LUA_TableViewDataSource:public Ref,public TableViewDataSource +class LUA_TableViewDataSource:public Object,public TableViewDataSource { public: LUA_TableViewDataSource(){} diff --git a/extensions/scripting/lua-bindings/manual/fairygui/axlua_fairygui_manual.cpp b/extensions/scripting/lua-bindings/manual/fairygui/axlua_fairygui_manual.cpp index c1d7627ffca0..e63bf1317d20 100644 --- a/extensions/scripting/lua-bindings/manual/fairygui/axlua_fairygui_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/fairygui/axlua_fairygui_manual.cpp @@ -164,7 +164,7 @@ int lua_ax_fairygui_GObject_getData(lua_State* tolua_S) return 0; } void* ret = cobj->getData(); - object_to_luaval(tolua_S, /*"cc."*/"ax.Ref", (cocos2d::Ref*)ret); + object_to_luaval(tolua_S, /*"cc."*/"ax.Object", (cocos2d::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GObject:getData", argc, 0); @@ -504,9 +504,9 @@ static int lua_ax_fairygui_UIObjectFactory_setPackageItemExtension(lua_State* to stack->executeFunctionByHandler(handler,1); return ret; }); - cocos2d::Ref* self = nullptr; + cocos2d::Object* self = nullptr; if (argc == 4) { - self = (cocos2d::Ref*)tolua_tousertype(tolua_S, 5, 0); + self = (cocos2d::Object*)tolua_tousertype(tolua_S, 5, 0); } if (self) { @@ -639,7 +639,7 @@ int lua_ax_fairygui_EventContext_getData(lua_State* tolua_S) return 0; } void* ret = cobj->getData(); - object_to_luaval(tolua_S, /*"cc."*/"ax.Ref", (cocos2d::Ref*)ret); + object_to_luaval(tolua_S, /*"cc."*/"ax.Object", (cocos2d::Object*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.EventContext:getData", argc, 0); diff --git a/extensions/scripting/lua-bindings/manual/network/lua_downloader.cpp b/extensions/scripting/lua-bindings/manual/network/lua_downloader.cpp index f5cdec95b77c..0a178642bb1e 100644 --- a/extensions/scripting/lua-bindings/manual/network/lua_downloader.cpp +++ b/extensions/scripting/lua-bindings/manual/network/lua_downloader.cpp @@ -340,7 +340,7 @@ static int lua_downloader_tostring(lua_State* L) static const struct luaL_Reg downloaderStaticFns[] = {{"new", lua_downloader_new}, /* - * ax::Downloader is not a subclass of ax::Ref, + * ax::Downloader is not a subclass of ax::Object, * `create()` is not provided. */ //{ "create", lua_downloader_new }, diff --git a/extensions/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp b/extensions/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp index 998c0f6f7a7e..a139ea9570e5 100644 --- a/extensions/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp +++ b/extensions/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp @@ -41,7 +41,7 @@ USING_NS_AX; using namespace ax::network; -class LuaMinXmlHttpRequest : public ax::Ref +class LuaMinXmlHttpRequest : public ax::Object { public: enum class ResponseType @@ -1171,7 +1171,7 @@ TOLUA_API int register_xml_http_request(lua_State* L) lua_reg_xml_http_request(L); tolua_module(L, "ax", 0); tolua_beginmodule(L, "ax"); - tolua_cclass(L, "XMLHttpRequest", "ax.XMLHttpRequest", "ax.Ref", lua_collect_xml_http_request); + tolua_cclass(L, "XMLHttpRequest", "ax.XMLHttpRequest", "ax.Object", lua_collect_xml_http_request); tolua_beginmodule(L, "XMLHttpRequest"); tolua_variable(L, "responseType", lua_get_XMLHttpRequest_responseType, lua_set_XMLHttpRequest_responseType); tolua_variable(L, "withCredentials", lua_get_XMLHttpRequest_withCredentials, diff --git a/extensions/scripting/lua-bindings/manual/physics/axlua_physics_manual.cpp b/extensions/scripting/lua-bindings/manual/physics/axlua_physics_manual.cpp index 0908cf3e02e3..98413a53e530 100644 --- a/extensions/scripting/lua-bindings/manual/physics/axlua_physics_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/physics/axlua_physics_manual.cpp @@ -140,7 +140,7 @@ int axlua_physics_PhysicsWorld_getScene(lua_State* tolua_S) ax::Scene& ret = cobj->getScene(); do { - auto className = getLuaTypeName(&ret, "ax.Scene"); + auto className = getLuaTypeName(&ret, "ax.Scene"); int ID = (int)(ret._ID); int* luaID = &(ret._luaID); diff --git a/extensions/scripting/lua-bindings/manual/tolua_fix.cpp b/extensions/scripting/lua-bindings/manual/tolua_fix.cpp index e41280568b43..88c71c55db32 100644 --- a/extensions/scripting/lua-bindings/manual/tolua_fix.cpp +++ b/extensions/scripting/lua-bindings/manual/tolua_fix.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "lua-bindings/manual/tolua_fix.h" -#include "base/Ref.h" +#include "base/Object.h" #include "lua-bindings/manual/LuaBasicConversions.h" #include @@ -54,7 +54,7 @@ TOLUA_API int toluafix_pushusertype_ccobject(lua_State* L, int refid, int* p_ref return -1; } - Ref* vPtr = static_cast(ptr); + Object* vPtr = static_cast(ptr); const char* vType = getLuaTypeName(vPtr, type); if (*p_refid == 0) diff --git a/extensions/scripting/lua-bindings/manual/tolua_fix.h b/extensions/scripting/lua-bindings/manual/tolua_fix.h index cff185671eb6..cde48cf271cb 100644 --- a/extensions/scripting/lua-bindings/manual/tolua_fix.h +++ b/extensions/scripting/lua-bindings/manual/tolua_fix.h @@ -47,12 +47,12 @@ TOLUA_API void toluafix_open(lua_State* L); * If the userdata correspondings to the ptr exist,it would update the metatable information of the super. * In addition, this function would update some table in the Lua registry,such as toluafix_refid_ptr_mapping, * toluafix_refid_type_mapping,tolua_value_root,and so on. Meanwhile, Add a reference about the userdata corresponding - * to the ptr in the tolua_ubox table. The ptr should be point to a Ref object. + * to the ptr in the tolua_ubox table. The ptr should be point to a Object object. * * @param L the current lua_State. * @param uid the object id of the ptr. * @param p_refid the pointer points to the Lua reference id of the ptr. - * @param ptr the pointer points to the Ref object. + * @param ptr the pointer points to the Object object. * @param type the type name of the ptr. * @return -1 if the p_refid equal to nullptr or ptr equal to nullptr, otherwise return 0. * @lua NA @@ -61,17 +61,17 @@ TOLUA_API void toluafix_open(lua_State* L); TOLUA_API int toluafix_pushusertype_ccobject(lua_State* L, int uid, int* p_refid, void* ptr, const char* type); /** - * Find the value of Ref object pointer in the Lua registry by the refid. + * Find the value of Object object pointer in the Lua registry by the refid. * Then, remove the corresponding reference in some table in the Lua registry by refid, such as * toluafix_refid_type_mapping, toluafix_refid_ptr_mapping,tolua_value_root,and so on. Set the value of userdata nullptr - * and remove the reference of userdata in the tolua_ubox table. This function is called in the destructor of the Ref + * and remove the reference of userdata in the tolua_ubox table. This function is called in the destructor of the Object * automatically. * * @param L the current lua_State. - * @param refid the value of the _luaID of a Ref object. + * @param refid the value of the _luaID of a Object object. * @return -1,if refid equals to 0 , type name found by refid equals to nil or corresponding userdata pointer equal to - * nullptr; return -2, if the Ref object pointer found by refid is nullptr; return 3, if the value corresponding to the - * Ref object pointer in the tolua_ubox is nil; otherwise return 0. + * nullptr; return -2, if the Object object pointer found by refid is nullptr; return 3, if the value corresponding to the + * Object object pointer in the tolua_ubox is nil; otherwise return 0. * @lua NA * @js NA */ diff --git a/extensions/scripting/lua-bindings/manual/ui/axlua_ui_manual.cpp b/extensions/scripting/lua-bindings/manual/ui/axlua_ui_manual.cpp index 5fb2d97aa8f8..e9785cac1ef9 100644 --- a/extensions/scripting/lua-bindings/manual/ui/axlua_ui_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/ui/axlua_ui_manual.cpp @@ -50,11 +50,11 @@ using namespace ui; -static int handleUIEvent(int handler, ax::Ref* sender, int eventType) +static int handleUIEvent(int handler, ax::Object* sender, int eventType) { LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); - stack->pushObject(sender, "ax.Ref"); + stack->pushObject(sender, "ax.Object"); stack->pushInt(eventType); stack->executeFunctionByHandler(handler, 2); @@ -101,7 +101,7 @@ static int axlua_Widget_addTouchEventListener(lua_State* L) LUA_FUNCTION handler = (toluafix_ref_function(L, 2, 0)); self->addTouchEventListener( - [=](ax::Ref* ref, Widget::TouchEventType eventType) { handleUIEvent(handler, ref, (int)eventType); }); + [=](ax::Object* ref, Widget::TouchEventType eventType) { handleUIEvent(handler, ref, (int)eventType); }); ScriptHandlerMgr::getInstance()->addCustomHandler((void*)self, handler); return 0; @@ -155,9 +155,9 @@ static int axlua_Widget_addClickEventListener(lua_State* L) LUA_FUNCTION handler = (toluafix_ref_function(L, 2, 0)); - self->addClickEventListener([=](ax::Ref* sender) { + self->addClickEventListener([=](ax::Object* sender) { LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); - stack->pushObject(sender, "ax.Ref"); + stack->pushObject(sender, "ax.Object"); stack->executeFunctionByHandler(handler, 1); stack->clean(); }); @@ -224,7 +224,7 @@ static int axlua_CheckBox_addEventListener(lua_State* L) LUA_FUNCTION handler = (toluafix_ref_function(L, 2, 0)); self->addEventListener( - [=](ax::Ref* ref, CheckBox::EventType eventType) { handleUIEvent(handler, ref, (int)eventType); }); + [=](ax::Object* ref, CheckBox::EventType eventType) { handleUIEvent(handler, ref, (int)eventType); }); ScriptHandlerMgr::getInstance()->addCustomHandler((void*)self, handler); return 0; @@ -428,7 +428,7 @@ static int axlua_Slider_addEventListener(lua_State* L) LUA_FUNCTION handler = (toluafix_ref_function(L, 2, 0)); self->addEventListener( - [=](ax::Ref* ref, Slider::EventType eventType) { handleUIEvent(handler, ref, (int)eventType); }); + [=](ax::Object* ref, Slider::EventType eventType) { handleUIEvent(handler, ref, (int)eventType); }); ScriptHandlerMgr::getInstance()->addCustomHandler((void*)self, handler); return 0; @@ -492,7 +492,7 @@ static int axlua_TextField_addEventListener(lua_State* L) LUA_FUNCTION handler = (toluafix_ref_function(L, 2, 0)); self->addEventListener( - [=](ax::Ref* ref, TextField::EventType eventType) { handleUIEvent(handler, ref, (int)eventType); }); + [=](ax::Object* ref, TextField::EventType eventType) { handleUIEvent(handler, ref, (int)eventType); }); ScriptHandlerMgr::getInstance()->addCustomHandler((void*)self, handler); return 0; @@ -554,7 +554,7 @@ static int axlua_PageView_addEventListener(lua_State* L) } #endif LUA_FUNCTION handler = (toluafix_ref_function(L, 2, 0)); - auto pageViewHandler = [=](ax::Ref* ref, PageView::EventType eventType) { + auto pageViewHandler = [=](ax::Object* ref, PageView::EventType eventType) { handleUIEvent(handler, ref, (int)eventType); }; self->addEventListener((PageView::ccPageViewCallback)pageViewHandler); @@ -621,7 +621,7 @@ static int axlua_ScrollView_addEventListener(lua_State* L) LUA_FUNCTION handler = (toluafix_ref_function(L, 2, 0)); self->addEventListener( - [=](ax::Ref* ref, ScrollView::EventType eventType) { handleUIEvent(handler, ref, (int)eventType); }); + [=](ax::Object* ref, ScrollView::EventType eventType) { handleUIEvent(handler, ref, (int)eventType); }); ScriptHandlerMgr::getInstance()->addCustomHandler((void*)self, handler); return 0; @@ -684,7 +684,7 @@ static int axlua_ListView_addEventListener(lua_State* L) #endif LUA_FUNCTION handler = (toluafix_ref_function(L, 2, 0)); - auto listViewCallback = [=](ax::Ref* ref, ListView::EventType eventType) { + auto listViewCallback = [=](ax::Object* ref, ListView::EventType eventType) { handleUIEvent(handler, ref, (int)eventType); }; self->addEventListener((ui::ListView::ccListViewCallback)listViewCallback); @@ -739,7 +739,7 @@ static int axlua_ListView_addScrollViewEventListener(lua_State* L) #endif LUA_FUNCTION handler = (toluafix_ref_function(L, 2, 0)); - auto scrollViewCallback = [=](ax::Ref* ref, ui::ScrollView::EventType eventType) { + auto scrollViewCallback = [=](ax::Object* ref, ui::ScrollView::EventType eventType) { handleUIEvent(handler, ref, (int)eventType); }; self->addEventListener((ui::ScrollView::ccScrollViewCallback)scrollViewCallback); diff --git a/extensions/scripting/lua-bindings/manual/ui/axlua_video_manual.cpp b/extensions/scripting/lua-bindings/manual/ui/axlua_video_manual.cpp index a751463f229e..8de14372e862 100644 --- a/extensions/scripting/lua-bindings/manual/ui/axlua_video_manual.cpp +++ b/extensions/scripting/lua-bindings/manual/ui/axlua_video_manual.cpp @@ -65,10 +65,10 @@ static int axlua_video_VideoPlayer_addEventListener(lua_State* L) LUA_FUNCTION handler = (toluafix_ref_function(L, 2, 0)); - self->addEventListener([=](ax::Ref* ref, ax::ui::VideoPlayer::EventType eventType) { + self->addEventListener([=](ax::Object* ref, ax::ui::VideoPlayer::EventType eventType) { LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); - stack->pushObject(ref, "ax.Ref"); + stack->pushObject(ref, "ax.Object"); stack->pushInt((int)eventType); stack->executeFunctionByHandler(handler, 2); diff --git a/tests/cpp-tests/Source/BaseTest.cpp b/tests/cpp-tests/Source/BaseTest.cpp index 123dc41ed422..5c6873af8e80 100644 --- a/tests/cpp-tests/Source/BaseTest.cpp +++ b/tests/cpp-tests/Source/BaseTest.cpp @@ -206,7 +206,7 @@ void TestList::runThisTest() else { // Add close and "Start AutoTest" button. - auto closeItem = MenuItemImage::create(s_pathClose, s_pathClose, [](Ref* sender) { + auto closeItem = MenuItemImage::create(s_pathClose, s_pathClose, [](Object* sender) { TestController::getInstance()->stopAutoTest(); TestController::destroyInstance(); Director::getInstance()->end(); @@ -215,7 +215,7 @@ void TestList::runThisTest() auto autoTestLabel = Label::createWithTTF("Start AutoTest", "fonts/arial.ttf", 16); auto autoTestItem = - MenuItemLabel::create(autoTestLabel, [&](Ref* sender) { TestController::getInstance()->startAutoTest(); }); + MenuItemLabel::create(autoTestLabel, [&](Object* sender) { TestController::getInstance()->startAutoTest(); }); autoTestItem->setPosition(Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y + 50)); auto menu = Menu::create(closeItem, autoTestItem, nullptr); @@ -494,7 +494,7 @@ void TestCase::onExit() Scene::onExit(); } -void TestCase::restartTestCallback(Ref* sender) +void TestCase::restartTestCallback(Object* sender) { if (_testSuite) { @@ -502,7 +502,7 @@ void TestCase::restartTestCallback(Ref* sender) } } -void TestCase::nextTestCallback(Ref* sender) +void TestCase::nextTestCallback(Object* sender) { if (_testSuite) { @@ -510,7 +510,7 @@ void TestCase::nextTestCallback(Ref* sender) } } -void TestCase::priorTestCallback(Ref* sender) +void TestCase::priorTestCallback(Object* sender) { if (_testSuite) { @@ -518,7 +518,7 @@ void TestCase::priorTestCallback(Ref* sender) } } -void TestCase::onBackCallback(Ref* sender) +void TestCase::onBackCallback(Object* sender) { if (_testSuite) { diff --git a/tests/cpp-tests/Source/BaseTest.h b/tests/cpp-tests/Source/BaseTest.h index f8fa54d10d6e..f1c95d030e2e 100644 --- a/tests/cpp-tests/Source/BaseTest.h +++ b/tests/cpp-tests/Source/BaseTest.h @@ -76,10 +76,10 @@ class TestCase : public ax::Scene virtual std::string getActualOutput() const { return ""; } /** Callback functions.*/ - virtual void restartTestCallback(ax::Ref* sender); - virtual void nextTestCallback(ax::Ref* sender); - virtual void priorTestCallback(ax::Ref* sender); - virtual void onBackCallback(ax::Ref* sender); + virtual void restartTestCallback(ax::Object* sender); + virtual void nextTestCallback(ax::Object* sender); + virtual void priorTestCallback(ax::Object* sender); + virtual void onBackCallback(ax::Object* sender); /** * You should NEVER call this method, unless you know what you are doing. @@ -125,7 +125,7 @@ class TestCase : public ax::Scene * * @note You should not inherit from TestBase directly. */ -class TestBase : public ax::Ref +class TestBase : public ax::Object { public: virtual ~TestBase(); @@ -248,9 +248,9 @@ class BaseTest : public ax::Layer virtual std::string title() const { return ""; } virtual std::string subtitle() const { return ""; } - virtual void restartCallback(ax::Ref* sender) {} - virtual void nextCallback(ax::Ref* sender) {} - virtual void backCallback(ax::Ref* sender) {} + virtual void restartCallback(ax::Object* sender) {} + virtual void nextCallback(ax::Object* sender) {} + virtual void backCallback(ax::Object* sender) {} virtual void onEnter() override {} virtual void onExit() override {} diff --git a/tests/cpp-tests/Source/BillBoardTest/BillBoardTest.cpp b/tests/cpp-tests/Source/BillBoardTest/BillBoardTest.cpp index 45e59b23bcca..4c1f8748c0b4 100644 --- a/tests/cpp-tests/Source/BillBoardTest/BillBoardTest.cpp +++ b/tests/cpp-tests/Source/BillBoardTest/BillBoardTest.cpp @@ -199,7 +199,7 @@ BillBoardTest::BillBoardTest() : _camera(nullptr) schedule(AX_SCHEDULE_SELECTOR(BillBoardTest::update)); } -void BillBoardTest::menuCallback_orientedPoint(Ref* sender) +void BillBoardTest::menuCallback_orientedPoint(Object* sender) { for (auto&& billboard : _billboards) { @@ -207,7 +207,7 @@ void BillBoardTest::menuCallback_orientedPoint(Ref* sender) } } -void BillBoardTest::menuCallback_orientedPlane(Ref* sender) +void BillBoardTest::menuCallback_orientedPlane(Object* sender) { for (auto&& billboard : _billboards) { @@ -296,7 +296,7 @@ void BillBoardTest::onTouchesMoved(const std::vector& touches, Event* ev } } -void BillBoardTest::rotateCameraCallback(Ref* sender, float value) +void BillBoardTest::rotateCameraCallback(Object* sender, float value) { Vec3 rotation3D = _camera->getRotation3D(); rotation3D.y += value; diff --git a/tests/cpp-tests/Source/BillBoardTest/BillBoardTest.h b/tests/cpp-tests/Source/BillBoardTest/BillBoardTest.h index f7005f7caae7..01e4007ae046 100644 --- a/tests/cpp-tests/Source/BillBoardTest/BillBoardTest.h +++ b/tests/cpp-tests/Source/BillBoardTest/BillBoardTest.h @@ -57,11 +57,11 @@ class BillBoardTest : public TestCase virtual void update(float dt) override; void addNewBillBoardWithCoords(ax::Vec3 p); void addNewAniBillBoardWithCoords(ax::Vec3 p); - void rotateCameraCallback(ax::Ref* sender, float value); + void rotateCameraCallback(ax::Object* sender, float value); void onTouchesMoved(const std::vector& touches, ax::Event* event); - void menuCallback_orientedPoint(ax::Ref* sender); - void menuCallback_orientedPlane(ax::Ref* sender); + void menuCallback_orientedPoint(ax::Object* sender); + void menuCallback_orientedPlane(ax::Object* sender); protected: ax::Camera* _camera; diff --git a/tests/cpp-tests/Source/Box2DTest/Box2dTest.cpp b/tests/cpp-tests/Source/Box2DTest/Box2dTest.cpp index caeeeb2b3509..e33872de303e 100644 --- a/tests/cpp-tests/Source/Box2DTest/Box2dTest.cpp +++ b/tests/cpp-tests/Source/Box2DTest/Box2dTest.cpp @@ -110,7 +110,7 @@ Box2DTest::~Box2DTest() AX_SAFE_DELETE(world); } -void Box2DTest::toggleDebugCallback(Ref* sender) +void Box2DTest::toggleDebugCallback(Object* sender) { showDebugDraw = !showDebugDraw; drawBox2D->clear(); @@ -247,7 +247,7 @@ void Box2DTest::initPhysics() void Box2DTest::createResetButton() { auto reset = MenuItemImage::create("Images/r1.png", "Images/r2.png", - [&](Ref* sender) { getTestSuite()->restartCurrTest(); }); + [&](Object* sender) { getTestSuite()->restartCurrTest(); }); auto menu = Menu::create(reset, nullptr); diff --git a/tests/cpp-tests/Source/Box2DTest/Box2dTest.h b/tests/cpp-tests/Source/Box2DTest/Box2dTest.h index 626ec2d5971a..c0c65420befb 100644 --- a/tests/cpp-tests/Source/Box2DTest/Box2dTest.h +++ b/tests/cpp-tests/Source/Box2DTest/Box2dTest.h @@ -51,7 +51,7 @@ class Box2DTest : public TestCase void update(float dt) override; void onTouchesEnded(const std::vector& touches, ax::Event* event); - void toggleDebugCallback(ax::Ref* sender); + void toggleDebugCallback(ax::Object* sender); private: b2World* world; diff --git a/tests/cpp-tests/Source/BugsTest/Bug-1159.cpp b/tests/cpp-tests/Source/BugsTest/Bug-1159.cpp index 29ea976028d5..1091cf50f7ba 100644 --- a/tests/cpp-tests/Source/BugsTest/Bug-1159.cpp +++ b/tests/cpp-tests/Source/BugsTest/Bug-1159.cpp @@ -62,7 +62,7 @@ bool Bug1159Layer::init() return false; } -void Bug1159Layer::callBack(Ref* sender) +void Bug1159Layer::callBack(Object* sender) { Director::getInstance()->replaceScene(TransitionPageTurn::create(1.0f, Bug1159Layer::create(), false)); } diff --git a/tests/cpp-tests/Source/BugsTest/Bug-1159.h b/tests/cpp-tests/Source/BugsTest/Bug-1159.h index db5b0c6e35ec..bc7874e882d4 100644 --- a/tests/cpp-tests/Source/BugsTest/Bug-1159.h +++ b/tests/cpp-tests/Source/BugsTest/Bug-1159.h @@ -34,7 +34,7 @@ class Bug1159Layer : public BugsTestBase virtual void onExit() override; virtual std::string title() const override { return "Bug1159"; } - void callBack(ax::Ref* sender); + void callBack(ax::Object* sender); CREATE_FUNC(Bug1159Layer); }; diff --git a/tests/cpp-tests/Source/BugsTest/Bug-422.cpp b/tests/cpp-tests/Source/BugsTest/Bug-422.cpp index ee8681337670..bc4b1b327ad1 100644 --- a/tests/cpp-tests/Source/BugsTest/Bug-422.cpp +++ b/tests/cpp-tests/Source/BugsTest/Bug-422.cpp @@ -81,7 +81,7 @@ void Bug422Layer::check(Node* t) } } -void Bug422Layer::menuCallback(Ref* sender) +void Bug422Layer::menuCallback(Object* sender) { reset(); } diff --git a/tests/cpp-tests/Source/BugsTest/Bug-422.h b/tests/cpp-tests/Source/BugsTest/Bug-422.h index ec3d2d8a582d..c93d0f0a8c78 100644 --- a/tests/cpp-tests/Source/BugsTest/Bug-422.h +++ b/tests/cpp-tests/Source/BugsTest/Bug-422.h @@ -37,7 +37,7 @@ class Bug422Layer : public BugsTestBase void reset(); void check(Node* target); - void menuCallback(ax::Ref* sender); + void menuCallback(ax::Object* sender); }; #endif // __BUG_422_H__ diff --git a/tests/cpp-tests/Source/BugsTest/Bug-458/Bug-458.cpp b/tests/cpp-tests/Source/BugsTest/Bug-458/Bug-458.cpp index aab6a6ed394b..a0101ffb20c1 100644 --- a/tests/cpp-tests/Source/BugsTest/Bug-458/Bug-458.cpp +++ b/tests/cpp-tests/Source/BugsTest/Bug-458/Bug-458.cpp @@ -66,7 +66,7 @@ bool Bug458Layer::init() return false; } -void Bug458Layer::selectAnswer(Ref* sender) +void Bug458Layer::selectAnswer(Object* sender) { ax::print("Selected"); } diff --git a/tests/cpp-tests/Source/BugsTest/Bug-458/Bug-458.h b/tests/cpp-tests/Source/BugsTest/Bug-458/Bug-458.h index 2a9fccc1232b..d99dd7ba1516 100644 --- a/tests/cpp-tests/Source/BugsTest/Bug-458/Bug-458.h +++ b/tests/cpp-tests/Source/BugsTest/Bug-458/Bug-458.h @@ -33,7 +33,7 @@ class Bug458Layer : public BugsTestBase CREATE_FUNC(Bug458Layer); virtual bool init() override; - void selectAnswer(ax::Ref* sender); + void selectAnswer(ax::Object* sender); }; #endif // __BUG_458_H__ diff --git a/tests/cpp-tests/Source/BugsTest/Bug-914.cpp b/tests/cpp-tests/Source/BugsTest/Bug-914.cpp index f352c01bf489..20ea1d732551 100644 --- a/tests/cpp-tests/Source/BugsTest/Bug-914.cpp +++ b/tests/cpp-tests/Source/BugsTest/Bug-914.cpp @@ -81,7 +81,7 @@ void Bug914Layer::onTouchesBegan(const std::vector& touches, Event* even onTouchesMoved(touches, event); } -void Bug914Layer::restart(Ref* sender) +void Bug914Layer::restart(Object* sender) { Director::getInstance()->replaceScene(Bug914Layer::create()); } diff --git a/tests/cpp-tests/Source/BugsTest/Bug-914.h b/tests/cpp-tests/Source/BugsTest/Bug-914.h index 0ec252998d13..38297e983eb7 100644 --- a/tests/cpp-tests/Source/BugsTest/Bug-914.h +++ b/tests/cpp-tests/Source/BugsTest/Bug-914.h @@ -35,7 +35,7 @@ class Bug914Layer : public BugsTestBase void onTouchesMoved(const std::vector& touches, ax::Event* event); void onTouchesBegan(const std::vector& touches, ax::Event* event); - void restart(ax::Ref* sender); + void restart(ax::Object* sender); CREATE_FUNC(Bug914Layer); }; diff --git a/tests/cpp-tests/Source/BugsTest/Bug-Child.cpp b/tests/cpp-tests/Source/BugsTest/Bug-Child.cpp index 124b75efff7a..3fea8981d423 100644 --- a/tests/cpp-tests/Source/BugsTest/Bug-Child.cpp +++ b/tests/cpp-tests/Source/BugsTest/Bug-Child.cpp @@ -67,7 +67,7 @@ bool BugChild::init() return false; } -void BugChild::switchChild(Ref* sender) +void BugChild::switchChild(Object* sender) { if (parent1->getChildrenCount() > 0) { @@ -125,7 +125,7 @@ bool BugCameraMask::init() return true; } -void BugCameraMask::switchSpriteFlag(Ref* sender) +void BugCameraMask::switchSpriteFlag(Object* sender) { if ((unsigned short)CameraFlag::USER1 == _sprite->getCameraMask()) { diff --git a/tests/cpp-tests/Source/BugsTest/Bug-Child.h b/tests/cpp-tests/Source/BugsTest/Bug-Child.h index 89d6cf7bae56..feafc684acef 100644 --- a/tests/cpp-tests/Source/BugsTest/Bug-Child.h +++ b/tests/cpp-tests/Source/BugsTest/Bug-Child.h @@ -43,7 +43,7 @@ class BugChild : public BugsTestBase virtual bool init() override; virtual std::string title() const override { return "BugChild"; } - void switchChild(ax::Ref* sender); + void switchChild(ax::Object* sender); protected: ax::Sprite* parent1; @@ -62,7 +62,7 @@ class BugCameraMask : public BugsTestBase virtual bool init() override; virtual std::string title() const override { return "BugCameraMask"; } - void switchSpriteFlag(ax::Ref* sender); + void switchSpriteFlag(ax::Object* sender); void updateSpriteMaskLabel(); Node* _sprite; ax::Label* _spriteMaskLabel; diff --git a/tests/cpp-tests/Source/Camera3DTest/Camera3DTest.cpp b/tests/cpp-tests/Source/Camera3DTest/Camera3DTest.cpp index 68456d04e155..ab0e4e068257 100644 --- a/tests/cpp-tests/Source/Camera3DTest/Camera3DTest.cpp +++ b/tests/cpp-tests/Source/Camera3DTest/Camera3DTest.cpp @@ -199,7 +199,7 @@ std::string Camera3DTestDemo::title() const return "Testing Camera"; } -void Camera3DTestDemo::scaleCameraCallback(Ref* sender, float value) +void Camera3DTestDemo::scaleCameraCallback(Object* sender, float value) { if (_camera && _cameraType != CameraType::FirstPerson) { @@ -208,7 +208,7 @@ void Camera3DTestDemo::scaleCameraCallback(Ref* sender, float value) _camera->setPosition3D(cameraPos); } } -void Camera3DTestDemo::rotateCameraCallback(Ref* sender, float value) +void Camera3DTestDemo::rotateCameraCallback(Object* sender, float value) { if (_cameraType == CameraType::Free || _cameraType == CameraType::FirstPerson) { @@ -217,7 +217,7 @@ void Camera3DTestDemo::rotateCameraCallback(Ref* sender, float value) _camera->setRotation3D(rotation3D); } } -void Camera3DTestDemo::SwitchViewCallback(Ref* sender, CameraType cameraType) +void Camera3DTestDemo::SwitchViewCallback(Object* sender, CameraType cameraType) { if (_cameraType == cameraType) { @@ -829,7 +829,7 @@ void CameraCullingDemo::reachEndCallBack() _cameraFirst->runAction(seq); } -void CameraCullingDemo::switchViewCallback(Ref* sender) +void CameraCullingDemo::switchViewCallback(Object* sender) { auto s = Director::getInstance()->getWinSize(); @@ -872,7 +872,7 @@ void CameraCullingDemo::switchViewCallback(Ref* sender) } } -void CameraCullingDemo::addMeshCallback(Ref* sender) +void CameraCullingDemo::addMeshCallback(Object* sender) { _layer3D->removeAllChildren(); _objects.clear(); @@ -900,7 +900,7 @@ void CameraCullingDemo::addMeshCallback(Ref* sender) _labelMeshCount->setString(szText); } -void CameraCullingDemo::delMeshCallback(Ref* sender) +void CameraCullingDemo::delMeshCallback(Object* sender) { if (_row == 0) return; @@ -1170,7 +1170,7 @@ void CameraArcBallDemo::updateCameraTransform() _camera->setNodeToParentTransform(result); } -void CameraArcBallDemo::switchOperateCallback(Ref* sender) +void CameraArcBallDemo::switchOperateCallback(Object* sender) { if (_operate == OperateCamType::MoveCamera) { @@ -1182,7 +1182,7 @@ void CameraArcBallDemo::switchOperateCallback(Ref* sender) } } -void CameraArcBallDemo::switchTargetCallback(Ref* sender) +void CameraArcBallDemo::switchTargetCallback(Object* sender) { if (_target == 0) { @@ -1321,7 +1321,7 @@ void FogTestDemo::onEnter() #endif } -void FogTestDemo::switchTypeCallback(Ref* sender, int type) +void FogTestDemo::switchTypeCallback(Object* sender, int type) { if (type == 0) { @@ -1526,7 +1526,7 @@ void BackgroundColorBrushTest::onEnter() slider->loadProgressBarTexture("cocosui/sliderProgress.png"); slider->setPosition(Vec2(s.width / 2, s.height / 4)); slider->setPercent(50); - slider->addEventListener([slider, colorBrush](Ref*, ui::Slider::EventType) { + slider->addEventListener([slider, colorBrush](Object*, ui::Slider::EventType) { colorBrush->setColor(Color4F(.1f, .1f, 1.f, (float)slider->getPercent() / 100.f)); }); addChild(slider); diff --git a/tests/cpp-tests/Source/Camera3DTest/Camera3DTest.h b/tests/cpp-tests/Source/Camera3DTest/Camera3DTest.h index f4a235a63c5c..276ce50ac1cd 100644 --- a/tests/cpp-tests/Source/Camera3DTest/Camera3DTest.h +++ b/tests/cpp-tests/Source/Camera3DTest/Camera3DTest.h @@ -118,9 +118,9 @@ class Camera3DTestDemo : public CameraBaseTest void onTouchesMoved(const std::vector& touches, ax::Event* event); void onTouchesEnded(const std::vector& touches, ax::Event* event); - void scaleCameraCallback(ax::Ref* sender, float value); - void rotateCameraCallback(ax::Ref* sender, float value); - void SwitchViewCallback(ax::Ref* sender, CameraType cameraType); + void scaleCameraCallback(ax::Object* sender, float value); + void rotateCameraCallback(ax::Object* sender, float value); + void SwitchViewCallback(ax::Object* sender, CameraType cameraType); void updateCamera(float fDelta); void move3D(float elapsedTime); void updateState(float elapsedTime); @@ -174,9 +174,9 @@ class CameraCullingDemo : public CameraBaseTest // overrides virtual std::string title() const override; void reachEndCallBack(); - void switchViewCallback(ax::Ref* sender); - void addMeshCallback(ax::Ref* sender); - void delMeshCallback(ax::Ref* sender); + void switchViewCallback(ax::Object* sender); + void addMeshCallback(ax::Object* sender); + void delMeshCallback(ax::Object* sender); void drawCameraFrustum(); @@ -208,8 +208,8 @@ class CameraArcBallDemo : public CameraBaseTest // overrides virtual std::string title() const override; - void switchOperateCallback(ax::Ref* sender); - void switchTargetCallback(ax::Ref* sender); + void switchOperateCallback(ax::Object* sender); + void switchTargetCallback(ax::Object* sender); void onTouchsMoved(const std::vector& touchs, ax::Event* event); void updateCameraTransform(); void calculateArcBall(ax::Vec3& axis, @@ -252,7 +252,7 @@ class FogTestDemo : public CameraBaseTest void onTouchesMoved(const std::vector& touches, ax::Event* event); - void switchTypeCallback(ax::Ref* sender, int type); + void switchTypeCallback(ax::Object* sender, int type); protected: CameraType _cameraType = CameraType::Free; diff --git a/tests/cpp-tests/Source/ChipmunkTest/ChipmunkTest.cpp b/tests/cpp-tests/Source/ChipmunkTest/ChipmunkTest.cpp index 3a6f38dff034..88fcff7374d1 100644 --- a/tests/cpp-tests/Source/ChipmunkTest/ChipmunkTest.cpp +++ b/tests/cpp-tests/Source/ChipmunkTest/ChipmunkTest.cpp @@ -97,7 +97,7 @@ ChipmunkTest::ChipmunkTest() scheduleUpdate(); } -void ChipmunkTest::toggleDebugCallback(Ref* sender) +void ChipmunkTest::toggleDebugCallback(Object* sender) { _debugLayer->setVisible(!_debugLayer->isVisible()); } @@ -197,7 +197,7 @@ void ChipmunkTest::createResetButton() this->addChild(menu, -1); } -void ChipmunkTest::reset(Ref* sender) +void ChipmunkTest::reset(Object* sender) { getTestSuite()->restartCurrTest(); } diff --git a/tests/cpp-tests/Source/ChipmunkTest/ChipmunkTest.h b/tests/cpp-tests/Source/ChipmunkTest/ChipmunkTest.h index 479afcbb92b0..7519eeb4f8f9 100644 --- a/tests/cpp-tests/Source/ChipmunkTest/ChipmunkTest.h +++ b/tests/cpp-tests/Source/ChipmunkTest/ChipmunkTest.h @@ -44,11 +44,11 @@ class ChipmunkTest : public TestCase void onEnter() override; void initPhysics(); void createResetButton(); - void reset(ax::Ref* sender); + void reset(ax::Object* sender); void addNewSpriteAtPosition(ax::Vec2 p); void update(float dt) override; - void toggleDebugCallback(ax::Ref* sender); + void toggleDebugCallback(ax::Object* sender); void onTouchesEnded(const std::vector& touches, ax::Event* event); virtual void onAcceleration(ax::Acceleration* acc, ax::Event* event); diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/ChipmunkTestBed.cpp b/tests/cpp-tests/Source/ChipmunkTestBed/ChipmunkTestBed.cpp index 0d5b1f23b0b8..c71cae965cb2 100644 --- a/tests/cpp-tests/Source/ChipmunkTestBed/ChipmunkTestBed.cpp +++ b/tests/cpp-tests/Source/ChipmunkTestBed/ChipmunkTestBed.cpp @@ -410,7 +410,7 @@ void ChipmunkTestBed::createResetButton() this->addChild(menu, -1); } -void ChipmunkTestBed::reset(Ref* sender) +void ChipmunkTestBed::reset(Object* sender) { ChipmunkDemoFreeSpaceChildren(_space); getTestSuite()->restartCurrTest(); @@ -785,12 +785,12 @@ void BenchDemo::onEnter() { ChipmunkTestBed::onEnter(); - auto itemPrev = MenuItemImage::create("Images/b1.png", "Images/b2.png", [&](Ref* sender) { + auto itemPrev = MenuItemImage::create("Images/b1.png", "Images/b2.png", [&](Object* sender) { bench = (bench > 0) ? bench - 1 : (bench_count - 1); reset(sender); }); - auto itemNext = MenuItemImage::create("Images/f1.png", "Images/f2.png", [&](Ref* sender) { + auto itemNext = MenuItemImage::create("Images/f1.png", "Images/f2.png", [&](Object* sender) { bench = (bench < (bench_count - 1)) ? bench + 1 : 0; reset(sender); }); diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/ChipmunkTestBed.h b/tests/cpp-tests/Source/ChipmunkTestBed/ChipmunkTestBed.h index 6eba6ad607b2..11f40b310e5a 100644 --- a/tests/cpp-tests/Source/ChipmunkTestBed/ChipmunkTestBed.h +++ b/tests/cpp-tests/Source/ChipmunkTestBed/ChipmunkTestBed.h @@ -43,7 +43,7 @@ class ChipmunkTestBed : public TestCase void onEnter() override; void createResetButton(); - void reset(ax::Ref* sender); + void reset(ax::Object* sender); void update(float dt) override; virtual void initPhysics(); diff --git a/tests/cpp-tests/Source/ClippingNodeTest/ClippingNodeTest.cpp b/tests/cpp-tests/Source/ClippingNodeTest/ClippingNodeTest.cpp index 2ca3bb591cad..bfd8fd20cd4e 100644 --- a/tests/cpp-tests/Source/ClippingNodeTest/ClippingNodeTest.cpp +++ b/tests/cpp-tests/Source/ClippingNodeTest/ClippingNodeTest.cpp @@ -820,7 +820,7 @@ std::string ClippingToRenderTextureTest::subtitle() const void ClippingToRenderTextureTest::setup() { - auto button = MenuItemFont::create("Reproduce bug", [&](Ref* sender) { + auto button = MenuItemFont::create("Reproduce bug", [&](Object* sender) { std::vector nodes; enumerateChildren("remove me [0-9]", [&](Node* node) { nodes.emplace_back(node); @@ -1010,7 +1010,7 @@ void ClippingNodePerformanceTest::setup() MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(65); - auto increase = MenuItemFont::create(" + ", [=] (Ref*) -> void { + auto increase = MenuItemFont::create(" + ", [=] (Object*) -> void { addClippingNode(10); }); increase->setColor(Color3B(0, 200, 20)); diff --git a/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.cpp b/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.cpp index bdaa5ba47922..8cff2b541e42 100644 --- a/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.cpp +++ b/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.cpp @@ -276,7 +276,7 @@ IndividualThicknessTest::IndividualThicknessTest() scheduleUpdate(); } -void IndividualThicknessTest::changeThickness(ax::Ref* pSender, ax::ui::Slider::EventType type) +void IndividualThicknessTest::changeThickness(ax::Object* pSender, ax::ui::Slider::EventType type) { if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -417,7 +417,7 @@ DrawPieTest::DrawPieTest() scheduleUpdate(); } -void DrawPieTest::changeEndAngle(ax::Ref* pSender, ax::ui::Slider::EventType type) +void DrawPieTest::changeEndAngle(ax::Object* pSender, ax::ui::Slider::EventType type) { if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -427,7 +427,7 @@ void DrawPieTest::changeEndAngle(ax::Ref* pSender, ax::ui::Slider::EventType typ } } -void DrawPieTest::changeStartAngle(ax::Ref* pSender, ax::ui::Slider::EventType type) +void DrawPieTest::changeStartAngle(ax::Object* pSender, ax::ui::Slider::EventType type) { if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -437,7 +437,7 @@ void DrawPieTest::changeStartAngle(ax::Ref* pSender, ax::ui::Slider::EventType t } } -void DrawPieTest::changeRotation(ax::Ref* pSender, ax::ui::Slider::EventType type) +void DrawPieTest::changeRotation(ax::Object* pSender, ax::ui::Slider::EventType type) { if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -447,7 +447,7 @@ void DrawPieTest::changeRotation(ax::Ref* pSender, ax::ui::Slider::EventType typ } } -void DrawPieTest::changeThickness(ax::Ref* pSender, ax::ui::Slider::EventType type) +void DrawPieTest::changeThickness(ax::Object* pSender, ax::ui::Slider::EventType type) { if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -773,7 +773,7 @@ ax::ui::Slider* DrawNodePart1Test::createSlider() return slider; } -void DrawNodePart1Test::listviewCallback(ax::Ref* sender, ax::ui::ListView::EventType type) +void DrawNodePart1Test::listviewCallback(ax::Object* sender, ax::ui::ListView::EventType type) { // clear all text to white auto listview = static_cast(sender); @@ -786,7 +786,7 @@ void DrawNodePart1Test::listviewCallback(ax::Ref* sender, ax::ui::ListView::Even isDirty = true; } -void DrawNodePart1Test::sliderCallback(ax::Ref* sender, ax::ui::Slider::EventType type) +void DrawNodePart1Test::sliderCallback(ax::Object* sender, ax::ui::Slider::EventType type) { if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -1099,7 +1099,7 @@ ax::ui::Slider* DrawNodePart2Test::createSlider() return slider; } -void DrawNodePart2Test::listviewCallback(ax::Ref* sender, ax::ui::ListView::EventType type) +void DrawNodePart2Test::listviewCallback(ax::Object* sender, ax::ui::ListView::EventType type) { // clear all text to white auto listview = static_cast(sender); @@ -1111,7 +1111,7 @@ void DrawNodePart2Test::listviewCallback(ax::Ref* sender, ax::ui::ListView::Even listview->getItem(_currentSeletedItemIndex)->setColor(ax::Color3B::RED); } -void DrawNodePart2Test::sliderCallback(ax::Ref* sender, ax::ui::Slider::EventType type) +void DrawNodePart2Test::sliderCallback(ax::Object* sender, ax::ui::Slider::EventType type) { if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { diff --git a/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.h b/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.h index b2bbf9eb985b..50cee555f968 100644 --- a/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.h +++ b/tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.h @@ -72,8 +72,8 @@ class IndividualThicknessTest : public DrawNodeExBaseTest void update(float dt); void initSliders(); - void changeThickness(ax::Ref* pSender, ax::ui::Slider::EventType type); - // void changeLineWidth(Ref* pSender, ax::ui::Slider::EventType type); + void changeThickness(ax::Object* pSender, ax::ui::Slider::EventType type); + // void changeLineWidth(Object* pSender, ax::ui::Slider::EventType type); private: ax::extension::DrawNodeEx* drawNodeEx; @@ -123,10 +123,10 @@ class DrawPieTest : public DrawNodeExBaseTest void update(float dt); void initSliders(); - void changeStartAngle(ax::Ref* pSender, ax::ui::Slider::EventType type); - void changeEndAngle(ax::Ref* pSender, ax::ui::Slider::EventType type); - void changeRotation(ax::Ref* pSender, ax::ui::Slider::EventType type); - void changeThickness(ax::Ref* pSender, ax::ui::Slider::EventType type); + void changeStartAngle(ax::Object* pSender, ax::ui::Slider::EventType type); + void changeEndAngle(ax::Object* pSender, ax::ui::Slider::EventType type); + void changeRotation(ax::Object* pSender, ax::ui::Slider::EventType type); + void changeThickness(ax::Object* pSender, ax::ui::Slider::EventType type); private: ax::extension::DrawNodeEx* drawNode; @@ -151,8 +151,8 @@ class DrawNodePart1Test : public DrawNodeExBaseTest virtual std::string subtitle() const override; void update(float dt); - void sliderCallback(ax::Ref* sender, ax::ui::Slider::EventType type); - void listviewCallback(ax::Ref* sender, ax::ui::ListView::EventType type); + void sliderCallback(ax::Object* sender, ax::ui::Slider::EventType type); + void listviewCallback(ax::Object* sender, ax::ui::ListView::EventType type); void drawAll(); @@ -181,8 +181,8 @@ class DrawNodePart2Test : public DrawNodeExBaseTest virtual std::string subtitle() const override; void update(float dt); - void sliderCallback(ax::Ref* sender, ax::ui::Slider::EventType type); - void listviewCallback(ax::Ref* sender, ax::ui::ListView::EventType type); + void sliderCallback(ax::Object* sender, ax::ui::Slider::EventType type); + void listviewCallback(ax::Object* sender, ax::ui::ListView::EventType type); void drawAll(); diff --git a/tests/cpp-tests/Source/DrawPrimitivesTest/DrawPrimitivesTest.cpp b/tests/cpp-tests/Source/DrawPrimitivesTest/DrawPrimitivesTest.cpp index b153cdd3b6ee..0807466c9993 100644 --- a/tests/cpp-tests/Source/DrawPrimitivesTest/DrawPrimitivesTest.cpp +++ b/tests/cpp-tests/Source/DrawPrimitivesTest/DrawPrimitivesTest.cpp @@ -296,7 +296,7 @@ BetterCircleRendering::BetterCircleRendering() scheduleUpdate(); } -void BetterCircleRendering::changeLineWidth(ax::Ref* pSender, ax::ui::Slider::EventType type) +void BetterCircleRendering::changeLineWidth(ax::Object* pSender, ax::ui::Slider::EventType type) { if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -306,7 +306,7 @@ void BetterCircleRendering::changeLineWidth(ax::Ref* pSender, ax::ui::Slider::Ev } } -void BetterCircleRendering::changeThreshold(ax::Ref* pSender, ax::ui::Slider::EventType type) +void BetterCircleRendering::changeThreshold(ax::Object* pSender, ax::ui::Slider::EventType type) { if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -390,7 +390,7 @@ DrawNodeTestNewFeature1::DrawNodeTestNewFeature1() scheduleUpdate(); } -void DrawNodeTestNewFeature1::changeEndAngle(ax::Ref* pSender, ax::ui::Slider::EventType type) +void DrawNodeTestNewFeature1::changeEndAngle(ax::Object* pSender, ax::ui::Slider::EventType type) { if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -400,7 +400,7 @@ void DrawNodeTestNewFeature1::changeEndAngle(ax::Ref* pSender, ax::ui::Slider::E } } -void DrawNodeTestNewFeature1::changeStartAngle(ax::Ref* pSender, ax::ui::Slider::EventType type) +void DrawNodeTestNewFeature1::changeStartAngle(ax::Object* pSender, ax::ui::Slider::EventType type) { if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -410,7 +410,7 @@ void DrawNodeTestNewFeature1::changeStartAngle(ax::Ref* pSender, ax::ui::Slider: } } -void DrawNodeTestNewFeature1::changeAngle(ax::Ref* pSender, ax::ui::Slider::EventType type) +void DrawNodeTestNewFeature1::changeAngle(ax::Object* pSender, ax::ui::Slider::EventType type) { if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { diff --git a/tests/cpp-tests/Source/DrawPrimitivesTest/DrawPrimitivesTest.h b/tests/cpp-tests/Source/DrawPrimitivesTest/DrawPrimitivesTest.h index 064c34c39ef3..227549c0f444 100644 --- a/tests/cpp-tests/Source/DrawPrimitivesTest/DrawPrimitivesTest.h +++ b/tests/cpp-tests/Source/DrawPrimitivesTest/DrawPrimitivesTest.h @@ -71,8 +71,8 @@ class BetterCircleRendering : public DrawPrimitivesBaseTest void update(float dt); void initSliders(); - void changeThreshold(Ref* pSender, ax::ui::Slider::EventType type); - void changeLineWidth(Ref* pSender, ax::ui::Slider::EventType type); + void changeThreshold(Object* pSender, ax::ui::Slider::EventType type); + void changeLineWidth(Object* pSender, ax::ui::Slider::EventType type); private: ax::DrawNode* drawNode; @@ -117,9 +117,9 @@ class DrawNodeTestNewFeature1 : public DrawPrimitivesBaseTest void update(float dt); void initSliders(); - void changeStartAngle(Ref* pSender, ax::ui::Slider::EventType type); - void changeEndAngle(Ref* pSender, ax::ui::Slider::EventType type); - void changeAngle(Ref* pSender, ax::ui::Slider::EventType type); + void changeStartAngle(Object* pSender, ax::ui::Slider::EventType type); + void changeEndAngle(Object* pSender, ax::ui::Slider::EventType type); + void changeAngle(Object* pSender, ax::ui::Slider::EventType type); private: ax::DrawNode* drawNode; diff --git a/tests/cpp-tests/Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp b/tests/cpp-tests/Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp index dfb3b16e5b18..fbb364e4188b 100644 --- a/tests/cpp-tests/Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp +++ b/tests/cpp-tests/Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.cpp @@ -114,7 +114,7 @@ void AssetsManagerExLoaderScene::onLoadEnd() backgroundSprite->setPosition(VisibleRect::center()); } -void AssetsManagerExLoaderScene::startDownloadCallback(Ref* sender) +void AssetsManagerExLoaderScene::startDownloadCallback(Object* sender) { removeChild(_downloadMenu); _downloadMenu = nullptr; diff --git a/tests/cpp-tests/Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h b/tests/cpp-tests/Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h index 5d57f0f8820b..d23331c64536 100644 --- a/tests/cpp-tests/Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h +++ b/tests/cpp-tests/Source/ExtensionsTest/AssetsManagerExTest/AssetsManagerExTest.h @@ -37,7 +37,7 @@ class AssetsManagerExLoaderScene : public TestCase AssetsManagerExLoaderScene(int testIndex); - void startDownloadCallback(ax::Ref* sender); + void startDownloadCallback(ax::Object* sender); virtual std::string title() const override; diff --git a/tests/cpp-tests/Source/IntervalTest/IntervalTest.cpp b/tests/cpp-tests/Source/IntervalTest/IntervalTest.cpp index 0f222d6737e5..15b1d4a2c1b1 100644 --- a/tests/cpp-tests/Source/IntervalTest/IntervalTest.cpp +++ b/tests/cpp-tests/Source/IntervalTest/IntervalTest.cpp @@ -121,7 +121,7 @@ IntervalTest::IntervalTest() addChild(sprite); sprite->runAction(RepeatForever::create(Sequence::create(jump, jump->reverse(), nullptr))); // pause button - auto item1 = MenuItemFont::create("Pause", [&](Ref* sender) { + auto item1 = MenuItemFont::create("Pause", [&](Object* sender) { if (Director::getInstance()->isPaused()) Director::getInstance()->resume(); else diff --git a/tests/cpp-tests/Source/LabelTest/LabelTestNew.cpp b/tests/cpp-tests/Source/LabelTest/LabelTestNew.cpp index d04dbfede2dc..1f77795a84c9 100644 --- a/tests/cpp-tests/Source/LabelTest/LabelTestNew.cpp +++ b/tests/cpp-tests/Source/LabelTest/LabelTestNew.cpp @@ -760,7 +760,7 @@ std::string LabelFNTMultiLineAlignment::getItemString(ax::MenuItemFont* item) return str; } -void LabelFNTMultiLineAlignment::stringChanged(ax::Ref* sender) +void LabelFNTMultiLineAlignment::stringChanged(ax::Object* sender) { auto item = (MenuItemFont*)sender; @@ -769,7 +769,7 @@ void LabelFNTMultiLineAlignment::stringChanged(ax::Ref* sender) this->snapArrowsToEdge(); } -void LabelFNTMultiLineAlignment::alignmentChanged(ax::Ref* sender) +void LabelFNTMultiLineAlignment::alignmentChanged(ax::Object* sender) { auto item = static_cast(sender); @@ -1095,19 +1095,19 @@ void LabelTTFDynamicAlignment::updateAlignment() } } -void LabelTTFDynamicAlignment::setAlignmentLeft(Ref* sender) +void LabelTTFDynamicAlignment::setAlignmentLeft(Object* sender) { _horizAlign = TextHAlignment::LEFT; this->updateAlignment(); } -void LabelTTFDynamicAlignment::setAlignmentCenter(Ref* sender) +void LabelTTFDynamicAlignment::setAlignmentCenter(Object* sender) { _horizAlign = TextHAlignment::CENTER; this->updateAlignment(); } -void LabelTTFDynamicAlignment::setAlignmentRight(Ref* sender) +void LabelTTFDynamicAlignment::setAlignmentRight(Object* sender) { _horizAlign = TextHAlignment::RIGHT; this->updateAlignment(); @@ -1451,7 +1451,7 @@ void LabelShadowTest::onEnter() addChild(shadowLabelBMFont); } -void LabelShadowTest::sliderEvent(Ref* pSender, ui::Slider::EventType type) +void LabelShadowTest::sliderEvent(Object* pSender, ui::Slider::EventType type) { if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -1711,32 +1711,32 @@ LabelAlignmentTest::LabelAlignmentTest() addChild(_label); } -void LabelAlignmentTest::setAlignmentLeft(Ref* sender) +void LabelAlignmentTest::setAlignmentLeft(Object* sender) { _label->setHorizontalAlignment(TextHAlignment::LEFT); } -void LabelAlignmentTest::setAlignmentCenter(Ref* sender) +void LabelAlignmentTest::setAlignmentCenter(Object* sender) { _label->setHorizontalAlignment(TextHAlignment::CENTER); } -void LabelAlignmentTest::setAlignmentRight(Ref* sender) +void LabelAlignmentTest::setAlignmentRight(Object* sender) { _label->setHorizontalAlignment(TextHAlignment::RIGHT); } -void LabelAlignmentTest::setAlignmentTop(Ref* sender) +void LabelAlignmentTest::setAlignmentTop(Object* sender) { _label->setVerticalAlignment(TextVAlignment::TOP); } -void LabelAlignmentTest::setAlignmentMiddle(Ref* sender) +void LabelAlignmentTest::setAlignmentMiddle(Object* sender) { _label->setVerticalAlignment(TextVAlignment::CENTER); } -void LabelAlignmentTest::setAlignmentBottom(Ref* sender) +void LabelAlignmentTest::setAlignmentBottom(Object* sender) { _label->setVerticalAlignment(TextVAlignment::BOTTOM); } @@ -1824,7 +1824,7 @@ LabelLineHeightTest::LabelLineHeightTest() addChild(slider); } -void LabelLineHeightTest::sliderEvent(Ref* sender, ui::Slider::EventType type) +void LabelLineHeightTest::sliderEvent(Object* sender, ui::Slider::EventType type) { if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -1868,7 +1868,7 @@ LabelAdditionalKerningTest::LabelAdditionalKerningTest() addChild(slider); } -void LabelAdditionalKerningTest::sliderEvent(Ref* sender, ui::Slider::EventType type) +void LabelAdditionalKerningTest::sliderEvent(Object* sender, ui::Slider::EventType type) { if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -2201,7 +2201,7 @@ LabelIssue10688Test::LabelIssue10688Test() auto label = Label::createWithTTF("Glow MenuItemLabel", "fonts/arial.ttf", 30); label->setTextColor(Color4B::RED); label->enableGlow(Color4B::YELLOW); - auto menuItem1 = MenuItemLabel::create(label, [](Ref*) {}); + auto menuItem1 = MenuItemLabel::create(label, [](Object*) {}); menuItem1->setAnchorPoint(Vec2::ANCHOR_MIDDLE_LEFT); menuItem1->setPosition(center.x - label->getContentSize().width / 2, center.y); @@ -2323,7 +2323,7 @@ void LabelLayoutBaseTest::initWrapOption(const ax::Size& size) checkBox->setSelected(true); checkBox->setName("toggleWrap"); - checkBox->addEventListener([=](Ref* ref, CheckBox::EventType event) { + checkBox->addEventListener([=](Object* ref, CheckBox::EventType event) { if (event == CheckBox::EventType::SELECTED) { _label->enableWrap(true); @@ -2354,7 +2354,7 @@ void LabelLayoutBaseTest::initToggleLabelTypeOption(const ax::Size& size) auto stepper = (ControlStepper*)this->getChildByName("stepper"); - checkBox->addEventListener([=](Ref* ref, CheckBox::EventType event) { + checkBox->addEventListener([=](Object* ref, CheckBox::EventType event) { float fontSize = stepper->getValue(); if (event == CheckBox::EventType::SELECTED) @@ -2419,7 +2419,7 @@ void LabelLayoutBaseTest::initSliders(const ax::Size& size) addChild(slider2); auto winSize = Director::getInstance()->getVisibleSize(); - slider->addEventListener([=](Ref* ref, Slider::EventType event) { + slider->addEventListener([=](Object* ref, Slider::EventType event) { float percent = slider->getPercent(); auto labelSize = _label->getContentSize(); auto drawNodeSize = Size(percent / 100.0 * winSize.width, labelSize.height); @@ -2431,7 +2431,7 @@ void LabelLayoutBaseTest::initSliders(const ax::Size& size) this->updateDrawNodeSize(drawNodeSize); }); - slider2->addEventListener([=](Ref* ref, Slider::EventType event) { + slider2->addEventListener([=](Object* ref, Slider::EventType event) { float percent = slider2->getPercent(); auto labelSize = _label->getContentSize(); auto drawNodeSize = Size(labelSize.width, percent / 100.0 * winSize.height); @@ -2465,37 +2465,37 @@ void LabelLayoutBaseTest::initDrawNode(const ax::Size& size) this->updateDrawNodeSize(_label->getContentSize()); } -void LabelLayoutBaseTest::setAlignmentLeft(Ref* sender) +void LabelLayoutBaseTest::setAlignmentLeft(Object* sender) { _label->setHorizontalAlignment(TextHAlignment::LEFT); } -void LabelLayoutBaseTest::setAlignmentCenter(Ref* sender) +void LabelLayoutBaseTest::setAlignmentCenter(Object* sender) { _label->setHorizontalAlignment(TextHAlignment::CENTER); } -void LabelLayoutBaseTest::setAlignmentRight(Ref* sender) +void LabelLayoutBaseTest::setAlignmentRight(Object* sender) { _label->setHorizontalAlignment(TextHAlignment::RIGHT); } -void LabelLayoutBaseTest::setAlignmentTop(Ref* sender) +void LabelLayoutBaseTest::setAlignmentTop(Object* sender) { _label->setVerticalAlignment(TextVAlignment::TOP); } -void LabelLayoutBaseTest::setAlignmentMiddle(Ref* sender) +void LabelLayoutBaseTest::setAlignmentMiddle(Object* sender) { _label->setVerticalAlignment(TextVAlignment::CENTER); } -void LabelLayoutBaseTest::setAlignmentBottom(Ref* sender) +void LabelLayoutBaseTest::setAlignmentBottom(Object* sender) { _label->setVerticalAlignment(TextVAlignment::BOTTOM); } -void LabelLayoutBaseTest::valueChanged(ax::Ref* sender, ax::extension::Control::EventType controlEvent) +void LabelLayoutBaseTest::valueChanged(ax::Object* sender, ax::extension::Control::EventType controlEvent) { ControlStepper* pControl = (ControlStepper*)sender; // Change value of label. @@ -2663,7 +2663,7 @@ LabelResizeTest::LabelResizeTest() slider2->setVisible(false); auto winSize = Director::getInstance()->getVisibleSize(); - slider1->addEventListener([=](Ref* ref, Slider::EventType event) { + slider1->addEventListener([=](Object* ref, Slider::EventType event) { float percent = slider1->getPercent(); auto drawNodeSize = Size(percent / 100.0 * winSize.width, _label->getContentSize().height); if (drawNodeSize.height <= 0) @@ -2690,7 +2690,7 @@ LabelResizeTest::LabelResizeTest() checkBox->setSelected(false); checkBox->setName("LineBreak"); - checkBox->addEventListener([=](Ref* ref, CheckBox::EventType event) { + checkBox->addEventListener([=](Object* ref, CheckBox::EventType event) { if (event == CheckBox::EventType::SELECTED) { _label->setLineBreakWithoutSpace(true); @@ -2729,7 +2729,7 @@ LabelToggleTypeTest::LabelToggleTypeTest() slider2->setVisible(false); auto winSize = Director::getInstance()->getVisibleSize(); - slider1->addEventListener([=](Ref* ref, Slider::EventType event) { + slider1->addEventListener([=](Object* ref, Slider::EventType event) { float percent = slider1->getPercent(); auto drawNodeSize = Size(percent / 100.0 * winSize.width, _label->getContentSize().height); if (drawNodeSize.height <= 0) @@ -2756,7 +2756,7 @@ LabelToggleTypeTest::LabelToggleTypeTest() checkBox->setSelected(false); checkBox->setName("LineBreak"); - checkBox->addEventListener([=](Ref* ref, CheckBox::EventType event) { + checkBox->addEventListener([=](Object* ref, CheckBox::EventType event) { if (event == CheckBox::EventType::SELECTED) { _label->setLineBreakWithoutSpace(true); @@ -2875,7 +2875,7 @@ LabelSystemFontTest::LabelSystemFontTest() auto slider1 = (ui::Slider*)this->getChildByTag(1); auto winSize = Director::getInstance()->getVisibleSize(); - slider1->addEventListener([=](Ref* ref, Slider::EventType event) { + slider1->addEventListener([=](Object* ref, Slider::EventType event) { float percent = slider1->getPercent(); auto drawNodeSize = Size(percent / 100.0 * winSize.width, _label->getContentSize().height); if (drawNodeSize.height <= 0) @@ -2899,7 +2899,7 @@ LabelSystemFontTest::LabelSystemFontTest() checkBox->setSelected(false); checkBox->setName("LineBreak"); - checkBox->addEventListener([=](Ref* ref, CheckBox::EventType event) { + checkBox->addEventListener([=](Object* ref, CheckBox::EventType event) { if (event == CheckBox::EventType::SELECTED) { _label->setLineBreakWithoutSpace(true); @@ -3104,7 +3104,7 @@ LabelItalics::LabelItalics() addChild(_label2a, 0, kTagBitmapAtlas2); _label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 6)); - auto menuItem = MenuItemFont::create("disable italics", [&](ax::Ref* sender) { + auto menuItem = MenuItemFont::create("disable italics", [&](ax::Object* sender) { _label2a->disableEffect(LabelEffect::ITALICS); _label1a->disableEffect(LabelEffect::ITALICS); }); @@ -3156,7 +3156,7 @@ LabelBold::LabelBold() addChild(_label2a, 0, kTagBitmapAtlas2); _label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 6)); - auto menuItem = MenuItemFont::create("disable bold", [&](ax::Ref* sender) { + auto menuItem = MenuItemFont::create("disable bold", [&](ax::Object* sender) { _label2a->disableEffect(LabelEffect::BOLD); _label1a->disableEffect(LabelEffect::BOLD); }); @@ -3208,7 +3208,7 @@ LabelUnderline::LabelUnderline() addChild(_label2a, 0, kTagBitmapAtlas2); _label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 6)); - auto menuItem = MenuItemFont::create("disable underline", [&](ax::Ref* sender) { + auto menuItem = MenuItemFont::create("disable underline", [&](ax::Object* sender) { _label2a->disableEffect(LabelEffect::UNDERLINE); _label1a->disableEffect(LabelEffect::UNDERLINE); }); @@ -3250,7 +3250,7 @@ LabelUnderlineMultiline::LabelUnderlineMultiline() addChild(_label2a, 0, kTagBitmapAtlas2); _label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 3)); - auto menuItem = MenuItemFont::create("disable underline", [&](ax::Ref* sender) { + auto menuItem = MenuItemFont::create("disable underline", [&](ax::Object* sender) { _label2a->disableEffect(LabelEffect::UNDERLINE); _label1a->disableEffect(LabelEffect::UNDERLINE); }); @@ -3292,7 +3292,7 @@ LabelStrikethrough::LabelStrikethrough() addChild(_label2a, 0, kTagBitmapAtlas2); _label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 3)); - auto menuItem = MenuItemFont::create("disable underline", [&](ax::Ref* sender) { + auto menuItem = MenuItemFont::create("disable underline", [&](ax::Object* sender) { _label2a->disableEffect(LabelEffect::STRIKETHROUGH); _label1a->disableEffect(LabelEffect::STRIKETHROUGH); }); diff --git a/tests/cpp-tests/Source/LabelTest/LabelTestNew.h b/tests/cpp-tests/Source/LabelTest/LabelTestNew.h index 420d68c7ef1d..0ffaac833a3e 100644 --- a/tests/cpp-tests/Source/LabelTest/LabelTestNew.h +++ b/tests/cpp-tests/Source/LabelTest/LabelTestNew.h @@ -170,8 +170,8 @@ class LabelFNTMultiLineAlignment : public AtlasDemoNew void snapArrowsToEdge(); virtual std::string title() const override; virtual std::string subtitle() const override; - void stringChanged(ax::Ref* sender); - void alignmentChanged(ax::Ref* sender); + void stringChanged(ax::Object* sender); + void alignmentChanged(ax::Object* sender); void onTouchesBegan(const std::vector& touches, ax::Event* event); void onTouchesEnded(const std::vector& touches, ax::Event* event); void onTouchesMoved(const std::vector& touches, ax::Event* event); @@ -286,9 +286,9 @@ class LabelTTFDynamicAlignment : public AtlasDemoNew virtual std::string subtitle() const override; private: - void setAlignmentLeft(ax::Ref* sender); - void setAlignmentCenter(ax::Ref* sender); - void setAlignmentRight(ax::Ref* sender); + void setAlignmentLeft(ax::Object* sender); + void setAlignmentCenter(ax::Object* sender); + void setAlignmentRight(ax::Object* sender); void updateAlignment(); ax::Label* _label; @@ -374,7 +374,7 @@ class LabelShadowTest : public AtlasDemoNew virtual std::string title() const override; virtual std::string subtitle() const override; - void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); + void sliderEvent(ax::Object* sender, ax::ui::Slider::EventType type); private: ax::Label* shadowLabelOutline; @@ -459,12 +459,12 @@ class LabelAlignmentTest : public AtlasDemoNew virtual std::string subtitle() const override; private: - void setAlignmentLeft(ax::Ref* sender); - void setAlignmentCenter(ax::Ref* sender); - void setAlignmentRight(ax::Ref* sender); - void setAlignmentTop(ax::Ref* sender); - void setAlignmentMiddle(ax::Ref* sender); - void setAlignmentBottom(ax::Ref* sender); + void setAlignmentLeft(ax::Object* sender); + void setAlignmentCenter(ax::Object* sender); + void setAlignmentRight(ax::Object* sender); + void setAlignmentTop(ax::Object* sender); + void setAlignmentMiddle(ax::Object* sender); + void setAlignmentBottom(ax::Object* sender); ax::Label* _label; }; @@ -501,7 +501,7 @@ class LabelLineHeightTest : public AtlasDemoNew virtual std::string title() const override; virtual std::string subtitle() const override; - void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); + void sliderEvent(ax::Object* sender, ax::ui::Slider::EventType type); private: ax::Label* label; @@ -517,7 +517,7 @@ class LabelAdditionalKerningTest : public AtlasDemoNew virtual std::string title() const override; virtual std::string subtitle() const override; - void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); + void sliderEvent(ax::Object* sender, ax::ui::Slider::EventType type); private: ax::Label* label; @@ -706,15 +706,15 @@ class LabelLayoutBaseTest : public AtlasDemoNew LabelLayoutBaseTest(); void updateDrawNodeSize(const ax::Size& drawNodeSize); ax::extension::ControlStepper* makeControlStepper(); - void valueChanged(ax::Ref* sender, ax::extension::Control::EventType controlEvent); + void valueChanged(ax::Object* sender, ax::extension::Control::EventType controlEvent); protected: - void setAlignmentLeft(ax::Ref* sender); - void setAlignmentCenter(ax::Ref* sender); - void setAlignmentRight(ax::Ref* sender); - void setAlignmentTop(ax::Ref* sender); - void setAlignmentMiddle(ax::Ref* sender); - void setAlignmentBottom(ax::Ref* sender); + void setAlignmentLeft(ax::Object* sender); + void setAlignmentCenter(ax::Object* sender); + void setAlignmentRight(ax::Object* sender); + void setAlignmentTop(ax::Object* sender); + void setAlignmentMiddle(ax::Object* sender); + void setAlignmentBottom(ax::Object* sender); void initWrapOption(const ax::Size& size); void initToggleLabelTypeOption(const ax::Size& size); diff --git a/tests/cpp-tests/Source/LayerTest/LayerTest.cpp b/tests/cpp-tests/Source/LayerTest/LayerTest.cpp index b4b183c9950e..1074be21297f 100644 --- a/tests/cpp-tests/Source/LayerTest/LayerTest.cpp +++ b/tests/cpp-tests/Source/LayerTest/LayerTest.cpp @@ -476,7 +476,7 @@ LayerGradientTest::LayerGradientTest() menu->setPosition(Vec2(s.width / 2, 100.0f)); } -void LayerGradientTest::toggleItem(Ref* sender) +void LayerGradientTest::toggleItem(Object* sender) { auto gradient = static_cast(getChildByTag(kTagLayer)); gradient->setCompressedInterpolation(!gradient->isCompressedInterpolation()); @@ -562,7 +562,7 @@ void LayerIgnoreAnchorPointPos::onEnter() menu->setPosition(Vec2(s.width / 2, s.height / 2)); } -void LayerIgnoreAnchorPointPos::onToggle(Ref* pObject) +void LayerIgnoreAnchorPointPos::onToggle(Object* pObject) { auto layer = this->getChildByTag(kLayerIgnoreAnchorPoint); bool ignore = layer->isIgnoreAnchorPointForPosition(); @@ -610,7 +610,7 @@ void LayerIgnoreAnchorPointRot::onEnter() menu->setPosition(Vec2(s.width / 2, s.height / 2)); } -void LayerIgnoreAnchorPointRot::onToggle(Ref* pObject) +void LayerIgnoreAnchorPointRot::onToggle(Object* pObject) { auto layer = this->getChildByTag(kLayerIgnoreAnchorPoint); bool ignore = layer->isIgnoreAnchorPointForPosition(); @@ -661,7 +661,7 @@ void LayerIgnoreAnchorPointScale::onEnter() menu->setPosition(Vec2(s.width / 2, s.height / 2)); } -void LayerIgnoreAnchorPointScale::onToggle(Ref* pObject) +void LayerIgnoreAnchorPointScale::onToggle(Object* pObject) { auto layer = this->getChildByTag(kLayerIgnoreAnchorPoint); bool ignore = layer->isIgnoreAnchorPointForPosition(); @@ -870,7 +870,7 @@ ax::ui::Slider* LayerRadialGradientTest::createSlider() return slider; } -void LayerRadialGradientTest::listviewCallback(ax::Ref* sender, ax::ui::ListView::EventType type) +void LayerRadialGradientTest::listviewCallback(ax::Object* sender, ax::ui::ListView::EventType type) { // clear all text to white auto listview = static_cast(sender); @@ -910,7 +910,7 @@ void LayerRadialGradientTest::listviewCallback(ax::Ref* sender, ax::ui::ListView } } -void LayerRadialGradientTest::sliderCallback(ax::Ref* sender, ax::ui::Slider::EventType type) +void LayerRadialGradientTest::sliderCallback(ax::Object* sender, ax::ui::Slider::EventType type) { auto slider = static_cast(sender); float percent = slider->getPercent() / 100.f; diff --git a/tests/cpp-tests/Source/LayerTest/LayerTest.h b/tests/cpp-tests/Source/LayerTest/LayerTest.h index 1c7cc951dffc..0b96316e5361 100644 --- a/tests/cpp-tests/Source/LayerTest/LayerTest.h +++ b/tests/cpp-tests/Source/LayerTest/LayerTest.h @@ -129,7 +129,7 @@ class LayerGradientTest : public LayerTest void onTouchesMoved(const std::vector& touches, ax::Event* event); virtual std::string title() const override; virtual std::string subtitle() const override; - void toggleItem(ax::Ref* sender); + void toggleItem(ax::Object* sender); }; class LayerGradientTest2 : public LayerTest @@ -146,7 +146,7 @@ class LayerIgnoreAnchorPointPos : public LayerTest public: CREATE_FUNC(LayerIgnoreAnchorPointPos); virtual void onEnter() override; - void onToggle(ax::Ref* pObject); + void onToggle(ax::Object* pObject); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -156,7 +156,7 @@ class LayerIgnoreAnchorPointRot : public LayerTest public: CREATE_FUNC(LayerIgnoreAnchorPointRot); virtual void onEnter() override; - void onToggle(ax::Ref* pObject); + void onToggle(ax::Object* pObject); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -166,7 +166,7 @@ class LayerIgnoreAnchorPointScale : public LayerTest public: CREATE_FUNC(LayerIgnoreAnchorPointScale); virtual void onEnter() override; - void onToggle(ax::Ref* pObject); + void onToggle(ax::Object* pObject); virtual std::string title() const override; virtual std::string subtitle() const override; }; @@ -228,8 +228,8 @@ class LayerRadialGradientTest : public LayerTest virtual void onEnter() override; virtual std::string title() const override; - void sliderCallback(ax::Ref* sender, ax::ui::Slider::EventType type); - void listviewCallback(ax::Ref* sender, ax::ui::ListView::EventType type); + void sliderCallback(ax::Object* sender, ax::ui::Slider::EventType type); + void listviewCallback(ax::Object* sender, ax::ui::ListView::EventType type); private: ax::ui::Slider* createSlider(); diff --git a/tests/cpp-tests/Source/LightTest/LightTest.cpp b/tests/cpp-tests/Source/LightTest/LightTest.cpp index 8e462fbae23a..51b30f01fc3d 100644 --- a/tests/cpp-tests/Source/LightTest/LightTest.cpp +++ b/tests/cpp-tests/Source/LightTest/LightTest.cpp @@ -257,7 +257,7 @@ void LightTest::update(float delta) TestCase::update(delta); } -void LightTest::SwitchLight(Ref* sender, LightType lightType) +void LightTest::SwitchLight(Object* sender, LightType lightType) { switch (lightType) { diff --git a/tests/cpp-tests/Source/LightTest/LightTest.h b/tests/cpp-tests/Source/LightTest/LightTest.h index 3f314da181e4..0d280519edc3 100644 --- a/tests/cpp-tests/Source/LightTest/LightTest.h +++ b/tests/cpp-tests/Source/LightTest/LightTest.h @@ -41,7 +41,7 @@ class LightTest : public TestCase virtual void update(float delta) override; - void SwitchLight(ax::Ref* sender, ax::LightType lightType); + void SwitchLight(ax::Object* sender, ax::LightType lightType); private: void addSprite(); diff --git a/tests/cpp-tests/Source/MaterialSystemTest/MaterialSystemTest.cpp b/tests/cpp-tests/Source/MaterialSystemTest/MaterialSystemTest.cpp index 30d11bc53461..a96fcae671fe 100644 --- a/tests/cpp-tests/Source/MaterialSystemTest/MaterialSystemTest.cpp +++ b/tests/cpp-tests/Source/MaterialSystemTest/MaterialSystemTest.cpp @@ -152,7 +152,7 @@ void Material_2DEffects::onEnter() schedule(AX_SCHEDULE_SELECTOR(Material_2DEffects::updateCCTimeUniforms)); - // properties is not a "Ref" object + // properties is not a "Object" object AX_SAFE_DELETE(properties); } @@ -269,7 +269,7 @@ void Material_AutoBindings::onEnter() _locationTime = _noiseProgramState->getUniformLocation("u_Time"); schedule(AX_SCHEDULE_SELECTOR(Material_AutoBindings::updateUniformTime)); - // properties is not a "Ref" object + // properties is not a "Object" object AX_SAFE_DELETE(properties); } @@ -411,7 +411,7 @@ void Material_parsePerformance::onEnter() slider->setPercent(50); slider->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 3.0f)); - slider->addEventListener([&](Ref* sender, ui::Slider::EventType type) { + slider->addEventListener([&](Object* sender, ui::Slider::EventType type) { if (type == ui::Slider::EventType::ON_SLIDEBALL_UP) { ui::Slider* slider = dynamic_cast(sender); diff --git a/tests/cpp-tests/Source/MenuTest/MenuTest.cpp b/tests/cpp-tests/Source/MenuTest/MenuTest.cpp index a9b3c607055f..ac15e3bd1425 100644 --- a/tests/cpp-tests/Source/MenuTest/MenuTest.cpp +++ b/tests/cpp-tests/Source/MenuTest/MenuTest.cpp @@ -86,7 +86,7 @@ MenuLayerMainMenu::MenuLayerMainMenu() AXLOG("test MenuItem Label getString: %s", item3->getString().data()); // Font Item auto item4 = MenuItemFont::create("I toggle enable items", - [&](Ref* sender) { _disabledItem->setEnabled(!_disabledItem->isEnabled()); }); + [&](Object* sender) { _disabledItem->setEnabled(!_disabledItem->isEnabled()); }); item4->setFontSizeObj(20); item4->setFontName("fonts/Marker Felt.ttf"); @@ -161,12 +161,12 @@ MenuLayerMainMenu::~MenuLayerMainMenu() _disabledItem->release(); } -void MenuLayerMainMenu::menuCallback(Ref* sender) +void MenuLayerMainMenu::menuCallback(Object* sender) { static_cast(_parent)->switchTo(1, false); } -void MenuLayerMainMenu::menuCallbackConfig(Ref* sender) +void MenuLayerMainMenu::menuCallbackConfig(Object* sender) { static_cast(_parent)->switchTo(3, false); } @@ -178,7 +178,7 @@ void MenuLayerMainMenu::allowTouches(float dt) ax::print("TOUCHES ALLOWED AGAIN"); } -void MenuLayerMainMenu::menuCallbackDisabled(Ref* sender) +void MenuLayerMainMenu::menuCallbackDisabled(Object* sender) { // hijack all touch events for 5 seconds _eventDispatcher->setPriority(_touchListener, -1); @@ -186,23 +186,23 @@ void MenuLayerMainMenu::menuCallbackDisabled(Ref* sender) ax::print("TOUCHES DISABLED FOR 5 SECONDS"); } -void MenuLayerMainMenu::menuCallback2(Ref* sender) +void MenuLayerMainMenu::menuCallback2(Object* sender) { static_cast(_parent)->switchTo(2, false); } -void MenuLayerMainMenu::menuCallbackBugsTest(Ref* pSender) +void MenuLayerMainMenu::menuCallbackBugsTest(Object* pSender) { static_cast(_parent)->switchTo(4, false); } -void MenuLayerMainMenu::onQuit(Ref* sender) +void MenuLayerMainMenu::onQuit(Object* sender) { //[[Director sharedDirector] end]; // getCocosApp()->exit(); } -void MenuLayerMainMenu::menuMovingCallback(Ref* pSender) +void MenuLayerMainMenu::menuMovingCallback(Object* pSender) { static_cast(_parent)->switchTo(5, false); } @@ -290,12 +290,12 @@ void MenuLayer2::alignMenusV() } } -void MenuLayer2::menuCallback(Ref* sender) +void MenuLayer2::menuCallback(Object* sender) { static_cast(_parent)->switchTo(0, false); } -void MenuLayer2::menuCallbackOpacity(Ref* sender) +void MenuLayer2::menuCallbackOpacity(Object* sender) { auto menu = static_cast(static_cast(sender)->getParent()); uint8_t opacity = menu->getOpacity(); @@ -305,7 +305,7 @@ void MenuLayer2::menuCallbackOpacity(Ref* sender) menu->setOpacity(128); } -void MenuLayer2::menuCallbackAlign(Ref* sender) +void MenuLayer2::menuCallbackAlign(Object* sender) { _alignedH = !_alignedH; @@ -326,20 +326,20 @@ MenuLayer3::MenuLayer3() MenuItemFont::setFontSize(28); auto label = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", "Enable AtlasItem"); - auto item1 = MenuItemLabel::create(label, [&](Ref* sender) { + auto item1 = MenuItemLabel::create(label, [&](Object* sender) { // AXLOG("Label clicked. Toggling AtlasSprite"); _disabledItem->setEnabled(!_disabledItem->isEnabled()); _disabledItem->stopAllActions(); }); auto item2 = MenuItemFont::create("--- Go Back ---", - [&](Ref* sender) { static_cast(_parent)->switchTo(0, false); }); + [&](Object* sender) { static_cast(_parent)->switchTo(0, false); }); auto spriteNormal = Sprite::create(s_MenuItem, Rect(0, 23 * 2, 115, 23)); auto spriteSelected = Sprite::create(s_MenuItem, Rect(0, 23 * 1, 115, 23)); auto spriteDisabled = Sprite::create(s_MenuItem, Rect(0, 23 * 0, 115, 23)); auto item3 = MenuItemSprite::create(spriteNormal, spriteSelected, spriteDisabled, - [](Ref* sender) { ax::print("sprite clicked!"); }); + [](Object* sender) { ax::print("sprite clicked!"); }); _disabledItem = item3; item3->retain(); _disabledItem->setEnabled(false); @@ -443,13 +443,13 @@ MenuLayer4::MenuLayer4() MenuLayer4::~MenuLayer4() {} -void MenuLayer4::menuCallback(Ref* sender) +void MenuLayer4::menuCallback(Object* sender) { // AXLOG("selected item: %x index:%d", dynamic_cast(sender)->selectedItem(), // dynamic_cast(sender)->selectedIndex() ); } -void MenuLayer4::backCallback(Ref* sender) +void MenuLayer4::backCallback(Object* sender) { static_cast(_parent)->switchTo(0, false); } @@ -469,7 +469,7 @@ BugsTest::BugsTest() menu->setPosition(Vec2(s.width / 2, s.height / 2)); } -void BugsTest::issue1410MenuCallback(Ref* sender) +void BugsTest::issue1410MenuCallback(Object* sender) { auto menu = static_cast(static_cast(sender)->getParent()); menu->setEnabled(false); @@ -478,7 +478,7 @@ void BugsTest::issue1410MenuCallback(Ref* sender) ax::print("NO CRASHES"); } -void BugsTest::issue1410v2MenuCallback(ax::Ref* pSender) +void BugsTest::issue1410v2MenuCallback(ax::Object* pSender) { auto menu = static_cast(static_cast(pSender)->getParent()); menu->setEnabled(true); @@ -487,7 +487,7 @@ void BugsTest::issue1410v2MenuCallback(ax::Ref* pSender) ax::print("NO CRASHES. AND MENU SHOULD STOP WORKING"); } -void BugsTest::backMenuCallback(ax::Ref* pSender) +void BugsTest::backMenuCallback(ax::Object* pSender) { static_cast(_parent)->switchTo(0, false); } @@ -521,7 +521,7 @@ RemoveMenuItemWhenMove::RemoveMenuItemWhenMove() _eventDispatcher->addEventListenerWithFixedPriority(_touchListener, -129); } -void RemoveMenuItemWhenMove::goBack(Ref* pSender) +void RemoveMenuItemWhenMove::goBack(Object* pSender) { static_cast(_parent)->switchTo(0, false); } diff --git a/tests/cpp-tests/Source/MenuTest/MenuTest.h b/tests/cpp-tests/Source/MenuTest/MenuTest.h index 6654f9e4e660..84e03816d107 100644 --- a/tests/cpp-tests/Source/MenuTest/MenuTest.h +++ b/tests/cpp-tests/Source/MenuTest/MenuTest.h @@ -57,14 +57,14 @@ class MenuLayerMainMenu : public ax::Layer void touchMoved(ax::Touch* touch, ax::Event* event); void allowTouches(float dt); - void menuCallback(ax::Ref* sender); - void menuCallbackConfig(ax::Ref* sender); - void menuCallbackDisabled(ax::Ref* sender); - void menuCallback2(ax::Ref* sender); - void menuCallbackPriorityTest(ax::Ref* sender); - void menuCallbackBugsTest(ax::Ref* pSender); - void onQuit(ax::Ref* sender); - void menuMovingCallback(ax::Ref* pSender); + void menuCallback(ax::Object* sender); + void menuCallbackConfig(ax::Object* sender); + void menuCallbackDisabled(ax::Object* sender); + void menuCallback2(ax::Object* sender); + void menuCallbackPriorityTest(ax::Object* sender); + void menuCallbackBugsTest(ax::Object* pSender); + void onQuit(ax::Object* sender); + void menuMovingCallback(ax::Object* pSender); // CREATE_NODE(MenuLayer1); }; @@ -82,9 +82,9 @@ class MenuLayer2 : public ax::Layer MenuLayer2(); ~MenuLayer2(); - void menuCallback(ax::Ref* sender); - void menuCallbackOpacity(ax::Ref* sender); - void menuCallbackAlign(ax::Ref* sender); + void menuCallback(ax::Object* sender); + void menuCallbackOpacity(ax::Object* sender); + void menuCallbackAlign(ax::Object* sender); // CREATE_NODE(MenuLayer2); }; @@ -105,8 +105,8 @@ class MenuLayer4 : public ax::Layer MenuLayer4(); ~MenuLayer4(); - void menuCallback(ax::Ref* sender); - void backCallback(ax::Ref* sender); + void menuCallback(ax::Object* sender); + void backCallback(ax::Object* sender); }; class BugsTest : public ax::Layer @@ -114,9 +114,9 @@ class BugsTest : public ax::Layer public: BugsTest(); - void issue1410MenuCallback(ax::Ref* pSender); - void issue1410v2MenuCallback(ax::Ref* pSender); - void backMenuCallback(ax::Ref* pSender); + void issue1410MenuCallback(ax::Object* pSender); + void issue1410v2MenuCallback(ax::Object* pSender); + void backMenuCallback(ax::Object* pSender); }; class RemoveMenuItemWhenMove : public ax::Layer @@ -127,7 +127,7 @@ class RemoveMenuItemWhenMove : public ax::Layer bool onTouchBegan(ax::Touch* touch, ax::Event* event); void onTouchMoved(ax::Touch* touch, ax::Event* event); - void goBack(ax::Ref* pSender); + void goBack(ax::Object* pSender); private: ax::MenuItemFont* item; diff --git a/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.cpp b/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.cpp index aefd8f365e30..912f1383125f 100644 --- a/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.cpp +++ b/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.cpp @@ -572,7 +572,7 @@ std::string MeshRendererFakeShadowTest::subtitle() const return "touch the screen to move around"; } -void MeshRendererFakeShadowTest::Move(ax::Ref* sender, int value) +void MeshRendererFakeShadowTest::Move(ax::Object* sender, int value) { _orc->setPositionX(_orc->getPositionX() + value); } @@ -1024,7 +1024,7 @@ std::string AsyncLoadMeshRendererTest::subtitle() const return ""; } -void AsyncLoadMeshRendererTest::menuCallback_asyncLoadMesh(Ref* sender) +void AsyncLoadMeshRendererTest::menuCallback_asyncLoadMesh(Object* sender) { // Note that you must stop the tasks before leaving the scene. AsyncTaskPool::getInstance()->stopTasks(AsyncTaskPool::TaskType::TASK_IO); @@ -1132,7 +1132,7 @@ std::string MeshRendererWithSkinTest::getAnimationQualityMessage() const return ""; } -void MeshRendererWithSkinTest::switchAnimationQualityCallback(Ref* sender) +void MeshRendererWithSkinTest::switchAnimationQualityCallback(Object* sender) { ++_animateQuality; if (_animateQuality > (int)Animate3DQuality::QUALITY_HIGH) @@ -1465,7 +1465,7 @@ MeshRendererReskinTest::MeshRendererReskinTest() : _mesh(nullptr) pMenu1->setPosition(Vec2(0.0f, 0.0f)); this->addChild(pMenu1, 10); } -void MeshRendererReskinTest::menuCallback_reSkin(Ref* sender) +void MeshRendererReskinTest::menuCallback_reSkin(Object* sender) { auto index = static_cast((uintptr_t)(((MenuItemLabel*)sender)->getUserData())); if (index < (int)SkinType::MAX_TYPE) @@ -1728,7 +1728,7 @@ void MeshRendererWithOBBPerformanceTest::reachEndCallBack() _mesh->runAction(seq); } -void MeshRendererWithOBBPerformanceTest::addOBBCallback(Ref* sender) +void MeshRendererWithOBBPerformanceTest::addOBBCallback(Object* sender) { addOBBWithCount(10); } @@ -1747,7 +1747,7 @@ void MeshRendererWithOBBPerformanceTest::addOBBWithCount(float value) } } -void MeshRendererWithOBBPerformanceTest::delOBBCallback(Ref* sender) +void MeshRendererWithOBBPerformanceTest::delOBBCallback(Object* sender) { delOBBWithCount(10); } @@ -1921,14 +1921,14 @@ UseCaseMeshRenderer::UseCaseMeshRenderer() : _caseIdx(0) _useCaseTitles[0] = "transparent 3d mesh and 2d mesh"; _useCaseTitles[1] = "ui - 3d - ui"; - auto itemPrev = MenuItemImage::create("Images/b1.png", "Images/b2.png", [&](Ref* sender) { + auto itemPrev = MenuItemImage::create("Images/b1.png", "Images/b2.png", [&](Object* sender) { _caseIdx--; if (_caseIdx < 0) _caseIdx = (int)USECASE::MAX_CASE_NUM - 1; this->switchCase(); }); - auto itemNext = MenuItemImage::create("Images/f1.png", "Images/f2.png", [&](Ref* sender) { + auto itemNext = MenuItemImage::create("Images/f1.png", "Images/f2.png", [&](Object* sender) { _caseIdx++; if (_caseIdx >= (int)USECASE::MAX_CASE_NUM) _caseIdx = 0; @@ -2049,7 +2049,7 @@ void UseCaseMeshRenderer::switchCase() } } -void UseCaseMeshRenderer::menuCallback_Message(Ref* sender) +void UseCaseMeshRenderer::menuCallback_Message(Object* sender) { auto layer = getChildByTag(101); auto message = layer->getChildByTag(102); // message layer @@ -2098,7 +2098,7 @@ NodeAnimationTest::NodeAnimationTest() : _vectorIndex(0) { auto s = Director::getInstance()->getWinSize(); - auto itemPrev = MenuItemImage::create("Images/b1.png", "Images/b2.png", [&](Ref* sender) { + auto itemPrev = MenuItemImage::create("Images/b1.png", "Images/b2.png", [&](Object* sender) { _meshes[_vectorIndex]->setVisible(false); int tIndex = _vectorIndex - 1; @@ -2110,7 +2110,7 @@ NodeAnimationTest::NodeAnimationTest() : _vectorIndex(0) _meshes[_vectorIndex]->setVisible(true); }); - auto itemNext = MenuItemImage::create("Images/f1.png", "Images/f2.png", [&](Ref* sender) { + auto itemNext = MenuItemImage::create("Images/f1.png", "Images/f2.png", [&](Object* sender) { _meshes[_vectorIndex]->setVisible(false); int tIndex = _vectorIndex + 1; @@ -2339,7 +2339,7 @@ Issue9767::Issue9767() Issue9767::~Issue9767() {} -void Issue9767::menuCallback_SwitchShader(ax::Ref* sender) +void Issue9767::menuCallback_SwitchShader(ax::Object* sender) { AX_SAFE_RELEASE_NULL(_programState); if (_shaderType == Issue9767::ShaderType::SHADER_TEX) @@ -2539,7 +2539,7 @@ CameraBackgroundClearTest::CameraBackgroundClearTest() _label->setPosition(s.width / 2.f, VisibleRect::top().y * 0.8f); } -void CameraBackgroundClearTest::switch_CameraClearMode(ax::Ref* sender) +void CameraBackgroundClearTest::switch_CameraClearMode(ax::Object* sender) { auto brush = _camera->getBackgroundBrush(); CameraBackgroundBrush::BrushType type = CameraBackgroundBrush::BrushType::NONE; @@ -2759,7 +2759,7 @@ std::string MeshRendererPropertyTest::subtitle() const } void MeshRendererPropertyTest::update(float delta) {} -void MeshRendererPropertyTest::printMeshName(ax::Ref* sender) +void MeshRendererPropertyTest::printMeshName(ax::Object* sender) { AXLOG("MeshName Begin"); Vector meshes = _mesh->getMeshes(); @@ -2769,7 +2769,7 @@ void MeshRendererPropertyTest::printMeshName(ax::Ref* sender) } AXLOG("MeshName End"); } -void MeshRendererPropertyTest::removeUsedTexture(ax::Ref* sender) +void MeshRendererPropertyTest::removeUsedTexture(ax::Object* sender) { if (_meshTex != nullptr) { @@ -2778,7 +2778,7 @@ void MeshRendererPropertyTest::removeUsedTexture(ax::Ref* sender) } } -void MeshRendererPropertyTest::resetTexture(ax::Ref* sender) +void MeshRendererPropertyTest::resetTexture(ax::Object* sender) { if (_meshTex != nullptr) { @@ -2819,7 +2819,7 @@ Issue16155Test::Issue16155Test() addChild(mesh); removeChild(mesh); - ax::print("Issue 16155: Ref count:%d. Run this test again. RC should be the same", rcBefore); + ax::print("Issue 16155: Object count:%d. Run this test again. RC should be the same", rcBefore); } std::string Issue16155Test::title() const diff --git a/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.h b/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.h index 328939c97e3c..6836a9b6d960 100644 --- a/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.h +++ b/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.h @@ -151,7 +151,7 @@ class MeshRendererFakeShadowTest : public MeshRendererTestDemo virtual ~MeshRendererFakeShadowTest(); virtual std::string title() const override; virtual std::string subtitle() const override; - void Move(ax::Ref* sender, int value); + void Move(ax::Object* sender, int value); void updateCamera(float fDelta); void move3D(float elapsedTime); void updateState(float elapsedTime); @@ -243,7 +243,7 @@ class AsyncLoadMeshRendererTest : public MeshRendererTestDemo virtual std::string title() const override; virtual std::string subtitle() const override; - void menuCallback_asyncLoadMesh(ax::Ref* sender); + void menuCallback_asyncLoadMesh(ax::Object* sender); void asyncLoad_Callback(ax::MeshRenderer* mesh, void* param); @@ -261,7 +261,7 @@ class MeshRendererWithSkinTest : public MeshRendererTestDemo void addNewMeshWithCoords(ax::Vec2 p); - void switchAnimationQualityCallback(ax::Ref* sender); + void switchAnimationQualityCallback(ax::Object* sender); void onTouchesEnded(const std::vector& touches, ax::Event* event); std::string getAnimationQualityMessage() const; @@ -360,7 +360,7 @@ class MeshRendererReskinTest : public MeshRendererTestDemo void onTouchesEnded(const std::vector& touches, ax::Event* event); void addNewMeshWithCoords(ax::Vec2 p); - void menuCallback_reSkin(ax::Ref* sender); + void menuCallback_reSkin(ax::Object* sender); protected: void applyCurSkin(); @@ -395,8 +395,8 @@ class MeshRendererWithOBBPerformanceTest : public MeshRendererTestDemo void onTouchesBegan(const std::vector& touches, ax::Event* event); void onTouchesEnded(const std::vector& touches, ax::Event* event); void onTouchesMoved(const std::vector& touches, ax::Event* event); - void addOBBCallback(ax::Ref* sender); - void delOBBCallback(ax::Ref* sender); + void addOBBCallback(ax::Object* sender); + void delOBBCallback(ax::Object* sender); void addOBBWithCount(float value); void delOBBWithCount(float value); @@ -466,7 +466,7 @@ class UseCaseMeshRenderer : public MeshRendererTestDemo virtual void update(float delta) override; - void menuCallback_Message(ax::Ref* sender); + void menuCallback_Message(ax::Object* sender); protected: void switchCase(); @@ -543,7 +543,7 @@ class Issue9767 : public MeshRendererTestDemo virtual std::string title() const override; virtual std::string subtitle() const override; - void menuCallback_SwitchShader(ax::Ref* sender); + void menuCallback_SwitchShader(ax::Object* sender); protected: ShaderType _shaderType; @@ -582,7 +582,7 @@ class CameraBackgroundClearTest : public MeshRendererTestDemo virtual std::string title() const override; virtual std::string subtitle() const override; - void switch_CameraClearMode(ax::Ref* sender); + void switch_CameraClearMode(ax::Object* sender); protected: ax::Camera* _camera; @@ -641,9 +641,9 @@ class MeshRendererPropertyTest : public MeshRendererTestDemo virtual std::string subtitle() const override; virtual void update(float delta) override; - void printMeshName(ax::Ref* sender); - void removeUsedTexture(ax::Ref* sender); - void resetTexture(ax::Ref* sender); + void printMeshName(ax::Object* sender); + void removeUsedTexture(ax::Object* sender); + void resetTexture(ax::Object* sender); void refreshMeshRender(); diff --git a/tests/cpp-tests/Source/MotionStreakTest/MotionStreakTest.cpp b/tests/cpp-tests/Source/MotionStreakTest/MotionStreakTest.cpp index dbd2911895a3..ded9c07f3ba0 100644 --- a/tests/cpp-tests/Source/MotionStreakTest/MotionStreakTest.cpp +++ b/tests/cpp-tests/Source/MotionStreakTest/MotionStreakTest.cpp @@ -265,7 +265,7 @@ void MotionStreakTest::onEnter() menuMode->setPosition(Vec2(s.width / 2, s.height / 4)); } -void MotionStreakTest::modeCallback(Ref* pSender) +void MotionStreakTest::modeCallback(Object* pSender) { bool fastMode = _streak->isFastMode(); _streak->setFastMode(!fastMode); diff --git a/tests/cpp-tests/Source/MotionStreakTest/MotionStreakTest.h b/tests/cpp-tests/Source/MotionStreakTest/MotionStreakTest.h index 6ec251305bfe..6fe4e8d0f993 100644 --- a/tests/cpp-tests/Source/MotionStreakTest/MotionStreakTest.h +++ b/tests/cpp-tests/Source/MotionStreakTest/MotionStreakTest.h @@ -39,7 +39,7 @@ class MotionStreakTest : public TestCase virtual std::string subtitle() const override; virtual void onEnter() override; - void modeCallback(ax::Ref* sender); + void modeCallback(ax::Object* sender); protected: ax::MotionStreak* _streak; diff --git a/tests/cpp-tests/Source/NavMeshTest/NavMeshTest.cpp b/tests/cpp-tests/Source/NavMeshTest/NavMeshTest.cpp index 7ad48b0b3bb0..058e740fcd21 100644 --- a/tests/cpp-tests/Source/NavMeshTest/NavMeshTest.cpp +++ b/tests/cpp-tests/Source/NavMeshTest/NavMeshTest.cpp @@ -308,7 +308,7 @@ bool NavMeshBasicTestDemo::init() TTFConfig ttfConfig("fonts/arial.ttf", 15); _debugLabel = Label::createWithTTF(ttfConfig, "Debug Draw ON"); _debugLabel->retain(); - auto menuItem1 = MenuItemLabel::create(_debugLabel, [=](Ref*) { + auto menuItem1 = MenuItemLabel::create(_debugLabel, [=](Object*) { bool enabledDebug = !getNavMesh()->isDebugDrawEnabled(); getNavMesh()->setDebugDrawEnable(enabledDebug); if (enabledDebug) @@ -355,7 +355,7 @@ bool NavMeshAdvanceTestDemo::init() _debugLabel = Label::createWithTTF(ttfConfig, "Debug Draw ON"); _debugLabel->retain(); - auto menuItem0 = MenuItemLabel::create(_obstacleLabel, [=](Ref*) { + auto menuItem0 = MenuItemLabel::create(_obstacleLabel, [=](Object*) { float x = ax::random(-50.0f, 50.0f); float z = ax::random(-50.0f, 50.0f); Physics3DWorld::HitResult result; @@ -365,7 +365,7 @@ bool NavMeshAdvanceTestDemo::init() menuItem0->setAnchorPoint(Vec2::ANCHOR_TOP_LEFT); menuItem0->setPosition(Vec2(VisibleRect::left().x, VisibleRect::top().y - 50)); - auto menuItem1 = MenuItemLabel::create(_agentLabel, [=](Ref*) { + auto menuItem1 = MenuItemLabel::create(_agentLabel, [=](Object*) { float x = ax::random(-50.0f, 50.0f); float z = ax::random(-50.0f, 50.0f); Physics3DWorld::HitResult result; @@ -375,7 +375,7 @@ bool NavMeshAdvanceTestDemo::init() menuItem1->setAnchorPoint(Vec2::ANCHOR_TOP_LEFT); menuItem1->setPosition(Vec2(VisibleRect::left().x, VisibleRect::top().y - 100)); - auto menuItem2 = MenuItemLabel::create(_debugLabel, [=](Ref*) { + auto menuItem2 = MenuItemLabel::create(_debugLabel, [=](Object*) { bool enabledDebug = !getNavMesh()->isDebugDrawEnabled(); getNavMesh()->setDebugDrawEnable(enabledDebug); if (enabledDebug) diff --git a/tests/cpp-tests/Source/NetworkTest/DownloaderTest/DownloaderTest.cpp b/tests/cpp-tests/Source/NetworkTest/DownloaderTest/DownloaderTest.cpp index c23e024c8c7e..07157676c13a 100644 --- a/tests/cpp-tests/Source/NetworkTest/DownloaderTest/DownloaderTest.cpp +++ b/tests/cpp-tests/Source/NetworkTest/DownloaderTest/DownloaderTest.cpp @@ -122,7 +122,7 @@ struct DownloaderTest : public TestCase SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_ui_plist); // add four download view in test case - Node* topRightView = createDownloadView(sNameList[0], [this](Ref*) { + Node* topRightView = createDownloadView(sNameList[0], [this](Object*) { auto view = this->getChildByName(sNameList[0]); auto sprite = view->getChildByTag(TAG_SPRITE); if (sprite) @@ -142,7 +142,7 @@ struct DownloaderTest : public TestCase topRightView->setPosition(VisibleRect::center()); this->addChild(topRightView); - Node* topLeftView = createDownloadView(sNameList[1], [this](Ref*) { + Node* topLeftView = createDownloadView(sNameList[1], [this](Object*) { auto view = this->getChildByName(sNameList[1]); auto sprite = view->getChildByTag(TAG_SPRITE); if (sprite) @@ -163,7 +163,7 @@ struct DownloaderTest : public TestCase topLeftView->setPosition(VisibleRect::center()); this->addChild(topLeftView); - Node* bottomLeftView = createDownloadView(sNameList[2], [this](Ref*) { + Node* bottomLeftView = createDownloadView(sNameList[2], [this](Object*) { auto view = this->getChildByName(sNameList[2]); auto sprite = view->getChildByTag(TAG_SPRITE); if (sprite) @@ -185,7 +185,7 @@ struct DownloaderTest : public TestCase bottomLeftView->setPosition(VisibleRect::center()); this->addChild(bottomLeftView); - Node* bottomRightView = createDownloadView(sNameList[3], [this](Ref*) { + Node* bottomRightView = createDownloadView(sNameList[3], [this](Object*) { auto view = this->getChildByName(sNameList[3]); auto btn = (ui::Button*)view->getChildByTag(TAG_BUTTON); btn->setEnabled(false); diff --git a/tests/cpp-tests/Source/NetworkTest/HttpClientTest/HttpClientTest.cpp b/tests/cpp-tests/Source/NetworkTest/HttpClientTest/HttpClientTest.cpp index af7f9a94eebe..2649e5025a5a 100644 --- a/tests/cpp-tests/Source/NetworkTest/HttpClientTest/HttpClientTest.cpp +++ b/tests/cpp-tests/Source/NetworkTest/HttpClientTest/HttpClientTest.cpp @@ -109,7 +109,7 @@ HttpClientTest::~HttpClientTest() HttpClient::destroyInstance(); } -void HttpClientTest::onMenuGetTestClicked(ax::Ref* sender) +void HttpClientTest::onMenuGetTestClicked(ax::Object* sender) { // test 1 { @@ -165,7 +165,7 @@ void HttpClientTest::onMenuGetTestClicked(ax::Ref* sender) _labelStatusCode->setString("waiting..."); } -void HttpClientTest::onMenuPatchTestClicked(Ref* sender) +void HttpClientTest::onMenuPatchTestClicked(Object* sender) { // test 1 { @@ -204,7 +204,7 @@ void HttpClientTest::onMenuPatchTestClicked(Ref* sender) _labelStatusCode->setString("waiting..."); } -void HttpClientTest::onMenuPostTestClicked(ax::Ref* sender) +void HttpClientTest::onMenuPostTestClicked(ax::Object* sender) { // test 1 { @@ -242,7 +242,7 @@ void HttpClientTest::onMenuPostTestClicked(ax::Ref* sender) _labelStatusCode->setString("waiting..."); } -void HttpClientTest::onMenuPostBinaryTestClicked(ax::Ref* sender) +void HttpClientTest::onMenuPostBinaryTestClicked(ax::Object* sender) { HttpRequest* request = new HttpRequest(); request->setUrl("https://httpbin.org/post"); @@ -260,7 +260,7 @@ void HttpClientTest::onMenuPostBinaryTestClicked(ax::Ref* sender) _labelStatusCode->setString("waiting..."); } -void HttpClientTest::onMenuPutTestClicked(Ref* sender) +void HttpClientTest::onMenuPutTestClicked(Object* sender) { // test 1 { @@ -299,7 +299,7 @@ void HttpClientTest::onMenuPutTestClicked(Ref* sender) _labelStatusCode->setString("waiting..."); } -void HttpClientTest::onMenuDeleteTestClicked(Ref* sender) +void HttpClientTest::onMenuDeleteTestClicked(Object* sender) { // test 1 { @@ -411,7 +411,7 @@ HttpClientClearRequestsTest::~HttpClientClearRequestsTest() HttpClient::destroyInstance(); } -void HttpClientClearRequestsTest::onMenuCancelAllClicked(ax::Ref* sender) +void HttpClientClearRequestsTest::onMenuCancelAllClicked(ax::Object* sender) { for (int i = 0; i < 10; i++) { @@ -439,7 +439,7 @@ void HttpClientClearRequestsTest::onMenuCancelAllClicked(ax::Ref* sender) _labelStatusCode->setString("waiting..."); } -void HttpClientClearRequestsTest::onMenuCancelSomeClicked(ax::Ref* sender) +void HttpClientClearRequestsTest::onMenuCancelSomeClicked(ax::Object* sender) { // test 1 for (int i = 0; i < 10; i++) diff --git a/tests/cpp-tests/Source/NetworkTest/HttpClientTest/HttpClientTest.h b/tests/cpp-tests/Source/NetworkTest/HttpClientTest/HttpClientTest.h index 6ddd3b144bf6..141729165504 100644 --- a/tests/cpp-tests/Source/NetworkTest/HttpClientTest/HttpClientTest.h +++ b/tests/cpp-tests/Source/NetworkTest/HttpClientTest/HttpClientTest.h @@ -42,12 +42,12 @@ class HttpClientTest : public TestCase virtual ~HttpClientTest(); // Menu Callbacks - void onMenuGetTestClicked(ax::Ref* sender); - void onMenuPatchTestClicked(ax::Ref* sender); - void onMenuPostTestClicked(ax::Ref* sender); - void onMenuPostBinaryTestClicked(ax::Ref* sender); - void onMenuPutTestClicked(ax::Ref* sender); - void onMenuDeleteTestClicked(ax::Ref* sender); + void onMenuGetTestClicked(ax::Object* sender); + void onMenuPatchTestClicked(ax::Object* sender); + void onMenuPostTestClicked(ax::Object* sender); + void onMenuPostBinaryTestClicked(ax::Object* sender); + void onMenuPutTestClicked(ax::Object* sender); + void onMenuDeleteTestClicked(ax::Object* sender); // Http Response Callback void onHttpRequestCompleted(ax::network::HttpClient* sender, ax::network::HttpResponse* response); @@ -67,8 +67,8 @@ class HttpClientClearRequestsTest : public TestCase virtual ~HttpClientClearRequestsTest(); // Menu Callbacks - void onMenuCancelAllClicked(ax::Ref* sender); - void onMenuCancelSomeClicked(ax::Ref* sender); + void onMenuCancelAllClicked(ax::Object* sender); + void onMenuCancelSomeClicked(ax::Object* sender); // Http Response Callback void onHttpRequestCompleted(ax::network::HttpClient* sender, ax::network::HttpResponse* response); diff --git a/tests/cpp-tests/Source/NetworkTest/WebSocketTest/WebSocketTest.cpp b/tests/cpp-tests/Source/NetworkTest/WebSocketTest/WebSocketTest.cpp index 2df4273213fd..02dd0d3f0975 100644 --- a/tests/cpp-tests/Source/NetworkTest/WebSocketTest/WebSocketTest.cpp +++ b/tests/cpp-tests/Source/NetworkTest/WebSocketTest/WebSocketTest.cpp @@ -145,7 +145,7 @@ void WebSocketTest::onExit() TestCase::onExit(); } -void WebSocketTest::startTestCallback(Ref* sender) +void WebSocketTest::startTestCallback(Object* sender) { removeChild(_startTestMenu); _startTestMenu = nullptr; @@ -288,7 +288,7 @@ void WebSocketTest::onError(network::WebSocket* ws, const network::WebSocket::Er } // Menu Callbacks -void WebSocketTest::onMenuSendTextClicked(ax::Ref* sender) +void WebSocketTest::onMenuSendTextClicked(ax::Object* sender) { if (!_wsiSendText) { @@ -308,7 +308,7 @@ void WebSocketTest::onMenuSendTextClicked(ax::Ref* sender) } } -void WebSocketTest::onMenuSendMultipleTextClicked(ax::Ref* sender) +void WebSocketTest::onMenuSendMultipleTextClicked(ax::Object* sender) { if (!_wsiSendText) { @@ -331,7 +331,7 @@ void WebSocketTest::onMenuSendMultipleTextClicked(ax::Ref* sender) } } -void WebSocketTest::onMenuSendBinaryClicked(ax::Ref* sender) +void WebSocketTest::onMenuSendBinaryClicked(ax::Object* sender) { if (!_wsiSendBinary) { @@ -365,7 +365,7 @@ WebSocketCloseTest::WebSocketCloseTest() : _wsiTest(nullptr) } auto closeItem = - MenuItemImage::create(s_pathClose, s_pathClose, [](Ref* sender) { Director::getInstance()->end(); }); + MenuItemImage::create(s_pathClose, s_pathClose, [](Object* sender) { Director::getInstance()->end(); }); closeItem->setPosition(VisibleRect::right().x / 2, VisibleRect::top().y * 2 / 3); auto menu = Menu::create(closeItem, nullptr); @@ -476,7 +476,7 @@ void WebSocketDelayTest::onExit() TestCase::onExit(); } -void WebSocketDelayTest::startTestCallback(Ref* sender) +void WebSocketDelayTest::startTestCallback(Object* sender) { removeChild(_startTestMenu); _startTestMenu = nullptr; @@ -574,7 +574,7 @@ void WebSocketDelayTest::onError(network::WebSocket* ws, const network::WebSocke } // Menu Callbacks -void WebSocketDelayTest::onMenuSendTextClicked(ax::Ref* sender) +void WebSocketDelayTest::onMenuSendTextClicked(ax::Object* sender) { if (!_wsiSendText) { diff --git a/tests/cpp-tests/Source/NetworkTest/WebSocketTest/WebSocketTest.h b/tests/cpp-tests/Source/NetworkTest/WebSocketTest/WebSocketTest.h index 8d096c9b65fb..bc3a379a1ed2 100644 --- a/tests/cpp-tests/Source/NetworkTest/WebSocketTest/WebSocketTest.h +++ b/tests/cpp-tests/Source/NetworkTest/WebSocketTest/WebSocketTest.h @@ -58,12 +58,12 @@ class WebSocketTest : public TestCase virtual void onError(ax::network::WebSocket* ws, const ax::network::WebSocket::ErrorCode& error)override; // Menu Callbacks - void onMenuSendTextClicked(ax::Ref *sender); - void onMenuSendMultipleTextClicked(ax::Ref *sender); - void onMenuSendBinaryClicked(ax::Ref *sender); + void onMenuSendTextClicked(ax::Object *sender); + void onMenuSendMultipleTextClicked(ax::Object *sender); + void onMenuSendBinaryClicked(ax::Object *sender); virtual std::string title() const override { return "WebSocket Test"; } - void startTestCallback(ax::Ref* sender); + void startTestCallback(ax::Object* sender); private: ax::network::WebSocket* _wsiSendText; @@ -117,10 +117,10 @@ class WebSocketDelayTest : public TestCase virtual void onError(ax::network::WebSocket* ws, const ax::network::WebSocket::ErrorCode& error)override; // Menu Callbacks - void onMenuSendTextClicked(ax::Ref *sender); + void onMenuSendTextClicked(ax::Object *sender); virtual std::string title() const override { return "WebSocket Delay Test"; } - void startTestCallback(ax::Ref* sender); + void startTestCallback(ax::Object* sender); int64_t getNowMircroSeconds() { diff --git a/tests/cpp-tests/Source/NewAudioEngineTest/NewAudioEngineTest.cpp b/tests/cpp-tests/Source/NewAudioEngineTest/NewAudioEngineTest.cpp index d41c009e860f..23e2d960bd49 100644 --- a/tests/cpp-tests/Source/NewAudioEngineTest/NewAudioEngineTest.cpp +++ b/tests/cpp-tests/Source/NewAudioEngineTest/NewAudioEngineTest.cpp @@ -213,7 +213,7 @@ std::string AudioEngineTestDemo::title() const return "New Audio Engine Test"; } -void AudioEngineTestDemo::onBackCallback(ax::Ref* sender) +void AudioEngineTestDemo::onBackCallback(ax::Object* sender) { AudioEngine::end(); TestCase::onBackCallback(sender); @@ -323,7 +323,7 @@ bool AudioControlTest::init() auto volumeSlider = SliderEx::create(); volumeSlider->setPercent(100); - volumeSlider->addEventListener([&](Ref* sender, Slider::EventType event) { + volumeSlider->addEventListener([&](Object* sender, Slider::EventType event) { SliderEx* slider = dynamic_cast(sender); _volume = slider->getRatio(); if (_audioID != AudioEngine::INVALID_AUDIO_ID) @@ -335,7 +335,7 @@ bool AudioControlTest::init() addChild(volumeSlider); auto timeSlider = SliderEx::create(); - timeSlider->addEventListener([&](Ref* sender, Slider::EventType event) { + timeSlider->addEventListener([&](Object* sender, Slider::EventType event) { SliderEx* slider = dynamic_cast(sender); switch (event) { @@ -1161,7 +1161,7 @@ void AudioPlayInFinishedCB::onEnter() { AudioEngineTestDemo::onEnter(); - auto item = MenuItemFont::create("Play 3 files one by one", [this](Ref* sender) { + auto item = MenuItemFont::create("Play 3 files one by one", [this](Object* sender) { playMusic("background.mp3"); playMusic("background.mp3"); playMusic("background.mp3"); diff --git a/tests/cpp-tests/Source/NewAudioEngineTest/NewAudioEngineTest.h b/tests/cpp-tests/Source/NewAudioEngineTest/NewAudioEngineTest.h index 10db911cc200..b86b17090dbd 100644 --- a/tests/cpp-tests/Source/NewAudioEngineTest/NewAudioEngineTest.h +++ b/tests/cpp-tests/Source/NewAudioEngineTest/NewAudioEngineTest.h @@ -44,7 +44,7 @@ class AudioEngineTestDemo : public TestCase virtual std::string title() const override; virtual void onExit() override; - virtual void onBackCallback(ax::Ref* sender) override; + virtual void onBackCallback(ax::Object* sender) override; protected: std::shared_ptr _isDestroyed; diff --git a/tests/cpp-tests/Source/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/tests/cpp-tests/Source/NewEventDispatcherTest/NewEventDispatcherTest.cpp index 56d9d503eb33..42e65e40b16e 100644 --- a/tests/cpp-tests/Source/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/tests/cpp-tests/Source/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -216,13 +216,13 @@ void TouchableSpriteTest::onEnter() _eventDispatcher->addEventListenerWithSceneGraphPriority(listener1->clone(), sprite2); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener1->clone(), sprite3); - auto removeAllTouchItem = MenuItemFont::create("Remove All Touch Listeners", [this](Ref* sender) { + auto removeAllTouchItem = MenuItemFont::create("Remove All Touch Listeners", [this](Object* sender) { auto senderItem = static_cast(sender); senderItem->setString("Only Next item could be clicked"); _eventDispatcher->removeEventListenersForType(EventListener::Type::TOUCH_ONE_BY_ONE); - auto nextItem = MenuItemFont::create("Next", [=](Ref* sender) { getTestSuite()->enterNextTest(); }); + auto nextItem = MenuItemFont::create("Next", [=](Object* sender) { getTestSuite()->enterNextTest(); }); nextItem->setFontSizeObj(16); nextItem->setPosition(VisibleRect::right() + Vec2(-100.0f, -30.0f)); @@ -416,7 +416,7 @@ void RemoveListenerWhenDispatching::onEnter() std::shared_ptr enable(new bool(true)); // Enable/Disable item auto toggleItem = MenuItemToggle::createWithCallback( - [=](Ref* sender) { + [=](Object* sender) { if (*enable) { _eventDispatcher->removeEventListener(listener1); @@ -475,7 +475,7 @@ void CustomEventTest::onEnter() _eventDispatcher->addEventListenerWithFixedPriority(_listener, 1); - auto sendItem = MenuItemFont::create("Send Custom Event 1", [=](Ref* sender) { + auto sendItem = MenuItemFont::create("Send Custom Event 1", [=](Object* sender) { static int count = 0; ++count; char* buf = new char[10]; @@ -501,7 +501,7 @@ void CustomEventTest::onEnter() _eventDispatcher->addEventListenerWithFixedPriority(_listener2, 1); - auto sendItem2 = MenuItemFont::create("Send Custom Event 2", [=](Ref* sender) { + auto sendItem2 = MenuItemFont::create("Send Custom Event 2", [=](Object* sender) { static int count = 0; ++count; char* buf = new char[10]; @@ -779,7 +779,7 @@ void RemoveListenerAfterAddingTest::onEnter() { EventDispatcherTestDemo::onEnter(); - auto item1 = MenuItemFont::create("Click Me 1", [this](Ref* sender) { + auto item1 = MenuItemFont::create("Click Me 1", [this](Object* sender) { auto listener = EventListenerTouchOneByOne::create(); listener->onTouchBegan = [](Touch* touch, Event* event) -> bool { AXASSERT(false, "Should not come here!"); @@ -794,7 +794,7 @@ void RemoveListenerAfterAddingTest::onEnter() auto addNextButton = [this]() { auto next = MenuItemFont::create("Please Click Me To Reset!", - [this](Ref* sender) { getTestSuite()->restartCurrTest(); }); + [this](Object* sender) { getTestSuite()->restartCurrTest(); }); next->setPosition(VisibleRect::center() + Vec2(0.0f, -40.0f)); auto menu = Menu::create(next, nullptr); @@ -803,7 +803,7 @@ void RemoveListenerAfterAddingTest::onEnter() this->addChild(menu); }; - auto item2 = MenuItemFont::create("Click Me 2", [=](Ref* sender) { + auto item2 = MenuItemFont::create("Click Me 2", [=](Object* sender) { auto listener = EventListenerTouchOneByOne::create(); listener->onTouchBegan = [](Touch* touch, Event* event) -> bool { AXASSERT(false, "Should not come here!"); @@ -818,7 +818,7 @@ void RemoveListenerAfterAddingTest::onEnter() item2->setPosition(VisibleRect::center() + Vec2(0.0f, 40.0f)); - auto item3 = MenuItemFont::create("Click Me 3", [=](Ref* sender) { + auto item3 = MenuItemFont::create("Click Me 3", [=](Object* sender) { auto listener = EventListenerTouchOneByOne::create(); listener->onTouchBegan = [](Touch* touch, Event* event) -> bool { AXASSERT(false, "Should not come here!"); @@ -1222,14 +1222,14 @@ PauseResumeTargetTest::PauseResumeTargetTest() sprite3->setPosition(Vec2(0, 0)); sprite2->addChild(sprite3, -1); - auto popup = MenuItemFont::create("Popup", [=](Ref* sender) { + auto popup = MenuItemFont::create("Popup", [=](Object* sender) { sprite3->getListener()->setEnabled(false); _eventDispatcher->pauseEventListenersForTarget(this, true); auto colorLayer = LayerColor::create(Color4B(0, 0, 255, 100)); this->addChild(colorLayer, 99999); - auto closeItem = MenuItemFont::create("close", [=](Ref* sender) { + auto closeItem = MenuItemFont::create("close", [=](Object* sender) { colorLayer->removeFromParent(); _eventDispatcher->resumeEventListenersForTarget(this, true); sprite3->getListener()->setEnabled(true); @@ -1279,7 +1279,7 @@ PauseResumeTargetTest2::PauseResumeTargetTest2() _touchableSprite->setPosition(origin + Vec2(size.width / 2, size.height / 2) + Vec2(-80.0f, 40.0f)); addChild(_touchableSprite); - _itemPauseTouch = MenuItemFont::create("pauseTouch", [=](Ref* sender) { + _itemPauseTouch = MenuItemFont::create("pauseTouch", [=](Object* sender) { _itemPauseTouch->setEnabled(false); _itemResumeTouch->setEnabled(true); @@ -1289,7 +1289,7 @@ PauseResumeTargetTest2::PauseResumeTargetTest2() _itemPauseTouch->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); _itemPauseTouch->setPosition(VisibleRect::right() + Vec2(-150.0f, 0.0f)); - _itemResumeTouch = MenuItemFont::create("resumeTouch", [=](Ref* sender) { + _itemResumeTouch = MenuItemFont::create("resumeTouch", [=](Object* sender) { _itemPauseTouch->setEnabled(true); _itemResumeTouch->setEnabled(false); @@ -1299,7 +1299,7 @@ PauseResumeTargetTest2::PauseResumeTargetTest2() _itemResumeTouch->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); _itemResumeTouch->setPosition(VisibleRect::right() + Vec2(0, 0)); - _itemAddToScene = MenuItemFont::create("addToScene", [=](Ref* sender) { + _itemAddToScene = MenuItemFont::create("addToScene", [=](Object* sender) { _itemAddToScene->setEnabled(false); _itemRemoveFromScene->setEnabled(true); @@ -1309,7 +1309,7 @@ PauseResumeTargetTest2::PauseResumeTargetTest2() _itemAddToScene->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); _itemAddToScene->setPosition(VisibleRect::right() + Vec2(-150.0f, -50.0f)); - _itemRemoveFromScene = MenuItemFont::create("removeFromScene", [=](Ref* sender) { + _itemRemoveFromScene = MenuItemFont::create("removeFromScene", [=](Object* sender) { _itemAddToScene->setEnabled(true); _itemRemoveFromScene->setEnabled(false); _touchableSprite->removeFromParentAndCleanup(false); @@ -1359,7 +1359,7 @@ PauseResumeTargetTest3::PauseResumeTargetTest3() _touchableSprite->setPosition(origin + Vec2(size.width / 2, size.height / 2) + Vec2(-80.0f, 40.0f)); addChild(_touchableSprite); - auto item = MenuItemFont::create("addListener", [=](Ref* sender) { + auto item = MenuItemFont::create("addListener", [=](Object* sender) { MenuItemFont* senderItem = static_cast(sender); senderItem->setEnabled(false); @@ -1427,13 +1427,13 @@ Issue4129::Issue4129() : _bugFixed(false) _bugFixed = true; }); - auto removeAllTouchItem = MenuItemFont::create("Remove All Listeners", [this](Ref* sender) { + auto removeAllTouchItem = MenuItemFont::create("Remove All Listeners", [this](Object* sender) { auto senderItem = static_cast(sender); senderItem->setString("Only 'Reset' item could be clicked"); _eventDispatcher->removeAllEventListeners(); - auto nextItem = MenuItemFont::create("Reset", [=](Ref* sender) { + auto nextItem = MenuItemFont::create("Reset", [=](Object* sender) { AXASSERT(_bugFixed, "This issue was not fixed!"); getTestSuite()->restartCurrTest(); }); @@ -1723,7 +1723,7 @@ Issue8194::Issue8194() // When click this menuitem, it will add two node A and B, then send a custom event. // Because Node B's localZOrder < A's, the custom event should process by node B. - auto menuItem = MenuItemFont::create("Dispatch Custom Event", [this](Ref* sender) { + auto menuItem = MenuItemFont::create("Dispatch Custom Event", [this](Object* sender) { // add nodeA to scene auto nodeA = Node::create(); addChild(nodeA, 1, tagA); @@ -1785,7 +1785,7 @@ Issue9898::Issue9898() _eventDispatcher->addEventListenerWithSceneGraphPriority(_listener, nodeA); auto menuItem = MenuItemFont::create("Dispatch Custom Event", - [&](Ref* sender) { _eventDispatcher->dispatchCustomEvent("Issue9898"); }); + [&](Object* sender) { _eventDispatcher->dispatchCustomEvent("Issue9898"); }); menuItem->setPosition(origin.x + size.width / 2, origin.y + size.height / 2); auto menu = Menu::create(menuItem, nullptr); menu->setPosition(Vec2::ZERO); diff --git a/tests/cpp-tests/Source/NewRendererTest/NewRendererTest.cpp b/tests/cpp-tests/Source/NewRendererTest/NewRendererTest.cpp index 12c10b53a7fa..9fa72393b453 100644 --- a/tests/cpp-tests/Source/NewRendererTest/NewRendererTest.cpp +++ b/tests/cpp-tests/Source/NewRendererTest/NewRendererTest.cpp @@ -548,13 +548,13 @@ void SpriteCreation::doTest() spriteCache.clear(); } -void SpriteCreation::addSpritesCallback(ax::Ref*) +void SpriteCreation::addSpritesCallback(ax::Object*) { updateSpriteCountLabel(totalSprites + suggestDelta); doTest(); } -void SpriteCreation::delSpritesCallback(ax::Ref*) +void SpriteCreation::delSpritesCallback(ax::Object*) { updateSpriteCountLabel(totalSprites - suggestDelta); doTest(); @@ -649,7 +649,7 @@ std::string CaptureScreenTest::subtitle() const return "Capture screen test, press the menu items to capture the screen"; } -void CaptureScreenTest::onCaptured(Ref*) +void CaptureScreenTest::onCaptured(Object*) { Director::getInstance()->getTextureCache()->removeTextureForKey(_filename); removeChildByTag(childTag); @@ -722,7 +722,7 @@ std::string CaptureNodeTest::subtitle() const return "Capture node test, press the menu items to capture this scene with scale 0.5"; } -void CaptureNodeTest::onCaptured(Ref*) +void CaptureNodeTest::onCaptured(Object*) { Director::getInstance()->getTextureCache()->removeTextureForKey(_filename); removeChildByTag(childTag); diff --git a/tests/cpp-tests/Source/NewRendererTest/NewRendererTest.h b/tests/cpp-tests/Source/NewRendererTest/NewRendererTest.h index 85c7047743c4..c8fd56025b12 100644 --- a/tests/cpp-tests/Source/NewRendererTest/NewRendererTest.h +++ b/tests/cpp-tests/Source/NewRendererTest/NewRendererTest.h @@ -126,8 +126,8 @@ class SpriteCreation : public MultiSceneTest virtual std::string title() const override; virtual std::string subtitle() const override; - void addSpritesCallback(Ref*); - void delSpritesCallback(Ref*); + void addSpritesCallback(Object*); + void delSpritesCallback(Object*); void updateSpriteCountLabel(int x); @@ -168,7 +168,7 @@ class CaptureScreenTest : public MultiSceneTest CaptureScreenTest(); ~CaptureScreenTest(); - void onCaptured(ax::Ref*); + void onCaptured(ax::Object*); void afterCaptured(bool succeed, std::string_view outputFile); std::string _filename; @@ -187,7 +187,7 @@ class CaptureNodeTest : public MultiSceneTest CaptureNodeTest(); ~CaptureNodeTest(); - void onCaptured(ax::Ref*); + void onCaptured(ax::Object*); std::string _filename; }; diff --git a/tests/cpp-tests/Source/ParticleTest/ParticleTest.cpp b/tests/cpp-tests/Source/ParticleTest/ParticleTest.cpp index 4761e1206937..920266303a93 100644 --- a/tests/cpp-tests/Source/ParticleTest/ParticleTest.cpp +++ b/tests/cpp-tests/Source/ParticleTest/ParticleTest.cpp @@ -2320,7 +2320,7 @@ void ParticleDemo::update(float dt) } } -void ParticleDemo::toggleCallback(Ref* sender) +void ParticleDemo::toggleCallback(Object* sender) { if (_emitter != nullptr) { @@ -3160,11 +3160,11 @@ void ParticleResetTotalParticles::onEnter() this->addChild(p); auto add = MenuItemFont::create("add 10 particles", - [p](Ref*) -> void { p->setTotalParticles(p->getTotalParticles() + 10); }); + [p](Object*) -> void { p->setTotalParticles(p->getTotalParticles() + 10); }); add->setFontSizeObj(20); add->setPosition(Vec2(0, 25)); - auto remove = MenuItemFont::create("remove 10 particles", [p](Ref*) -> void { + auto remove = MenuItemFont::create("remove 10 particles", [p](Object*) -> void { int count = p->getTotalParticles() - 10; if (count < 0) { diff --git a/tests/cpp-tests/Source/ParticleTest/ParticleTest.h b/tests/cpp-tests/Source/ParticleTest/ParticleTest.h index 49cede133a95..925ba63819e2 100644 --- a/tests/cpp-tests/Source/ParticleTest/ParticleTest.h +++ b/tests/cpp-tests/Source/ParticleTest/ParticleTest.h @@ -44,7 +44,7 @@ class ParticleDemo : public TestCase virtual std::string title() const override; virtual std::string subtitle() const override; - void toggleCallback(ax::Ref* sender); + void toggleCallback(ax::Object* sender); void onTouchesBegan(const std::vector& touches, ax::Event* event); void onTouchesMoved(const std::vector& touches, ax::Event* event); diff --git a/tests/cpp-tests/Source/Physics3DTest/Physics3DTest.cpp b/tests/cpp-tests/Source/Physics3DTest/Physics3DTest.cpp index 666eb8725351..38e1c1527594 100644 --- a/tests/cpp-tests/Source/Physics3DTest/Physics3DTest.cpp +++ b/tests/cpp-tests/Source/Physics3DTest/Physics3DTest.cpp @@ -117,7 +117,7 @@ bool Physics3DTestDemo::init() TTFConfig ttfConfig("fonts/arial.ttf", 10); auto label = Label::createWithTTF(ttfConfig, "DebugDraw OFF"); - auto menuItem = MenuItemLabel::create(label, [=](Ref* /*ref*/) { + auto menuItem = MenuItemLabel::create(label, [=](Object* /*ref*/) { if (getPhysics3DWorld()->isDebugDrawEnabled()) { getPhysics3DWorld()->setDebugDrawEnable(false); diff --git a/tests/cpp-tests/Source/PhysicsTest/PhysicsTest.cpp b/tests/cpp-tests/Source/PhysicsTest/PhysicsTest.cpp index 22a9d26a73a2..86efe32e2536 100644 --- a/tests/cpp-tests/Source/PhysicsTest/PhysicsTest.cpp +++ b/tests/cpp-tests/Source/PhysicsTest/PhysicsTest.cpp @@ -123,7 +123,7 @@ Sprite* PhysicsDemo::addGrossiniAtPosition(Vec2 p, float scale /* = 1.0*/) return sp; } -void PhysicsDemo::toggleDebugCallback(Ref* /*sender*/) +void PhysicsDemo::toggleDebugCallback(Object* /*sender*/) { toggleDebug(); } @@ -500,7 +500,7 @@ void PhysicsDemoRayCast::onEnter() scheduleUpdate(); } -void PhysicsDemoRayCast::changeModeCallback(Ref* sender) +void PhysicsDemoRayCast::changeModeCallback(Object* sender) { _mode = (_mode + 1) % 3; @@ -1373,7 +1373,7 @@ void PhysicsContactTest::onEnter() resetTest(); } -void PhysicsContactTest::onDecrease(Ref* sender) +void PhysicsContactTest::onDecrease(Object* sender) { switch (dynamic_cast(sender)->getTag()) { @@ -1401,7 +1401,7 @@ void PhysicsContactTest::onDecrease(Ref* sender) resetTest(); } -void PhysicsContactTest::onIncrease(Ref* sender) +void PhysicsContactTest::onIncrease(Object* sender) { switch (dynamic_cast(sender)->getTag()) { @@ -1735,7 +1735,7 @@ void PhysicsDemoBug5482::onExit() _body->release(); } -void PhysicsDemoBug5482::changeBodyCallback(Ref* /*sender*/) +void PhysicsDemoBug5482::changeBodyCallback(Object* /*sender*/) { Sprite* node = _bodyInA ? _nodeB : _nodeA; if (_bodyInA) diff --git a/tests/cpp-tests/Source/PhysicsTest/PhysicsTest.h b/tests/cpp-tests/Source/PhysicsTest/PhysicsTest.h index 5f7cad4267ff..18d10a928bf4 100644 --- a/tests/cpp-tests/Source/PhysicsTest/PhysicsTest.h +++ b/tests/cpp-tests/Source/PhysicsTest/PhysicsTest.h @@ -43,7 +43,7 @@ class PhysicsDemo : public TestCase virtual void onEnter() override; virtual std::string title() const override; - void toggleDebugCallback(ax::Ref* sender); + void toggleDebugCallback(ax::Object* sender); ax::Sprite* addGrossiniAtPosition(ax::Vec2 p, float scale = 1.0); ax::Sprite* makeBall(ax::Vec2 point, @@ -115,7 +115,7 @@ class PhysicsDemoRayCast : public PhysicsDemo void update(float delta) override; void onTouchesEnded(const std::vector& touches, ax::Event* event); - void changeModeCallback(ax::Ref* sender); + void changeModeCallback(ax::Object* sender); bool anyRay(ax::PhysicsWorld& world, const ax::PhysicsRayCastInfo& info, void* data); @@ -212,8 +212,8 @@ class PhysicsContactTest : public PhysicsDemo virtual std::string title() const override; virtual std::string subtitle() const override; - void onDecrease(ax::Ref* sender); - void onIncrease(ax::Ref* sender); + void onDecrease(ax::Object* sender); + void onIncrease(ax::Object* sender); private: int _yellowBoxNum; @@ -252,7 +252,7 @@ class PhysicsDemoBug5482 : public PhysicsDemo virtual std::string title() const override; virtual std::string subtitle() const override; - void changeBodyCallback(ax::Ref* sender); + void changeBodyCallback(ax::Object* sender); private: ax::Sprite* _nodeA; diff --git a/tests/cpp-tests/Source/ReleasePoolTest/ReleasePoolTest.cpp b/tests/cpp-tests/Source/ReleasePoolTest/ReleasePoolTest.cpp index 8c85713463ad..2c4efdc80559 100644 --- a/tests/cpp-tests/Source/ReleasePoolTest/ReleasePoolTest.cpp +++ b/tests/cpp-tests/Source/ReleasePoolTest/ReleasePoolTest.cpp @@ -31,7 +31,7 @@ ReleasePoolTests::ReleasePoolTests() ADD_TEST_CASE(ReleasePoolTest); } -class TestObject : public Ref +class TestObject : public Object { public: TestObject() : _name("") {} diff --git a/tests/cpp-tests/Source/RenderTextureTest/RenderTextureTest.cpp b/tests/cpp-tests/Source/RenderTextureTest/RenderTextureTest.cpp index 35a2e3bc1cec..ab54365aeef5 100644 --- a/tests/cpp-tests/Source/RenderTextureTest/RenderTextureTest.cpp +++ b/tests/cpp-tests/Source/RenderTextureTest/RenderTextureTest.cpp @@ -85,17 +85,17 @@ std::string RenderTextureSave::subtitle() const return "Press 'Save Image' to create an snapshot of the render texture"; } -void RenderTextureSave::clearImage(ax::Ref* sender) +void RenderTextureSave::clearImage(ax::Object* sender) { _target->clear(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1()); } -void RenderTextureSave::clearImageTransparent(ax::Ref* sender) +void RenderTextureSave::clearImageTransparent(ax::Object* sender) { _target->clear(0, 0, 0, 0); } -void RenderTextureSave::saveImageWithPremultipliedAlpha(ax::Ref* sender) +void RenderTextureSave::saveImageWithPremultipliedAlpha(ax::Object* sender) { static int counter = 0; @@ -120,7 +120,7 @@ void RenderTextureSave::saveImageWithPremultipliedAlpha(ax::Ref* sender) counter++; } -void RenderTextureSave::saveImageWithNonPremultipliedAlpha(ax::Ref* sender) +void RenderTextureSave::saveImageWithNonPremultipliedAlpha(ax::Object* sender) { static int counter = 0; @@ -146,7 +146,7 @@ void RenderTextureSave::saveImageWithNonPremultipliedAlpha(ax::Ref* sender) counter++; } -void RenderTextureSave::addImage(ax::Ref* sender) +void RenderTextureSave::addImage(ax::Object* sender) { auto s = Director::getInstance()->getWinSize(); @@ -639,7 +639,7 @@ RenderTextureTargetNode::RenderTextureTargetNode() menu->setPosition(Vec2(s.width / 2, s.height / 2)); } -void RenderTextureTargetNode::touched(Ref* sender) +void RenderTextureTargetNode::touched(Object* sender) { // TODO: minggo if (renderTexture->getClearFlags() == ClearFlag::NONE) @@ -783,7 +783,7 @@ Issue16113Test::Issue16113Test() // Save Image menu MenuItemFont::setFontSize(16); - auto item1 = MenuItemFont::create("Save Image", [&](Ref* ref) { + auto item1 = MenuItemFont::create("Save Image", [&](Object* ref) { auto winSize = Director::getInstance()->getVisibleSize(); auto text = Label::createWithTTF("hello world", "fonts/Marker Felt.ttf", 40); text->setTextColor(Color4B::RED); diff --git a/tests/cpp-tests/Source/RenderTextureTest/RenderTextureTest.h b/tests/cpp-tests/Source/RenderTextureTest/RenderTextureTest.h index 3af3e38360d2..8a96fa553dd7 100644 --- a/tests/cpp-tests/Source/RenderTextureTest/RenderTextureTest.h +++ b/tests/cpp-tests/Source/RenderTextureTest/RenderTextureTest.h @@ -43,11 +43,11 @@ class RenderTextureSave : public RenderTextureTest virtual std::string title() const override; virtual std::string subtitle() const override; void onTouchesMoved(const std::vector& touches, ax::Event* event); - void clearImage(ax::Ref* pSender); - void clearImageTransparent(ax::Ref* sender); - void saveImageWithPremultipliedAlpha(ax::Ref* pSender); - void saveImageWithNonPremultipliedAlpha(ax::Ref* pSender); - void addImage(ax::Ref* sender); + void clearImage(ax::Object* pSender); + void clearImageTransparent(ax::Object* sender); + void saveImageWithPremultipliedAlpha(ax::Object* pSender); + void saveImageWithNonPremultipliedAlpha(ax::Object* pSender); + void addImage(ax::Object* sender); private: ax::RenderTexture* _target; @@ -130,7 +130,7 @@ class RenderTextureTargetNode : public RenderTextureTest virtual std::string title() const override; virtual std::string subtitle() const override; - void touched(ax::Ref* sender); + void touched(ax::Object* sender); }; class RenderTexturePartTest : public RenderTextureTest diff --git a/tests/cpp-tests/Source/Scene3DTest/Scene3DTest.cpp b/tests/cpp-tests/Source/Scene3DTest/Scene3DTest.cpp index d28c0cc865a8..4c5ca943a16d 100644 --- a/tests/cpp-tests/Source/Scene3DTest/Scene3DTest.cpp +++ b/tests/cpp-tests/Source/Scene3DTest/Scene3DTest.cpp @@ -447,7 +447,7 @@ void Scene3DTestScene::createUI() // first, add menu to ui // create player button - auto showPlayerDlgItem = MenuItemImage::create("Images/Pea.png", "Images/Pea.png", [this](Ref* sender) { + auto showPlayerDlgItem = MenuItemImage::create("Images/Pea.png", "Images/Pea.png", [this](Object* sender) { this->_playerDlg->setVisible(!this->_playerDlg->isVisible()); }); showPlayerDlgItem->setName("showPlayerDlgItem"); @@ -455,7 +455,7 @@ void Scene3DTestScene::createUI() // create description button TTFConfig ttfConfig("fonts/arial.ttf", 20); - auto descItem = MenuItemLabel::create(Label::createWithTTF(ttfConfig, "Description"), [this](Ref* sender) { + auto descItem = MenuItemLabel::create(Label::createWithTTF(ttfConfig, "Description"), [this](Object* sender) { if (this->_descDlg->isVisible()) { // hide descDlg @@ -487,7 +487,7 @@ void Scene3DTestScene::createUI() cb->setName(text); cb->setAnchorPoint(Vec2(0, 0.5)); cb->setScale(0.8f); - cb->addClickEventListener([this](Ref* sender) { + cb->addClickEventListener([this](Object* sender) { auto index = static_cast(sender)->getTag(); auto camera = this->_gameCameras[index]; camera->setVisible(!camera->isVisible()); @@ -571,7 +571,7 @@ void Scene3DTestScene::createPlayerDlg() item->setScale(1.5); item->setAnchorPoint(itemAnchor); item->setPosition(itemPos); - item->addClickEventListener([this](Ref* sender) { this->_detailDlg->setVisible(!this->_detailDlg->isVisible()); }); + item->addClickEventListener([this](Object* sender) { this->_detailDlg->setVisible(!this->_detailDlg->isVisible()); }); _playerDlg->addChild(item); // second, add 3d actor, which on dialog layer @@ -587,7 +587,7 @@ void Scene3DTestScene::createPlayerDlg() zoomIn->setScale(0.5); zoomIn->setAnchorPoint(Vec2(1, 1)); zoomIn->setPosition(Vec2(bgSize.width / 2 - margin / 2, bgSize.height - margin)); - zoomIn->addClickEventListener([girl](Ref* sender) { girl->setScale(girl->getScale() * 2); }); + zoomIn->addClickEventListener([girl](Object* sender) { girl->setScale(girl->getScale() * 2); }); zoomIn->setTitleText("Zoom In"); zoomIn->setName("Zoom In"); zoomIn->setCameraMask(s_CM[LAYER_TOP]); @@ -597,7 +597,7 @@ void Scene3DTestScene::createPlayerDlg() zoomOut->setScale(0.5); zoomOut->setAnchorPoint(Vec2(0, 1)); zoomOut->setPosition(Vec2(bgSize.width / 2 + margin / 2, bgSize.height - margin)); - zoomOut->addClickEventListener([girl](Ref* sender) { girl->setScale(girl->getScale() / 2); }); + zoomOut->addClickEventListener([girl](Object* sender) { girl->setScale(girl->getScale() / 2); }); zoomOut->setTitleText("Zoom Out"); zoomOut->setName("Zoom Out"); zoomOut->setCameraMask(s_CM[LAYER_TOP]); @@ -608,7 +608,7 @@ void Scene3DTestScene::createPlayerDlg() slider->setScale9Enabled(true); slider->setPosition(Vec2(bgSize.width / 2, margin)); slider->setContentSize(Size(bgSize.width - margin, slider->getContentSize().height)); - slider->addEventListener([girl, slider](Ref* sender, ui::Slider::EventType type) { + slider->addEventListener([girl, slider](Object* sender, ui::Slider::EventType type) { girl->setRotation3D(Vec3(0, 360 * slider->getPercent() / 100, 0)); }); slider->setName("Slider"); @@ -644,7 +644,7 @@ void Scene3DTestScene::createDetailDlg() capture->setScale(0.5); capture->setAnchorPoint(Vec2(0.5, 0)); capture->setPosition(Vec2(dlgSize.width / 3, margin)); - capture->addClickEventListener([this](Ref* sender) { + capture->addClickEventListener([this](Object* sender) { Director::getInstance()->getTextureCache()->removeTextureForKey(_snapshotFile); _osdScene->removeChildByTag(SNAPSHOT_TAG); _snapshotFile = "CaptureScreenTest.png"; @@ -672,7 +672,7 @@ void Scene3DTestScene::createDetailDlg() remove->setScale(0.5); remove->setAnchorPoint(Vec2(0.5, 0)); remove->setPosition(Vec2(dlgSize.width * 2 / 3, margin)); - remove->addClickEventListener([this](Ref* sender) { _osdScene->removeChildByTag(SNAPSHOT_TAG); }); + remove->addClickEventListener([this](Object* sender) { _osdScene->removeChildByTag(SNAPSHOT_TAG); }); remove->setTitleText("Del Snapshot"); remove->setName("Del Snapshot"); _detailDlg->addChild(remove); @@ -817,7 +817,7 @@ void Scene3DTestScene::createDescDlg() btn->setAnchorPoint(Vec2(1, 0)); btn->setPosition(btnPos); btnPos.y += 20; - btn->addClickEventListener([this, applyCurSkin](Ref* sender) { + btn->addClickEventListener([this, applyCurSkin](Object* sender) { auto index = static_cast(sender)->getTag(); if (index < SkinType::MAX_TYPE) { diff --git a/tests/cpp-tests/Source/SceneTest/SceneTest.cpp b/tests/cpp-tests/Source/SceneTest/SceneTest.cpp index 47596abb51e5..623c25008432 100644 --- a/tests/cpp-tests/Source/SceneTest/SceneTest.cpp +++ b/tests/cpp-tests/Source/SceneTest/SceneTest.cpp @@ -92,19 +92,19 @@ SceneTestLayer1::~SceneTestLayer1() // NSLog(@"SceneTestLayer1 - dealloc"); } -void SceneTestLayer1::onPushScene(Ref* sender) +void SceneTestLayer1::onPushScene(Object* sender) { auto scene = SceneTestScene::create(2); Director::getInstance()->pushScene(scene); } -void SceneTestLayer1::onPushSceneTran(Ref* sender) +void SceneTestLayer1::onPushSceneTran(Object* sender) { auto scene = SceneTestScene::create(2); Director::getInstance()->pushScene(TransitionSlideInT::create(1, scene)); } -void SceneTestLayer1::onQuit(Ref* sender) +void SceneTestLayer1::onQuit(Object* sender) { // getCocosApp()->exit(); // Director::getInstance()->popScene(); @@ -153,18 +153,18 @@ void SceneTestLayer2::testDealloc(float dt) // onReplaceScene(this); } -void SceneTestLayer2::onGoBack(Ref* sender) +void SceneTestLayer2::onGoBack(Object* sender) { Director::getInstance()->popScene(); } -void SceneTestLayer2::onReplaceScene(Ref* sender) +void SceneTestLayer2::onReplaceScene(Object* sender) { auto scene = SceneTestScene::create(3); Director::getInstance()->replaceScene(scene); } -void SceneTestLayer2::onReplaceSceneTran(Ref* sender) +void SceneTestLayer2::onReplaceSceneTran(Object* sender) { auto scene = SceneTestScene::create(3); Director::getInstance()->replaceScene(TransitionFlipX::create(2, scene)); @@ -214,7 +214,7 @@ void SceneTestLayer3::testDealloc(float dt) ax::print("Layer3:testDealloc"); } -void SceneTestLayer3::item0Clicked(Ref* sender) +void SceneTestLayer3::item0Clicked(Object* sender) { auto s = Director::getInstance()->getWinSize(); auto newScene = Scene::createWithSize(s); @@ -222,17 +222,17 @@ void SceneTestLayer3::item0Clicked(Ref* sender) Director::getInstance()->pushScene(TransitionFade::create(0.5, newScene, Color3B(0, 255, 255))); } -void SceneTestLayer3::item1Clicked(Ref* sender) +void SceneTestLayer3::item1Clicked(Object* sender) { Director::getInstance()->popScene(); } -void SceneTestLayer3::item2Clicked(Ref* sender) +void SceneTestLayer3::item2Clicked(Object* sender) { Director::getInstance()->popToRootScene(); } -void SceneTestLayer3::item3Clicked(Ref* sender) +void SceneTestLayer3::item3Clicked(Object* sender) { Director::getInstance()->popToSceneStackLevel(2); } diff --git a/tests/cpp-tests/Source/SceneTest/SceneTest.h b/tests/cpp-tests/Source/SceneTest/SceneTest.h index e1544fe8bab7..f50c2a77e833 100644 --- a/tests/cpp-tests/Source/SceneTest/SceneTest.h +++ b/tests/cpp-tests/Source/SceneTest/SceneTest.h @@ -42,9 +42,9 @@ class SceneTestLayer1 : public ax::Layer virtual void onEnterTransitionDidFinish() override; void testDealloc(float dt); - void onPushScene(ax::Ref* sender); - void onPushSceneTran(ax::Ref* sender); - void onQuit(ax::Ref* sender); + void onPushScene(ax::Object* sender); + void onPushSceneTran(ax::Object* sender); + void onQuit(ax::Object* sender); }; class SceneTestLayer2 : public ax::Layer @@ -57,9 +57,9 @@ class SceneTestLayer2 : public ax::Layer SceneTestLayer2(); void testDealloc(float dt); - void onGoBack(ax::Ref* sender); - void onReplaceScene(ax::Ref* sender); - void onReplaceSceneTran(ax::Ref* sender); + void onGoBack(ax::Object* sender); + void onReplaceScene(ax::Object* sender); + void onReplaceSceneTran(ax::Object* sender); }; class SceneTestLayer3 : public ax::LayerColor @@ -71,10 +71,10 @@ class SceneTestLayer3 : public ax::LayerColor virtual bool init() override; virtual void testDealloc(float dt); - void item0Clicked(ax::Ref* sender); - void item1Clicked(ax::Ref* sender); - void item2Clicked(ax::Ref* sender); - void item3Clicked(ax::Ref* sender); + void item0Clicked(ax::Object* sender); + void item1Clicked(ax::Object* sender); + void item2Clicked(ax::Object* sender); + void item3Clicked(ax::Object* sender); }; class SceneTestScene : public TestCase diff --git a/tests/cpp-tests/Source/SchedulerTest/SchedulerTest.cpp b/tests/cpp-tests/Source/SchedulerTest/SchedulerTest.cpp index 62a19dacf59e..d8e62d3d674d 100644 --- a/tests/cpp-tests/Source/SchedulerTest/SchedulerTest.cpp +++ b/tests/cpp-tests/Source/SchedulerTest/SchedulerTest.cpp @@ -598,7 +598,7 @@ void SchedulerUpdate::removeUpdates(float /*dt*/) for (auto&& c : children) { - auto obj = static_cast(c); + auto obj = static_cast(c); auto node = static_cast(obj); if (!node) @@ -777,7 +777,7 @@ ControlSlider* SchedulerTimeScale::sliderCtl() return slider; } -void SchedulerTimeScale::sliderAction(Ref* sender, Control::EventType /*controlEvent*/) +void SchedulerTimeScale::sliderAction(Object* sender, Control::EventType /*controlEvent*/) { ControlSlider* pSliderCtl = static_cast(sender); float scale; @@ -871,7 +871,7 @@ ControlSlider* TwoSchedulers::sliderCtl() return slider; } -void TwoSchedulers::sliderAction(Ref* sender, Control::EventType /*controlEvent*/) +void TwoSchedulers::sliderAction(Object* sender, Control::EventType /*controlEvent*/) { float scale; diff --git a/tests/cpp-tests/Source/SchedulerTest/SchedulerTest.h b/tests/cpp-tests/Source/SchedulerTest/SchedulerTest.h index 139e9e7c12f0..234d9f969e3d 100644 --- a/tests/cpp-tests/Source/SchedulerTest/SchedulerTest.h +++ b/tests/cpp-tests/Source/SchedulerTest/SchedulerTest.h @@ -273,7 +273,7 @@ class SchedulerTimeScale : public SchedulerTestLayer virtual std::string title() const override; virtual std::string subtitle() const override; ax::extension::ControlSlider* sliderCtl(); - void sliderAction(ax::Ref* sender, ax::extension::Control::EventType controlEvent); + void sliderAction(ax::Object* sender, ax::extension::Control::EventType controlEvent); ax::extension::ControlSlider* _sliderCtl; }; @@ -287,7 +287,7 @@ class TwoSchedulers : public SchedulerTestLayer virtual std::string subtitle() const override; void onEnter() override; ax::extension::ControlSlider* sliderCtl(); - void sliderAction(ax::Ref* sender, ax::extension::Control::EventType controlEvent); + void sliderAction(ax::Object* sender, ax::extension::Control::EventType controlEvent); ax::Scheduler* sched1; ax::Scheduler* sched2; ax::ActionManager* actionManager1; diff --git a/tests/cpp-tests/Source/ShaderTest/ShaderTest.cpp b/tests/cpp-tests/Source/ShaderTest/ShaderTest.cpp index 7355ae5f5dc0..b39e48bfcad3 100644 --- a/tests/cpp-tests/Source/ShaderTest/ShaderTest.cpp +++ b/tests/cpp-tests/Source/ShaderTest/ShaderTest.cpp @@ -541,13 +541,13 @@ bool ShaderBlur::init() return false; } -void ShaderBlur::onRadiusChanged(Ref* sender, Control::EventType) +void ShaderBlur::onRadiusChanged(Object* sender, Control::EventType) { ControlSlider* slider = (ControlSlider*)sender; _blurSprite->setBlurRadius(slider->getValue()); } -void ShaderBlur::onSampleNumChanged(Ref* sender, Control::EventType) +void ShaderBlur::onSampleNumChanged(Object* sender, Control::EventType) { ControlSlider* slider = (ControlSlider*)sender; _blurSprite->setBlurSampleNum(slider->getValue()); @@ -712,7 +712,7 @@ ui::Slider* ShaderMultiTexture::createSliderCtl() slider->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 3.0f)); addChild(slider); - slider->addEventListener([&](Ref* sender, ui::Slider::EventType type) { + slider->addEventListener([&](Object* sender, ui::Slider::EventType type) { if (type == ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { ui::Slider* slider = dynamic_cast(sender); @@ -769,7 +769,7 @@ bool ShaderMultiTexture::init() return false; } -void ShaderMultiTexture::changeTexture(Ref*) +void ShaderMultiTexture::changeTexture(Object*) { static const int textureFilesCount = 3; static const std::string textureFiles[textureFilesCount] = {"Images/grossini.png", "Images/grossinis_sister1.png", diff --git a/tests/cpp-tests/Source/ShaderTest/ShaderTest.h b/tests/cpp-tests/Source/ShaderTest/ShaderTest.h index 9c05d0c3e3f1..6bcac4e9cffb 100644 --- a/tests/cpp-tests/Source/ShaderTest/ShaderTest.h +++ b/tests/cpp-tests/Source/ShaderTest/ShaderTest.h @@ -112,8 +112,8 @@ class ShaderBlur : public ShaderTestDemo virtual std::string subtitle() const override; virtual bool init() override; void createSliderCtls(); - void onRadiusChanged(ax::Ref* sender, ax::extension::Control::EventType controlEvent); - void onSampleNumChanged(ax::Ref* sender, ax::extension::Control::EventType controlEvent); + void onRadiusChanged(ax::Object* sender, ax::extension::Control::EventType controlEvent); + void onSampleNumChanged(ax::Object* sender, ax::extension::Control::EventType controlEvent); protected: SpriteBlur* _blurSprite; @@ -212,7 +212,7 @@ class ShaderMultiTexture : public ShaderTestDemo CREATE_FUNC(ShaderMultiTexture); ShaderMultiTexture(); ax::ui::Slider* createSliderCtl(); - void changeTexture(ax::Ref*); + void changeTexture(ax::Object*); int _changedTextureId; ax::Sprite* _sprite; diff --git a/tests/cpp-tests/Source/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Source/ShaderTest/ShaderTest2.cpp index f9d31d85b9b1..bf4e4221a6c5 100644 --- a/tests/cpp-tests/Source/ShaderTest/ShaderTest2.cpp +++ b/tests/cpp-tests/Source/ShaderTest/ShaderTest2.cpp @@ -475,14 +475,14 @@ bool EffectSpriteTest::init() auto s = Director::getInstance()->getWinSize(); - auto itemPrev = MenuItemImage::create("Images/b1.png", "Images/b2.png", [&](Ref* sender) { + auto itemPrev = MenuItemImage::create("Images/b1.png", "Images/b2.png", [&](Object* sender) { _vectorIndex--; if (_vectorIndex < 0) _vectorIndex = _effects.size() - 1; _sprite->setEffect(_effects.at(_vectorIndex)); }); - auto itemNext = MenuItemImage::create("Images/f1.png", "Images/f2.png", [&](Ref* sender) { + auto itemNext = MenuItemImage::create("Images/f1.png", "Images/f2.png", [&](Object* sender) { _vectorIndex++; if (_vectorIndex >= _effects.size()) _vectorIndex = 0; diff --git a/tests/cpp-tests/Source/ShaderTest/ShaderTest2.h b/tests/cpp-tests/Source/ShaderTest/ShaderTest2.h index bb15dadc23a4..e26766f6d4c6 100644 --- a/tests/cpp-tests/Source/ShaderTest/ShaderTest2.h +++ b/tests/cpp-tests/Source/ShaderTest/ShaderTest2.h @@ -41,7 +41,7 @@ class ShaderTestDemo2 : public TestCase // class EffectSprite; -class Effect : public ax::Ref +class Effect : public ax::Object { public: ax::backend::ProgramState* getProgramState() const { return _programState; } diff --git a/tests/cpp-tests/Source/SpritePolygonTest/SpritePolygonTest.cpp b/tests/cpp-tests/Source/SpritePolygonTest/SpritePolygonTest.cpp index 4524f3a6206b..6dfa67cc75bd 100644 --- a/tests/cpp-tests/Source/SpritePolygonTest/SpritePolygonTest.cpp +++ b/tests/cpp-tests/Source/SpritePolygonTest/SpritePolygonTest.cpp @@ -78,7 +78,7 @@ bool SpritePolygonTestCase::init() { TTFConfig ttfConfig("fonts/arial.ttf", 10); auto label = Label::createWithTTF(ttfConfig, "DebugDraw OFF"); - auto menuItem = MenuItemLabel::create(label, [=](Ref* ref) { + auto menuItem = MenuItemLabel::create(label, [=](Object* ref) { if (_isDebugDraw) { _isDebugDraw = false; @@ -328,7 +328,7 @@ void SpritePolygonTestSlider::makeSprites(const std::string* list, const int cou } } -void SpritePolygonTestSlider::changeEpsilon(ax::Ref* pSender, ax::ui::Slider::EventType type) +void SpritePolygonTestSlider::changeEpsilon(ax::Object* pSender, ax::ui::Slider::EventType type) { if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED) { diff --git a/tests/cpp-tests/Source/SpritePolygonTest/SpritePolygonTest.h b/tests/cpp-tests/Source/SpritePolygonTest/SpritePolygonTest.h index 147320ea9304..77fcdeb1baef 100644 --- a/tests/cpp-tests/Source/SpritePolygonTest/SpritePolygonTest.h +++ b/tests/cpp-tests/Source/SpritePolygonTest/SpritePolygonTest.h @@ -84,7 +84,7 @@ class SpritePolygonTestSlider : public SpritePolygonTestCase void initSliders(); virtual void initSprites(){}; void makeSprites(const std::string* list, const int count, const float y); - void changeEpsilon(Ref* pSender, ax::ui::Slider::EventType type); + void changeEpsilon(Object* pSender, ax::ui::Slider::EventType type); void updateLabel(const ax::Sprite* sp, const ax::PolygonInfo& pinfo); }; diff --git a/tests/cpp-tests/Source/Texture2dTest/Texture2dTest.cpp b/tests/cpp-tests/Source/Texture2dTest/Texture2dTest.cpp index e281e04f2fba..bf88e2b56c04 100644 --- a/tests/cpp-tests/Source/Texture2dTest/Texture2dTest.cpp +++ b/tests/cpp-tests/Source/Texture2dTest/Texture2dTest.cpp @@ -2128,7 +2128,7 @@ void TextureMemoryAlloc::onEnter() menu2->setPosition(Vec2(s.width / 2, s.height / 4)); } -void TextureMemoryAlloc::changeBackgroundVisible(ax::Ref* sender) +void TextureMemoryAlloc::changeBackgroundVisible(ax::Object* sender) { if (_background) { @@ -2136,7 +2136,7 @@ void TextureMemoryAlloc::changeBackgroundVisible(ax::Ref* sender) } } -void TextureMemoryAlloc::updateImage(ax::Ref* sender) +void TextureMemoryAlloc::updateImage(ax::Object* sender) { if (_background) { diff --git a/tests/cpp-tests/Source/Texture2dTest/Texture2dTest.h b/tests/cpp-tests/Source/Texture2dTest/Texture2dTest.h index b86756cfd0ca..51e84a6513c5 100644 --- a/tests/cpp-tests/Source/Texture2dTest/Texture2dTest.h +++ b/tests/cpp-tests/Source/Texture2dTest/Texture2dTest.h @@ -546,8 +546,8 @@ class TextureMemoryAlloc : public TextureDemo virtual void onEnter() override; virtual std::string title() const override; virtual std::string subtitle() const override; - void updateImage(ax::Ref* sender); - void changeBackgroundVisible(ax::Ref* sender); + void updateImage(ax::Object* sender); + void changeBackgroundVisible(ax::Object* sender); private: ax::Sprite* _background; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index 88e72e66e34e..e799c59f083d 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -111,7 +111,7 @@ bool UIButtonTest::init() return false; } -void UIButtonTest::touchEvent(Ref* pSender, Widget::TouchEventType type) +void UIButtonTest::touchEvent(Object* pSender, Widget::TouchEventType type) { switch (type) { @@ -147,7 +147,7 @@ void UIButtonTest::touchEvent(Ref* pSender, Widget::TouchEventType type) } } -void UIButtonTest::printWidgetResources(ax::Ref* sender) +void UIButtonTest::printWidgetResources(ax::Object* sender) { ax::ResourceData normalFileName = _button->getNormalFile(); AXLOG("normalFileName Name : %s, Type: %d", normalFileName.file.c_str(), normalFileName.type); @@ -209,7 +209,7 @@ bool UIButtonTest_Scale9::init() return false; } -void UIButtonTest_Scale9::touchEvent(Ref* pSender, Widget::TouchEventType type) +void UIButtonTest_Scale9::touchEvent(Object* pSender, Widget::TouchEventType type) { switch (type) { @@ -291,7 +291,7 @@ bool UIButtonTest_Scale9_State_Change::init() return false; } -void UIButtonTest_Scale9_State_Change::touchEvent(Ref* pSender, Widget::TouchEventType type) +void UIButtonTest_Scale9_State_Change::touchEvent(Object* pSender, Widget::TouchEventType type) { switch (type) { @@ -371,7 +371,7 @@ bool UIButtonTest_PressedAction::init() return false; } -void UIButtonTest_PressedAction::touchEvent(Ref* pSender, Widget::TouchEventType type) +void UIButtonTest_PressedAction::touchEvent(Object* pSender, Widget::TouchEventType type) { switch (type) { @@ -463,7 +463,7 @@ bool UIButtonTest_Title::init() return false; } -void UIButtonTest_Title::touchEvent(Ref* pSender, Widget::TouchEventType type) +void UIButtonTest_Title::touchEvent(Object* pSender, Widget::TouchEventType type) { switch (type) { @@ -549,7 +549,7 @@ bool UIButtonTestRemoveSelf::init() return false; } -void UIButtonTestRemoveSelf::touchEvent(Ref* pSender, Widget::TouchEventType type) +void UIButtonTestRemoveSelf::touchEvent(Object* pSender, Widget::TouchEventType type) { switch (type) { @@ -609,7 +609,7 @@ bool UIButtonTestSwitchScale9::init() return false; } -void UIButtonTestSwitchScale9::touchEvent(Ref* pSender, Widget::TouchEventType type) +void UIButtonTestSwitchScale9::touchEvent(Object* pSender, Widget::TouchEventType type) { switch (type) { @@ -660,7 +660,7 @@ bool UIButtonTestZoomScale::init() Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + 20)); button->setPressedActionEnabled(true); - button->addClickEventListener([=](Ref* sender) { + button->addClickEventListener([=](Object* sender) { AXLOG("Button clicked, position = (%f, %f)", button->getPosition().x, button->getPosition().y); }); button->setName("button"); @@ -680,7 +680,7 @@ bool UIButtonTestZoomScale::init() return false; } -void UIButtonTestZoomScale::sliderEvent(Ref* pSender, Slider::EventType type) +void UIButtonTestZoomScale::sliderEvent(Object* pSender, Slider::EventType type) { if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -719,7 +719,7 @@ bool UIButtonTextOnly::init() button->getContentSize().height); button->setZoomScale(0.3f); button->setPressedActionEnabled(true); - button->addClickEventListener([](Ref* sender) { AXLOG("clicked!"); }); + button->addClickEventListener([](Object* sender) { AXLOG("clicked!"); }); _uiLayer->addChild(button); return true; @@ -752,7 +752,7 @@ bool UIButtonIgnoreContentSizeTest::init() button->setTitleText("PLAY GAME"); button->setZoomScale(0.3f); button->setPressedActionEnabled(true); - button->addClickEventListener([=](Ref* sender) { + button->addClickEventListener([=](Object* sender) { AXLOG("clicked!"); button->setScale(1.2f); }); @@ -766,7 +766,7 @@ bool UIButtonIgnoreContentSizeTest::init() button2->setTitleText("PLAY GAME"); button2->setZoomScale(0.3f); button2->setPressedActionEnabled(true); - button2->addClickEventListener([=](Ref* sender) { + button2->addClickEventListener([=](Object* sender) { button2->runAction(ScaleTo::create(1.0f, 1.2f)); AXLOG("clicked!"); }); @@ -945,7 +945,7 @@ bool UIButtonDisableDefaultTest::init() button->setBright(false); button->setScale9Enabled(true); button->setCapInsets(Rect(3, 3, 5, 5)); - button->addClickEventListener([=](Ref*) { button->setBright(true); }); + button->addClickEventListener([=](Object*) { button->setBright(true); }); _uiLayer->addChild(button); // Create the button @@ -1135,7 +1135,7 @@ bool UIButtonScale9ChangeSpriteFrame::init() button->setTitleText("Press me"); addChild(button); - button->addClickEventListener([sprite](Ref* button) { sprite->loadTexture("Images/blocks9.png"); }); + button->addClickEventListener([sprite](Object* button) { sprite->loadTexture("Images/blocks9.png"); }); return true; } diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h index 7340864863ab..1a0d7106ca50 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h @@ -39,9 +39,9 @@ class UIButtonTest : public UIScene ~UIButtonTest(); virtual bool init() override; - void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void touchEvent(ax::Object* sender, ax::ui::Widget::TouchEventType type); - void printWidgetResources(ax::Ref* sender); + void printWidgetResources(ax::Object* sender); protected: ax::ui::Text* _displayValueLabel; @@ -57,7 +57,7 @@ class UIButtonTest_Scale9 : public UIScene ~UIButtonTest_Scale9(); virtual bool init() override; - void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void touchEvent(ax::Object* sender, ax::ui::Widget::TouchEventType type); protected: ax::ui::Text* _displayValueLabel; @@ -72,7 +72,7 @@ class UIButtonTest_Scale9_State_Change : public UIScene ~UIButtonTest_Scale9_State_Change(); virtual bool init() override; - void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void touchEvent(ax::Object* sender, ax::ui::Widget::TouchEventType type); protected: ax::ui::Text* _displayValueLabel; @@ -87,7 +87,7 @@ class UIButtonTest_PressedAction : public UIScene ~UIButtonTest_PressedAction(); virtual bool init() override; - void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void touchEvent(ax::Object* sender, ax::ui::Widget::TouchEventType type); protected: ax::ui::Text* _displayValueLabel; @@ -102,7 +102,7 @@ class UIButtonTest_Title : public UIScene ~UIButtonTest_Title(); virtual bool init() override; - void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void touchEvent(ax::Object* sender, ax::ui::Widget::TouchEventType type); protected: ax::ui::Text* _displayValueLabel; @@ -117,7 +117,7 @@ class UIButtonTestRemoveSelf : public UIScene ~UIButtonTestRemoveSelf(); virtual bool init() override; - void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void touchEvent(ax::Object* sender, ax::ui::Widget::TouchEventType type); protected: ax::ui::Text* _displayValueLabel; @@ -132,7 +132,7 @@ class UIButtonTestSwitchScale9 : public UIScene ~UIButtonTestSwitchScale9(); virtual bool init() override; - void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void touchEvent(ax::Object* sender, ax::ui::Widget::TouchEventType type); protected: ax::ui::Text* _displayValueLabel; @@ -147,7 +147,7 @@ class UIButtonTestZoomScale : public UIScene ~UIButtonTestZoomScale(); virtual bool init() override; - void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); + void sliderEvent(ax::Object* sender, ax::ui::Slider::EventType type); protected: ax::ui::Text* _displayValueLabel; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp index e545ce43ca18..12cad88dc6b9 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp @@ -81,7 +81,7 @@ bool UICheckBoxTest::init() return false; } -void UICheckBoxTest::selectedEvent(Ref* pSender, CheckBox::EventType type) +void UICheckBoxTest::selectedEvent(Object* pSender, CheckBox::EventType type) { switch (type) { @@ -98,7 +98,7 @@ void UICheckBoxTest::selectedEvent(Ref* pSender, CheckBox::EventType type) } } -void UICheckBoxTest::printWidgetResources(ax::Ref* sender) +void UICheckBoxTest::printWidgetResources(ax::Object* sender) { ax::ResourceData backGroundFileName = _checkBox->getBackNormalFile(); AXLOG("backGroundFile Name : %s, Type: %d", backGroundFileName.file.c_str(), backGroundFileName.type); diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h index bfb64d2d52ac..7c2a1ff18116 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h @@ -39,9 +39,9 @@ class UICheckBoxTest : public UIScene ~UICheckBoxTest(); virtual bool init() override; - void selectedEvent(ax::Ref* sender, ax::ui::CheckBox::EventType type); + void selectedEvent(ax::Object* sender, ax::ui::CheckBox::EventType type); - void printWidgetResources(ax::Ref* sender); + void printWidgetResources(ax::Object* sender); protected: ax::ui::Text* _displayValueLabel; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIEditBoxTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIEditBoxTest.cpp index 76474137bc9b..3e643f462d15 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIEditBoxTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIEditBoxTest.cpp @@ -79,7 +79,7 @@ bool UIEditBoxTest::init() auto buttonSize = button->getContentSize(); button->setTitleText("Single Line"); button->setPosition(_editName->getPosition() + Vec2(editBoxSize.width / 2 + buttonSize.width / 2, 0.0f)); - button->addClickEventListener([=](Ref* ref) { _editName->setInputMode(ui::EditBox::InputMode::SINGLE_LINE); }); + button->addClickEventListener([=](Object* ref) { _editName->setInputMode(ui::EditBox::InputMode::SINGLE_LINE); }); addChild(button); // middle @@ -102,7 +102,7 @@ bool UIEditBoxTest::init() buttonPassword->setPosition(_editPassword->getPosition() + Vec2(editBoxSize.width / 2 + buttonSize.width / 2, 0.0f)); buttonPassword->addClickEventListener( - [=](Ref* ref) { _editPassword->setInputMode(ui::EditBox::InputMode::ANY); }); + [=](Object* ref) { _editPassword->setInputMode(ui::EditBox::InputMode::ANY); }); addChild(buttonPassword); // bottom @@ -129,7 +129,7 @@ bool UIEditBoxTest::init() buttonEmail->setTitleText("Multiline"); buttonEmail->setPosition(_editEmailParent->getPosition() + Vec2(editBoxSize.width / 2 + buttonSize.width / 2, 0.0f)); - buttonEmail->addClickEventListener([=](Ref* ref) { _editEmail->setInputMode(ui::EditBox::InputMode::ANY); }); + buttonEmail->addClickEventListener([=](Object* ref) { _editEmail->setInputMode(ui::EditBox::InputMode::ANY); }); addChild(buttonEmail); return true; @@ -213,7 +213,7 @@ bool UIEditBoxTestToggleVisibility::init() auto buttonSize = button->getContentSize(); button->setTitleText("Toggle Visibility"); button->setPosition(_editName->getPosition() + Vec2(editBoxSize.width / 2 + buttonSize.width / 2, 0.0f)); - button->addClickEventListener([=](Ref* ref) { _editName->setVisible(!_editName->isVisible()); }); + button->addClickEventListener([=](Object* ref) { _editName->setVisible(!_editName->isVisible()); }); addChild(button); // middle @@ -235,7 +235,7 @@ bool UIEditBoxTestToggleVisibility::init() buttonPassword->setPosition(_editPassword->getPosition() + Vec2(editBoxSize.width / 2 + buttonSize.width / 2, 0.0f)); buttonPassword->addClickEventListener( - [=](Ref* ref) { _editPassword->setVisible(!_editPassword->isVisible()); }); + [=](Object* ref) { _editPassword->setVisible(!_editPassword->isVisible()); }); addChild(buttonPassword); // bottom @@ -262,7 +262,7 @@ bool UIEditBoxTestToggleVisibility::init() buttonEmail->setTitleText("Toggle Visibility"); buttonEmail->setPosition(_editEmailParent->getPosition() + Vec2(editBoxSize.width / 2 + buttonSize.width / 2, 0.0f)); - buttonEmail->addClickEventListener([=](Ref* ref) { _editEmail->setVisible(!_editEmail->isVisible()); }); + buttonEmail->addClickEventListener([=](Object* ref) { _editEmail->setVisible(!_editEmail->isVisible()); }); addChild(buttonEmail); return true; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp index 59067f3f9c98..b5fec59d4afa 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp @@ -103,7 +103,7 @@ bool UIFocusTestBase::init() return false; } -void UIFocusTestBase::onImageViewClicked(ax::Ref* ref, Widget::TouchEventType touchType) +void UIFocusTestBase::onImageViewClicked(ax::Object* ref, Widget::TouchEventType touchType) { if (touchType == Widget::TouchEventType::ENDED) { @@ -211,7 +211,7 @@ bool UIFocusTestHorizontal::init() return false; } -void UIFocusTestHorizontal::toggleFocusLoop(ax::Ref* pObjc, Widget::TouchEventType type) +void UIFocusTestHorizontal::toggleFocusLoop(ax::Object* pObjc, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { @@ -271,7 +271,7 @@ bool UIFocusTestVertical::init() return false; } -void UIFocusTestVertical::toggleFocusLoop(ax::Ref* pObjc, Widget::TouchEventType type) +void UIFocusTestVertical::toggleFocusLoop(ax::Object* pObjc, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { @@ -367,7 +367,7 @@ bool UIFocusTestNestedLayout1::init() return false; } -void UIFocusTestNestedLayout1::toggleFocusLoop(ax::Ref* pObjc, Widget::TouchEventType type) +void UIFocusTestNestedLayout1::toggleFocusLoop(ax::Object* pObjc, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { @@ -463,7 +463,7 @@ bool UIFocusTestNestedLayout2::init() return false; } -void UIFocusTestNestedLayout2::toggleFocusLoop(ax::Ref* pObjc, Widget::TouchEventType type) +void UIFocusTestNestedLayout2::toggleFocusLoop(ax::Object* pObjc, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { @@ -564,7 +564,7 @@ bool UIFocusTestNestedLayout3::init() return false; } -void UIFocusTestNestedLayout3::toggleFocusLoop(ax::Ref* pObjc, Widget::TouchEventType type) +void UIFocusTestNestedLayout3::toggleFocusLoop(ax::Object* pObjc, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.h index 06e84e9adda5..bd85582e7c9e 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.h @@ -51,7 +51,7 @@ class UIFocusTestBase : public UIScene virtual void onDownKeyPressed(); virtual void onFocusChanged(ax::ui::Widget* widgetLostFocus, ax::ui::Widget* widgetGetFocus); - void onImageViewClicked(ax::Ref* ref, ax::ui::Widget::TouchEventType touchType); + void onImageViewClicked(ax::Object* ref, ax::ui::Widget::TouchEventType touchType); protected: ax::Menu* _dpadMenu; @@ -70,7 +70,7 @@ class UIFocusTestHorizontal : public UIFocusTestBase virtual bool init() override; - void toggleFocusLoop(ax::Ref*, ax::ui::Widget::TouchEventType); + void toggleFocusLoop(ax::Object*, ax::ui::Widget::TouchEventType); protected: ax::ui::Layout* _horizontalLayout; @@ -87,7 +87,7 @@ class UIFocusTestVertical : public UIFocusTestBase virtual bool init() override; - void toggleFocusLoop(ax::Ref*, ax::ui::Widget::TouchEventType); + void toggleFocusLoop(ax::Object*, ax::ui::Widget::TouchEventType); protected: ax::ui::Layout* _verticalLayout; @@ -104,7 +104,7 @@ class UIFocusTestNestedLayout1 : public UIFocusTestBase virtual bool init() override; - void toggleFocusLoop(ax::Ref*, ax::ui::Widget::TouchEventType); + void toggleFocusLoop(ax::Object*, ax::ui::Widget::TouchEventType); protected: ax::ui::Layout* _verticalLayout; @@ -121,7 +121,7 @@ class UIFocusTestNestedLayout2 : public UIFocusTestBase virtual bool init() override; - void toggleFocusLoop(ax::Ref*, ax::ui::Widget::TouchEventType); + void toggleFocusLoop(ax::Object*, ax::ui::Widget::TouchEventType); protected: ax::ui::Layout* _horizontalLayout; @@ -138,7 +138,7 @@ class UIFocusTestNestedLayout3 : public UIFocusTestBase virtual bool init() override; - void toggleFocusLoop(ax::Ref*, ax::ui::Widget::TouchEventType); + void toggleFocusLoop(ax::Object*, ax::ui::Widget::TouchEventType); protected: ax::ui::Layout* _verticalLayout; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp index 2067eb16f07b..ac6e658dde6f 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp @@ -74,7 +74,7 @@ bool UIImageViewTest::init() return false; } -void UIImageViewTest::printWidgetResources(ax::Ref* sender) +void UIImageViewTest::printWidgetResources(ax::Object* sender) { ax::ResourceData textureFile = _image->getRenderFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); @@ -136,7 +136,7 @@ bool UIImageViewTest_Scale9_State_Change::init() imageView->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); imageView->setTouchEnabled(true); - imageView->addTouchEventListener([=](Ref* sender, Widget::TouchEventType type) { + imageView->addTouchEventListener([=](Object* sender, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { if (imageView->isScale9Enabled()) @@ -200,7 +200,7 @@ bool UIImageViewTest_ContentSize::init() imageView->addChild(imageViewChild); imageView->setTouchEnabled(true); - imageView->addTouchEventListener([=](Ref* sender, Widget::TouchEventType type) { + imageView->addTouchEventListener([=](Object* sender, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { float width = AXRANDOM_0_1() * 200 + 50; @@ -253,14 +253,14 @@ bool UIImageViewFlipTest::init() toggleButton->setPosition(imageView->getPosition() + Vec2(-50.0f, -imageView->getContentSize().height / 2 - 20)); this->addChild(toggleButton); - toggleButton->addClickEventListener([=](Ref*) { imageView->setFlippedX(!imageView->isFlippedX()); }); + toggleButton->addClickEventListener([=](Object*) { imageView->setFlippedX(!imageView->isFlippedX()); }); auto toggleScale9 = Button::create(); toggleScale9->setTitleText("Toggle Scale9"); toggleScale9->setPosition(imageView->getPosition() + Vec2(+50.0f, -imageView->getContentSize().height / 2 - 20)); this->addChild(toggleScale9); - toggleScale9->addClickEventListener([=](Ref*) { + toggleScale9->addClickEventListener([=](Object*) { imageView->setScale9Enabled(!imageView->isScale9Enabled()); // after switching scale9, you must call setContentSize to keep the size not change imageView->setContentSize(Size(250, 115)); diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h index 47b734a1d8b5..bfcfd7e39a30 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h @@ -37,7 +37,7 @@ class UIImageViewTest : public UIScene virtual bool init() override; - void printWidgetResources(ax::Ref* sender); + void printWidgetResources(ax::Object* sender); protected: ax::ui::ImageView* _image; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp index e8dd4da9d78f..8402fc00eb48 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp @@ -296,7 +296,7 @@ bool UILayoutTest_BackGroundImage::init() return false; } -void UILayoutTest_BackGroundImage::printWidgetResources(ax::Ref* sender) +void UILayoutTest_BackGroundImage::printWidgetResources(ax::Object* sender) { ax::ResourceData textureFile = _layout->getRenderFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); @@ -898,7 +898,7 @@ bool UILayoutComponentTest::init() return false; } -void UILayoutComponentTest::touchEvent(Ref* pSender, Widget::TouchEventType type) +void UILayoutComponentTest::touchEvent(Object* pSender, Widget::TouchEventType type) { switch (type) { diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h index 398e292f7b16..eb382f0b1459 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.h @@ -69,7 +69,7 @@ class UILayoutTest_BackGroundImage : public UIScene CREATE_FUNC(UILayoutTest_BackGroundImage); - void printWidgetResources(ax::Ref* sender); + void printWidgetResources(ax::Object* sender); protected: ax::ui::Layout* _layout; @@ -162,7 +162,7 @@ class UILayoutComponentTest : public UIScene CREATE_FUNC(UILayoutComponentTest); virtual bool init() override; - void touchEvent(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void touchEvent(ax::Object* sender, ax::ui::Widget::TouchEventType type); protected: ax::LayerColor* _baseLayer; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp index 2371b2bc186c..db4cd7202202 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp @@ -170,7 +170,7 @@ bool UIListViewTest_Vertical::init() _uiLayer->addChild(_indexLabels[2]); // Callback - _listView->ScrollView::addEventListener([this](Ref* ref, ScrollView::EventType eventType) { + _listView->ScrollView::addEventListener([this](Object* ref, ScrollView::EventType eventType) { ListView* listView = dynamic_cast(ref); if (listView == nullptr || eventType != ScrollView::EventType::CONTAINER_MOVED) { @@ -254,7 +254,7 @@ void UIListViewTest_Vertical::update(float dt) this->_lastContentPosY = this->_listView->getInnerContainer()->getPosition().y; } -void UIListViewTest_Vertical::selectedItemEvent(Ref* pSender, ListView::EventType type) +void UIListViewTest_Vertical::selectedItemEvent(Object* pSender, ListView::EventType type) { switch (type) { @@ -277,7 +277,7 @@ void UIListViewTest_Vertical::selectedItemEvent(Ref* pSender, ListView::EventTyp } } -void UIListViewTest_Vertical::selectedItemEventScrollView(Ref* pSender, ui::ScrollView::EventType type) +void UIListViewTest_Vertical::selectedItemEventScrollView(Object* pSender, ui::ScrollView::EventType type) { switch (type) { @@ -459,7 +459,7 @@ void UIListViewTest_Horizontal::update(float dt) this->_lastContentPosX = this->_listView->getInnerContainer()->getPosition().x; } -void UIListViewTest_Horizontal::selectedItemEvent(Ref* pSender, ListView::EventType type) +void UIListViewTest_Horizontal::selectedItemEvent(Object* pSender, ListView::EventType type) { switch (type) { @@ -697,7 +697,7 @@ bool UIListViewTest_ScrollToItem::init() pButton->setScale(0.8f); pButton->setPosition(Vec2(layerSize / 2) + Vec2(120.0f, -60.0f)); pButton->setTitleText(StringUtils::format("Go to '%d'", _nextIndex)); - pButton->addClickEventListener([this, pButton](Ref*) { + pButton->addClickEventListener([this, pButton](Object*) { _listView->scrollToItem(_nextIndex, Vec2::ANCHOR_MIDDLE, Vec2::ANCHOR_MIDDLE); _nextIndex = (_nextIndex + (NUMBER_OF_ITEMS / 2)) % NUMBER_OF_ITEMS; pButton->setTitleText(StringUtils::format("Go to '%d'", _nextIndex)); @@ -779,7 +779,7 @@ bool UIListViewTest_Magnetic::init() _indexLabels[4]->setPosition(_uiLayer->getContentSize() / 2 + Size(deltaX, deltaY)); // center // Callback - _listView->ScrollView::addEventListener([this](Ref* ref, ScrollView::EventType eventType) { + _listView->ScrollView::addEventListener([this](Object* ref, ScrollView::EventType eventType) { ListView* listView = dynamic_cast(ref); if (listView == nullptr || eventType != ScrollView::EventType::CONTAINER_MOVED) { @@ -809,7 +809,7 @@ bool UIListViewTest_Magnetic::init() pButton->setScale(0.8f); pButton->setPosition(Vec2(layerSize / 2) + Vec2(130.0f, -60.0f)); pButton->setTitleText("Next Magnetic"); - pButton->addClickEventListener([this](Ref*) { + pButton->addClickEventListener([this](Object*) { ListView::MagneticType eCurrentType = _listView->getMagneticType(); ListView::MagneticType eNextType = ListView::MagneticType::NONE; std::string sString; @@ -986,7 +986,7 @@ bool UIListViewTest_Padding::init() _indexLabels[4]->setPosition(_uiLayer->getContentSize() / 2 + Size(deltaX, deltaY)); // center // Callback - _listView->ScrollView::addEventListener([this](Ref* ref, ScrollView::EventType eventType) { + _listView->ScrollView::addEventListener([this](Object* ref, ScrollView::EventType eventType) { ListView* listView = dynamic_cast(ref); if (listView == nullptr || eventType != ScrollView::EventType::CONTAINER_MOVED) { @@ -1019,7 +1019,7 @@ bool UIListViewTest_Padding::init() return true; } -void UIListViewTest_Padding::sliderEvent(Ref* pSender, Slider::EventType type) +void UIListViewTest_Padding::sliderEvent(Object* pSender, Slider::EventType type) { if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) { diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h index e53e116a9596..5b254daca333 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.h @@ -40,8 +40,8 @@ class UIListViewTest_Vertical : public UIScene ~UIListViewTest_Vertical(); virtual bool init() override; - void selectedItemEvent(ax::Ref* sender, ax::ui::ListView::EventType type); - void selectedItemEventScrollView(ax::Ref* sender, ax::ui::ScrollView::EventType type); + void selectedItemEvent(ax::Object* sender, ax::ui::ListView::EventType type); + void selectedItemEventScrollView(ax::Object* sender, ax::ui::ScrollView::EventType type); virtual void update(float dt) override; protected: @@ -78,7 +78,7 @@ class UIListViewTest_Horizontal : public UIScene ~UIListViewTest_Horizontal(); virtual bool init() override; - void selectedItemEvent(ax::Ref* sender, ax::ui::ListView::EventType type); + void selectedItemEvent(ax::Object* sender, ax::ui::ListView::EventType type); virtual void update(float dt) override; protected: @@ -191,7 +191,7 @@ class UIListViewTest_Padding : public UIScene virtual bool init() override; virtual ax::ui::ScrollView::Direction getListViewDirection() const = 0; - void sliderEvent(ax::Ref* pSender, ax::ui::Slider::EventType type); + void sliderEvent(ax::Object* pSender, ax::ui::Slider::EventType type); ax::ui::ListView* _listView; ax::ui::Text* _titleLabel; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp index b28bcdfdab8e..2ec5950bda86 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp @@ -78,7 +78,7 @@ bool UILoadingBarTest_Left::init() button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + 50)); button->setTitleText("Click to change direction!"); - button->addTouchEventListener([=](Ref*, Widget::TouchEventType type) { + button->addTouchEventListener([=](Object*, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { if (loadingBar->getDirection() == LoadingBar::Direction::LEFT) @@ -126,7 +126,7 @@ void UILoadingBarTest_Left::update(float delta) loadingBarCopy->setPercent(_count); } -void UILoadingBarTest_Left::printWidgetResources(ax::Ref* sender) +void UILoadingBarTest_Left::printWidgetResources(ax::Object* sender) { ax::ResourceData textureFile = _loadingBar->getRenderFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); @@ -317,7 +317,7 @@ bool UILoadingBarTest_Scale9_State_Change::init() loadingBar->setPercent(100); loadingBar->setTouchEnabled(true); - loadingBar->addTouchEventListener([=](Ref* sender, Widget::TouchEventType type) { + loadingBar->addTouchEventListener([=](Object* sender, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { if (loadingBar->isScale9Enabled()) @@ -375,14 +375,14 @@ bool UILoadingBarReloadTexture::init() auto buttonScale9 = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); buttonScale9->setTitleText("ToggleScale9"); buttonScale9->addClickEventListener( - [=](Ref*) { loadingBar->setScale9Enabled(!loadingBar->isScale9Enabled()); }); + [=](Object*) { loadingBar->setScale9Enabled(!loadingBar->isScale9Enabled()); }); buttonScale9->setPosition(loadingBar->getPosition() + Vec2(-50, 50)); _uiLayer->addChild(buttonScale9); auto buttonChangeTexture = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); buttonChangeTexture->setTitleText("ChangeTexture"); - buttonChangeTexture->addClickEventListener([=](Ref*) { + buttonChangeTexture->addClickEventListener([=](Object*) { auto name = loadingBar->getName(); if (name == "texture0") { @@ -459,7 +459,7 @@ bool UILoadingBarIssue12249::init() button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + 50)); button->setTitleText("Click to change direction!"); - button->addTouchEventListener([=](Ref*, Widget::TouchEventType type) { + button->addTouchEventListener([=](Object*, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { if (loadingBar->getDirection() == LoadingBar::Direction::LEFT) @@ -536,7 +536,7 @@ bool UILoadingBarTest_Direction::init() button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + 50)); button->setTitleText("Click to change direction!"); - button->addTouchEventListener([=](Ref*, Widget::TouchEventType type) { + button->addTouchEventListener([=](Object*, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { if (loadingBar->getDirection() == LoadingBar::Direction::LEFT) diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h index c0338b9c6d04..34de4c1a3063 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.h @@ -39,7 +39,7 @@ class UILoadingBarTest_Left : public UIScene ~UILoadingBarTest_Left(); virtual bool init() override; void update(float delta) override; - void printWidgetResources(ax::Ref* sender); + void printWidgetResources(ax::Object* sender); protected: int _count; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index 883e635a2044..31e9623331cc 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -115,7 +115,7 @@ bool UIPageViewTest::init() return false; } -void UIPageViewTest::pageViewEvent(Ref* pSender, PageView::EventType type) +void UIPageViewTest::pageViewEvent(Object* pSender, PageView::EventType type) { switch (type) { @@ -215,7 +215,7 @@ bool UIPageViewButtonTest::init() return false; } -void UIPageViewButtonTest::onButtonClicked(Ref* sender, Widget::TouchEventType type) +void UIPageViewButtonTest::onButtonClicked(Object* sender, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { @@ -223,7 +223,7 @@ void UIPageViewButtonTest::onButtonClicked(Ref* sender, Widget::TouchEventType t } } -void UIPageViewButtonTest::pageViewEvent(Ref* pSender, PageView::EventType type) +void UIPageViewButtonTest::pageViewEvent(Object* pSender, PageView::EventType type) { switch (type) { @@ -312,7 +312,7 @@ bool UIPageViewTouchPropagationTest::init() pageView->addEventListener( (PageView::ccPageViewCallback)AX_CALLBACK_2(UIPageViewTouchPropagationTest::pageViewEvent, this)); pageView->setName("pageView"); - pageView->addTouchEventListener([](Ref* sender, Widget::TouchEventType type) { + pageView->addTouchEventListener([](Object* sender, Widget::TouchEventType type) { if (type == Widget::TouchEventType::BEGAN) { AXLOG("page view touch began"); @@ -376,7 +376,7 @@ bool UIPageViewTouchPropagationTest::init() return false; } -void UIPageViewTouchPropagationTest::onButtonClicked(Ref* pSender, Widget::TouchEventType type) +void UIPageViewTouchPropagationTest::onButtonClicked(Object* pSender, Widget::TouchEventType type) { Button* btn = (Button*)pSender; CheckBox* ck1 = (CheckBox*)_uiLayer->getChildByName("propagation"); @@ -413,7 +413,7 @@ void UIPageViewTouchPropagationTest::onButtonClicked(Ref* pSender, Widget::Touch } } -void UIPageViewTouchPropagationTest::pageViewEvent(Ref* pSender, PageView::EventType type) +void UIPageViewTouchPropagationTest::pageViewEvent(Object* pSender, PageView::EventType type) { switch (type) { @@ -513,7 +513,7 @@ bool UIPageViewDynamicAddAndRemoveTest::init() button->setZoomScale(0.3f); button->setPressedActionEnabled(true); button->setTitleColor(Color3B::RED); - button->addClickEventListener([=](Ref* sender) { + button->addClickEventListener([=](Object* sender) { HBox* outerBox = HBox::create(); outerBox->setContentSize(Size(240.0f, 130.0f)); @@ -547,7 +547,7 @@ bool UIPageViewDynamicAddAndRemoveTest::init() button2->setZoomScale(0.3f); button2->setPressedActionEnabled(true); button2->setTitleColor(Color3B::RED); - button2->addClickEventListener([=](Ref* sender) { + button2->addClickEventListener([=](Object* sender) { if (pageView->getItems().size() > 0) { pageView->removeItem(pageView->getItems().size() - 1); @@ -568,7 +568,7 @@ bool UIPageViewDynamicAddAndRemoveTest::init() button3->setZoomScale(0.3f); button3->setPressedActionEnabled(true); button3->setTitleColor(Color3B::RED); - button3->addClickEventListener([=](Ref* sender) { + button3->addClickEventListener([=](Object* sender) { pageView->removeAllItems(); _displayValueLabel->setString( StringUtils::format("page count = %d", static_cast(pageView->getItems().size()))); @@ -579,7 +579,7 @@ bool UIPageViewDynamicAddAndRemoveTest::init() auto button4 = (ui::Button*)button3->clone(); button4->setTitleText("Scroll to Page4"); button4->setPositionNormalized(Vec2(0.85f, 0.5f)); - button4->addClickEventListener([=](Ref* sender) { + button4->addClickEventListener([=](Object* sender) { pageView->scrollToItem(3); AXLOG("current page index = %zd", pageView->getCurrentPageIndex()); }); @@ -590,7 +590,7 @@ bool UIPageViewDynamicAddAndRemoveTest::init() return false; } -void UIPageViewDynamicAddAndRemoveTest::pageViewEvent(Ref* pSender, PageView::EventType type) +void UIPageViewDynamicAddAndRemoveTest::pageViewEvent(Object* pSender, PageView::EventType type) { switch (type) { @@ -675,26 +675,26 @@ bool UIPageViewJumpToPageTest::init() button1->setPositionNormalized(Vec2(0.1f, 0.75f)); button1->setTitleText("Jump to Page1"); AXLOG("button1 content Size = %f, %f", button1->getContentSize().width, button1->getContentSize().height); - button1->addClickEventListener([=](Ref*) { pageView->setCurrentPageIndex(0); }); + button1->addClickEventListener([=](Object*) { pageView->setCurrentPageIndex(0); }); _uiLayer->addChild(button1); auto button2 = static_cast(button1->clone()); button2->setTitleText("Jump to Page2"); button2->setPositionNormalized(Vec2(0.1f, 0.65f)); AXLOG("button2 content Size = %f, %f", button2->getContentSize().width, button2->getContentSize().height); - button2->addClickEventListener([=](Ref*) { pageView->setCurrentPageIndex(1); }); + button2->addClickEventListener([=](Object*) { pageView->setCurrentPageIndex(1); }); _uiLayer->addChild(button2); auto button3 = static_cast(button2->clone()); button3->setTitleText("Jump to Page3"); button3->setPositionNormalized(Vec2(0.9f, 0.75f)); - button3->addClickEventListener([=](Ref*) { pageView->setCurrentPageIndex(2); }); + button3->addClickEventListener([=](Object*) { pageView->setCurrentPageIndex(2); }); _uiLayer->addChild(button3); auto button4 = static_cast(button2->clone()); button4->setTitleText("Jump to Page4"); button4->setPositionNormalized(Vec2(0.9f, 0.65f)); - button4->addClickEventListener([=](Ref*) { pageView->setCurrentPageIndex(3); }); + button4->addClickEventListener([=](Object*) { pageView->setCurrentPageIndex(3); }); _uiLayer->addChild(button4); _uiLayer->addChild(pageView); @@ -771,7 +771,7 @@ bool UIPageViewVerticalTest::init() return false; } -void UIPageViewVerticalTest::pageViewEvent(Ref* pSender, PageView::EventType type) +void UIPageViewVerticalTest::pageViewEvent(Object* pSender, PageView::EventType type) { switch (type) { @@ -920,7 +920,7 @@ bool UIPageViewChildSizeTest::init() return false; } -void UIPageViewChildSizeTest::pageViewEvent(Ref* pSender, PageView::EventType type) +void UIPageViewChildSizeTest::pageViewEvent(Object* pSender, PageView::EventType type) { switch (type) { diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h index 9010004ebb04..22916be323b9 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h @@ -39,7 +39,7 @@ class UIPageViewTest : public UIScene ~UIPageViewTest(); virtual bool init() override; - void pageViewEvent(ax::Ref* sender, ax::ui::PageView::EventType type); + void pageViewEvent(ax::Object* sender, ax::ui::PageView::EventType type); protected: ax::ui::Text* _displayValueLabel; @@ -54,8 +54,8 @@ class UIPageViewButtonTest : public UIScene ~UIPageViewButtonTest(); virtual bool init() override; - void pageViewEvent(ax::Ref* sender, ax::ui::PageView::EventType type); - void onButtonClicked(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void pageViewEvent(ax::Object* sender, ax::ui::PageView::EventType type); + void onButtonClicked(ax::Object* sender, ax::ui::Widget::TouchEventType type); protected: ax::ui::Text* _displayValueLabel; @@ -70,8 +70,8 @@ class UIPageViewTouchPropagationTest : public UIScene ~UIPageViewTouchPropagationTest(); virtual bool init() override; - void pageViewEvent(ax::Ref* sender, ax::ui::PageView::EventType type); - void onButtonClicked(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void pageViewEvent(ax::Object* sender, ax::ui::PageView::EventType type); + void onButtonClicked(ax::Object* sender, ax::ui::Widget::TouchEventType type); protected: ax::ui::Text* _displayValueLabel; @@ -86,8 +86,8 @@ class UIPageViewDynamicAddAndRemoveTest : public UIScene ~UIPageViewDynamicAddAndRemoveTest(); virtual bool init() override; - void pageViewEvent(ax::Ref* sender, ax::ui::PageView::EventType type); - void onButtonClicked(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + void pageViewEvent(ax::Object* sender, ax::ui::PageView::EventType type); + void onButtonClicked(ax::Object* sender, ax::ui::Widget::TouchEventType type); protected: ax::ui::Text* _displayValueLabel; @@ -115,7 +115,7 @@ class UIPageViewVerticalTest : public UIScene ~UIPageViewVerticalTest(); virtual bool init() override; - void pageViewEvent(ax::Ref* sender, ax::ui::PageView::EventType type); + void pageViewEvent(ax::Object* sender, ax::ui::PageView::EventType type); protected: ax::ui::Text* _displayValueLabel; @@ -143,7 +143,7 @@ class UIPageViewChildSizeTest : public UIScene ~UIPageViewChildSizeTest(); virtual bool init() override; - void pageViewEvent(ax::Ref* sender, ax::ui::PageView::EventType type); + void pageViewEvent(ax::Object* sender, ax::ui::PageView::EventType type); protected: ax::ui::Text* _displayValueLabel; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp index 4dddb44201cd..61598387c4c0 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.cpp @@ -85,7 +85,7 @@ bool UIRadioButtonTest::init() Button* allowNoSelectionToggle = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); allowNoSelectionToggle->setTitleText("Toggle Allow-No-Selection"); allowNoSelectionToggle->setPosition(Vec2(widgetSize.width / 2.0f + 100, widgetSize.height / 2.0f - 65)); - allowNoSelectionToggle->addClickEventListener([this](Ref*) { + allowNoSelectionToggle->addClickEventListener([this](Object*) { _radioButtonGroup->setAllowedNoSelection(!_radioButtonGroup->isAllowedNoSelection()); _allowNoSelectionText->setString(_radioButtonGroup->isAllowedNoSelection() ? "No selection is allowed." : "No selection is disallowed."); @@ -103,7 +103,7 @@ bool UIRadioButtonTest::init() return false; } -void UIRadioButtonTest::addRadioButton(Ref* sender) +void UIRadioButtonTest::addRadioButton(Object* sender) { Vec2 pos; if (_radioButtonGroup->getNumberOfRadioButtons() > 0) @@ -125,7 +125,7 @@ void UIRadioButtonTest::addRadioButton(Ref* sender) _uiLayer->addChild(radioButton); } -void UIRadioButtonTest::deleteRadioButton(Ref* sender) +void UIRadioButtonTest::deleteRadioButton(Object* sender) { if (_radioButtonGroup->getNumberOfRadioButtons() > 0) { @@ -281,7 +281,7 @@ void UIRadioButtonTwoGroupsTest::onChangedRadioButtonSelect(RadioButton* radioBu addLog(text); } -void UIRadioButtonTwoGroupsTest::clearRadioButtonGroup(Ref* sender) +void UIRadioButtonTwoGroupsTest::clearRadioButtonGroup(Object* sender) { for (int i = 0; i < 2; ++i) { diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.h index 640fcdd6afa9..40745f22bf6a 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRadioButtonTest/UIRadioButtonTest.h @@ -40,8 +40,8 @@ class UIRadioButtonTest : public UIScene virtual bool init() override; - void addRadioButton(Ref* sender); - void deleteRadioButton(Ref* sender); + void addRadioButton(Object* sender); + void deleteRadioButton(Object* sender); private: ax::ui::RadioButtonGroup* _radioButtonGroup; @@ -64,7 +64,7 @@ class UIRadioButtonTwoGroupsTest : public UIScene int index, ax::ui::RadioButtonGroup::EventType type); void onChangedRadioButtonSelect(ax::ui::RadioButton* radioButton, ax::ui::RadioButton::EventType type); - void clearRadioButtonGroup(Ref* sender); + void clearRadioButtonGroup(Object* sender); protected: void addLog(std::string_view log); diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp index 970083b62725..ed207c825b0e 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp @@ -71,7 +71,7 @@ bool UIRichTextTestBase::init() return true; } -void UIRichTextTestBase::touchEvent(Ref* pSender, Widget::TouchEventType type) +void UIRichTextTestBase::touchEvent(Object* pSender, Widget::TouchEventType type) { switch (type) { @@ -94,7 +94,7 @@ void UIRichTextTestBase::touchEvent(Ref* pSender, Widget::TouchEventType type) } } -void UIRichTextTestBase::switchWrapMode(Ref* pSender, Widget::TouchEventType type) +void UIRichTextTestBase::switchWrapMode(Object* pSender, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { @@ -104,7 +104,7 @@ void UIRichTextTestBase::switchWrapMode(Ref* pSender, Widget::TouchEventType typ } } -void UIRichTextTestBase::switchHorizontalAlignment(Ref* sender, Widget::TouchEventType type) +void UIRichTextTestBase::switchHorizontalAlignment(Object* sender, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { @@ -115,7 +115,7 @@ void UIRichTextTestBase::switchHorizontalAlignment(Ref* sender, Widget::TouchEve } } -void UIRichTextTestBase::switchVerticalAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type) +void UIRichTextTestBase::switchVerticalAlignment(ax::Object* sender, ax::ui::Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.h index a2a9c063cecd..105f00035e6a 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.h @@ -37,10 +37,10 @@ class UIRichTextTestBase : public UIScene ~UIRichTextTestBase() override = 0; // Pure virtual to prevent instancing this class bool init() override; - virtual void touchEvent(Ref* pSender, ax::ui::Widget::TouchEventType type); - virtual void switchWrapMode(ax::Ref* sender, ax::ui::Widget::TouchEventType type); - virtual void switchHorizontalAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); - virtual void switchVerticalAlignment(ax::Ref* sender, ax::ui::Widget::TouchEventType type); + virtual void touchEvent(Object* pSender, ax::ui::Widget::TouchEventType type); + virtual void switchWrapMode(ax::Object* sender, ax::ui::Widget::TouchEventType type); + virtual void switchHorizontalAlignment(ax::Object* sender, ax::ui::Widget::TouchEventType type); + virtual void switchVerticalAlignment(ax::Object* sender, ax::ui::Widget::TouchEventType type); protected: virtual void createButtonPanel(); diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp index 7b8ad9e4c143..7a392c273323 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp @@ -782,7 +782,7 @@ bool UIS9Flip::init() toggleFlipXButton->setTitleText("Toggle FlipX"); toggleFlipXButton->setPosition(flipXSprite->getPosition() + Vec2(0.0f, -20 - flipXSprite->getContentSize().height / 2)); - toggleFlipXButton->addClickEventListener([=](Ref*) { + toggleFlipXButton->addClickEventListener([=](Object*) { flipXSprite->setFlippedX(!flipXSprite->isFlippedX()); if (flipXSprite->isFlippedX()) { @@ -799,7 +799,7 @@ bool UIS9Flip::init() toggleFlipYButton->setTitleText("Toggle FlipY"); toggleFlipYButton->setPosition(flipYSprite->getPosition() + Vec2(0.0f, -20 - flipYSprite->getContentSize().height / 2)); - toggleFlipYButton->addClickEventListener([=](Ref*) { + toggleFlipYButton->addClickEventListener([=](Object*) { flipYSprite->setFlippedY(!flipYSprite->isFlippedY()); if (flipYSprite->isFlippedY()) { @@ -816,7 +816,7 @@ bool UIS9Flip::init() toggleScale9Button->setTitleText("Toggle Scale9"); toggleScale9Button->setPosition(normalSprite->getPosition() + Vec2(0.0f, -20 - normalSprite->getContentSize().height / 2)); - toggleScale9Button->addClickEventListener([=](Ref*) { + toggleScale9Button->addClickEventListener([=](Object*) { flipXSprite->setScale9Enabled(!flipXSprite->isScale9Enabled()); flipYSprite->setScale9Enabled(!flipYSprite->isScale9Enabled()); if (flipXSprite->isScale9Enabled()) @@ -885,7 +885,7 @@ bool UIS9ChangeAnchorPoint::init() button1->setPosition(Vec2(winSize.width / 2 - 100, winSize.height / 2 - 50)); button1->setName("button2"); button1->setTitleText("Vec(0,0)"); - button1->addTouchEventListener([=](Ref*, Widget::TouchEventType type) { + button1->addTouchEventListener([=](Object*, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { normalSprite->setAnchorPoint(Vec2::ZERO); @@ -903,7 +903,7 @@ bool UIS9ChangeAnchorPoint::init() button2->setPosition(Vec2(winSize.width / 2 + 100, winSize.height / 2 - 50)); button2->setName("button2"); button2->setTitleText("Vec(1,1)"); - button2->addTouchEventListener([=](Ref*, Widget::TouchEventType type) { + button2->addTouchEventListener([=](Object*, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { normalSprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT); @@ -990,7 +990,7 @@ bool UIS9BatchTest::init() addSpriteButton->setPosition(Vec2(winSize.width / 2 - 50, winSize.height - 100)); addSpriteButton->setTitleText("Add Normal Sprite"); std::srand((unsigned)time(nullptr)); - addSpriteButton->addClickEventListener([=](Ref*) { + addSpriteButton->addClickEventListener([=](Object*) { auto spriteFrameName = spriteFrameNameArray[rand() % 2]; auto sprite = Sprite::createWithSpriteFrameName(spriteFrameName); sprite->setPosition(Vec2(rand() % (int)winSize.width + 50.0f, winSize.height / 2)); @@ -1002,7 +1002,7 @@ bool UIS9BatchTest::init() ui::Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); addSliceSpriteButton->setPosition(Vec2(winSize.width / 2 + 50, winSize.height - 100)); addSliceSpriteButton->setTitleText("Add Slice Sprite"); - addSliceSpriteButton->addClickEventListener([=](Ref*) { + addSliceSpriteButton->addClickEventListener([=](Object*) { int random = rand() % 2; auto spriteFrameName = spriteFrameNameArray[random]; auto sprite = ui::Scale9Sprite::createWithSpriteFrameName(spriteFrameName); @@ -1048,7 +1048,7 @@ bool UIS9ToggleRenderingTypeTest::init() ui::Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); addSliceSpriteButton->setPosition(Vec2(winSize.width / 2, winSize.height - 100)); addSliceSpriteButton->setTitleText("Slice Rendering"); - addSliceSpriteButton->addClickEventListener([=](Ref*) { + addSliceSpriteButton->addClickEventListener([=](Object*) { if (blocks->getRenderingType() == Scale9Sprite::RenderingType::SLICE) { blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE); @@ -1182,7 +1182,7 @@ bool UIS9GrayStateOpacityTest::init() return false; } -void UIS9GrayStateOpacityTest::sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type) +void UIS9GrayStateOpacityTest::sliderEvent(ax::Object* sender, ax::ui::Slider::EventType type) { if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) { diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScale9SpriteTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScale9SpriteTest.h index b38345ffa316..c22a63e94191 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScale9SpriteTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScale9SpriteTest.h @@ -314,7 +314,7 @@ class UIS9GrayStateOpacityTest : public UIScene { public: CREATE_FUNC(UIS9GrayStateOpacityTest); - void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); + void sliderEvent(ax::Object* sender, ax::ui::Slider::EventType type); virtual bool init() override; }; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp index f41cf9223c75..81f613170a6d 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp @@ -741,7 +741,7 @@ bool UIScrollViewTestEvents::init() scrollView->jumpToBottomRight(); auto getRandomColor = [] { return Color4B(random(0, 255), random(0, 255), random(0, 255), 255); }; - scrollView->addEventListener([&](Ref*, ui::ScrollView::EventType e) { + scrollView->addEventListener([&](Object*, ui::ScrollView::EventType e) { switch (e) { case ui::ScrollView::EventType::SCROLLING_BEGAN: @@ -816,7 +816,7 @@ bool UIScrollViewStopScrollingTest::init() _uiLayer->addChild(_scrollView); // Log some ScrollView events. - _scrollView->addEventListener([&](Ref*, ui::ScrollView::EventType e) { + _scrollView->addEventListener([&](Object*, ui::ScrollView::EventType e) { switch (e) { case ui::ScrollView::EventType::SCROLLING_BEGAN: @@ -842,7 +842,7 @@ bool UIScrollViewStopScrollingTest::init() button_scale9->setScale9Enabled(true); button_scale9->setContentSize(Size(120.0f, button_scale9->getVirtualRendererSize().height)); button_scale9->setPosition(Vec2(innerSize.width / 2.0f, innerSize.height / 2.0f)); - button_scale9->addClickEventListener([this](Ref*) { this->_remainingTime = 3.0f; }); + button_scale9->addClickEventListener([this](Object*) { this->_remainingTime = 3.0f; }); _scrollView->addChild(button_scale9); // Schedule update for this scene. diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp index 97b54cfd84e0..40b96ee08963 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp @@ -90,7 +90,7 @@ bool UISliderTest::init() return false; } -void UISliderTest::sliderEvent(Ref* pSender, Slider::EventType type) +void UISliderTest::sliderEvent(Object* pSender, Slider::EventType type) { if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -100,7 +100,7 @@ void UISliderTest::sliderEvent(Ref* pSender, Slider::EventType type) _displayValueLabel->setString(StringUtils::format("Percent %f", 10000.0 * percent / maxPercent)); } } -void UISliderTest::printWidgetResources(ax::Ref* /*sender*/) +void UISliderTest::printWidgetResources(ax::Object* /*sender*/) { ax::ResourceData textureFile = _slider->getBackFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); @@ -161,7 +161,7 @@ bool UISliderTest_Scale9::init() return false; } -void UISliderTest_Scale9::sliderEvent(Ref* pSender, Slider::EventType type) +void UISliderTest_Scale9::sliderEvent(Object* pSender, Slider::EventType type) { if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -207,7 +207,7 @@ bool UISliderTest_Scale9_State_Change::init() slider->setContentSize(Size(200.0f, 60.0f)); slider->setPosition( Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f /* + slider->getSize().height * 3.0f*/)); - slider->addTouchEventListener([=](Ref* /*sender*/, Widget::TouchEventType type) { + slider->addTouchEventListener([=](Object* /*sender*/, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { if (slider->isScale9Enabled()) @@ -225,7 +225,7 @@ bool UISliderTest_Scale9_State_Change::init() return false; } -void UISliderTest_Scale9_State_Change::sliderEvent(Ref* pSender, Slider::EventType type) +void UISliderTest_Scale9_State_Change::sliderEvent(Object* pSender, Slider::EventType type) { if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) { @@ -360,7 +360,7 @@ bool UISliderNewEventCallbackTest::init() slider->loadProgressBarTexture("cocosui/sliderProgress.png"); slider->setMaxPercent(1000); slider->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + 50)); - slider->addEventListener([=](Ref* widget, Slider::EventType type) { + slider->addEventListener([=](Object* widget, Slider::EventType type) { Slider* slider = (Slider*)widget; AX_UNUSED_PARAM(slider); if (type == Slider::EventType::ON_SLIDEBALL_DOWN) @@ -419,7 +419,7 @@ bool UISliderIssue12249Test::init() return false; } -void UISliderIssue12249Test::sliderEvent(Ref* pSender, Slider::EventType type) +void UISliderIssue12249Test::sliderEvent(Object* pSender, Slider::EventType type) { if (type == Slider::EventType::ON_PERCENTAGE_CHANGED) { diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.h index 57ea8b76245c..2b9a3321373e 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.h @@ -38,8 +38,8 @@ class UISliderTest : public UIScene UISliderTest(); ~UISliderTest(); virtual bool init() override; - void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); - void printWidgetResources(ax::Ref* sender); + void sliderEvent(ax::Object* sender, ax::ui::Slider::EventType type); + void printWidgetResources(ax::Object* sender); protected: ax::ui::TextBMFont* _displayValueLabel; @@ -54,7 +54,7 @@ class UISliderTest_Scale9 : public UIScene UISliderTest_Scale9(); ~UISliderTest_Scale9(); virtual bool init() override; - void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); + void sliderEvent(ax::Object* sender, ax::ui::Slider::EventType type); protected: ax::ui::Text* _displayValueLabel; @@ -68,7 +68,7 @@ class UISliderTest_Scale9_State_Change : public UIScene UISliderTest_Scale9_State_Change(); ~UISliderTest_Scale9_State_Change(); virtual bool init() override; - void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); + void sliderEvent(ax::Object* sender, ax::ui::Slider::EventType type); protected: ax::ui::Text* _displayValueLabel; @@ -121,7 +121,7 @@ class UISliderIssue12249Test : public UIScene UISliderIssue12249Test(); ~UISliderIssue12249Test(); virtual bool init() override; - void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type); + void sliderEvent(ax::Object* sender, ax::ui::Slider::EventType type); protected: ax::ui::TextBMFont* _displayValueLabel; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp index 4e11cd2943a4..8af49d82e84b 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp @@ -73,7 +73,7 @@ bool UITextAtlasTest::init() } return false; } -void UITextAtlasTest::printWidgetResources(ax::Ref* sender) +void UITextAtlasTest::printWidgetResources(ax::Object* sender) { ax::ResourceData textureFile = _textAtlas->getRenderFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); @@ -123,7 +123,7 @@ bool UITextAtlasETC1ShadowTest::init() } return false; } -void UITextAtlasETC1ShadowTest::printWidgetResources(ax::Ref* sender) +void UITextAtlasETC1ShadowTest::printWidgetResources(ax::Object* sender) { ax::ResourceData textureFile = _textAtlas->getRenderFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.h index b0fa8ee323fd..17fe73703008 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.h @@ -35,7 +35,7 @@ class UITextAtlasTest : public UIScene CREATE_FUNC(UITextAtlasTest); virtual bool init() override; - void printWidgetResources(ax::Ref* sender); + void printWidgetResources(ax::Object* sender); protected: ax::ui::TextAtlas* _textAtlas; @@ -47,7 +47,7 @@ class UITextAtlasETC1ShadowTest : public UIScene CREATE_FUNC(UITextAtlasETC1ShadowTest); virtual bool init() override; - void printWidgetResources(ax::Ref* sender); + void printWidgetResources(ax::Object* sender); protected: ax::ui::TextAtlas* _textAtlas; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp index 0ab632219c9a..78cad5ffbe64 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp @@ -66,7 +66,7 @@ bool UITextBMFontTest::init() } return false; } -void UITextBMFontTest::printWidgetResources(ax::Ref* sender) +void UITextBMFontTest::printWidgetResources(ax::Object* sender) { ax::ResourceData textureFile = _textBMFont->getRenderFile(); AXLOG("textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type); diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.h index a13ee909927d..4a1ea274d291 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.h @@ -36,7 +36,7 @@ class UITextBMFontTest : public UIScene CREATE_FUNC(UITextBMFontTest) virtual bool init() override; - void printWidgetResources(ax::Ref* sender); + void printWidgetResources(ax::Object* sender); protected: ax::ui::TextBMFont* _textBMFont; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp index 19478808a228..46d9eb4c7ade 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp @@ -75,7 +75,7 @@ bool UITextFieldTest::init() return false; } -void UITextFieldTest::textFieldEvent(Ref* pSender, TextField::EventType type) +void UITextFieldTest::textFieldEvent(Object* pSender, TextField::EventType type) { switch (type) { @@ -150,7 +150,7 @@ bool UITextFieldTest_MaxLength::init() return false; } -void UITextFieldTest_MaxLength::textFieldEvent(Ref* pSender, TextField::EventType type) +void UITextFieldTest_MaxLength::textFieldEvent(Object* pSender, TextField::EventType type) { switch (type) { @@ -231,7 +231,7 @@ bool UITextFieldTest_Password::init() return false; } -void UITextFieldTest_Password::textFieldEvent(Ref* pSender, TextField::EventType type) +void UITextFieldTest_Password::textFieldEvent(Object* pSender, TextField::EventType type) { switch (type) { @@ -310,7 +310,7 @@ bool UITextFieldTest_LineWrap::init() return false; } -void UITextFieldTest_LineWrap::textFieldEvent(Ref* pSender, TextField::EventType type) +void UITextFieldTest_LineWrap::textFieldEvent(Object* pSender, TextField::EventType type) { switch (type) { @@ -384,7 +384,7 @@ bool UITextFieldTest_TrueTypeFont::init() return false; } -void UITextFieldTest_TrueTypeFont::textFieldEvent(Ref* pSender, TextField::EventType type) +void UITextFieldTest_TrueTypeFont::textFieldEvent(Object* pSender, TextField::EventType type) { switch (type) { @@ -457,7 +457,7 @@ bool UITextFieldTest_BMFont::init() return false; } -void UITextFieldTest_BMFont::textFieldEvent(Ref* pSender, TextField::EventType type) +void UITextFieldTest_BMFont::textFieldEvent(Object* pSender, TextField::EventType type) { switch (type) { @@ -533,7 +533,7 @@ bool UITextFieldTest_PlaceHolderColor::init() return false; } -void UITextFieldTest_PlaceHolderColor::textFieldEvent(Ref* pSender, TextField::EventType type) +void UITextFieldTest_PlaceHolderColor::textFieldEvent(Object* pSender, TextField::EventType type) { switch (type) { diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h index bd2242444926..c0de26a2294b 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.h @@ -38,7 +38,7 @@ class UITextFieldTest : public UIScene UITextFieldTest(); ~UITextFieldTest(); virtual bool init() override; - void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); + void textFieldEvent(ax::Object* sender, ax::ui::TextField::EventType type); protected: ax::ui::Text* _displayValueLabel; @@ -52,7 +52,7 @@ class UITextFieldTest_MaxLength : public UIScene UITextFieldTest_MaxLength(); ~UITextFieldTest_MaxLength(); virtual bool init() override; - void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); + void textFieldEvent(ax::Object* sender, ax::ui::TextField::EventType type); protected: ax::ui::Text* _displayValueLabel; @@ -66,7 +66,7 @@ class UITextFieldTest_Password : public UIScene UITextFieldTest_Password(); ~UITextFieldTest_Password(); virtual bool init() override; - void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); + void textFieldEvent(ax::Object* sender, ax::ui::TextField::EventType type); protected: ax::ui::Text* _displayValueLabel; @@ -80,7 +80,7 @@ class UITextFieldTest_LineWrap : public UIScene UITextFieldTest_LineWrap(); ~UITextFieldTest_LineWrap(); virtual bool init() override; - void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); + void textFieldEvent(ax::Object* sender, ax::ui::TextField::EventType type); protected: ax::ui::Text* _displayValueLabel; @@ -94,7 +94,7 @@ class UITextFieldTest_TrueTypeFont : public UIScene UITextFieldTest_TrueTypeFont(); ~UITextFieldTest_TrueTypeFont(); virtual bool init() override; - void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); + void textFieldEvent(ax::Object* sender, ax::ui::TextField::EventType type); protected: ax::ui::Text* _displayValueLabel; @@ -108,7 +108,7 @@ class UITextFieldTest_BMFont : public UIScene UITextFieldTest_BMFont(); ~UITextFieldTest_BMFont(); virtual bool init() override; - void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); + void textFieldEvent(ax::Object* sender, ax::ui::TextField::EventType type); protected: ax::ui::Text* _displayValueLabel; @@ -122,7 +122,7 @@ class UITextFieldTest_PlaceHolderColor : public UIScene UITextFieldTest_PlaceHolderColor(); ~UITextFieldTest_PlaceHolderColor(); virtual bool init() override; - void textFieldEvent(ax::Ref* sender, ax::ui::TextField::EventType type); + void textFieldEvent(ax::Object* sender, ax::ui::TextField::EventType type); protected: ax::ui::Text* _displayValueLabel; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp index ff9e00529927..3b63d6db0c35 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp @@ -85,7 +85,7 @@ bool UITextTest_LineWrap::init() text->setTextHorizontalAlignment(TextHAlignment::CENTER); text->setTouchScaleChangeEnabled(true); text->setTouchEnabled(true); - text->addTouchEventListener([=](Ref* sender, Widget::TouchEventType type) { + text->addTouchEventListener([=](Object* sender, Widget::TouchEventType type) { if (type == Widget::TouchEventType::ENDED) { if ((int)text->getContentSize().width == 280) @@ -164,7 +164,7 @@ bool UILabelTest_Effect::init() disableOutlineBtn->setTitleFontName("fonts/Marker Felt.ttf"); disableOutlineBtn->setPosition(Vec2(widgetSize.width * 0.3f, widgetSize.height * 0.7f)); disableOutlineBtn->setPressedActionEnabled(true); - disableOutlineBtn->addClickEventListener([=](Ref*) { + disableOutlineBtn->addClickEventListener([=](Object*) { outline_label->disableEffect(LabelEffect::OUTLINE); AXLOG("content size after disable outline: %f %f", outline_label->getContentSize().width, outline_label->getContentSize().height); @@ -176,13 +176,13 @@ bool UILabelTest_Effect::init() auto disableGlowBtn = (Button*)disableOutlineBtn->clone(); disableGlowBtn->setPosition(disableOutlineBtn->getPosition() + Vec2(buttonWidth + 40, 0.0f)); disableGlowBtn->setTitleText("Disable Glow"); - disableGlowBtn->addClickEventListener([=](Ref*) { glow_label->disableEffect(LabelEffect::GLOW); }); + disableGlowBtn->addClickEventListener([=](Object*) { glow_label->disableEffect(LabelEffect::GLOW); }); this->addChild(disableGlowBtn); auto disableShadowBtn = (Button*)disableGlowBtn->clone(); disableShadowBtn->setPosition(disableGlowBtn->getPosition() + Vec2(buttonWidth + 40, 0.0f)); disableShadowBtn->setTitleText("Disable Shadow"); - disableShadowBtn->addClickEventListener([=](Ref*) { shadow_label->disableEffect(LabelEffect::SHADOW); }); + disableShadowBtn->addClickEventListener([=](Object*) { shadow_label->disableEffect(LabelEffect::SHADOW); }); this->addChild(disableShadowBtn); return true; @@ -243,7 +243,7 @@ bool UITextTest_IgnoreContentSize::init() auto halighButton = Button::create(); halighButton->setTitleText("Alignment Right"); - halighButton->addClickEventListener([=](Ref*) { + halighButton->addClickEventListener([=](Object*) { leftText->setTextHorizontalAlignment(TextHAlignment::RIGHT); rightText->setTextHorizontalAlignment(TextHAlignment::RIGHT); }); diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp index ba7085cfe6fc..c9a41f9a8a4a 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp @@ -131,12 +131,12 @@ void VideoPlayerTest::onExit() } -void VideoPlayerTest::menuCloseCallback(Ref* sender) +void VideoPlayerTest::menuCloseCallback(Object* sender) { Director::getInstance()->end(); } -void VideoPlayerTest::menuFullScreenCallback(Ref* sender) +void VideoPlayerTest::menuFullScreenCallback(Object* sender) { if (_videoPlayer) { @@ -144,7 +144,7 @@ void VideoPlayerTest::menuFullScreenCallback(Ref* sender) } } -void VideoPlayerTest::menuRatioCallback(Ref* sender) +void VideoPlayerTest::menuRatioCallback(Object* sender) { if (_videoPlayer) { @@ -152,7 +152,7 @@ void VideoPlayerTest::menuRatioCallback(Ref* sender) } } -void VideoPlayerTest::menuLoopCallback(Ref* sender) +void VideoPlayerTest::menuLoopCallback(Object* sender) { if (_videoPlayer) { @@ -161,7 +161,7 @@ void VideoPlayerTest::menuLoopCallback(Ref* sender) } } -void VideoPlayerTest::menuResourceVideoCallback(Ref* sender) +void VideoPlayerTest::menuResourceVideoCallback(Object* sender) { if (_videoPlayer) { @@ -174,7 +174,7 @@ void VideoPlayerTest::menuResourceVideoCallback(Ref* sender) } } -void VideoPlayerTest::menuOnlineVideoCallback(Ref* sender) +void VideoPlayerTest::menuOnlineVideoCallback(Object* sender) { if (_videoPlayer) { @@ -183,7 +183,7 @@ void VideoPlayerTest::menuOnlineVideoCallback(Ref* sender) } } -void VideoPlayerTest::menuPauseCallback(Ref* sender) +void VideoPlayerTest::menuPauseCallback(Object* sender) { if (_videoPlayer) { @@ -191,7 +191,7 @@ void VideoPlayerTest::menuPauseCallback(Ref* sender) } } -void VideoPlayerTest::menuResumeCallback(Ref* sender) +void VideoPlayerTest::menuResumeCallback(Object* sender) { if (_videoPlayer) { @@ -199,7 +199,7 @@ void VideoPlayerTest::menuResumeCallback(Ref* sender) } } -void VideoPlayerTest::menuStopCallback(Ref* sender) +void VideoPlayerTest::menuStopCallback(Object* sender) { if (_videoPlayer) { @@ -207,7 +207,7 @@ void VideoPlayerTest::menuStopCallback(Ref* sender) } } -void VideoPlayerTest::menuHintCallback(Ref* sender) +void VideoPlayerTest::menuHintCallback(Object* sender) { if (_videoPlayer) { @@ -260,7 +260,7 @@ void VideoPlayerTest::createSlider() _uiLayer->addChild(vSlider, 0, 2); } -void VideoPlayerTest::sliderCallback(Ref* sender, ui::Slider::EventType eventType) +void VideoPlayerTest::sliderCallback(Object* sender, ui::Slider::EventType eventType) { if (eventType == Slider::EventType::ON_PERCENTAGE_CHANGED && _videoPlayer) { @@ -274,7 +274,7 @@ void VideoPlayerTest::sliderCallback(Ref* sender, ui::Slider::EventType eventTyp } } -void VideoPlayerTest::videoEventCallback(Ref* sender, VideoPlayer::EventType eventType) +void VideoPlayerTest::videoEventCallback(Object* sender, VideoPlayer::EventType eventType) { switch (eventType) { @@ -383,12 +383,12 @@ void SimpleVideoPlayerTest::onExit() UIScene::onExit(); } -void SimpleVideoPlayerTest::menuCloseCallback(Ref* sender) +void SimpleVideoPlayerTest::menuCloseCallback(Object* sender) { Director::getInstance()->end(); } -void SimpleVideoPlayerTest::switchStyleCallback(Ref* sender) +void SimpleVideoPlayerTest::switchStyleCallback(Object* sender) { switch (_style) { @@ -412,7 +412,7 @@ void SimpleVideoPlayerTest::switchStyleCallback(Ref* sender) updateButtonsTexts(); } -void SimpleVideoPlayerTest::switchUserInputCallback(Ref* sender) +void SimpleVideoPlayerTest::switchUserInputCallback(Object* sender) { _userInputEnabled = !_userInputEnabled; if (_videoPlayer) diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h index fa113d629c3a..b7cd7aa559c4 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.h @@ -37,22 +37,22 @@ class VideoPlayerTest : public UIScene virtual bool init() override; - void menuCloseCallback(ax::Ref* sender); + void menuCloseCallback(ax::Object* sender); - void menuRatioCallback(ax::Ref* sender); - void menuResourceVideoCallback(ax::Ref* sender); - void menuOnlineVideoCallback(ax::Ref* sender); + void menuRatioCallback(ax::Object* sender); + void menuResourceVideoCallback(ax::Object* sender); + void menuOnlineVideoCallback(ax::Object* sender); - void menuFullScreenCallback(ax::Ref* sender); - void menuPauseCallback(ax::Ref* sender); - void menuResumeCallback(ax::Ref* sender); - void menuStopCallback(ax::Ref* sender); - void menuHintCallback(ax::Ref* sender); - void menuLoopCallback(ax::Ref* sender); + void menuFullScreenCallback(ax::Object* sender); + void menuPauseCallback(ax::Object* sender); + void menuResumeCallback(ax::Object* sender); + void menuStopCallback(ax::Object* sender); + void menuHintCallback(ax::Object* sender); + void menuLoopCallback(ax::Object* sender); - void sliderCallback(ax::Ref* sender, ax::ui::Slider::EventType eventType); + void sliderCallback(ax::Object* sender, ax::ui::Slider::EventType eventType); - void videoEventCallback(ax::Ref* sender, ax::ui::VideoPlayer::EventType eventType); + void videoEventCallback(ax::Object* sender, ax::ui::VideoPlayer::EventType eventType); void onEnter() override; void onExit() override; @@ -76,9 +76,9 @@ class SimpleVideoPlayerTest : public UIScene virtual bool init() override; - void menuCloseCallback(ax::Ref* sender); - void switchStyleCallback(ax::Ref* sender); - void switchUserInputCallback(ax::Ref* sender); + void menuCloseCallback(ax::Object* sender); + void switchStyleCallback(ax::Object* sender); + void switchUserInputCallback(ax::Object* sender); void onEnter() override; void onExit() override; diff --git a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp index b4610c46090e..d90a0ea09942 100644 --- a/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp +++ b/tests/cpp-tests/Source/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.cpp @@ -71,7 +71,7 @@ bool WebViewTest::init() resetBtn->setTitleText("Visit URL"); resetBtn->setPosition(Vec2(winSize / 2) + Vec2(50, _webView->getContentSize().height / 2 + resetBtn->getContentSize().height / 2 + 10)); - resetBtn->addClickEventListener([=](Ref*) { + resetBtn->addClickEventListener([=](Object*) { if (urlTextField->getString().size() != 0) { _webView->loadURL(std::string("https://").append(urlTextField->getString())); @@ -84,7 +84,7 @@ bool WebViewTest::init() reloadBtn->setPosition( Vec2(winSize / 2) + Vec2(_webView->getContentSize().width / 2 + reloadBtn->getContentSize().width / 2 + 10, 50)); - reloadBtn->addClickEventListener([=](Ref*) { _webView->reload(); }); + reloadBtn->addClickEventListener([=](Object*) { _webView->reload(); }); this->addChild(reloadBtn); Button* forwardBtn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); @@ -92,7 +92,7 @@ bool WebViewTest::init() forwardBtn->setPosition( Vec2(winSize / 2) + Vec2(_webView->getContentSize().width / 2 + forwardBtn->getContentSize().width / 2 + 10, 0)); - forwardBtn->addClickEventListener([=](Ref*) { _webView->goForward(); }); + forwardBtn->addClickEventListener([=](Object*) { _webView->goForward(); }); this->addChild(forwardBtn); Button* backBtn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); @@ -100,7 +100,7 @@ bool WebViewTest::init() backBtn->setPosition( Vec2(winSize / 2) + Vec2(_webView->getContentSize().width / 2 + backBtn->getContentSize().width / 2 + 10, -50)); - backBtn->addClickEventListener([=](Ref*) { _webView->goBack(); }); + backBtn->addClickEventListener([=](Object*) { _webView->goBack(); }); this->addChild(backBtn); Button* loadFileBtn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); @@ -108,7 +108,7 @@ bool WebViewTest::init() loadFileBtn->setPosition( Vec2(winSize / 2) - Vec2(_webView->getContentSize().width / 2 + loadFileBtn->getContentSize().width / 2 + 10, 50)); - loadFileBtn->addClickEventListener([=](Ref*) { _webView->loadFile("Test.html"); }); + loadFileBtn->addClickEventListener([=](Object*) { _webView->loadFile("Test.html"); }); this->addChild(loadFileBtn); Button* loadHTMLBtn = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); @@ -116,7 +116,7 @@ bool WebViewTest::init() loadHTMLBtn->setPosition( Vec2(winSize / 2) - Vec2(_webView->getContentSize().width / 2 + loadHTMLBtn->getContentSize().width / 2 + 10, 0)); - loadHTMLBtn->addClickEventListener([=](Ref*) { + loadHTMLBtn->addClickEventListener([=](Object*) { _webView->loadHTMLString("Hello World ", "Images/"); }); @@ -127,7 +127,7 @@ bool WebViewTest::init() evalJsBtn->setPosition( Vec2(winSize / 2) - Vec2(_webView->getContentSize().width / 2 + evalJsBtn->getContentSize().width / 2 + 10, -50)); - evalJsBtn->addClickEventListener([=](Ref*) { _webView->evaluateJS("alert(\"hello\")"); }); + evalJsBtn->addClickEventListener([=](Object*) { _webView->evaluateJS("alert(\"hello\")"); }); evalJsBtn->setName("evalJs"); this->addChild(evalJsBtn); @@ -136,7 +136,7 @@ bool WebViewTest::init() opacityBtn->setPosition( Vec2(winSize / 2) - Vec2(_webView->getContentSize().width / 2 + opacityBtn->getContentSize().width / 2 + 10, 100)); - opacityBtn->addClickEventListener([=](Ref*) { + opacityBtn->addClickEventListener([=](Object*) { auto currentOpacity = _webView->getOpacityWebView(); if (currentOpacity == 1.f) { @@ -163,7 +163,7 @@ bool WebViewTest::init() transparentBgBtn->setPosition( Vec2(winSize / 2) + Vec2(_webView->getContentSize().width / 2 + transparentBgBtn->getContentSize().width / 2 + 10, -100)); - transparentBgBtn->addClickEventListener([=](Ref*) { _webView->setBackgroundTransparent(); }); + transparentBgBtn->addClickEventListener([=](Object*) { _webView->setBackgroundTransparent(); }); transparentBgBtn->setName("Transparent"); this->addChild(transparentBgBtn); diff --git a/tests/cpp-tests/Source/VRTest/VRTest.cpp b/tests/cpp-tests/Source/VRTest/VRTest.cpp index 2d8a768191e7..99f32a219c03 100644 --- a/tests/cpp-tests/Source/VRTest/VRTest.cpp +++ b/tests/cpp-tests/Source/VRTest/VRTest.cpp @@ -47,7 +47,7 @@ VRTest1::VRTest1() image->setPosition(size / 2); addChild(image); - auto button = MenuItemFont::create("Enable / Disable VR", [](Ref* ref) { + auto button = MenuItemFont::create("Enable / Disable VR", [](Object* ref) { auto glView = Director::getInstance()->getGLView(); auto vrimpl = glView->getVR(); if (vrimpl) diff --git a/tests/live2d-tests/Source/SampleScene.cpp b/tests/live2d-tests/Source/SampleScene.cpp index 5c321f788bc0..66fbd7e95adf 100644 --- a/tests/live2d-tests/Source/SampleScene.cpp +++ b/tests/live2d-tests/Source/SampleScene.cpp @@ -185,7 +185,7 @@ void SampleScene::onExit() LAppLive2DManager::GetInstance()->ReleaseAllModel(); } -void SampleScene::menuCloseCallback(Ref* pSender) +void SampleScene::menuCloseCallback(Object* pSender) { LAppLive2DManager::ReleaseInstance(); @@ -196,7 +196,7 @@ void SampleScene::menuCloseCallback(Ref* pSender) #endif } -void SampleScene::menuChangeCallback(Ref* pSender) +void SampleScene::menuChangeCallback(Object* pSender) { LAppLive2DManager::GetInstance()->NextScene(); } diff --git a/tests/live2d-tests/Source/SampleScene.h b/tests/live2d-tests/Source/SampleScene.h index bf57308f7430..efc2cd776d38 100644 --- a/tests/live2d-tests/Source/SampleScene.h +++ b/tests/live2d-tests/Source/SampleScene.h @@ -27,8 +27,8 @@ class SampleScene : public ax::Scene virtual void onExit() override; // a selector callback - void menuCloseCallback(ax::Ref* pSender); - void menuChangeCallback(ax::Ref* pSender); + void menuCloseCallback(ax::Object* pSender); + void menuChangeCallback(ax::Object* pSender); // implement the "static create()" method manually CREATE_FUNC(SampleScene);