diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index 96402dd4d9..9808553d62 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -38,6 +38,42 @@ NS_CC_BEGIN namespace ui { +class LayoutExecutant : public Ref +{ +public: + LayoutExecutant(){}; + virtual ~LayoutExecutant(){}; + static LayoutExecutant* create(); + virtual void doLayout(const Size& layoutSize, Vector container){}; +}; + +class LinearVerticalLayoutExecutant : public LayoutExecutant +{ +public: + LinearVerticalLayoutExecutant(){}; + virtual ~LinearVerticalLayoutExecutant(){}; + static LinearVerticalLayoutExecutant* create(); + virtual void doLayout(const Size& layoutSize, Vector container); +}; + +class LinearHorizontalLayoutExecutant : public LayoutExecutant +{ +public: + LinearHorizontalLayoutExecutant(){}; + virtual ~LinearHorizontalLayoutExecutant(){}; + static LinearHorizontalLayoutExecutant* create(); + virtual void doLayout(const Size& layoutSize, Vector container); +}; + +class RelativeLayoutExecutant : public LayoutExecutant +{ +public: + RelativeLayoutExecutant(){}; + virtual ~RelativeLayoutExecutant(){}; + static RelativeLayoutExecutant* create(); + virtual void doLayout(const Size& layoutSize, Vector container); +}; + LayoutExecutant* LayoutExecutant::create() { LayoutExecutant* exe = new LayoutExecutant(); diff --git a/cocos/ui/UILayout.h b/cocos/ui/UILayout.h index 6c76089f3f..3155332793 100644 --- a/cocos/ui/UILayout.h +++ b/cocos/ui/UILayout.h @@ -50,48 +50,13 @@ typedef enum { LAYOUT_CLIPPING_STENCIL, LAYOUT_CLIPPING_SCISSOR }LayoutClippingType; - - -class LayoutExecutant : public Ref -{ -public: - LayoutExecutant(){}; - virtual ~LayoutExecutant(){}; - static LayoutExecutant* create(); - virtual void doLayout(const Size& layoutSize, Vector container){}; -}; - -class LinearVerticalLayoutExecutant : public LayoutExecutant -{ -public: - LinearVerticalLayoutExecutant(){}; - virtual ~LinearVerticalLayoutExecutant(){}; - static LinearVerticalLayoutExecutant* create(); - virtual void doLayout(const Size& layoutSize, Vector container); -}; - -class LinearHorizontalLayoutExecutant : public LayoutExecutant -{ -public: - LinearHorizontalLayoutExecutant(){}; - virtual ~LinearHorizontalLayoutExecutant(){}; - static LinearHorizontalLayoutExecutant* create(); - virtual void doLayout(const Size& layoutSize, Vector container); -}; - -class RelativeLayoutExecutant : public LayoutExecutant -{ -public: - RelativeLayoutExecutant(){}; - virtual ~RelativeLayoutExecutant(){}; - static RelativeLayoutExecutant* create(); - virtual void doLayout(const Size& layoutSize, Vector container); -}; /** * @js NA * @lua NA */ +class LayoutExecutant; + class Layout : public Widget {