Dali 3D User Interface Engine
List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
Dali::Internal::RelayoutController Class Reference

The relayout controller is responsible for taking request from actors to relayout their sizes. More...

#include <relayout-controller-impl.h>

Inheritance diagram for Dali::Internal::RelayoutController:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::RelayoutController:
Collaboration graph
[legend]

Public Member Functions

 RelayoutController (Integration::RenderController &controller)
 Constructor. More...
 
virtual ~RelayoutController ()
 Destructor. More...
 
void SetStageSize (unsigned int width, unsigned int height)
 Set the stage size. More...
 
void RequestRelayout (Dali::Actor &actor, Dimension::Type dimension=Dimension::ALL_DIMENSIONS)
 Request to relayout the given actor and all sub-actors of it. More...
 
void RequestRelayoutTree (Dali::Actor &actor)
 Request to relayout of all actors in the sub-tree below the given actor. More...
 
void PropagateFlags (Dali::Actor &actor, Dimension::Type dimension=Dimension::ALL_DIMENSIONS)
 Force propagate relayout flags through the tree. More...
 
void Relayout ()
 Relayouts all actors that have been marked as dirty. More...
 
void SetEnabled (bool enabled)
 Enable/disable the controller. More...
 
bool IsPerformingRelayout () const
 Return true if the relayout controller is currently performing a relayout. More...
 
void SetProcessingCoreEvents (bool processingEvents)
 Sets whether core is processing events. More...
 
void OnApplicationSceneCreated ()
 Callback raised after the application creates the scene. More...
 
void OnObjectDestroyed (const Dali::RefObject *object)
 Callback for when an object is destroyed. More...
 
- Public Member Functions inherited from Dali::BaseObject
template<class T >
bool ConnectSignal (ConnectionTrackerInterface *connectionTracker, const std::string &signalName, const T &functor)
 Connects a void() functor to a specified signal. More...
 
bool DoAction (const std::string &actionName, const Property::Map &attributes)
 Perform action on this object with the given action name and attributes. More...
 
const std::string & GetTypeName () const
 Returns the type name for the Handle. More...
 
bool GetTypeInfo (Dali::TypeInfo &info) const
 Returns the type info for the Handle. More...
 
bool DoConnectSignal (ConnectionTrackerInterface *connectionTracker, const std::string &signalName, FunctorDelegate *functorDelegate)
 Not intended for application developers. More...
 
- Public Member Functions inherited from Dali::RefObject
void Reference ()
 Increment the object's reference count. More...
 
void Unreference ()
 Decrement the object's reference count. More...
 
int ReferenceCount ()
 Retrieve the object's reference count. More...
 

Static Public Member Functions

static RelayoutControllerGet ()
 Get the singleton of RelayoutController object. More...
 

Private Types

typedef Dali::Vector
< BaseObject * > 
RawActorList
 

Private Member Functions

void Request ()
 Request for relayout. More...
 
void AddRequest (Dali::Actor &actor)
 Add actor to request list. More...
 
void RemoveRequest (Dali::Actor &actor)
 Remove actor from request list. More...
 
void Disconnect ()
 Disconnect the Relayout() method from the Stage::EventProcessingFinishedSignal(). More...
 
void PropagateAll (Dali::Actor &actor, Dimension::Type dimension, std::vector< Dali::Actor > &topOfSubTreeStack, std::vector< Dali::Actor > &potentialRedundantSubRoots)
 Propagate dirty layout flags to actor and all sub-actors. More...
 
void QueueActor (Dali::Actor &actor, RelayoutContainer &actors, Vector2 size)
 Queue an actor on the relayout container. More...
 
void FindAndZero (const RawActorList &list, const Dali::RefObject *object)
 Find the given object in the list and null it out. More...
 
 RelayoutController (const RelayoutController &)
 
RelayoutControlleroperator= (const RelayoutController &)
 

Private Attributes

Integration::RenderControllermRenderController
 
MemoryPoolObjectAllocator
< MemoryPoolRelayoutContainer::RelayoutInfo
mRelayoutInfoAllocator
 
SlotDelegate< RelayoutControllermSlotDelegate
 
RawActorList mDirtyLayoutSubTrees
 List of roots of sub trees that are dirty. More...
 
MemoryPoolRelayoutContainermRelayoutStack
 Stack for relayouting. More...
 
Vector2 mStageSize
 size of the stage More...
 
bool mRelayoutConnection: 1
 Whether EventProcessingFinishedSignal signal is connected. More...
 
bool mRelayoutFlag: 1
 Relayout flag to avoid unnecessary calls. More...
 
bool mEnabled: 1
 Initially disabled. Must be enabled at some point. More...
 
bool mPerformingRelayout: 1
 The relayout controller is currently performing a relayout. More...
 
bool mProcessingCoreEvents: 1
 Whether core is processing events. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Dali::BaseObject
 BaseObject ()
 Default constructor. More...
 
virtual ~BaseObject ()
 A reference counted object may only be deleted by calling Unreference(). More...
 
void RegisterObject ()
 Registers the object as created with the Object registry. More...
 
void UnregisterObject ()
 Unregisters the object from Object registry. More...
 

Detailed Description

The relayout controller is responsible for taking request from actors to relayout their sizes.

The requests are actioned on at the end of the frame where all actors that have made a request are resized.

Definition at line 44 of file relayout-controller-impl.h.

Member Typedef Documentation

Definition at line 150 of file relayout-controller-impl.h.

Constructor & Destructor Documentation

Dali::Internal::RelayoutController::RelayoutController ( Integration::RenderController controller)

Constructor.

We should only create a unique instance.

Parameters
[in]controllerto request a render from the RenderController if core is not processing events.

Definition at line 108 of file relayout-controller-impl.cpp.

References mRelayoutStack, and Dali::Internal::MemoryPoolRelayoutContainer::Reserve().

Here is the call graph for this function:

Dali::Internal::RelayoutController::~RelayoutController ( )
virtual

Destructor.

Definition at line 124 of file relayout-controller-impl.cpp.

References mRelayoutStack.

Dali::Internal::RelayoutController::RelayoutController ( const RelayoutController )
private

Member Function Documentation

void Dali::Internal::RelayoutController::AddRequest ( Dali::Actor actor)
private

Add actor to request list.

Parameters
[in]actorThe root of the sub tree to add

Definition at line 375 of file relayout-controller-impl.cpp.

References Dali::GetImplementation(), mDirtyLayoutSubTrees, Dali::Vector< T, IsTrivialType >::PushBack(), and Dali::VectorBase::Size().

Referenced by RequestRelayout(), and RequestRelayoutTree().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::RelayoutController::Disconnect ( )
private

Disconnect the Relayout() method from the Stage::EventProcessingFinishedSignal().

void Dali::Internal::RelayoutController::FindAndZero ( const RawActorList list,
const Dali::RefObject object 
)
private

Find the given object in the list and null it out.

Parameters
[in]listThe list to search
[in]objectThe object to search for

Definition at line 513 of file relayout-controller-impl.cpp.

References Dali::Vector< T, IsTrivialType >::Begin(), and Dali::Vector< T, IsTrivialType >::End().

Referenced by OnObjectDestroyed().

Here is the call graph for this function:

Here is the caller graph for this function:

RelayoutController * Dali::Internal::RelayoutController::Get ( )
static

Get the singleton of RelayoutController object.

Returns
A handle to the RelayoutController control.

Definition at line 129 of file relayout-controller-impl.cpp.

References Dali::Internal::ThreadLocalStorage::Get(), and Dali::Internal::ThreadLocalStorage::GetRelayoutController().

Referenced by Dali::Internal::Actor::RelayoutRequest().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Dali::Internal::RelayoutController::IsPerformingRelayout ( ) const

Return true if the relayout controller is currently performing a relayout.

Returns
Return true if the relayout controller is currently performing a relayout

Definition at line 503 of file relayout-controller-impl.cpp.

References mPerformingRelayout.

void Dali::Internal::RelayoutController::OnApplicationSceneCreated ( )

Callback raised after the application creates the scene.

Definition at line 205 of file relayout-controller-impl.cpp.

References DALI_LOG_INFO, Dali::Stage::GetCurrent(), Dali::Stage::GetRootLayer(), mEnabled, Request(), and RequestRelayoutTree().

Here is the call graph for this function:

void Dali::Internal::RelayoutController::OnObjectDestroyed ( const Dali::RefObject object)

Callback for when an object is destroyed.

Parameters
[in]objectThe object being destroyed

Definition at line 424 of file relayout-controller-impl.cpp.

References FindAndZero(), and mDirtyLayoutSubTrees.

Referenced by Request().

Here is the call graph for this function:

Here is the caller graph for this function:

RelayoutController& Dali::Internal::RelayoutController::operator= ( const RelayoutController )
private
void Dali::Internal::RelayoutController::PropagateAll ( Dali::Actor actor,
Dimension::Type  dimension,
std::vector< Dali::Actor > &  topOfSubTreeStack,
std::vector< Dali::Actor > &  potentialRedundantSubRoots 
)
private

Propagate dirty layout flags to actor and all sub-actors.

This will stop propagating when a dirty actor is found.

Parameters
[in]actorThe actor to propagate on
[in]dimensionThe dimension to propagate on
[in]topOfSubTreeStackThe top of the sub tree that this actor is in
[in]potentialRedundantSubRootsActors collected as potentially already being included in relayout

Definition at line 253 of file relayout-controller-impl.cpp.

References Dali::Dimension::DIMENSION_COUNT, Dali::Actor::GetChildAt(), Dali::Actor::GetChildCount(), Dali::GetImplementation(), Dali::Actor::GetParent(), Dali::Internal::Actor::IsLayoutDirty(), Dali::Internal::Actor::IsRelayoutEnabled(), Dali::Internal::Actor::RelayoutDependentOnChildren(), Dali::Internal::Actor::RelayoutDependentOnDimension(), Dali::Internal::Actor::RelayoutDependentOnParent(), Dali::Internal::Actor::RelayoutPossible(), Dali::Internal::Actor::SetLayoutDirty(), and Dali::Internal::Actor::SetLayoutNegotiated().

Referenced by RequestRelayout().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::RelayoutController::PropagateFlags ( Dali::Actor actor,
Dimension::Type  dimension = Dimension::ALL_DIMENSIONS 
)

Force propagate relayout flags through the tree.

This is similiar to Request Relayout except all dependencies have their flags reset in spite of whether they are all ready set.

This is useful for resetting layout flags during the layout process.

Parameters
[in]actorThe actor to propagate from
[in]dimensionThe dimension to propagate on

Definition at line 327 of file relayout-controller-impl.cpp.

References Dali::Dimension::DIMENSION_COUNT, Dali::Actor::GetChildAt(), Dali::Actor::GetChildCount(), Dali::GetImplementation(), Dali::Actor::GetParent(), Dali::Internal::Actor::IsRelayoutEnabled(), Dali::Internal::Actor::RelayoutDependentOnChildren(), Dali::Internal::Actor::RelayoutDependentOnDimension(), Dali::Internal::Actor::RelayoutDependentOnParent(), Dali::Internal::Actor::SetLayoutDirty(), and Dali::Internal::Actor::SetLayoutNegotiated().

Here is the call graph for this function:

void Dali::Internal::RelayoutController::QueueActor ( Dali::Actor actor,
RelayoutContainer actors,
Vector2  size 
)
private

Queue an actor on the relayout container.

Parameters
[in]actorThe actor to be queued
[in]actorsThe container to add the actor to
[in]sizeThe size that this actor should be

Definition at line 140 of file relayout-controller-impl.cpp.

References Dali::RelayoutContainer::Add(), and Dali::GetImplementation().

Referenced by Relayout().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::RelayoutController::Relayout ( )
void Dali::Internal::RelayoutController::RemoveRequest ( Dali::Actor actor)
private

Remove actor from request list.

Parameters
[in]actorThe root of the sub tree to remove

Definition at line 396 of file relayout-controller-impl.cpp.

References Dali::Vector< T, IsTrivialType >::Begin(), Dali::Vector< T, IsTrivialType >::End(), Dali::Vector< T, IsTrivialType >::Erase(), Dali::GetImplementation(), and mDirtyLayoutSubTrees.

Referenced by RequestRelayout().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::RelayoutController::Request ( )
private

Request for relayout.

Relays out whole scene.

Definition at line 411 of file relayout-controller-impl.cpp.

References Dali::Stage::GetCurrent(), Dali::Stage::GetObjectRegistry(), mRelayoutConnection, mRelayoutFlag, mSlotDelegate, Dali::ObjectRegistry::ObjectDestroyedSignal(), and OnObjectDestroyed().

Referenced by OnApplicationSceneCreated(), and RequestRelayout().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::RelayoutController::RequestRelayout ( Dali::Actor actor,
Dimension::Type  dimension = Dimension::ALL_DIMENSIONS 
)

Request to relayout the given actor and all sub-actors of it.

This flags the actor and all actors dependent on it for relayout. The actual relayout is performed at the end of the frame. This means that multiple calls to relayout will not cause multiple relayouts to occur.

Parameters
[in]actorThe actor to request relayout on
[in]dimensionThe dimension(s) to request the relayout on. Defaults to all dimensions

Definition at line 148 of file relayout-controller-impl.cpp.

References AddRequest(), Dali::Dimension::DIMENSION_COUNT, Dali::GetImplementation(), Dali::Actor::GetParent(), mEnabled, mProcessingCoreEvents, mRenderController, PropagateAll(), RemoveRequest(), Request(), and Dali::Integration::RenderController::RequestProcessEventsOnIdle().

Referenced by Dali::Internal::Actor::RelayoutRequest().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::RelayoutController::RequestRelayoutTree ( Dali::Actor actor)

Request to relayout of all actors in the sub-tree below the given actor.

This flags the actor and all actors below it for relayout. The actual relayout is performed at the end of the frame. This means that multiple calls to relayout will not cause multiple relayouts to occur.

Parameters
[in]actorThe actor to request relayout on

Definition at line 221 of file relayout-controller-impl.cpp.

References AddRequest(), Dali::Actor::GetChildAt(), Dali::Actor::GetChildCount(), Dali::GetImplementation(), Dali::Actor::GetParent(), mEnabled, Dali::Internal::Actor::RelayoutPossible(), Dali::Internal::Actor::SetLayoutDirty(), and Dali::Internal::Actor::SetLayoutNegotiated().

Referenced by OnApplicationSceneCreated().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::RelayoutController::SetEnabled ( bool  enabled)

Enable/disable the controller.

Parameters
[in]enabledFlag to indicate whether the controller should be enabled or disabled

Definition at line 498 of file relayout-controller-impl.cpp.

References mEnabled.

void Dali::Internal::RelayoutController::SetProcessingCoreEvents ( bool  processingEvents)

Sets whether core is processing events.

Parameters
[in]processingEventswhether core is processing events.

Definition at line 508 of file relayout-controller-impl.cpp.

References mProcessingCoreEvents.

void Dali::Internal::RelayoutController::SetStageSize ( unsigned int  width,
unsigned int  height 
)

Set the stage size.

Parameters
widthof the stage
heightof the stage

Definition at line 134 of file relayout-controller-impl.cpp.

References height, Dali::Vector2::height, mStageSize, width, and Dali::Vector2::width.

Member Data Documentation

RawActorList Dali::Internal::RelayoutController::mDirtyLayoutSubTrees
private

List of roots of sub trees that are dirty.

Definition at line 215 of file relayout-controller-impl.h.

Referenced by AddRequest(), OnObjectDestroyed(), Relayout(), and RemoveRequest().

bool Dali::Internal::RelayoutController::mEnabled
private

Initially disabled. Must be enabled at some point.

Definition at line 221 of file relayout-controller-impl.h.

Referenced by OnApplicationSceneCreated(), RequestRelayout(), RequestRelayoutTree(), and SetEnabled().

bool Dali::Internal::RelayoutController::mPerformingRelayout
private

The relayout controller is currently performing a relayout.

Definition at line 222 of file relayout-controller-impl.h.

Referenced by IsPerformingRelayout(), and Relayout().

bool Dali::Internal::RelayoutController::mProcessingCoreEvents
private

Whether core is processing events.

Definition at line 223 of file relayout-controller-impl.h.

Referenced by RequestRelayout(), and SetProcessingCoreEvents().

bool Dali::Internal::RelayoutController::mRelayoutConnection
private

Whether EventProcessingFinishedSignal signal is connected.

Definition at line 219 of file relayout-controller-impl.h.

Referenced by Request().

bool Dali::Internal::RelayoutController::mRelayoutFlag
private

Relayout flag to avoid unnecessary calls.

Definition at line 220 of file relayout-controller-impl.h.

Referenced by Relayout(), and Request().

MemoryPoolObjectAllocator< MemoryPoolRelayoutContainer::RelayoutInfo > Dali::Internal::RelayoutController::mRelayoutInfoAllocator
private

Definition at line 211 of file relayout-controller-impl.h.

Referenced by Relayout().

MemoryPoolRelayoutContainer* Dali::Internal::RelayoutController::mRelayoutStack
private

Stack for relayouting.

Definition at line 216 of file relayout-controller-impl.h.

Referenced by Relayout(), RelayoutController(), and ~RelayoutController().

Integration::RenderController& Dali::Internal::RelayoutController::mRenderController
private

Definition at line 210 of file relayout-controller-impl.h.

Referenced by RequestRelayout().

SlotDelegate< RelayoutController > Dali::Internal::RelayoutController::mSlotDelegate
private

Definition at line 213 of file relayout-controller-impl.h.

Referenced by Request().

Vector2 Dali::Internal::RelayoutController::mStageSize
private

size of the stage

Definition at line 218 of file relayout-controller-impl.h.

Referenced by Relayout(), and SetStageSize().


The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali