Renamed UIControl to UINode.

Removed UIControlAnim and UIDragableControl.
UIControlAnim and UIDragableControl implemented in base UINode.

--HG--
branch : dev-2.1
This commit is contained in:
Martí­n Lucas Golini
2018-01-02 02:37:23 -03:00
parent 04a605c684
commit e21daabe65
92 changed files with 1665 additions and 1959 deletions

View File

@@ -43,7 +43,7 @@ class EE_API MapEditor {
~MapEditor();
protected:
UIWindow * mUIWindow;
UIControl * mUIContainer;
UINode * mUIContainer;
UITheme * mTheme;
Private::UIMap * mUIMap;
MapEditorCloseCb mCloseCb;

View File

@@ -13,9 +13,7 @@
#include <eepp/ui/uiskincomplex.hpp>
#include <eepp/ui/uitheme.hpp>
#include <eepp/ui/uithememanager.hpp>
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uidragablecontrol.hpp>
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uiwidget.hpp>
#include <eepp/ui/uitouchdragablewidget.hpp>
#include <eepp/ui/uiimage.hpp>

View File

@@ -26,10 +26,10 @@ class EE_API TextureAtlasEditor {
UISpinBox * getSpinOffY() const { return mSpinOffY; }
protected:
class UITGEUpdater : public UIControl
class UITGEUpdater : public UINode
{
public:
UITGEUpdater( TextureAtlasEditor * TGEditor ) : UIControl(), mTGEditor( TGEditor ) {}
UITGEUpdater( TextureAtlasEditor * TGEditor ) : UINode(), mTGEditor( TGEditor ) {}
virtual void update() { mTGEditor->update(); }
protected:
@@ -38,7 +38,7 @@ class EE_API TextureAtlasEditor {
friend class UITGEUpdater;
UIWindow * mUIWindow;
UIControl * mUIContainer;
UINode * mUIContainer;
UITheme * mTheme;
TGEditorCloseCb mCloseCb;
TexturePacker * mTexturePacker;

View File

@@ -6,13 +6,13 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIBackground {
public:
static UIBackground * New( UIControl * control );
static UIBackground * New( UINode * control );
UIBackground( UIControl * control );
UIBackground( UINode * control );
~UIBackground();
@@ -42,7 +42,7 @@ class EE_API UIBackground {
protected:
std::vector<Color> mColor;
UIControl * mControl;
UINode * mControl;
BlendMode mBlendMode;
unsigned int mCorners;
Drawable * mDrawable;

View File

@@ -5,13 +5,13 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIBorder {
public:
static UIBorder * New( UIControl * control );
static UIBorder * New( UINode * control );
UIBorder( UIControl * control );
UIBorder( UINode * control );
const Color& getColor() const;
@@ -23,7 +23,7 @@ class EE_API UIBorder {
void draw( Rectf R, const Float& alpha, const int& corners, const bool& clipping );
protected:
UIControl * mControl;
UINode * mControl;
Color mColor;
unsigned int mWidth;
};

View File

@@ -24,9 +24,9 @@ class EE_API UICheckBox : public UITextView {
void setActive( const bool& active );
UIControlAnim * getActiveButton() const;
UINode * getActiveButton() const;
UIControlAnim * getInactiveButton() const;
UINode * getInactiveButton() const;
Int32 getTextSeparation() const;
@@ -34,8 +34,8 @@ class EE_API UICheckBox : public UITextView {
virtual void loadFromXmlNode( const pugi::xml_node& node );
protected:
UIControlAnim * mActiveButton;
UIControlAnim * mInactiveButton;
UINode * mActiveButton;
UINode * mInactiveButton;
bool mActive;
Uint32 mLastTick;
Int32 mTextSeparation;

View File

@@ -23,7 +23,7 @@ class EE_API UIComboBox : public UIWidget {
UIDropDownList * getDropDownList() const { return mDropDownList; }
UIControlAnim * getButton() const { return mButton; }
UINode * getButton() const { return mButton; }
InputTextBuffer * getInputTextBuffer();
@@ -32,7 +32,7 @@ class EE_API UIComboBox : public UIWidget {
void loadFromXmlNode(const pugi::xml_node & node);
protected:
UIDropDownList * mDropDownList;
UIControlAnim * mButton;
UINode * mButton;
void onButtonClick( const UIEvent * Event );

View File

@@ -1,458 +0,0 @@
#ifndef EE_UICUICONTROL_H
#define EE_UICUICONTROL_H
#include <eepp/ui/base.hpp>
#include <eepp/ui/uihelper.hpp>
#include <eepp/ui/uibackground.hpp>
#include <eepp/ui/uiborder.hpp>
#include <eepp/ui/uimessage.hpp>
#include <eepp/ui/uievent.hpp>
#include <eepp/ui/uieventkey.hpp>
#include <eepp/ui/uieventmouse.hpp>
#include <eepp/ui/uiskin.hpp>
#include <eepp/ui/uiskinstate.hpp>
#include <eepp/ui/uiskinsimple.hpp>
#include <eepp/ui/uiskincomplex.hpp>
#include <eepp/ui/uithememanager.hpp>
namespace EE { namespace UI {
class UITheme;
class UIWindow;
class UIManager;
class EE_API UIControl {
public:
static UIControl * New();
typedef cb::Callback1<void, const UIEvent*> UIEventCallback;
UIControl();
virtual ~UIControl();
void screenToControl( Vector2i& position ) const;
void controlToScreen( Vector2i& position ) const;
void worldToControl( Vector2i& pos ) const;
void controlToWorld( Vector2i& pos ) const;
virtual Uint32 getType() const;
virtual bool isType( const Uint32& type ) const;
virtual void messagePost( const UIMessage * Msg );
UIControl * setPosition( const Vector2i& position );
UIControl * setPosition( const Int32& x, const Int32& y );
void setPixelsPosition( const Vector2i& position );
void setPixelsPosition( const Int32& x, const Int32& y );
const Vector2i& getPosition() const;
const Vector2i& getRealPosition() const;
virtual UIControl * setSize( const Sizei& size );
UIControl * setSize( const Int32& Width, const Int32& Height );
void setPixelsSize( const Sizei& size );
void setPixelsSize( const Int32& x, const Int32& y );
const Sizei& getSize();
const Sizei& getRealSize();
Rect getRect() const;
UIControl * setVisible( const bool& visible );
bool isVisible() const;
bool isHided() const;
UIControl * setEnabled( const bool& enabled );
bool isEnabled() const;
bool isDisabled() const;
UIControl * getParent() const;
UIControl * setParent( UIControl * parent );
void centerHorizontal();
void centerVertical();
void center();
virtual void close();
virtual void draw();
virtual void update();
Uint32 getHorizontalAlign() const;
UIControl * setHorizontalAlign( Uint32 halign );
Uint32 getVerticalAlign() const;
UIControl * setVerticalAlign( Uint32 valign );
UIControl * setGravity( Uint32 hvalign );
UIBackground * setBackgroundFillEnabled( bool enabled );
UIBorder * setBorderEnabled( bool enabled );
UIControl * getNextControl() const;
UIControl * getPrevControl() const;
UIControl * getNextControlLoop() const;
UIControl * setData( const UintPtr& data );
const UintPtr& getData() const;
UIControl * childGetAt( Vector2i CtrlPos, unsigned int RecursiveLevel = 0 );
const Uint32& getFlags() const;
virtual UIControl * setFlags( const Uint32& flags );
virtual UIControl * unsetFlags( const Uint32& flags );
virtual UIControl * resetFlags( Uint32 newFlags = 0 );
UIControl * setBlendMode( const BlendMode& blend );
BlendMode getBlendMode();
void toFront();
void toBack();
void toPosition( const Uint32& position );
const Uint32& getControlFlags() const;
/** Use it at your own risk */
void setControlFlags( const Uint32& flags );
Uint32 isAnimated();
Uint32 isDragable();
Uint32 isWidget();
Uint32 isWindow();
Uint32 isClipped();
Uint32 isRotated();
Uint32 isScaled();
Uint32 isFrameBuffer();
bool isMeOrParentTreeRotated();
bool isMeOrParentTreeScaled();
bool isMeOrParentTreeScaledOrRotated();
bool isMeOrParentTreeScaledOrRotatedOrFrameBuffer();
Uint32 addEventListener( const Uint32& EventType, const UIEventCallback& Callback );
void removeEventListener( const Uint32& CallbackId );
UIBackground * getBackground();
UIBorder * getBorder();
void setThemeByName( const std::string& Theme );
virtual void setTheme( UITheme * Theme );
virtual UIControl * setThemeSkin( UITheme * Theme, const std::string& skinName );
virtual UIControl * setThemeSkin( const std::string& skinName );
void setThemeToChilds( UITheme * Theme );
UISkin * getSkin();
virtual UIControl * setSkin( const UISkin& Skin );
UIControl * setSkin( UISkin * skin );
void removeSkin();
UIControl * getFirstChild() const;
UIControl * getLastChild() const;
bool isMouseOver();
bool isMouseOverMeOrChilds();
Polygon2f& getPolygon();
const Vector2f& getPolygonCenter() const;
void setSkinState( const Uint32& State );
bool hasFocus() const;
virtual void setFocus();
bool isParentOf( UIControl * Ctrl );
void sendEvent( const UIEvent * Event );
void sendMouseEvent( const Uint32& Event, const Vector2i& position, const Uint32& flags );
void sendCommonEvent( const Uint32& Event );
Sizei getSkinSize();
UIControl * getNextWidget();
void applyDefaultTheme();
Rect getScreenRect();
void childsCloseAll();
std::string getId() const;
UIControl * setId( const std::string & id );
Uint32 getIdHash() const;
UIControl * getWindowContainer();
UIControl * find( const std::string& id );
template<typename T>
T * find( const std::string& id )
{
return reinterpret_cast<T*>( find( id ) );
}
template<typename T>
T * bind( const std::string& id, T*& ctrl )
{
ctrl = find<T>( id );
return ctrl;
}
bool isReverseDraw() const;
void setReverseDraw( bool reverseDraw );
UIWindow * getOwnerWindow();
void invalidateDraw();
void setClipEnabled();
void setClipDisabled();
protected:
typedef std::map< Uint32, std::map<Uint32, UIEventCallback> > UIEventsMap;
friend class UIManager;
friend class UIWindow;
std::string mId;
Uint32 mIdHash;
Vector2i mPos;
Vector2i mRealPos;
Vector2i mScreenPos;
Vector2f mScreenPosf;
Sizei mSize;
Sizei mRealSize;
Uint32 mFlags;
UintPtr mData;
UIControl * mParentCtrl;
UIWindow * mParentWindowCtrl;
UIControl * mChild; //! Pointer to the first child of the control
UIControl * mChildLast; //! Pointer to the last child added
UIControl * mNext; //! Pointer to the next child of the father
UIControl * mPrev; //! Pointer to the prev child of the father
UISkinState * mSkinState;
UIBackground * mBackground;
UIBorder * mBorder;
Uint32 mControlFlags;
BlendMode mBlend;
Uint16 mNumCallBacks;
Polygon2f mPoly;
Vector2f mCenter;
UIEventsMap mEvents;
bool mVisible;
bool mEnabled;
virtual Uint32 onMessage( const UIMessage * Msg );
virtual Uint32 onKeyDown( const UIEventKey& Event );
virtual Uint32 onKeyUp( const UIEventKey& Event );
virtual Uint32 onMouseMove( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseDown( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseClick( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseDoubleClick( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseUp( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseEnter( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseExit( const Vector2i& position, const Uint32 flags );
virtual Uint32 onFocus();
virtual Uint32 onFocusLoss();
virtual void onClose();
virtual Uint32 onValueChange();
virtual void onVisibilityChange();
virtual void onEnabledChange();
virtual void onPositionChange();
virtual void onSizeChange();
virtual void onParentSizeChange( const Vector2i& SizeChange );
virtual void onStateChange();
virtual void onParentChange();
virtual void onAlignChange();
virtual void onWidgetFocusLoss();
virtual void drawSkin();
virtual void drawBackground();
virtual void drawBorder();
virtual void updateQuad();
virtual void updateCenter();
virtual void matrixSet();
virtual void matrixUnset();
virtual void drawChilds();
virtual void onThemeLoaded();
virtual void onChildCountChange();
virtual UIControl * overFind( const Vector2f& Point );
virtual void onParentWindowControlChange();
virtual void clipMe();
void checkClose();
virtual void internalDraw();
void childDeleteAll();
void childAdd( UIControl * ChildCtrl );
void childAddAt( UIControl * ChildCtrl, Uint32 position );
void childRemove( UIControl * ChildCtrl );
bool isChild( UIControl * ChildCtrl ) const;
bool inParentTreeOf( UIControl * Child ) const;
Uint32 childCount() const;
UIControl * childAt( Uint32 Index ) const;
UIControl * childPrev( UIControl * Ctrl, bool Loop = false ) const;
UIControl * childNext( UIControl * Ctrl, bool Loop = false ) const;
virtual void clipDisable();
void setPrevSkinState();
virtual void updateScreenPos();
void updateChildsScreenPos();
void writeCtrlFlag( const Uint32& Flag, const Uint32& Val );
void writeFlag( const Uint32& Flag, const Uint32& Val );
void sendParentSizeChange( const Vector2i& SizeChange );
Time getElapsed();
Rect makePadding( bool PadLeft = true, bool PadRight = true, bool PadTop = true, bool PadBottom = true, bool SkipFlags = false );
Sizei getSkinSize( UISkin * Skin, const Uint32& State = UISkinState::StateNormal );
Rectf getRectf();
void drawHighlightFocus();
void drawOverControl();
void drawDebugData();
void drawBox();
void setInternalPosition( const Vector2i& Pos );
void setInternalSize( const Sizei& size );
void setInternalWidth( const Int32& width );
void setInternalHeight( const Int32& height );
void setInternalPixelsSize( const Sizei& size );
void setInternalPixelsWidth( const Int32& width );
void setInternalPixelsHeight( const Int32& height );
UIControl * findIdHash( const Uint32& idHash );
UIWindow * getParentWindow();
};
}}
#endif

View File

@@ -1,139 +0,0 @@
#ifndef EE_UICUICONTROLANIM_H
#define EE_UICUICONTROLANIM_H
#include <eepp/ui/base.hpp>
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uidragablecontrol.hpp>
namespace EE { namespace UI {
class EE_API UIControlAnim : public UIDragableControl {
public:
static UIControlAnim * New();
UIControlAnim();
virtual ~UIControlAnim();
virtual Uint32 getType() const;
virtual bool isType( const Uint32& type ) const;
virtual void update();
const Float& getRotation() const;
void setRotation( const Float& angle );
void setRotation( const Float& angle, const OriginPoint& center );
const OriginPoint& getRotationOriginPoint() const;
void setRotationOriginPoint( const OriginPoint& center );
Vector2f getRotationCenter();
const Vector2f& getScale() const;
void setScale( const Vector2f& scale );
void setScale( const Vector2f& scale, const OriginPoint& center );
void setScale( const Float& scale , const OriginPoint & center = OriginPoint::OriginCenter );
const OriginPoint& getScaleOriginPoint() const;
void setScaleOriginPoint( const OriginPoint& center );
Vector2f getScaleCenter();
const Float& getAlpha() const;
virtual void setAlpha( const Float& alpha );
virtual void setChildsAlpha( const Float& alpha );
bool isAnimating();
Interpolation1d * startAlphaAnim( const Float& From, const Float& To, const Time& TotalTime, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Vector2f& From, const Vector2f& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startTranslation( const Vector2i& From, const Vector2i& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation1d * startRotation( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation1d * startAlphaAnim( const Float& To, const Time& TotalTime, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Vector2f& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startTranslation( const Vector2i& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation1d * startRotation( const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation1d * createFadeIn( const Time& Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * createFadeOut( const Time& Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * closeFadeOut( const Time& Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * disableFadeOut( const Time & Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * getRotationInterpolation();
Interpolation2d * getScaleInterpolation();
Interpolation1d * getAlphaInterpolation();
Interpolation2d * getTranslationInterpolation();
virtual void draw();
bool isFadingOut();
protected:
friend class UIManager;
friend class UIControl;
Float mAngle;
OriginPoint mRotationOriginPoint;
Vector2f mScale;
OriginPoint mScaleOriginPoint;
Float mAlpha;
Interpolation1d * mAngleAnim;
Interpolation2d * mScaleAnim;
Interpolation1d * mAlphaAnim;
Interpolation2d * mMoveAnim;
virtual void drawBackground();
virtual void drawBorder();
virtual void drawSkin();
Color getColor( const Color& Col );
virtual void updateQuad();
virtual void onSizeChange();
virtual void onAngleChange();
virtual void onScaleChange();
virtual void onAlphaChange();
virtual void matrixSet();
virtual void matrixUnset();
void updateOriginPoint();
};
}}
#endif

View File

@@ -1,55 +0,0 @@
#ifndef EE_UICUIDRAGABLE_H
#define EE_UICUIDRAGABLE_H
#include <eepp/ui/uicontrol.hpp>
namespace EE { namespace UI {
class EE_API UIDragableControl : public UIControl {
public:
static UIDragableControl * New();
UIDragableControl();
virtual Uint32 getType() const;
virtual bool isType( const Uint32& type ) const;
bool isDragging() const;
void setDragging( const bool& dragging );
const Vector2i& getDragPoint() const;
void setDragPoint( const Vector2i& Point );
virtual void update();
bool isDragEnabled() const;
void setDragEnabled( const bool& enable );
void setDragButton( const Uint32& Button );
const Uint32& getDragButton() const;
protected:
virtual ~UIDragableControl();
Vector2i mDragPoint;
Uint32 mDragButton;
virtual Uint32 onMouseDown( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseUp( const Vector2i& position, const Uint32 flags );
virtual Uint32 onDrag( const Vector2i& position );
virtual Uint32 onDragStart( const Vector2i& position );
virtual Uint32 onDragStop( const Vector2i& position );
};
}}
#endif

View File

@@ -44,7 +44,7 @@ class EE_API UIDropDownList : public UITextInput {
UIDropDownListStyleConfig mStyleConfig;
UIListBox * mListBox;
UIControl * mFriendCtrl;
UINode * mFriendCtrl;
void onListBoxFocusLoss( const UIEvent * Event );
@@ -72,7 +72,7 @@ class EE_API UIDropDownList : public UITextInput {
virtual void onThemeLoaded();
void setFriendControl( UIControl * friendCtrl );
void setFriendControl( UINode * friendCtrl );
void destroyListBox();
};

View File

@@ -5,7 +5,7 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIEvent {
public:
@@ -56,15 +56,15 @@ class EE_API UIEvent {
NoEvent = eeINDEX_NOT_FOUND
};
UIEvent( UIControl * control, const Uint32& eventType = NoEvent );
UIEvent( UINode * control, const Uint32& eventType = NoEvent );
~UIEvent();
UIControl * getControl() const;
UINode * getControl() const;
const Uint32& getEventType() const;
protected:
UIControl * mCtrl;
UINode * mCtrl;
Uint32 mEventType;
};

View File

@@ -6,11 +6,11 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIEventKey : public UIEvent {
public:
UIEventKey( UIControl * getControl, const Uint32& EventNum, const Uint32& getKeyCode, const Uint16& getChar, const Uint32& getMod );
UIEventKey( UINode * getControl, const Uint32& EventNum, const Uint32& getKeyCode, const Uint16& getChar, const Uint32& getMod );
~UIEventKey();

View File

@@ -6,11 +6,11 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIEventMouse : public UIEvent {
public:
UIEventMouse( UIControl * getControl, const Uint32& EventNum, const Vector2i& getPosition, const Uint32& getFlags );
UIEventMouse( UINode * getControl, const Uint32& EventNum, const Vector2i& getPosition, const Uint32& getFlags );
~UIEventMouse();

View File

@@ -8,29 +8,27 @@ namespace EE { namespace UI {
enum UI_CONTROL_FLAGS_VALUES {
UI_CTRL_FLAG_CLOSE = (1<<0),
UI_CTRL_FLAG_CLOSE_FO = (1<<1),
UI_CTRL_FLAG_ANIM = (1<<2),
UI_CTRL_FLAG_MOUSEOVER = (1<<3),
UI_CTRL_FLAG_HAS_FOCUS = (1<<4),
UI_CTRL_FLAG_SELECTED = (1<<5),
UI_CTRL_FLAG_DISABLE_FADE_OUT = (1<<6),
UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD = (1<<7),
UI_CTRL_FLAG_DRAGGING = (1<<8),
UI_CTRL_FLAG_DRAGABLE = (1<<9),
UI_CTRL_FLAG_WIDGET = (1<<10),
UI_CTRL_FLAG_SKIN_OWNER = (1<<11),
UI_CTRL_FLAG_TOUCH_DRAGGING = (1<<12),
UI_CTRL_FLAG_DISABLED_BY_MODAL_WINDOW = (1<<13),
UI_CTRL_FLAG_SELECTING = (1<<14),
UI_CTRL_FLAG_ROTATED = (1<<15),
UI_CTRL_FLAG_SCALED = (1<<16),
UI_CTRL_FLAG_OWNED_BY_WINDOW = (1<<17),
UI_CTRL_FLAG_DRAWABLE_OWNER = (1<<18),
UI_CTRL_FLAG_REVERSE_DRAW = (1<<19),
UI_CTRL_FLAG_FRAME_BUFFER = (1<<20),
UI_CTRL_FLAG_NEEDS_REDRAW = (1<<21),
UI_CTRL_FLAG_DIRTY_POLY = (1<<22),
UI_CTRL_FLAG_WINDOW = (1<<23),
UI_CTRL_FLAG_FREE_USE = (1<<31)
UI_CTRL_FLAG_MOUSEOVER = (1<<2),
UI_CTRL_FLAG_HAS_FOCUS = (1<<3),
UI_CTRL_FLAG_SELECTED = (1<<4),
UI_CTRL_FLAG_DISABLE_FADE_OUT = (1<<5),
UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD = (1<<6),
UI_CTRL_FLAG_DRAGGING = (1<<7),
UI_CTRL_FLAG_WIDGET = (1<<8),
UI_CTRL_FLAG_SKIN_OWNER = (1<<9),
UI_CTRL_FLAG_TOUCH_DRAGGING = (1<<10),
UI_CTRL_FLAG_DISABLED_BY_MODAL_WINDOW = (1<<11),
UI_CTRL_FLAG_SELECTING = (1<<12),
UI_CTRL_FLAG_ROTATED = (1<<13),
UI_CTRL_FLAG_SCALED = (1<<14),
UI_CTRL_FLAG_OWNED_BY_WINDOW = (1<<15),
UI_CTRL_FLAG_DRAWABLE_OWNER = (1<<16),
UI_CTRL_FLAG_REVERSE_DRAW = (1<<17),
UI_CTRL_FLAG_FRAME_BUFFER = (1<<18),
UI_CTRL_FLAG_NEEDS_REDRAW = (1<<19),
UI_CTRL_FLAG_DIRTY_POLY = (1<<20),
UI_CTRL_FLAG_WINDOW = (1<<21),
UI_CTRL_FLAG_FREE_USE = (1<<22)
};
#define UI_HALIGN_LEFT TEXT_ALIGN_LEFT
@@ -71,9 +69,7 @@ enum UI_FLAGS {
};
enum UI_CONTROL_TYPES {
UI_TYPE_CONTROL = 0,
UI_TYPE_CONTROL_DRAGABLE,
UI_TYPE_CONTROL_ANIM,
UI_TYPE_NODE = 0,
UI_TYPE_WIDGET,
UI_TYPE_IMAGE,
UI_TYPE_SUBTEXTURE,

View File

@@ -1,12 +1,12 @@
#ifndef EE_UITUIITEMCONTAINER_HPP
#define EE_UITUIITEMCONTAINER_HPP
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uinode.hpp>
namespace EE { namespace UI {
template<class TContainer>
class UIItemContainer : public UIControl {
class UIItemContainer : public UINode {
public:
UIItemContainer();
@@ -16,12 +16,12 @@ class UIItemContainer : public UIControl {
void drawChilds();
protected:
UIControl * overFind( const Vector2f& Point );
UINode * overFind( const Vector2f& Point );
};
template<class TContainer>
UIItemContainer<TContainer>::UIItemContainer() :
UIControl()
UINode()
{
}
@@ -54,10 +54,10 @@ void UIItemContainer<TContainer>::drawChilds() {
}
template<class TContainer>
UIControl * UIItemContainer<TContainer>::overFind( const Vector2f& Point ) {
UINode * UIItemContainer<TContainer>::overFind( const Vector2f& Point ) {
TContainer * tParent = reinterpret_cast<TContainer*> ( getParent() );
UIControl * pOver = NULL;
UINode * pOver = NULL;
if ( mEnabled && mVisible && tParent->mItems.size() ) {
updateQuad();
@@ -67,7 +67,7 @@ UIControl * UIItemContainer<TContainer>::overFind( const Vector2f& Point ) {
for ( Uint32 i = tParent->mVisibleFirst; i <= tParent->mVisibleLast; i++ ) {
if ( NULL != tParent->mItems[i] ) {
UIControl * ChildOver = tParent->mItems[i]->overFind( Point );
UINode * ChildOver = tParent->mItems[i]->overFind( Point );
if ( NULL != ChildOver ) {
pOver = ChildOver;
@@ -78,7 +78,7 @@ UIControl * UIItemContainer<TContainer>::overFind( const Vector2f& Point ) {
}
if ( NULL == pOver )
pOver = const_cast<UIControl *>( reinterpret_cast<const UIControl *>( this ) );
pOver = const_cast<UINode *>( reinterpret_cast<const UINode *>( this ) );
}
}

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUILISTBOX_HPP
#define EE_UICUILISTBOX_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uiscrollbar.hpp>
#include <eepp/ui/uiitemcontainer.hpp>
#include <eepp/ui/uilistboxitem.hpp>

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUIMANAGER_H
#define EE_UICUIMANAGER_H
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uiwindow.hpp>
#include <eepp/window/input.hpp>
#include <eepp/window/window.hpp>
@@ -23,13 +23,13 @@ class EE_API UIManager {
UIWindow * getMainControl() const;
UIControl * getFocusControl() const;
UINode * getFocusControl() const;
void setFocusControl( UIControl * Ctrl );
void setFocusControl( UINode * Ctrl );
UIControl * getOverControl() const;
UINode * getOverControl() const;
void setOverControl( UIControl * Ctrl );
void setOverControl( UINode * Ctrl );
void init( Uint32 Flags = 0, EE::Window::Window * window = NULL );
@@ -43,7 +43,7 @@ class EE_API UIManager {
void resizeControl( EE::Window::Window * win );
void sendMsg( UIControl * Ctrl, const Uint32& Msg, const Uint32& Flags = 0 );
void sendMsg( UINode * Ctrl, const Uint32& Msg, const Uint32& Flags = 0 );
Vector2i getMousePos();
@@ -53,9 +53,9 @@ class EE_API UIManager {
const Uint32& getLastPressTrigger() const;
void clipSmartEnable( UIControl * ctrl, const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height );
void clipSmartEnable( UINode * ctrl, const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height );
void clipSmartDisable( UIControl * ctrl );
void clipSmartDisable( UINode * ctrl );
void sendKeyUp( const Uint32& KeyCode, const Uint16& Char, const Uint32& Mod );
@@ -105,18 +105,18 @@ class EE_API UIManager {
const Color& getHighlightOverColor() const;
void sendMouseClick( UIControl * ToCtrl, const Vector2i& Pos, const Uint32 Flags );
void sendMouseClick( UINode * ToCtrl, const Vector2i& Pos, const Uint32 Flags );
void sendMouseUp( UIControl * ToCtrl, const Vector2i& Pos, const Uint32 Flags );
void sendMouseUp( UINode * ToCtrl, const Vector2i& Pos, const Uint32 Flags );
void sendMouseDown( UIControl * ToCtrl, const Vector2i& Pos, const Uint32 Flags );
void sendMouseDown( UINode * ToCtrl, const Vector2i& Pos, const Uint32 Flags );
EE::Window::Window * getWindow() const;
/** Control where the mouse click started to be down */
UIControl * getDownControl() const;
UINode * getDownControl() const;
UIControl * getLossFocusControl() const;
UINode * getLossFocusControl() const;
const bool& isShootingDown() const;
@@ -134,17 +134,17 @@ class EE_API UIManager {
void setCursor( EE_CURSOR_TYPE cursor );
UIWidget * loadLayoutFromFile( const std::string& layoutPath, UIControl * parent = NULL );
UIWidget * loadLayoutFromFile( const std::string& layoutPath, UINode * parent = NULL );
UIWidget * loadLayoutFromString( const std::string& layoutString, UIControl * parent = NULL );
UIWidget * loadLayoutFromString( const std::string& layoutString, UINode * parent = NULL );
UIWidget * loadLayoutFromMemory( const void * buffer, Int32 bufferSize, UIControl * parent = NULL );
UIWidget * loadLayoutFromMemory( const void * buffer, Int32 bufferSize, UINode * parent = NULL );
UIWidget * loadLayoutFromStream( IOStream& stream, UIControl * parent = NULL );
UIWidget * loadLayoutFromStream( IOStream& stream, UINode * parent = NULL );
UIWidget * loadLayoutFromPack( Pack * pack, const std::string& FilePackPath, UIControl * parent = NULL );
UIWidget * loadLayoutFromPack( Pack * pack, const std::string& FilePackPath, UINode * parent = NULL );
UIWidget * loadLayoutNodes( pugi::xml_node node, UIControl * parent );
UIWidget * loadLayoutNodes( pugi::xml_node node, UINode * parent );
void setTranslator( Translator translator );
@@ -153,18 +153,18 @@ class EE_API UIManager {
String getTranslatorString( const std::string& str );
protected:
friend class UIControl;
friend class UINode;
friend class UIWindow;
EE::Window::Window *mWindow;
Input * mKM;
UIWindow * mControl;
UIControl * mFocusControl;
UIControl * mOverControl;
UIControl * mDownControl;
UIControl * mLossFocusControl;
UINode * mFocusControl;
UINode * mOverControl;
UINode * mDownControl;
UINode * mLossFocusControl;
std::list<UIWindow*> mWindowsList;
std::list<UIControl*> mCloseList;
std::list<UINode*> mCloseList;
Clock mClock;
Time mElapsed;
@@ -201,7 +201,7 @@ class EE_API UIManager {
bool windowExists( UIWindow * win );
void addToCloseQueue( UIControl * Ctrl );
void addToCloseQueue( UINode * Ctrl );
void checkClose();
};

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUIMENU_HPP
#define EE_UICUIMENU_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uimenuitem.hpp>
#include <eepp/ui/uimenucheckbox.hpp>
#include <eepp/ui/uimenusubmenu.hpp>
@@ -26,7 +26,7 @@ class EE_API UIMenu : public UIWidget {
Uint32 add( const String& Text, Drawable * Icon = NULL );
Uint32 add( UIControl * Control );
Uint32 add( UINode * Control );
Uint32 addSeparator();
@@ -34,23 +34,23 @@ class EE_API UIMenu : public UIWidget {
Uint32 addSubMenu( const String& Text, Drawable * Icon = NULL, UIMenu * SubMenu = NULL );
UIControl * getItem( const Uint32& Index );
UINode * getItem( const Uint32& Index );
UIControl * getItem( const String& Text );
UINode * getItem( const String& Text );
Uint32 getItemIndex( UIControl * Item );
Uint32 getItemIndex( UINode * Item );
Uint32 getCount() const;
void remove( const Uint32& Index );
void remove( UIControl * Ctrl );
void remove( UINode * Ctrl );
void removeAll();
void insert( const String& Text, Drawable * Icon, const Uint32& Index );
void insert( UIControl * Control, const Uint32& Index );
void insert( UINode * Control, const Uint32& Index );
virtual void setTheme( UITheme * Theme );
@@ -74,12 +74,12 @@ class EE_API UIMenu : public UIWidget {
friend class UIMenuCheckBox;
friend class UIMenuSubMenu;
std::deque<UIControl *> mItems;
std::deque<UINode *> mItems;
UIMenuStyleConfig mStyleConfig;
Uint32 mMaxWidth;
Uint32 mNextPosY;
Uint32 mBiggestIcon;
UIControl * mItemSelected;
UINode * mItemSelected;
Uint32 mItemSelectedIndex;
bool mClickHide;
Uint32 mLastTickMove;
@@ -90,7 +90,7 @@ class EE_API UIMenu : public UIWidget {
virtual Uint32 onMessage( const UIMessage * Msg );
void setControlSize( UIControl * Control, const Uint32& position );
void setControlSize( UINode * Control, const Uint32& position );
void resizeControls();
@@ -106,11 +106,11 @@ class EE_API UIMenu : public UIWidget {
void onThemeLoaded();
bool checkControlSize( UIControl * Control, const bool& Resize = true );
bool checkControlSize( UINode * Control, const bool& Resize = true );
bool isSubMenu( UIControl * Ctrl );
bool isSubMenu( UINode * Ctrl );
void setItemSelected( UIControl * Item );
void setItemSelected( UINode * Item );
virtual Uint32 onKeyDown( const UIEventKey& Event );
@@ -118,7 +118,7 @@ class EE_API UIMenu : public UIWidget {
void nextSel();
void trySelect( UIControl * Ctrl, bool Up );
void trySelect( UINode * Ctrl, bool Up );
};
}}

View File

@@ -25,7 +25,7 @@ class EE_API UIMenuSubMenu : public UIMenuItem {
UIMenu * getSubMenu() const;
UIControl * getArrow() const;
UINode * getArrow() const;
void showSubMenu();
@@ -37,7 +37,7 @@ class EE_API UIMenuSubMenu : public UIMenuItem {
protected:
UIMenu * mSubMenu;
UIControlAnim * mArrow;
UINode * mArrow;
Float mTimeOver;
Float mMaxTime;
Uint32 mCbId;

View File

@@ -5,7 +5,7 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIMessage {
public:
@@ -29,17 +29,17 @@ class EE_API UIMessage {
NoMessage = eeINDEX_NOT_FOUND
};
UIMessage( UIControl * Ctrl, const Uint32& getMsg, const Uint32& getFlags = NoMessage );
UIMessage( UINode * Ctrl, const Uint32& getMsg, const Uint32& getFlags = NoMessage );
~UIMessage();
UIControl * getSender() const;
UINode * getSender() const;
const Uint32& getMsg() const;
const Uint32& getFlags() const;
private:
UIControl * mCtrl;
UINode * mCtrl;
Uint32 mMsg;
Uint32 mFlags;
};

572
include/eepp/ui/uinode.hpp Normal file
View File

@@ -0,0 +1,572 @@
#ifndef EE_UIUINODE_HPP
#define EE_UIUINODE_HPP
#include <eepp/ui/base.hpp>
#include <eepp/ui/uihelper.hpp>
#include <eepp/ui/uibackground.hpp>
#include <eepp/ui/uiborder.hpp>
#include <eepp/ui/uimessage.hpp>
#include <eepp/ui/uievent.hpp>
#include <eepp/ui/uieventkey.hpp>
#include <eepp/ui/uieventmouse.hpp>
#include <eepp/ui/uiskin.hpp>
#include <eepp/ui/uiskinstate.hpp>
#include <eepp/ui/uiskinsimple.hpp>
#include <eepp/ui/uiskincomplex.hpp>
#include <eepp/ui/uithememanager.hpp>
namespace EE { namespace UI {
class UITheme;
class UIWindow;
class UIManager;
class EE_API UINode {
public:
static UINode * New();
typedef cb::Callback1<void, const UIEvent*> UIEventCallback;
UINode();
virtual ~UINode();
void screenToControl( Vector2i& position ) const;
void controlToScreen( Vector2i& position ) const;
void worldToControl( Vector2i& pos ) const;
void controlToWorld( Vector2i& pos ) const;
virtual Uint32 getType() const;
virtual bool isType( const Uint32& type ) const;
virtual void messagePost( const UIMessage * Msg );
UINode * setPosition( const Vector2i& position );
UINode * setPosition( const Int32& x, const Int32& y );
void setPixelsPosition( const Vector2i& position );
void setPixelsPosition( const Int32& x, const Int32& y );
const Vector2i& getPosition() const;
const Vector2i& getRealPosition() const;
virtual UINode * setSize( const Sizei& size );
UINode * setSize( const Int32& Width, const Int32& Height );
void setPixelsSize( const Sizei& size );
void setPixelsSize( const Int32& x, const Int32& y );
const Sizei& getSize();
const Sizei& getRealSize();
Rect getRect() const;
UINode * setVisible( const bool& visible );
bool isVisible() const;
bool isHided() const;
UINode * setEnabled( const bool& enabled );
bool isEnabled() const;
bool isDisabled() const;
UINode * getParent() const;
UINode * setParent( UINode * parent );
void centerHorizontal();
void centerVertical();
void center();
virtual void close();
virtual void draw();
virtual void update();
Uint32 getHorizontalAlign() const;
UINode * setHorizontalAlign( Uint32 halign );
Uint32 getVerticalAlign() const;
UINode * setVerticalAlign( Uint32 valign );
UINode * setGravity( Uint32 hvalign );
UIBackground * setBackgroundFillEnabled( bool enabled );
UIBorder * setBorderEnabled( bool enabled );
UINode * getNextControl() const;
UINode * getPrevControl() const;
UINode * getNextControlLoop() const;
UINode * setData( const UintPtr& data );
const UintPtr& getData() const;
UINode * childGetAt( Vector2i CtrlPos, unsigned int RecursiveLevel = 0 );
const Uint32& getFlags() const;
virtual UINode * setFlags( const Uint32& flags );
virtual UINode * unsetFlags( const Uint32& flags );
virtual UINode * resetFlags( Uint32 newFlags = 0 );
UINode * setBlendMode( const BlendMode& blend );
BlendMode getBlendMode();
void toFront();
void toBack();
void toPosition( const Uint32& position );
const Uint32& getControlFlags() const;
/** Use it at your own risk */
void setControlFlags( const Uint32& flags );
Uint32 isWidget();
Uint32 isWindow();
Uint32 isClipped();
Uint32 isRotated();
Uint32 isScaled();
Uint32 isFrameBuffer();
bool isMeOrParentTreeRotated();
bool isMeOrParentTreeScaled();
bool isMeOrParentTreeScaledOrRotated();
bool isMeOrParentTreeScaledOrRotatedOrFrameBuffer();
Uint32 addEventListener( const Uint32& EventType, const UIEventCallback& Callback );
void removeEventListener( const Uint32& CallbackId );
UIBackground * getBackground();
UIBorder * getBorder();
void setThemeByName( const std::string& Theme );
virtual void setTheme( UITheme * Theme );
virtual UINode * setThemeSkin( UITheme * Theme, const std::string& skinName );
virtual UINode * setThemeSkin( const std::string& skinName );
void setThemeToChilds( UITheme * Theme );
UISkin * getSkin();
virtual UINode * setSkin( const UISkin& Skin );
UINode * setSkin( UISkin * skin );
void removeSkin();
UINode * getFirstChild() const;
UINode * getLastChild() const;
bool isMouseOver();
bool isMouseOverMeOrChilds();
Polygon2f& getPolygon();
const Vector2f& getPolygonCenter() const;
void setSkinState( const Uint32& State );
bool hasFocus() const;
virtual void setFocus();
bool isParentOf( UINode * Ctrl );
void sendEvent( const UIEvent * Event );
void sendMouseEvent( const Uint32& Event, const Vector2i& position, const Uint32& flags );
void sendCommonEvent( const Uint32& Event );
Sizei getSkinSize();
UINode * getNextWidget();
void applyDefaultTheme();
Rect getScreenRect();
void childsCloseAll();
std::string getId() const;
UINode * setId( const std::string & id );
Uint32 getIdHash() const;
UINode * getWindowContainer();
UINode * find( const std::string& id );
template<typename T>
T * find( const std::string& id )
{
return reinterpret_cast<T*>( find( id ) );
}
template<typename T>
T * bind( const std::string& id, T*& ctrl )
{
ctrl = find<T>( id );
return ctrl;
}
bool isReverseDraw() const;
void setReverseDraw( bool reverseDraw );
UIWindow * getOwnerWindow();
void invalidateDraw();
void setClipEnabled();
void setClipDisabled();
bool isDragging() const;
void setDragging( const bool& dragging );
const Vector2i& getDragPoint() const;
void setDragPoint( const Vector2i& Point );
bool isDragEnabled() const;
void setDragEnabled( const bool& enable );
void setDragButton( const Uint32& Button );
const Uint32& getDragButton() const;
const Float& getRotation() const;
void setRotation( const Float& angle );
void setRotation( const Float& angle, const OriginPoint& center );
const OriginPoint& getRotationOriginPoint() const;
void setRotationOriginPoint( const OriginPoint& center );
Vector2f getRotationCenter();
const Vector2f& getScale() const;
void setScale( const Vector2f& scale );
void setScale( const Vector2f& scale, const OriginPoint& center );
void setScale( const Float& scale , const OriginPoint & center = OriginPoint::OriginCenter );
const OriginPoint& getScaleOriginPoint() const;
void setScaleOriginPoint( const OriginPoint& center );
Vector2f getScaleCenter();
const Float& getAlpha() const;
virtual void setAlpha( const Float& alpha );
virtual void setChildsAlpha( const Float& alpha );
bool isAnimating();
Interpolation1d * startAlphaAnim( const Float& From, const Float& To, const Time& TotalTime, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Vector2f& From, const Vector2f& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startTranslation( const Vector2i& From, const Vector2i& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation1d * startRotation( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation1d * startAlphaAnim( const Float& To, const Time& TotalTime, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Vector2f& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startTranslation( const Vector2i& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation1d * startRotation( const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation1d * createFadeIn( const Time& Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * createFadeOut( const Time& Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * closeFadeOut( const Time& Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * disableFadeOut( const Time & Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * getRotationInterpolation();
Interpolation2d * getScaleInterpolation();
Interpolation1d * getAlphaInterpolation();
Interpolation2d * getTranslationInterpolation();
bool isFadingOut();
protected:
typedef std::map< Uint32, std::map<Uint32, UIEventCallback> > UIEventsMap;
friend class UIManager;
friend class UIWindow;
std::string mId;
Uint32 mIdHash;
Vector2i mPos;
Vector2i mRealPos;
Vector2i mScreenPos;
Vector2f mScreenPosf;
Sizei mSize;
Sizei mRealSize;
Uint32 mFlags;
UintPtr mData;
UINode * mParentCtrl;
UIWindow * mParentWindowCtrl;
UINode * mChild; //! Pointer to the first child of the control
UINode * mChildLast; //! Pointer to the last child added
UINode * mNext; //! Pointer to the next child of the father
UINode * mPrev; //! Pointer to the prev child of the father
UISkinState * mSkinState;
UIBackground * mBackground;
UIBorder * mBorder;
Uint32 mControlFlags;
BlendMode mBlend;
Uint16 mNumCallBacks;
Polygon2f mPoly;
Vector2f mCenter;
UIEventsMap mEvents;
bool mVisible;
bool mEnabled;
Vector2i mDragPoint;
Uint32 mDragButton;
Float mAngle;
OriginPoint mRotationOriginPoint;
Vector2f mScale;
OriginPoint mScaleOriginPoint;
Float mAlpha;
Interpolation1d * mAngleAnim;
Interpolation2d * mScaleAnim;
Interpolation1d * mAlphaAnim;
Interpolation2d * mMoveAnim;
virtual Uint32 onMessage( const UIMessage * Msg );
virtual Uint32 onKeyDown( const UIEventKey& Event );
virtual Uint32 onKeyUp( const UIEventKey& Event );
virtual Uint32 onMouseMove( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseDown( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseClick( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseDoubleClick( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseUp( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseEnter( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseExit( const Vector2i& position, const Uint32 flags );
virtual Uint32 onFocus();
virtual Uint32 onFocusLoss();
virtual void onClose();
virtual Uint32 onValueChange();
virtual void onVisibilityChange();
virtual void onEnabledChange();
virtual void onPositionChange();
virtual void onSizeChange();
virtual void onParentSizeChange( const Vector2i& SizeChange );
virtual void onStateChange();
virtual void onParentChange();
virtual void onAlignChange();
virtual void onWidgetFocusLoss();
virtual void drawSkin();
virtual void drawBackground();
virtual void drawBorder();
virtual void updateQuad();
virtual void updateCenter();
virtual void matrixSet();
virtual void matrixUnset();
virtual void drawChilds();
virtual void onThemeLoaded();
virtual void onChildCountChange();
virtual void onAngleChange();
virtual void onScaleChange();
virtual void onAlphaChange();
virtual UINode * overFind( const Vector2f& Point );
virtual void onParentWindowControlChange();
virtual void clipMe();
virtual Uint32 onDrag( const Vector2i& position );
virtual Uint32 onDragStart( const Vector2i& position );
virtual Uint32 onDragStop( const Vector2i& position );
void checkClose();
virtual void internalDraw();
void childDeleteAll();
void childAdd( UINode * ChildCtrl );
void childAddAt( UINode * ChildCtrl, Uint32 position );
void childRemove( UINode * ChildCtrl );
bool isChild( UINode * ChildCtrl ) const;
bool inParentTreeOf( UINode * Child ) const;
Uint32 childCount() const;
UINode * childAt( Uint32 Index ) const;
UINode * childPrev( UINode * Ctrl, bool Loop = false ) const;
UINode * childNext( UINode * Ctrl, bool Loop = false ) const;
virtual void clipDisable();
void setPrevSkinState();
virtual void updateScreenPos();
void updateChildsScreenPos();
void writeCtrlFlag( const Uint32& Flag, const Uint32& Val );
void writeFlag( const Uint32& Flag, const Uint32& Val );
void sendParentSizeChange( const Vector2i& SizeChange );
Time getElapsed();
Rect makePadding( bool PadLeft = true, bool PadRight = true, bool PadTop = true, bool PadBottom = true, bool SkipFlags = false );
Sizei getSkinSize( UISkin * Skin, const Uint32& State = UISkinState::StateNormal );
Rectf getRectf();
void drawHighlightFocus();
void drawOverControl();
void drawDebugData();
void drawBox();
void setInternalPosition( const Vector2i& Pos );
void setInternalSize( const Sizei& size );
void setInternalWidth( const Int32& width );
void setInternalHeight( const Int32& height );
void setInternalPixelsSize( const Sizei& size );
void setInternalPixelsWidth( const Int32& width );
void setInternalPixelsHeight( const Int32& height );
Color getColor( const Color& Col );
UINode * findIdHash( const Uint32& idHash );
UIWindow * getParentWindow();
void updateOriginPoint();
};
}}
#endif

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICPROGRESSBAR_HPP
#define EE_UICPROGRESSBAR_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uitextview.hpp>
#include <eepp/graphics/scrollparallax.hpp>

View File

@@ -24,9 +24,9 @@ class EE_API UIRadioButton : public UITextView {
void setActive( const bool& active );
UIControlAnim * getActiveButton() const;
UINode * getActiveButton() const;
UIControlAnim * getInactiveButton() const;
UINode * getInactiveButton() const;
Int32 getTextSeparation() const;
@@ -34,8 +34,8 @@ class EE_API UIRadioButton : public UITextView {
virtual void loadFromXmlNode( const pugi::xml_node& node );
protected:
UIControlAnim * mActiveButton;
UIControlAnim * mInactiveButton;
UINode * mActiveButton;
UINode * mInactiveButton;
bool mActive;
Uint32 mLastTick;
Int32 mTextSeparation;

View File

@@ -51,13 +51,13 @@ class EE_API UIScrollBar : public UIWidget {
UISlider * getSlider() const;
UIControlAnim * getButtonUp() const;
UINode * getButtonUp() const;
UIControlAnim * getButtonDown() const;
UINode * getButtonDown() const;
UI_ORIENTATION getOrientation() const;
UIControl * setOrientation( const UI_ORIENTATION & orientation );
UINode * setOrientation( const UI_ORIENTATION & orientation );
ScrollBarType getScrollBarType() const;
@@ -72,8 +72,8 @@ class EE_API UIScrollBar : public UIWidget {
protected:
ScrollBarType mScrollBarType;
UISlider * mSlider;
UIControlAnim * mBtnUp;
UIControlAnim * mBtnDown;
UINode * mBtnUp;
UINode * mBtnDown;
virtual void onSizeChange();

View File

@@ -38,7 +38,7 @@ class EE_API UIScrollView : public UITouchDragableWidget {
UIScrollBar * getHorizontalScrollBar() const;
UIControlAnim * getContainer() const;
UINode * getContainer() const;
virtual void loadFromXmlNode( const pugi::xml_node& node );
protected:
@@ -47,8 +47,8 @@ class EE_API UIScrollView : public UITouchDragableWidget {
UI_SCROLLBAR_MODE mHScrollMode;
UIScrollBar * mVScroll;
UIScrollBar * mHScroll;
UIControlAnim * mContainer;
UIControl * mScrollView;
UINode * mContainer;
UINode * mScrollView;
Uint32 mSizeChangeCb;
virtual void onSizeChange();

View File

@@ -37,7 +37,7 @@ class EE_API UISkinState {
const Uint32& getPrevState() const;
protected:
friend class UIControl;
friend class UINode;
UISkin * mSkin;
Uint32 mCurState;

View File

@@ -40,9 +40,9 @@ class EE_API UISlider : public UIWidget {
virtual void update();
UIControl * getBackSlider() const;
UINode * getBackSlider() const;
UIDragableControl * getSliderButton() const;
UINode * getSliderButton() const;
void adjustChilds();
@@ -70,7 +70,7 @@ class EE_API UISlider : public UIWidget {
UI_ORIENTATION mOrientation;
UISliderStyleConfig mStyleConfig;
UIControlAnim * mBackSlider;
UINode * mBackSlider;
Private::UISliderButton * mSlider;
Float mMinValue;
Float mMaxValue;

View File

@@ -46,9 +46,9 @@ class EE_API UISpinBox : public UIWidget {
virtual void update();
UIControlAnim * getButtonPushUp() const;
UINode * getButtonPushUp() const;
UIControlAnim * getButtonPushDown() const;
UINode * getButtonPushDown() const;
UITextInput * getTextInput() const;
@@ -59,8 +59,8 @@ class EE_API UISpinBox : public UIWidget {
virtual void loadFromXmlNode( const pugi::xml_node& node );
protected:
UITextInput * mInput;
UIControlAnim * mPushUp;
UIControlAnim * mPushDown;
UINode * mPushUp;
UINode * mPushDown;
Float mMinValue;
Float mMaxValue;
Float mValue;

View File

@@ -13,9 +13,9 @@ class EE_API UITab : public UISelectButton {
UITab();
UIControl * getControlOwned() const;
UINode * getControlOwned() const;
void setControlOwned( UIControl * controlOwned );
void setControlOwned( UINode * controlOwned );
virtual ~UITab();
@@ -33,7 +33,7 @@ class EE_API UITab : public UISelectButton {
virtual void loadFromXmlNode( const pugi::xml_node& node );
protected:
UIControl * mControlOwned;
UINode * mControlOwned;
std::string mOwnedName;
virtual Uint32 onMouseClick( const Vector2i &position, const Uint32 flags );

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUIGENERICGRID_HPP
#define EE_UICUIGENERICGRID_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uitablecell.hpp>
#include <eepp/ui/uiscrollbar.hpp>
#include <eepp/ui/uiitemcontainer.hpp>

View File

@@ -18,9 +18,9 @@ class EE_API UITableCell : public UIWidget {
virtual void setTheme( UITheme * Theme );
void setCell( const Uint32& CollumnIndex, UIControl * Ctrl );
void setCell( const Uint32& CollumnIndex, UINode * Ctrl );
UIControl * getCell( const Uint32& CollumnIndex ) const;
UINode * getCell( const Uint32& CollumnIndex ) const;
virtual void update();
@@ -35,7 +35,7 @@ class EE_API UITableCell : public UIWidget {
friend class UIItemContainer<UITable>;
friend class UITable;
std::vector<UIControl*> mCells;
std::vector<UINode*> mCells;
UITable * gridParent() const;

View File

@@ -19,7 +19,7 @@ class EE_API UITabWidget : public UIWidget {
virtual bool isType( const Uint32& type ) const;
UITabWidget * add( const String& Text, UIControl * CtrlOwned, Drawable * Icon = NULL );
UITabWidget * add( const String& Text, UINode * CtrlOwned, Drawable * Icon = NULL );
UITabWidget * add( UITab * Tab );
@@ -37,7 +37,7 @@ class EE_API UITabWidget : public UIWidget {
void removeAll();
void insert( const String& Text, UIControl * CtrlOwned, Drawable * Icon, const Uint32& Index );
void insert( const String& Text, UINode * CtrlOwned, Drawable * Icon, const Uint32& Index );
void insert( UITab * Tab, const Uint32& Index );
@@ -148,7 +148,7 @@ class EE_API UITabWidget : public UIWidget {
void onThemeLoaded();
UITab * createTab( const String& Text, UIControl * CtrlOwned, Drawable * Icon );
UITab * createTab( const String& Text, UINode * CtrlOwned, Drawable * Icon );
virtual void onSizeChange();

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUITEXTEDIT_HPP
#define EE_UICUITEXTEDIT_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uitextinput.hpp>
#include <eepp/ui/uiscrollbar.hpp>

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUITEXTINPUT_H
#define EE_UICUITEXTINPUT_H
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uitextview.hpp>
#include <eepp/window/inputtextbuffer.hpp>

View File

@@ -6,7 +6,7 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIThemeManager : public ResourceManager<UITheme> {
SINGLETON_DECLARE_HEADERS(UIThemeManager)
@@ -28,7 +28,7 @@ class EE_API UIThemeManager : public ResourceManager<UITheme> {
UITheme * getDefaultTheme() const;
void applyDefaultTheme( UIControl * Control );
void applyDefaultTheme( UINode * Control );
void setAutoApplyDefaultTheme( const bool& apply );

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUITOOLTIP_HPP
#define EE_UICUITOOLTIP_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
namespace EE { namespace Graphics {
class Text;
@@ -9,7 +9,7 @@ class Text;
namespace EE { namespace UI {
class EE_API UITooltip : public UIControlAnim {
class EE_API UITooltip : public UINode {
public:
static UITooltip * New();
@@ -71,9 +71,9 @@ class EE_API UITooltip : public UIControlAnim {
const Time & getTooltipTime() const;
UIControl * getTooltipOf() const;
UINode * getTooltipOf() const;
void setTooltipOf(UIControl * tooltipOf);
void setTooltipOf(UINode * tooltipOf);
UITooltipStyleConfig getStyleConfig() const;
@@ -84,7 +84,7 @@ class EE_API UITooltip : public UIControlAnim {
Vector2f mAlignOffset;
Rect mRealPadding;
Time mTooltipTime;
UIControl * mTooltipOf;
UINode * mTooltipOf;
virtual void onSizeChange();

View File

@@ -1,7 +1,7 @@
#ifndef EE_UIUIWIDGET_HPP
#define EE_UIUIWIDGET_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uitooltip.hpp>
namespace pugi {
@@ -10,7 +10,7 @@ class xml_node;
namespace EE { namespace UI {
class EE_API UIWidget : public UIControlAnim {
class EE_API UIWidget : public UINode {
public:
static UIWidget * New();
@@ -24,21 +24,21 @@ class EE_API UIWidget : public UIControlAnim {
virtual void update();
virtual UIControl * setSize( const Sizei& size );
virtual UINode * setSize( const Sizei& size );
virtual UIControl * setFlags( const Uint32& flags );
virtual UINode * setFlags( const Uint32& flags );
virtual UIControl * unsetFlags( const Uint32& flags );
virtual UINode * unsetFlags( const Uint32& flags );
virtual UIWidget * setAnchors( const Uint32& flags );
virtual void setTheme( UITheme * Theme );
virtual UIControl * setThemeSkin( const std::string& skinName );
virtual UINode * setThemeSkin( const std::string& skinName );
virtual UIControl * setThemeSkin( UITheme * Theme, const std::string& skinName );
virtual UINode * setThemeSkin( UITheme * Theme, const std::string& skinName );
UIControl * setSize( const Int32& Width, const Int32& Height );
UINode * setSize( const Int32& Width, const Int32& Height );
const Sizei& getSize();

View File

@@ -33,9 +33,9 @@ class EE_API UIWindow : public UIWidget {
virtual bool isType( const Uint32& type ) const;
virtual UIControl * setSize( const Sizei& size );
virtual UINode * setSize( const Sizei& size );
UIControl * setSize( const Int32& Width, const Int32& Height );
UINode * setSize( const Int32& Width, const Int32& Height );
UIWindow * setSizeWithDecoration( const Int32& Width, const Int32& Height );
@@ -49,11 +49,11 @@ class EE_API UIWindow : public UIWidget {
UIWidget * getContainer() const;
UIControlAnim * getButtonClose() const;
UINode * getButtonClose() const;
UIControlAnim * getButtonMaximize() const;
UINode * getButtonMaximize() const;
UIControlAnim * getButtonMinimize() const;
UINode * getButtonMinimize() const;
virtual bool show();
@@ -150,15 +150,15 @@ class EE_API UIWindow : public UIWidget {
FrameBuffer * mFrameBuffer;
UIWindowStyleConfig mStyleConfig;
UIControlAnim * mWindowDecoration;
UIControlAnim * mBorderLeft;
UIControlAnim * mBorderRight;
UIControlAnim * mBorderBottom;
UINode * mWindowDecoration;
UINode * mBorderLeft;
UINode * mBorderRight;
UINode * mBorderBottom;
UIWidget * mContainer;
UIControlAnim * mButtonClose;
UIControlAnim * mButtonMinimize;
UIControlAnim * mButtonMaximize;
UINode * mButtonClose;
UINode * mButtonMinimize;
UINode * mButtonMaximize;
UITextView * mTitle;
UIWidget * mModalCtrl;
@@ -199,7 +199,7 @@ class EE_API UIWindow : public UIWidget {
void doResize( const UIMessage * Msg );
void decideResizeType( UIControl * Control );
void decideResizeType( UINode * Control );
void tryResize( const UI_RESIZE_TYPE& getType );

View File

@@ -56,7 +56,7 @@ class EE_API UIWinMenu : public UIWidget {
UIPopUpMenu * getMenuFromButton( UISelectButton * Button );
bool isPopUpMenuChild( UIControl * Ctrl );
bool isPopUpMenuChild( UINode * Ctrl );
void onMenuFocusLoss( const UIEvent * Event );