more fixes with the namespaces

This commit is contained in:
Ricardo Quesada 2015-04-08 21:23:47 -07:00
parent 51374eb822
commit 23b0d4d2f6
75 changed files with 244 additions and 104 deletions

View File

@ -2,6 +2,8 @@
#include "../testResource.h"
#include "cocos2d.h"
USING_NS_CC;
enum
{
kTagNode,

View File

@ -26,6 +26,8 @@
#include "ActionsEaseTest.h"
#include "../testResource.h"
USING_NS_CC;
enum {
kTagAction1 = 1,
kTagAction2 = 2,

View File

@ -31,6 +31,8 @@
#include "renderer/CCCustomCommand.h"
#include "renderer/CCGroupCommand.h"
USING_NS_CC;
ActionsTests::ActionsTests()
{
ADD_TEST_CASE(ActionManual);

View File

@ -26,6 +26,8 @@
#include "CocosStudio3DTest.h"
#include "cocostudio/CocoStudio.h"
USING_NS_CC;
enum
{
IDC_NEXT = 100,

View File

@ -3,6 +3,8 @@
#include "../testResource.h"
#include "cocos2d.h"
USING_NS_CC;
ConfigurationTests::ConfigurationTests()
{
ADD_TEST_CASE(ConfigurationLoadConfig);

View File

@ -41,6 +41,8 @@
#include <sstream>
#endif
USING_NS_CC;
//------------------------------------------------------------------
//
// ConsoleTest

View File

@ -2,6 +2,9 @@
#include "../../testResource.h"
#include "cocos2d.h"
USING_NS_CC;
USING_NS_CC_EXT;
const char* sceneManifests[] = {"AMTestScene1/project.manifest", "AMTestScene2/project.manifest", "AMTestScene3/project.manifest"};
const char* storagePaths[] = {"CppTests/AssetsManagerExTest/scene1/", "CppTests/AssetsManagerExTest/scene2/", "CppTests/AssetsManagerExTest/scene3"};
const char* backgroundPaths[] = {"Images/assetMgrBackground1.jpg", "Images/assetMgrBackground2.png", "Images/assetMgrBackground3.png"};

View File

@ -25,9 +25,9 @@ private:
cocos2d::Layer* _loadLayer;
cocos2d::Menu* _downloadMenu;
AssetsManagerEx *_am;
cocos2d::extension::AssetsManagerEx* _am;
cocos2d::Label* _progress;
EventListenerAssetsManagerEx* _amListener;
cocos2d::extension::EventListenerAssetsManagerEx* _amListener;
void onLoadEnd();
};

View File

@ -5,8 +5,6 @@
#include "../../BaseTest.h"
#include "cocostudio/CocoStudio.h"
using namespace cocostudio::timeline;
class CocoStudioActionTimelineTests : public TestSuite
{
public:

View File

@ -324,7 +324,7 @@ public:
virtual void playWithIndex(int index);
CC_SYNTHESIZE(cocostudio::Armature*, m_pMount, Mount);
CC_SYNTHESIZE(cocos2d::Scene*, _scene, cocos2d::Scene*);
CC_SYNTHESIZE(cocos2d::Scene*, _scene, Scene);
};
class TestArmatureNesting2 : public ArmatureBaseTest

View File

@ -8,7 +8,7 @@
DEFINE_TEST_SUITE(CocoStudioSceneEditTests);
class cocos2d::Scene*EditorTestBase : public TestCase
class SceneEditorTestBase : public TestCase
{
public:
virtual bool init() override;
@ -35,7 +35,7 @@ protected:
std::string _filePath;
};
class LoadSceneEdtiorFileTest : public cocos2d::Scene*EditorTestBase
class LoadSceneEdtiorFileTest : public SceneEditorTestBase
{
public:
CREATE_FUNC(LoadSceneEdtiorFileTest);
@ -52,7 +52,7 @@ private:
};
class SpriteComponentTest : public cocos2d::Scene*EditorTestBase
class SpriteComponentTest : public SceneEditorTestBase
{
public:
CREATE_FUNC(SpriteComponentTest);
@ -69,7 +69,7 @@ private:
void defaultPlay();
};
class ArmatureComponentTest : public cocos2d::Scene*EditorTestBase
class ArmatureComponentTest : public SceneEditorTestBase
{
public:
CREATE_FUNC(ArmatureComponentTest);
@ -86,7 +86,7 @@ private:
void defaultPlay();
};
class UIComponentTest : public cocos2d::Scene*EditorTestBase
class UIComponentTest : public SceneEditorTestBase
{
public:
CREATE_FUNC(UIComponentTest);
@ -103,7 +103,7 @@ private:
void defaultPlay();
};
class TmxMapComponentTest : public cocos2d::Scene*EditorTestBase
class TmxMapComponentTest : public SceneEditorTestBase
{
public:
CREATE_FUNC(TmxMapComponentTest);
@ -120,7 +120,7 @@ private:
};
class ParticleComponentTest : public cocos2d::Scene*EditorTestBase
class ParticleComponentTest : public SceneEditorTestBase
{
public:
CREATE_FUNC(ParticleComponentTest);
@ -136,7 +136,7 @@ protected:
void defaultPlay();
};
class EffectComponentTest : public cocos2d::Scene*EditorTestBase
class EffectComponentTest : public SceneEditorTestBase
{
public:
CREATE_FUNC(EffectComponentTest);
@ -154,7 +154,7 @@ private:
};
class BackgroundComponentTest : public cocos2d::Scene*EditorTestBase
class BackgroundComponentTest : public SceneEditorTestBase
{
public:
CREATE_FUNC(BackgroundComponentTest);
@ -170,7 +170,7 @@ private:
void defaultPlay();
};
class AttributeComponentTest : public cocos2d::Scene*EditorTestBase
class AttributeComponentTest : public SceneEditorTestBase
{
public:
CREATE_FUNC(AttributeComponentTest);
@ -188,7 +188,7 @@ private:
void defaultPlay();
};
class TriggerTest : public cocos2d::Scene*EditorTestBase
class TriggerTest : public SceneEditorTestBase
{
public:
CREATE_FUNC(TriggerTest);

View File

@ -24,6 +24,9 @@
#include "CCControlPotentiometerTest.h"
USING_NS_CC;
USING_NS_CC_EXT;
ControlPotentiometerTest::ControlPotentiometerTest()
: _displayValueLabel(nullptr)
{

View File

@ -1,5 +1,7 @@
#include "FileUtilsTest.h"
USING_NS_CC;
FileUtilsTests::FileUtilsTests()
{
ADD_TEST_CASE(TestResolutionDirectories);

View File

@ -35,8 +35,6 @@
DEFINE_TEST_SUITE(AudioEngineTests);
using namespace cocos2d;
class AudioEngineTestDemo : public TestCase
{
public:

View File

@ -5,6 +5,9 @@
#include <algorithm>
USING_NS_CC;
using namespace cocos2d::ui;
// Enable profiles for this file
#undef CC_PROFILER_DISPLAY_TIMERS
#define CC_PROFILER_DISPLAY_TIMERS() Profiler::getInstance()->displayTimers()

View File

@ -3,9 +3,10 @@
//
#include "PerformanceCallbackTest.h"
#include <algorithm>
USING_NS_CC;
// Enable profiles for this file
#undef CC_PROFILER_DISPLAY_TIMERS
#define CC_PROFILER_DISPLAY_TIMERS() Profiler::getInstance()->displayTimers()

View File

@ -2,9 +2,10 @@
*
*/
#include "PerformanceContainerTest.h"
#include <algorithm>
USING_NS_CC;
// Enable profiles for this file
#undef CC_PROFILER_DISPLAY_TIMERS
#define CC_PROFILER_DISPLAY_TIMERS() Profiler::getInstance()->displayTimers()

View File

@ -3,9 +3,10 @@
//
#include "PerformanceEventDispatcherTest.h"
#include <algorithm>
USING_NS_CC;
// Enable profiles for this file
#undef CC_PROFILER_DISPLAY_TIMERS
#define CC_PROFILER_DISPLAY_TIMERS() Profiler::getInstance()->displayTimers()

View File

@ -1,5 +1,7 @@
#include "PerformanceLabelTest.h"
USING_NS_CC;
enum {
kMaxNodes = 200,
kNodesIncrease = 10,

View File

@ -1,5 +1,7 @@
#include "PerformanceMathTest.h"
USING_NS_CC;
// Enable profiles for this file
#undef CC_PROFILER_DISPLAY_TIMERS
#define CC_PROFILER_DISPLAY_TIMERS() Profiler::getInstance()->displayTimers()

View File

@ -1,7 +1,8 @@
#include "PerformanceNodeChildrenTest.h"
#include <algorithm>
USING_NS_CC;
// Enable profiles for this file
#undef CC_PROFILER_DISPLAY_TIMERS
#define CC_PROFILER_DISPLAY_TIMERS() Profiler::getInstance()->displayTimers()

View File

@ -29,6 +29,8 @@
#include <cmath>
USING_NS_CC;
#if defined(_MSC_VER) && _MSC_VER<1800
#define CC_ROUND(__f__) __f__
#else

View File

@ -1,5 +1,7 @@
#include "PerformanceTextureTest.h"
USING_NS_CC;
enum
{
TEST_COUNT = 1,

View File

@ -1,5 +1,7 @@
#include "PerformanceTouchesTest.h"
USING_NS_CC;
// Enable profiles for this file
#undef CC_PROFILER_DISPLAY_TIMERS
#define CC_PROFILER_DISPLAY_TIMERS() Profiler::getInstance()->displayTimers()

View File

@ -1,6 +1,9 @@
#include "RenderTextureTest.h"
#include "../testBasic.h"
USING_NS_CC;
using namespace cocos2d::ui;
RenderTextureTests::RenderTextureTests()
{
ADD_TEST_CASE(RenderTextureSave);

View File

@ -6,11 +6,11 @@
DEFINE_TEST_SUITE(SceneTests);
class cocos2d::Scene*TestLayer1 : public cocos2d::Layer
class SceneTestLayer1 : public cocos2d::Layer
{
public:
CREATE_FUNC(SceneTestLayer1);
cocos2d::Scene*TestLayer1();
SceneTestLayer1();
~SceneTestLayer1();
virtual void onEnter() override;
@ -22,12 +22,12 @@ public:
void onQuit(cocos2d::Ref* sender);
} ;
class cocos2d::Scene*TestLayer2 : public cocos2d::Layer
class SceneTestLayer2 : public cocos2d::Layer
{
float _timeCounter;
public:
CREATE_FUNC(SceneTestLayer2);
cocos2d::Scene*TestLayer2();
SceneTestLayer2();
void testDealloc(float dt);
void onGoBack(cocos2d::Ref* sender);
@ -35,11 +35,11 @@ public:
void onReplaceSceneTran(cocos2d::Ref* sender);
} ;
class cocos2d::Scene*TestLayer3 : public cocos2d::LayerColor
class SceneTestLayer3 : public cocos2d::LayerColor
{
public:
CREATE_FUNC(SceneTestLayer3);
cocos2d::Scene*TestLayer3();
SceneTestLayer3();
bool init();
virtual void testDealloc(float dt);
void item0Clicked(cocos2d::Ref* sender);
@ -48,7 +48,7 @@ public:
void item3Clicked(cocos2d::Ref* sender);
} ;
class cocos2d::Scene*TestScene : public TestCase
class SceneTestScene : public TestCase
{
public:
CREATE_FUNC(SceneTestScene);

View File

@ -2,6 +2,7 @@
#include "../testResource.h"
USING_NS_CC;
USING_NS_CC_EXT;
enum {
kTagAnimationDance = 1,

View File

@ -243,9 +243,9 @@ public:
void onExit() override;
virtual std::string title() const override;
virtual std::string subtitle() const override;
ControlSlider* sliderCtl();
cocos2d::extension::ControlSlider* sliderCtl();
void sliderAction(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
ControlSlider* _sliderCtl;
cocos2d::extension::ControlSlider* _sliderCtl;
};
@ -258,15 +258,15 @@ public:
virtual std::string title() const override;
virtual std::string subtitle() const override;
void onEnter() override;
ControlSlider* sliderCtl();
cocos2d::extension::ControlSlider* sliderCtl();
void sliderAction(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
cocos2d::Scheduler* sched1;
cocos2d::Scheduler* sched2;
cocos2d::ActionManager* actionManager1;
cocos2d::ActionManager* actionManager2;
ControlSlider *sliderCtl1;
ControlSlider *sliderCtl2;
cocos2d::extension::ControlSlider* sliderCtl1;
cocos2d::extension::ControlSlider* sliderCtl2;
};
class SchedulerIssue2268 : public SchedulerTestLayer

View File

@ -2,6 +2,9 @@
#include "../testResource.h"
#include "cocos2d.h"
USING_NS_CC;
USING_NS_CC_EXT;
ShaderTests::ShaderTests()
{
ADD_TEST_CASE(ShaderLensFlare);

View File

@ -96,8 +96,8 @@ public:
protected:
SpriteBlur* _blurSprite;
ControlSlider* _sliderRadiusCtl;
ControlSlider* _sliderNumCtrl;
cocos2d::extension::ControlSlider* _sliderRadiusCtl;
cocos2d::extension::ControlSlider* _sliderNumCtrl;
};
class ShaderRetroEffect : public ShaderTestDemo

View File

@ -28,6 +28,8 @@
#include "cocos2d.h"
#include <tuple>
USING_NS_CC;
Shader2Tests::Shader2Tests()
{
ADD_TEST_CASE(EffectSpriteTest);

View File

@ -46,7 +46,7 @@ public:
virtual std::string title() const override;
};
class Sprite3DForceDepthTest : public cocos2d::Sprite3DTestDemo
class Sprite3DForceDepthTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DForceDepthTest);
@ -55,7 +55,7 @@ public:
virtual std::string subtitle() const override;
};
class Sprite3DEmptyTest : public cocos2d::Sprite3DTestDemo
class Sprite3DEmptyTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DEmptyTest);
@ -64,7 +64,7 @@ public:
virtual std::string subtitle() const override;
};
class Sprite3DBasicTest : public cocos2d::Sprite3DTestDemo
class Sprite3DBasicTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DBasicTest);
@ -76,7 +76,7 @@ public:
void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
};
class Sprite3DUVAnimationTest : public cocos2d::Sprite3DTestDemo
class Sprite3DUVAnimationTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DUVAnimationTest);
@ -97,7 +97,7 @@ protected:
#endif
};
class Sprite3DFakeShadowTest : public cocos2d::Sprite3DTestDemo
class Sprite3DFakeShadowTest : public Sprite3DTestDemo
{
public:
enum State
@ -133,7 +133,7 @@ private:
#endif
};
class Sprite3DLightMapTest : public cocos2d::Sprite3DTestDemo
class Sprite3DLightMapTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DLightMapTest);
@ -146,7 +146,7 @@ private:
cocos2d::Camera * _camera;
};
class Sprite3DBasicToonShaderTest : public cocos2d::Sprite3DTestDemo
class Sprite3DBasicToonShaderTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DBasicToonShaderTest);
@ -218,7 +218,7 @@ protected:
static cocos2d::GLProgram* getOrCreateProgram(bool isSkinned = false);
};
class Sprite3DHitTest : public cocos2d::Sprite3DTestDemo
class Sprite3DHitTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DHitTest);
@ -245,7 +245,7 @@ protected:
cocos2d::CustomCommand _command;
};
class Sprite3DEffectTest : public cocos2d::Sprite3DTestDemo
class Sprite3DEffectTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DEffectTest);
@ -258,7 +258,7 @@ public:
void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
};
class AsyncLoadSprite3DTest : public cocos2d::Sprite3DTestDemo
class AsyncLoadSprite3DTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(AsyncLoadSprite3DTest);
@ -275,7 +275,7 @@ protected:
std::vector<std::string> _paths; //model paths to be loaded
};
class Sprite3DWithSkinTest : public cocos2d::Sprite3DTestDemo
class Sprite3DWithSkinTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DWithSkinTest);
@ -293,7 +293,7 @@ private:
cocos2d::MenuItemFont* _menuItem;
};
class Sprite3DWithSkinOutlineTest : public cocos2d::Sprite3DTestDemo
class Sprite3DWithSkinOutlineTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DWithSkinOutlineTest);
@ -306,7 +306,7 @@ public:
void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
};
class Animate3DTest : public cocos2d::Sprite3DTestDemo
class Animate3DTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Animate3DTest);
@ -346,7 +346,7 @@ protected:
cocos2d::MoveTo* _moveAction;
};
class AttachmentTest : public cocos2d::Sprite3DTestDemo
class AttachmentTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(AttachmentTest);
@ -363,7 +363,7 @@ protected:
cocos2d::Sprite3D* _sprite;
};
class Sprite3DReskinTest : public cocos2d::Sprite3DTestDemo
class Sprite3DReskinTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DReskinTest);
@ -393,7 +393,7 @@ protected:
int _curSkin[(int)SkinType::MAX_TYPE]; //current skin index
cocos2d::Sprite3D* _sprite;
};
class Sprite3DWithOBBPerformanceTest : public cocos2d::Sprite3DTestDemo
class Sprite3DWithOBBPerformanceTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DWithOBBPerformanceTest);
@ -427,7 +427,7 @@ protected:
void calculateRayByLocationInView(cocos2d::Ray* ray, const cocos2d::Vec2& location);
};
class Sprite3DMirrorTest : public cocos2d::Sprite3DTestDemo
class Sprite3DMirrorTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DMirrorTest);
@ -443,7 +443,7 @@ protected:
cocos2d::Sprite3D* _mirrorSprite;
};
class QuaternionTest : public cocos2d::Sprite3DTestDemo
class QuaternionTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(QuaternionTest);
@ -462,7 +462,7 @@ protected:
};
// 3d + 2d use case
class UseCaseSprite3D : public cocos2d::Sprite3DTestDemo
class UseCaseSprite3D : public Sprite3DTestDemo
{
public:
CREATE_FUNC(UseCaseSprite3D);
@ -489,7 +489,7 @@ protected:
};
// node animation test, cocos2d-x supports both skeletal animation and node animation
class NodeAnimationTest : public cocos2d::Sprite3DTestDemo
class NodeAnimationTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(NodeAnimationTest);
@ -508,7 +508,7 @@ namespace cocos2d
class TextureCube;
class Skybox;
}
class Sprite3DCubeMapTest : public cocos2d::Sprite3DTestDemo
class Sprite3DCubeMapTest : public Sprite3DTestDemo
{
public:
CREATE_FUNC(Sprite3DCubeMapTest);

View File

@ -1,5 +1,7 @@
#include "TerrainTest.h"
USING_NS_CC;
TerrainTests::TerrainTests()
{
ADD_TEST_CASE(TerrainSimple);

View File

@ -23,9 +23,9 @@ public:
virtual std::string title() const override;
virtual std::string subtitle() const override;
void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
Terrain * _terrain;
cocos2d::Terrain* _terrain;
protected:
cocos2d::Camera* _camera;
cocos2d::Camera* _camera;
};
#define PLAYER_STATE_LEFT 0
@ -37,7 +37,7 @@ protected:
class Player : public cocos2d::Sprite3D
{
public:
static Player * create(const char * file, cocos2d::Camera* cam, Terrain * terrain);
static Player * create(const char * file, cocos2d::Camera* cam, cocos2d::Terrain* terrain);
virtual bool isDone() const;
virtual void update(float dt);
@ -51,7 +51,7 @@ public:
float _headingAngle;
cocos2d::Vec3 _headingAxis;
private:
Terrain * _terrain;
cocos2d::Terrain* _terrain;
cocos2d::Camera* _cam;
int _playerState;
};
@ -73,7 +73,7 @@ protected:
cocos2d::Label* left;
cocos2d::Label* right;
cocos2d::Camera* _camera;
Terrain * _terrain;
cocos2d::Terrain* _terrain;
Player * _player;
};

View File

@ -1,5 +1,7 @@
#include "TextInputTest.h"
USING_NS_CC;
#define FONT_NAME "fonts/Thonburi.ttf"
#define FONT_SIZE 36

View File

@ -12,14 +12,14 @@ DEFINE_TEST_SUITE(TextInputTests);
// KeyboardNotificationLayer for test IME keyboard notification.
//////////////////////////////////////////////////////////////////////////
class KeyboardNotificationLayer : public TestCase, public IMEDelegate
class KeyboardNotificationLayer : public TestCase, public cocos2d::IMEDelegate
{
public:
KeyboardNotificationLayer();
virtual std::string title() const override;
virtual void onClickTrackNode(bool bClicked) = 0;
virtual void keyboardWillShow(IMEKeyboardNotificationInfo& info);
virtual void keyboardWillShow(cocos2d::IMEKeyboardNotificationInfo& info);
bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchEnded(cocos2d::Touch* touch, cocos2d::Event* event);
@ -49,10 +49,10 @@ public:
// TextFieldTTFActionTest
//////////////////////////////////////////////////////////////////////////
class TextFieldTTFActionTest : public KeyboardNotificationLayer, public TextFieldDelegate
class TextFieldTTFActionTest : public KeyboardNotificationLayer, public cocos2d::TextFieldDelegate
{
TextFieldTTF * _textField;
Action * _textFieldAction;
cocos2d::TextFieldTTF* _textField;
cocos2d::Action* _textFieldAction;
bool _action;
int _charLimit; // the textfield max char limit
@ -69,11 +69,11 @@ public:
virtual void onExit() override;
// TextFieldDelegate
virtual bool onTextFieldAttachWithIME(TextFieldTTF * sender) override;
virtual bool onTextFieldDetachWithIME(TextFieldTTF * sender) override;
virtual bool onTextFieldInsertText(TextFieldTTF * sender, const char * text, size_t nLen) override;
virtual bool onTextFieldDeleteBackward(TextFieldTTF * sender, const char * delText, size_t nLen) override;
virtual bool onDraw(TextFieldTTF * sender);
virtual bool onTextFieldAttachWithIME(cocos2d::TextFieldTTF* sender) override;
virtual bool onTextFieldDetachWithIME(cocos2d::TextFieldTTF* sender) override;
virtual bool onTextFieldInsertText(cocos2d::TextFieldTTF* sender, const char * text, size_t nLen) override;
virtual bool onTextFieldDeleteBackward(cocos2d::TextFieldTTF* sender, const char * delText, size_t nLen) override;
virtual bool onDraw(cocos2d::TextFieldTTF* sender);
};
#endif // __TEXT_INPUT_TEST_H__

View File

@ -2,6 +2,8 @@
#include "Paddle.h"
#include "../VisibleRect.h"
USING_NS_CC;
Ball::Ball(void)
{
}

View File

@ -26,6 +26,8 @@
#include "TransitionsTest.h"
#include "../testResource.h"
USING_NS_CC;
#define TRANSITION_DURATION (1.2f)
class FadeWhiteTransition : public TransitionFade

View File

@ -7,7 +7,8 @@
USING_NS_CC;
USING_NS_CC_EXT;
using namespace cocos2d::ui;
using namespace cocostudio;
// CustomImageLayer
bool CustomImageLayer::init()

View File

@ -1,5 +1,8 @@
#include "UIButtonTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIButtonTests::UIButtonTests()
{
ADD_TEST_CASE(UIButtonTest);

View File

@ -1,5 +1,8 @@
#include "UIButtonTest_Editor.h"
USING_NS_CC;
using namespace cocos2d::ui;
// UIButtonTest_Editor
UIButtonEditorTests::UIButtonEditorTests()

View File

@ -1,5 +1,8 @@
#include "UICheckBoxTest_Editor.h"
USING_NS_CC;
using namespace cocos2d::ui;
UICheckBoxEditorTests::UICheckBoxEditorTests()
{
ADD_TEST_CASE(UICheckBoxTest_Editor);

View File

@ -39,7 +39,7 @@ public:
virtual bool init() override;
void selectedStateEvent(cocos2d::Ref* sender, CheckBox::EventType type);
void selectedStateEvent(cocos2d::Ref* sender, cocos2d::ui::CheckBox::EventType type);
virtual void configureGUIScene() override;
protected:
cocos2d::ui::Text* _displayValueLabel;

View File

@ -8,6 +8,9 @@
#include "UIFocusTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIFocusTests::UIFocusTests()
{
ADD_TEST_CASE(UIFocusTestHorizontal);

View File

@ -25,14 +25,14 @@ public:
virtual void onRightKeyPressed();
virtual void onUpKeyPressed();
virtual void onDownKeyPressed();
virtual void onFocusChanged(Widget* widgetLostFocus, cocos2d::ui::Widget* widgetGetFocus);
virtual void onFocusChanged(cocos2d::ui::Widget* widgetLostFocus, cocos2d::ui::Widget* widgetGetFocus);
void onImageViewClicked(cocos2d::Ref* ref, cocos2d::ui::Widget::TouchEventType touchType);
protected:
cocos2d::Menu* _dpadMenu;
Widget *_firstFocusedWidget;
EventListenerFocus *_eventListener;
cocos2d::ui::Widget* _firstFocusedWidget;
cocos2d::EventListenerFocus* _eventListener;
};
class UIFocusTestHorizontal : public UIFocusTestBase
@ -45,11 +45,11 @@ public:
virtual bool init() override;
void toggleFocusLoop(cocos2d::Ref*,Widget::TouchEventType);
void toggleFocusLoop(cocos2d::Ref*,cocos2d::ui::Widget::TouchEventType);
protected:
Layout *_horizontalLayout;
Text *_loopText;
cocos2d::ui::Layout* _horizontalLayout;
cocos2d::ui::Text* _loopText;
};
class UIFocusTestVertical : public UIFocusTestBase
@ -62,10 +62,10 @@ public:
virtual bool init() override;
void toggleFocusLoop(cocos2d::Ref*,Widget::TouchEventType);
void toggleFocusLoop(cocos2d::Ref*,cocos2d::ui::Widget::TouchEventType);
protected:
Layout *_verticalLayout;
Text *_loopText;
cocos2d::ui::Layout* _verticalLayout;
cocos2d::ui::Text* _loopText;
};
class UIFocusTestNestedLayout1 : public UIFocusTestBase
@ -78,10 +78,10 @@ public:
virtual bool init() override;
void toggleFocusLoop(cocos2d::Ref*,Widget::TouchEventType);
void toggleFocusLoop(cocos2d::Ref*,cocos2d::ui::Widget::TouchEventType);
protected:
Layout *_verticalLayout;
Text *_loopText;
cocos2d::ui::Layout* _verticalLayout;
cocos2d::ui::Text* _loopText;
};
class UIFocusTestNestedLayout2 : public UIFocusTestBase
@ -94,10 +94,10 @@ public:
virtual bool init() override;
void toggleFocusLoop(cocos2d::Ref*,Widget::TouchEventType);
void toggleFocusLoop(cocos2d::Ref*,cocos2d::ui::Widget::TouchEventType);
protected:
Layout *_horizontalLayout;
Text *_loopText;
cocos2d::ui::Layout* _horizontalLayout;
cocos2d::ui::Text* _loopText;
};
class UIFocusTestNestedLayout3 : public UIFocusTestBase
@ -110,10 +110,10 @@ public:
virtual bool init() override;
void toggleFocusLoop(cocos2d::Ref*,Widget::TouchEventType);
void toggleFocusLoop(cocos2d::Ref*,cocos2d::ui::Widget::TouchEventType);
protected:
Layout *_verticalLayout;
Text *_loopText;
cocos2d::ui::Layout* _verticalLayout;
cocos2d::ui::Text* _loopText;
};
class UIFocusTestListView : public UIFocusTestBase
@ -126,10 +126,10 @@ public:
virtual bool init() override;
void toggleFocusLoop(cocos2d::Ref*,Widget::TouchEventType);
void toggleFocusLoop(cocos2d::Ref*,cocos2d::ui::Widget::TouchEventType);
protected:
ListView *_listView;
Text *_loopText;
cocos2d::ui::ListView* _listView;
cocos2d::ui::Text* _loopText;
};

View File

@ -1,5 +1,8 @@
#include "UIImageViewTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIImageViewTests::UIImageViewTests()
{
ADD_TEST_CASE(UIImageViewTest);

View File

@ -1,5 +1,8 @@
#include "UIImageViewTest_Editor.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIImageViewEditorTests::UIImageViewEditorTests()
{
ADD_TEST_CASE(UIImageViewTest_Editor);

View File

@ -1,5 +1,8 @@
#include "UILayoutTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
UILayoutTests::UILayoutTests()
{
ADD_TEST_CASE(UILayoutTest);

View File

@ -1,6 +1,9 @@
#include "UILayoutTest_Editor.h"
#include "VisibleRect.h"
USING_NS_CC;
using namespace cocos2d::ui;
UILayoutEditorTests::UILayoutEditorTests()
{
ADD_TEST_CASE(UILayoutTest_Editor);

View File

@ -1,5 +1,8 @@
#include "UIListViewTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
const char* font_UIListViewTest = "fonts/Marker Felt.ttf";
UIListViewTests::UIListViewTests()

View File

@ -1,6 +1,9 @@
#include "UIListViewTest_Editor.h"
#include "VisibleRect.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIListViewEditorTests::UIListViewEditorTests()
{
ADD_TEST_CASE(UIListViewTest_Vertical_Editor);

View File

@ -34,7 +34,7 @@ class UIListViewTest_Vertical_Editor : public UIScene_Editor
public:
CREATE_FUNC(UIListViewTest_Vertical_Editor);
static void setupListView(ListView* listView);
static void setupListView(cocos2d::ui::ListView* listView);
UIListViewTest_Vertical_Editor();
~UIListViewTest_Vertical_Editor();
@ -43,7 +43,7 @@ public:
protected:
cocos2d::ui::Text* _displayValueLabel;
__Array* _array;
cocos2d::__Array* _array;
};
@ -60,7 +60,7 @@ public:
protected:
cocos2d::ui::Text* _displayValueLabel;
__Array* _array;
cocos2d::__Array* _array;
};
#endif /* defined(__TestCpp__UIListViewTest_Editor__) */

View File

@ -1,5 +1,8 @@
#include "UILoadingBarTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
UILoadingBarTests::UILoadingBarTests()
{
ADD_TEST_CASE(UILoadingBarTest_Left);

View File

@ -1,5 +1,8 @@
#include "UILoadingBarTest_Editor.h"
USING_NS_CC;
using namespace cocos2d::ui;
UILoadingBarEditorTests::UILoadingBarEditorTests()
{
ADD_TEST_CASE(UILoadingBarTest_Editor);

View File

@ -1,6 +1,9 @@
#include "UIPageViewTest.h"
#include "cocos2d.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIPageViewTests::UIPageViewTests()
{
ADD_TEST_CASE(UIPageViewTest);

View File

@ -1,6 +1,9 @@
#include "UIPageViewTest_Editor.h"
#include "VisibleRect.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIPageViewEditorTests::UIPageViewEditorTests()
{
ADD_TEST_CASE(UIPageViewTest_Editor);

View File

@ -2,6 +2,9 @@
#include "cocostudio/CCArmatureDataManager.h"
#include "cocostudio/CCArmature.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIRichTextTests::UIRichTextTests()
{
ADD_TEST_CASE(UIRichTextTest);

View File

@ -25,6 +25,9 @@
#include "UIScale9SpriteTest.h"
#include "testResource.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIScale9SpriteTests::UIScale9SpriteTests()
{
ADD_TEST_CASE(UIScale9SpriteTest);

View File

@ -3,6 +3,8 @@
#include "ui/CocosGUI.h"
#include "UISceneManager_Editor.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIScene_Editor::UIScene_Editor()
: _touchGroup(nullptr)

View File

@ -1,5 +1,8 @@
#include "UIScrollViewTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIScrollViewTests::UIScrollViewTests()
{
ADD_TEST_CASE(UIScrollViewTest_Vertical);

View File

@ -1,6 +1,9 @@
#include "UIScrollViewTest_Editor.h"
#include "VisibleRect.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIScrollViewEditorTests::UIScrollViewEditorTests()
{
ADD_TEST_CASE(UIScrollViewTest_Vertical_Editor);

View File

@ -1,5 +1,8 @@
#include "UISliderTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
UISliderTests::UISliderTests()
{
ADD_TEST_CASE(UISliderTest);

View File

@ -1,5 +1,8 @@
#include "UITextAtlasTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
UITextAtlasTests::UITextAtlasTests()
{
ADD_TEST_CASE(UITextAtlasTest);

View File

@ -1,5 +1,8 @@
#include "UITextAtlasTest_Editor.h"
USING_NS_CC;
using namespace cocos2d::ui;
UITextAtlasEditorTests::UITextAtlasEditorTests()
{
ADD_TEST_CASE(UITextAtlasTest_Editor);

View File

@ -1,5 +1,8 @@
#include "UITextBMFontTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
UITextBMFontTests::UITextBMFontTests()
{
ADD_TEST_CASE(UITextBMFontTest);

View File

@ -1,5 +1,8 @@
#include "UITextBMFontTest_Editor.h"
USING_NS_CC;
using namespace cocos2d::ui;
UITextBMFontEditorTest::UITextBMFontEditorTest()
{
ADD_TEST_CASE(UITextBMFontTest_Editor);

View File

@ -1,5 +1,8 @@
#include "UITextFieldTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
UITextFieldTests::UITextFieldTests()
{
ADD_TEST_CASE(UITextFieldTest);

View File

@ -1,5 +1,8 @@
#include "UITextFieldTest_Editor.h"
USING_NS_CC;
using namespace cocos2d::ui;
UITextFieldEditorTests::UITextFieldEditorTests()
{
ADD_TEST_CASE(UITextFieldTest_Editor);

View File

@ -1,12 +1,14 @@
#include "UITextTest_Editor.h"
#include "ui/CocosGUI.h"
USING_NS_CC;
using namespace cocos2d::ui;
UITextEditorTests::UITextEditorTests()
{
ADD_TEST_CASE(UITextTest_Editor);
}
// UITextTest_Editor
using namespace ui;
bool UITextTest_Editor::init()
{

View File

@ -1,6 +1,7 @@
#include "UIVideoPlayerTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
using namespace cocos2d::experimental::ui;
VideoPlayerTests::VideoPlayerTests()

View File

@ -26,14 +26,14 @@ public:
void sliderCallback(cocos2d::Ref* sender, cocos2d::ui::Slider::EventType eventType);
void videoEventCallback(cocos2d::Ref* sender, experimental::ui::VideoPlayer::EventType eventType);
void videoEventCallback(cocos2d::Ref* sender, cocos2d::experimental::ui::VideoPlayer::EventType eventType);
private:
void createVideo();
void createSlider();
cocos2d::MenuItemFont* _hintItem;
experimental::ui::VideoPlayer* _videoPlayer;
cocos2d::experimental::ui::VideoPlayer* _videoPlayer;
cocos2d::Label* _videoStateLabel;
cocos2d::Rect _visibleRect;

View File

@ -24,6 +24,9 @@
#include "UIWebViewTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
WebViewTests::WebViewTests()
{
ADD_TEST_CASE(WebViewTest);

View File

@ -35,9 +35,9 @@ public:
CREATE_FUNC(WebViewTest);
virtual bool init() override;
bool onWebViewShouldStartLoading(experimental::ui::WebView *sender, const std::string &url);
void onWebViewDidFinishLoading(experimental::ui::WebView *sender, const std::string &url);
void onWebViewDidFailLoading(experimental::ui::WebView *sender, const std::string &url);
bool onWebViewShouldStartLoading(cocos2d::experimental::ui::WebView *sender, const std::string &url);
void onWebViewDidFinishLoading(cocos2d::experimental::ui::WebView *sender, const std::string &url);
void onWebViewDidFailLoading(cocos2d::experimental::ui::WebView *sender, const std::string &url);
private:

View File

@ -1,5 +1,8 @@
#include "UIWidgetAddNodeTest.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIWidgetAddNodeTests::UIWidgetAddNodeTests()
{
ADD_TEST_CASE(UIWidgetAddNodeTest);

View File

@ -1,5 +1,8 @@
#include "UIWidgetAddNodeTest_Editor.h"
USING_NS_CC;
using namespace cocos2d::ui;
UIWidgetAddNodeEditorTests::UIWidgetAddNodeEditorTests()
{
ADD_TEST_CASE(UIWidgetAddNodeTest_Editor);