40 #ifndef _uiquadrenderable_h
41 #define _uiquadrenderable_h
44 #include "UI/uienumerations.h"
45 #include "UI/unifieddim.h"
46 #include "UI/positioninginfo.h"
47 #include "UI/sizinginfo.h"
48 #include "UI/renderable.h"
55 class ScreenRenderData;
57 class SingleImageLayer;
58 class MultiImageLayer;
59 class SingleLineTextLayer;
60 class MultiLineTextLayer;
64 class RenderLayerGroup;
174 virtual void ProtoSerializeImpl(
XML::Node& SelfRoot)
const;
176 virtual void ProtoDeSerializeImpl(
const XML::Node& SelfRoot);
180 void AppendLayerVertices(std::vector<VertexData>& Vertices);
184 void ResizeLayers(
const Whole NewSize);
216 virtual const UInt16& GetZOrder()
const;
221 virtual UInt16 GetHighestChildZOrder()
const;
226 virtual UInt16 GetLowestChildZOrder()
const;
228 virtual void UpdateChildOrder();
240 virtual Boole IsChildOfScreen()
const;
245 virtual void PopulateTextLinesInLayers(
const Real MaxWidth);
248 virtual Real GetIdealHeightForText()
const;
254 virtual void UpdateDimensions();
259 virtual void UpdateChildDimensions();
265 virtual void UpdateDimensions(
const Rect& OldSelfRect,
const Rect& NewSelfRect);
270 virtual void SetMousePassthrough(
Boole Enable);
273 virtual Boole GetMousePassthrough()
const;
279 virtual void SetManualTransformUpdates(
Boole Enable);
282 virtual Boole GetManualTransformUpdates()
const;
297 virtual void SetSizingPolicy(
const SizingInfo& Policy);
300 virtual const SizingInfo& GetSizingPolicy()
const;
305 virtual void SetHorizontalPositioningRules(
const Whole Rules);
308 virtual Whole GetHorizontalPositioningRules()
const;
312 virtual void SetVerticalPositioningRules(
const Whole Rules);
315 virtual Whole GetVerticalPositioningRules()
const;
319 virtual void SetHorizontalSizingRules(
const Whole Rules);
322 virtual Whole GetHorizontalSizingRules()
const;
326 virtual void SetVerticalSizingRules(
const Whole Rules);
329 virtual Whole GetVerticalSizingRules()
const;
484 UInt32 GetNumRenderLayers()
const;
487 UInt32 GetNumVisibleRenderLayers()
const;
490 void DestroyRenderLayer(
RenderLayer* ToBeDestroyed);
492 void DestroyAllRenderLayers();
496 RenderLayerIterator RenderLayerBegin();
499 RenderLayerIterator RenderLayerEnd();
502 ConstRenderLayerIterator RenderLayerBegin()
const;
505 ConstRenderLayerIterator RenderLayerEnd()
const;
512 void SetActiveGroup(
const UInt16 GroupID);
522 Boole RenderLayerGroupExists(
const UInt16 GroupID)
const;
525 UInt32 GetNumRenderLayerGroups()
const;
547 void AddLayerToGroups(
RenderLayer* Layer,
const GroupOrderEntryVector& Entrys);
578 void DestroyRenderLayerGroup(
const UInt16 GroupID);
583 void DestroyAllRenderLayerGroups();
587 RenderLayerGroupIterator RenderLayerGroupBegin();
590 RenderLayerGroupIterator RenderLayerGroupEnd();
593 ConstRenderLayerGroupIterator RenderLayerGroupBegin()
const;
596 ConstRenderLayerGroupIterator RenderLayerGroupEnd()
const;
607 virtual void AddChild(
Widget* Child);
615 virtual void AddChild(
Widget* Child,
const UInt16 ZOrder);
627 virtual Whole GetNumChildren()
const;
631 virtual void RemoveChild(
Widget* ToBeRemoved);
634 virtual void RemoveAllChildren();
637 virtual void DestroyChild(
Widget* ToBeDestroyed);
639 virtual void DestroyAllChildren();
643 ChildIterator ChildrenBegin();
646 ChildIterator ChildrenEnd();
649 ConstChildIterator ChildrenBegin()
const;
652 ConstChildIterator ChildrenEnd()
const;
656 ReverseChildIterator RChildrenBegin();
659 ReverseChildIterator RChildrenEnd();
662 ConstReverseChildIterator RChildrenBegin()
const;
665 ConstReverseChildIterator RChildrenEnd()
const;
672 virtual void SetUnifiedPosition(
const UnifiedVec2& Position);
675 virtual void SetUnifiedSize(
const UnifiedVec2& Size);
687 virtual Vector2 GetActualPosition()
const;
690 virtual Vector2 GetActualSize()
const;
694 virtual Rect GetRect()
const;
735 void SetLocalVertexCaching(
Boole Enable);
738 Boole IsVertexCachingEnabled()
const;
744 virtual void ProtoSerialize(
XML::Node& ParentNode)
const;
746 virtual void ProtoSerializeProperties(
XML::Node& SelfRoot)
const;
749 virtual void ProtoSerializeRenderLayers(
XML::Node& SelfRoot)
const;
752 virtual void ProtoSerializeRenderLayerGroups(
XML::Node& SelfRoot)
const;
755 virtual void ProtoSerializeChildQuads(
XML::Node& SelfRoot)
const;
758 virtual void ProtoDeSerialize(
const XML::Node& SelfRoot);
760 virtual void ProtoDeSerializeProperties(
const XML::Node& SelfRoot);
763 virtual void ProtoDeSerializeRenderLayers(
const XML::Node& SelfRoot);
766 virtual void ProtoDeSerializeRenderLayerGroups(
const XML::Node& SelfRoot);
769 virtual void ProtoDeSerializeChildQuads(
const XML::Node& SelfRoot);
772 virtual String GetDerivedSerializableName()
const;
774 static String GetSerializableName();
783 virtual void _SetZOrder(
const UInt16& Zorder);
795 virtual void _Clean();
797 virtual void _MarkDirty();
801 virtual void _MarkAllChildrenDirty();
804 virtual void _MarkAllLayersDirty();
This is a render layer specializing in single-line text.
RenderLayerContainer::iterator RenderLayerIterator
Iterator type for RenderLayer instances stored by this class.
std::vector< RenderLayer * > RenderLayerContainer
Basic container type for RenderLayer storage by this class.
RenderLayerGroupContainer::iterator RenderLayerGroupIterator
Iterator type for RenderLayerGroup instances stored by this class.
This is a base class for the algorithms used by QuadRenderables to determine how they should update t...
Basic class for all structures that get inserted into the rendering hierarchy.
bool Boole
Generally acts a single bit, true or false.
RenderLayerGroup * ActiveGroup
This is a pointer to the group of RenderLayers currently being used for rendering.
ChildContainer::reverse_iterator ReverseChildIterator
Reverse Iterator type for Widget instances stored by this class.
PositioningInfo PositioningPolicy
This stores all the information needed to determine the specific behaviors this Quad should have when...
~GroupOrderEntry()
Class destructor.
std::vector< Widget * > ChildContainer
Basic container type for Widget storage by this class.
SizingInfo SizingPolicy
This stores all the information needed to determine the specific behaviors this Quad should have when...
ChildContainer::const_iterator ConstChildIterator
Const Iterator type for Widget instances stored by this class.
UInt16 ZOrder
This is the ZOrder of this Quad in relation to all other Quads in it's parent.
This is a helper class designed to describe the behaviors of a quad when it needs to be resized...
All the definitions for datatypes as well as some basic conversion functions are defined here...
This is a render layer specializing in multi-line text.
GroupOrderEntry(const UInt16 ID, const UInt16 ZOrder)
Class constructor.
This class represents a box shaped area on the screen.
RenderLayerContainer::const_iterator ConstRenderLayerIterator
Const Iterator type for RenderLayer instances stored by this class.
RenderLayerContainer RenderLayers
This is a container storing all the RenderLayer instances created by and belonging to this Quad...
Boole AllLayersDirty
Determines whether or not this Quad needs all of it's layers refreshed. Usually after a transform upd...
ChildContainer ChildWidgets
This is a container storing all the children that belong to this Quad.
Rect ActDims
The actual (pixel) position and size of this Quad on the screen it belongs to.
RenderLayerGroupContainer::const_iterator ConstRenderLayerGroupIterator
Const Iterator type for RenderLayerGroup instances stored by this class.
float Real
A Datatype used to represent a real floating point number.
This class represents a 2D rect which can express the size and position of a renderable on screen...
AspectRatioLock
Used by sizing behavior classes to determine how resizes that preserve aspect ratio should behave...
uint16_t UInt16
An 16-bit unsigned integer.
A light-weight handle for manipulating nodes in DOM tree.
uint32_t UInt32
An 32-bit unsigned integer.
This is used to represent a point on a 2 dimentional area, such as a screen.
ChildContainer::const_reverse_iterator ConstReverseChildIterator
Const Reverse Iterator type for Widget instances stored by this class.
Boole ManualTransformUpdates
Controls whether or not this Quad and it's children will recieve automatic transform updates...
This is a small convenience class used to store a RenderLayerGroup ID and a ZOrder on that RenderLaye...
ScreenRenderData * VertexCache
This is a pointer to the optional cache of vertex's belonging to this Quad and all of it's children...
std::vector< GroupOrderEntry > GroupOrderEntryVector
Convenience container type for GroupOrderEntry storage.
This class stores a group of render layers that can be set to be rendered.
RenderLayerGroupContainer RenderLayerGroups
This is a container storing all the RenderLayerGroup instances created by and belonging to this Quad...
RenderLayerType
This enum describes the type of RenderLayer this is for use in casting.
UInt16 GroupID
The ID of the RenderLayerGroup this entry is referring to.
UInt16 LayerZOrder
The ZOrder within the specified RenderLayerGroup to modify.
The bulk of the engine components go in this namspace.
This class stores all vertices pertaining to a layer sorted by their priority for rendering...
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
ChildContainer::iterator ChildIterator
Iterator type for Widget instances stored by this class.
This class represents a point in 2D space using UnifiedDim's.
This represents a nestable quad for an object in a GUI layout.
This is an image layer that supports rendering only a single image/sprite.
Boole MousePassthrough
Controls whether or not this Quad will be considered for mouse hover checks.
This class is a helper class for creating UI's. It is responsible for storing and keeping track of al...
LayoutStrategy * LayoutStrat
This is a pointer to the strategy being used by this Quad to determine the positions and sizes of chi...
std::string String
A datatype used to a series of characters.
std::vector< RenderLayerGroup * > RenderLayerGroupContainer
Basic container type for RenderLayerGroup storage by this class.
QuadRenderable * ParentQuad
This is a pointer to the Quad that owns this Quad and is responsible for transform updates applied to...
This is an image layer that supports rendering of multiple images within it's space.
This is the base class for the types of layers that can be added to a renderable. ...
This is a helper class designed to describe the behaviors of a quad when it needs to be repositioned...