1 #ifndef DALI_INTERNAL_ACTOR_H
2 #define DALI_INTERNAL_ACTOR_H
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
25 #include <dali/public-api/actors/actor.h>
26 #include <dali/public-api/common/vector-wrapper.h>
27 #include <dali/public-api/common/dali-common.h>
28 #include <dali/public-api/events/gesture.h>
29 #include <dali/public-api/math/viewport.h>
30 #include <dali/public-api/object/ref-object.h>
31 #include <dali/public-api/size-negotiation/relayout-container.h>
32 #include <dali/internal/event/actors/actor-declarations.h>
33 #include <dali/internal/event/common/object-impl.h>
34 #include <dali/internal/event/common/stage-def.h>
35 #include <dali/internal/event/rendering/renderer-impl.h>
36 #include <dali/internal/update/nodes/node-declarations.h>
50 class ActorGestureData;
55 typedef std::vector< ActorPtr > ActorContainer;
56 typedef ActorContainer::iterator ActorIter;
57 typedef ActorContainer::const_iterator ActorConstIter;
59 typedef std::vector< RendererPtr > RendererContainer;
60 typedef RendererContainer::iterator RendererIter;
63 * Actor is the primary object which Dali applications interact with.
64 * UI controls can be built by combining multiple actors.
65 * Multi-Touch events are received through signals emitted by the actor tree.
67 * An Actor is a proxy for a Node in the scene graph.
68 * When an Actor is added to the Stage, it creates a node and connects it to the scene graph.
69 * The scene-graph can be updated in a separate thread, so the connection is done using an asynchronous message.
70 * When a tree of Actors is detached from the Stage, a message is sent to destroy the associated nodes.
72 class Actor : public Object
77 * @brief Struct to hold an actor and a dimension
79 struct ActorDimensionPair
84 * @param[in] newActor The actor to assign
85 * @param[in] newDimension The dimension to assign
87 ActorDimensionPair( Actor* newActor, Dimension::Type newDimension )
89 dimension( newDimension )
94 * @brief Equality operator
96 * @param[in] lhs The left hand side argument
97 * @param[in] rhs The right hand side argument
99 bool operator== ( const ActorDimensionPair& rhs )
101 return ( actor == rhs.actor ) && ( dimension == rhs.dimension );
104 Actor* actor; ///< The actor to hold
105 Dimension::Type dimension; ///< The dimension to hold
108 typedef std::vector< ActorDimensionPair > ActorDimensionStack;
113 * Create a new actor.
114 * @return A smart-pointer to the newly allocated Actor.
116 static ActorPtr New();
119 * Retrieve the name of the actor.
122 const std::string& GetName() const;
125 * Set the name of the actor.
126 * @param[in] name The new name.
128 void SetName( const std::string& name );
131 * @copydoc Dali::Actor::GetId
133 unsigned int GetId() const;
138 * Query whether an actor is the root actor, which is owned by the Stage.
139 * @return True if the actor is a root actor.
147 * Query whether the actor is connected to the Stage.
149 bool OnStage() const;
152 * Query whether the actor has any renderers.
153 * @return True if the actor is renderable.
155 bool IsRenderable() const
157 // inlined as this is called a lot in hit testing
158 return mRenderers && !mRenderers->empty();
162 * Query whether the actor is of class Dali::Layer
163 * @return True if the actor is a layer.
167 // inlined as this is called a lot in hit testing
172 * Gets the layer in which the actor is present
173 * @return The layer, which will be uninitialized if the actor is off-stage.
175 Dali::Layer GetLayer();
178 * Adds a child Actor to this Actor.
179 * @pre The child actor is not the same as the parent actor.
180 * @pre The child actor does not already have a parent.
181 * @param [in] child The child.
182 * @post The child will be referenced by its parent.
184 void Add( Actor& child );
187 * Removes a child Actor from this Actor.
188 * @param [in] child The child.
189 * @post The child will be unreferenced.
191 void Remove( Actor& child );
194 * @copydoc Dali::Actor::Unparent
199 * Retrieve the number of children held by the actor.
200 * @return The number of children
202 unsigned int GetChildCount() const;
205 * @copydoc Dali::Actor::GetChildAt
207 ActorPtr GetChildAt( unsigned int index ) const;
210 * Retrieve a reference to Actor's children.
211 * @note Not for public use.
212 * @return A reference to the container of children.
214 ActorContainer& GetChildrenInternal()
220 * @copydoc Dali::Actor::FindChildByName
222 ActorPtr FindChildByName( const std::string& actorName );
225 * @copydoc Dali::Actor::FindChildById
227 ActorPtr FindChildById( const unsigned int id );
230 * Retrieve the parent of an Actor.
231 * @return The parent actor, or NULL if the Actor does not have a parent.
233 Actor* GetParent() const
239 * Sets the size of an actor.
240 * This does not interfere with the actors scale factor.
241 * @param [in] width The new width.
242 * @param [in] height The new height.
244 void SetSize( float width, float height );
247 * Sets the size of an actor.
248 * This does not interfere with the actors scale factor.
249 * @param [in] width The size of the actor along the x-axis.
250 * @param [in] height The size of the actor along the y-axis.
251 * @param [in] depth The size of the actor along the z-axis.
253 void SetSize( float width, float height, float depth );
256 * Sets the size of an actor.
257 * This does not interfere with the actors scale factor.
258 * @param [in] size The new size.
260 void SetSize( const Vector2& size );
263 * Sets the update size for an actor.
265 * @param[in] size The size to set.
267 void SetSizeInternal( const Vector2& size );
270 * Sets the size of an actor.
271 * This does not interfere with the actors scale factor.
272 * @param [in] size The new size.
274 void SetSize( const Vector3& size );
277 * Sets the update size for an actor.
279 * @param[in] size The size to set.
281 void SetSizeInternal( const Vector3& size );
284 * Set the width component of the Actor's size.
285 * @param [in] width The new width component.
287 void SetWidth( float width );
290 * Set the height component of the Actor's size.
291 * @param [in] height The new height component.
293 void SetHeight( float height );
296 * Set the depth component of the Actor's size.
297 * @param [in] depth The new depth component.
299 void SetDepth( float depth );
302 * Retrieve the Actor's size from event side.
303 * This size will be the size set or if animating then the target size.
304 * @return The Actor's size.
306 const Vector3& GetTargetSize() const;
309 * Retrieve the Actor's size from update side.
310 * This size will be the size set or animating but will be a frame behind.
311 * @return The Actor's size.
313 const Vector3& GetCurrentSize() const;
316 * Return the natural size of the actor
318 * @return The actor's natural size
320 virtual Vector3 GetNaturalSize() const;
323 * Set the origin of an actor, within its parent's area.
324 * This is expressed in 2D unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent,
325 * and (1.0, 1.0, 0.5) is the bottom-right corner.
326 * The default parent-origin is top-left (0.0, 0.0, 0.5).
327 * An actor position is the distance between this origin, and the actors anchor-point.
328 * @param [in] origin The new parent-origin.
330 void SetParentOrigin( const Vector3& origin );
333 * Set the x component of the parent-origin
334 * @param [in] x The new x value.
336 void SetParentOriginX( float x );
339 * Set the y component of the parent-origin
340 * @param [in] y The new y value.
342 void SetParentOriginY( float y );
345 * Set the z component of the parent-origin
346 * @param [in] z The new z value.
348 void SetParentOriginZ( float z );
351 * Retrieve the parent-origin of an actor.
352 * @return The parent-origin.
354 const Vector3& GetCurrentParentOrigin() const;
357 * Set the anchor-point of an actor. This is expressed in 2D unit coordinates, such that
358 * (0.0, 0.0, 0.5) is the top-left corner of the actor, and (1.0, 1.0, 0.5) is the bottom-right corner.
359 * The default anchor point is top-left (0.0, 0.0, 0.5).
360 * An actor position is the distance between its parent-origin, and this anchor-point.
361 * An actor's rotation is centered around its anchor-point.
362 * @param [in] anchorPoint The new anchor-point.
364 void SetAnchorPoint( const Vector3& anchorPoint );
367 * Set the x component of the anchor-point.
368 * @param [in] x The new x value.
370 void SetAnchorPointX( float x );
373 * Set the y component of the anchor-point.
374 * @param [in] y The new y value.
376 void SetAnchorPointY( float y );
379 * Set the z component of the anchor-point.
380 * @param [in] z The new z value.
382 void SetAnchorPointZ( float z );
385 * Retrieve the anchor-point of an actor.
386 * @return The anchor-point.
388 const Vector3& GetCurrentAnchorPoint() const;
391 * Sets the position of the Actor.
392 * The coordinates are relative to the Actor's parent.
393 * The Actor's z position will be set to 0.0f.
394 * @param [in] x The new x position
395 * @param [in] y The new y position
397 void SetPosition( float x, float y );
400 * Sets the position of the Actor.
401 * The coordinates are relative to the Actor's parent.
402 * @param [in] x The new x position
403 * @param [in] y The new y position
404 * @param [in] z The new z position
406 void SetPosition( float x, float y, float z );
409 * Sets the position of the Actor.
410 * The coordinates are relative to the Actor's parent.
411 * @param [in] position The new position.
413 void SetPosition( const Vector3& position );
416 * Set the position of an actor along the X-axis.
417 * @param [in] x The new x position
419 void SetX( float x );
422 * Set the position of an actor along the Y-axis.
423 * @param [in] y The new y position.
425 void SetY( float y );
428 * Set the position of an actor along the Z-axis.
429 * @param [in] z The new z position
431 void SetZ( float z );
434 * Translate an actor relative to its existing position.
435 * @param[in] distance The actor will move by this distance.
437 void TranslateBy( const Vector3& distance );
440 * Retrieve the position of the Actor.
441 * The coordinates are relative to the Actor's parent.
442 * @return the Actor's position.
444 const Vector3& GetCurrentPosition() const;
447 * Retrieve the target position of the Actor.
448 * The coordinates are relative to the Actor's parent.
449 * @return the Actor's position.
451 const Vector3& GetTargetPosition() const;
454 * @copydoc Dali::Actor::GetCurrentWorldPosition()
456 const Vector3& GetCurrentWorldPosition() const;
459 * @copydoc Dali::Actor::SetPositionInheritanceMode()
461 void SetPositionInheritanceMode( PositionInheritanceMode mode );
464 * @copydoc Dali::Actor::GetPositionInheritanceMode()
466 PositionInheritanceMode GetPositionInheritanceMode() const;
469 * @copydoc Dali::Actor::SetInheritPosition()
471 void SetInheritPosition( bool inherit );
474 * @copydoc Dali::Actor::IsPositionInherited()
476 bool IsPositionInherited() const;
479 * Sets the orientation of the Actor.
480 * @param [in] angleRadians The new orientation angle in radians.
481 * @param [in] axis The new axis of orientation.
483 void SetOrientation( const Radian& angleRadians, const Vector3& axis );
486 * Sets the orientation of the Actor.
487 * @param [in] orientation The new orientation.
489 void SetOrientation( const Quaternion& orientation );
492 * Rotate an actor around its existing rotation axis.
493 * @param[in] angleRadians The angle to the rotation to combine with the existing rotation.
494 * @param[in] axis The axis of the rotation to combine with the existing rotation.
496 void RotateBy( const Radian& angleRadians, const Vector3& axis );
499 * Apply a relative rotation to an actor.
500 * @param[in] relativeRotation The rotation to combine with the actors existing rotation.
502 void RotateBy( const Quaternion& relativeRotation );
505 * Retreive the Actor's orientation.
506 * @return the orientation.
508 const Quaternion& GetCurrentOrientation() const;
511 * Set whether a child actor inherits it's parent's orientation. Default is to inherit.
512 * Switching this off means that using SetOrientation() sets the actor's world orientation.
513 * @param[in] inherit - true if the actor should inherit orientation, false otherwise.
515 void SetInheritOrientation( bool inherit );
518 * Returns whether the actor inherit's it's parent's orientation.
519 * @return true if the actor inherit's it's parent orientation, false if it uses world orientation.
521 bool IsOrientationInherited() const;
524 * Sets the factor of the parents size used for the child actor.
525 * Note: Only used if ResizePolicy is ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
526 * @param[in] factor The vector to multiply the parents size by to get the childs size.
528 void SetSizeModeFactor( const Vector3& factor );
531 * Gets the factor of the parents size used for the child actor.
532 * Note: Only used if ResizePolicy is ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
533 * @return The vector being used to multiply the parents size by to get the childs size.
535 const Vector3& GetSizeModeFactor() const;
538 * @copydoc Dali::Actor::GetCurrentWorldOrientation()
540 const Quaternion& GetCurrentWorldOrientation() const;
543 * Sets a scale factor applied to an actor.
544 * @param [in] scale The scale factor applied on all axes.
546 void SetScale( float scale );
549 * Sets a scale factor applied to an actor.
550 * @param [in] scaleX The scale factor applied along the x-axis.
551 * @param [in] scaleY The scale factor applied along the y-axis.
552 * @param [in] scaleZ The scale factor applied along the z-axis.
554 void SetScale( float scaleX, float scaleY, float scaleZ );
557 * Sets a scale factor applied to an actor.
558 * @param [in] scale A vector representing the scale factor for each axis.
560 void SetScale( const Vector3& scale );
563 * Set the x component of the scale factor.
564 * @param [in] x The new x value.
566 void SetScaleX( float x );
569 * Set the y component of the scale factor.
570 * @param [in] y The new y value.
572 void SetScaleY( float y );
575 * Set the z component of the scale factor.
576 * @param [in] z The new z value.
578 void SetScaleZ( float z );
581 * Apply a relative scale to an actor.
582 * @param[in] relativeScale The scale to combine with the actors existing scale.
584 void ScaleBy( const Vector3& relativeScale );
587 * Retrieve the scale factor applied to an actor.
588 * @return A vector representing the scale factor for each axis.
590 const Vector3& GetCurrentScale() const;
593 * @copydoc Dali::Actor::GetCurrentWorldScale()
595 const Vector3& GetCurrentWorldScale() const;
598 * @copydoc Dali::Actor::SetInheritScale()
600 void SetInheritScale( bool inherit );
603 * @copydoc Dali::Actor::IsScaleInherited()
605 bool IsScaleInherited() const;
608 * @copydoc Dali::Actor::GetCurrentWorldMatrix()
610 Matrix GetCurrentWorldMatrix() const;
615 * Sets the visibility flag of an actor.
616 * @param [in] visible The new visibility flag.
618 void SetVisible( bool visible );
621 * Retrieve the visibility flag of an actor.
622 * @return The visibility flag.
624 bool IsVisible() const;
627 * Sets the opacity of an actor.
628 * @param [in] opacity The new opacity.
630 void SetOpacity( float opacity );
633 * Retrieve the actor's opacity.
634 * @return The actor's opacity.
636 float GetCurrentOpacity() const;
639 * Retrieve the actor's clipping mode.
640 * @return The actor's clipping mode (cached)
642 ClippingMode::Type GetClippingMode() const;
645 * Sets whether an actor should emit touch or hover signals; see SignalTouch() and SignalHover().
646 * An actor is sensitive by default, which means that as soon as an application connects to the SignalTouch(),
647 * the touch event signal will be emitted, and as soon as an application connects to the SignalHover(), the
648 * hover event signal will be emitted.
650 * If the application wishes to temporarily disable the touch or hover event signal emission, then they can do so by calling:
652 * actor.SetSensitive(false);
655 * Then, to re-enable the touch or hover event signal emission, the application should call:
657 * actor.SetSensitive(true);
660 * @see SignalTouch() and SignalHover().
661 * @note If an actor's sensitivity is set to false, then it's children will not emit a touch or hover event signal either.
662 * @param[in] sensitive true to enable emission of the touch or hover event signals, false otherwise.
664 void SetSensitive( bool sensitive )
666 mSensitive = sensitive;
670 * Query whether an actor emits touch or hover event signals.
671 * @see SetSensitive(bool)
672 * @return true, if emission of touch or hover event signals is enabled, false otherwise.
674 bool IsSensitive() const
680 * @copydoc Dali::Actor::SetDrawMode
682 void SetDrawMode( DrawMode::Type drawMode );
685 * @copydoc Dali::Actor::GetDrawMode
687 DrawMode::Type GetDrawMode() const;
690 * @copydoc Dali::Actor::IsOverlay
692 bool IsOverlay() const;
695 * Sets the actor's color. The final color of actor depends on its color mode.
696 * This final color is applied to the drawable elements of an actor.
697 * @param [in] color The new color.
699 void SetColor( const Vector4& color );
702 * Set the red component of the color.
703 * @param [in] red The new red component.
705 void SetColorRed( float red );
708 * Set the green component of the color.
709 * @param [in] green The new green component.
711 void SetColorGreen( float green );
714 * Set the blue component of the scale factor.
715 * @param [in] blue The new blue value.
717 void SetColorBlue( float blue );
720 * Retrieve the actor's color.
723 const Vector4& GetCurrentColor() const;
726 * Sets the actor's color mode.
727 * Color mode specifies whether Actor uses its own color or inherits its parent color
728 * @param [in] colorMode to use.
730 void SetColorMode( ColorMode colorMode );
733 * Returns the actor's color mode.
734 * @return currently used colorMode.
736 ColorMode GetColorMode() const;
739 * @copydoc Dali::Actor::GetCurrentWorldColor()
741 const Vector4& GetCurrentWorldColor() const;
744 * @copydoc Dali::Actor::GetHierarchyDepth()
746 int GetHierarchyDepth() const
750 return static_cast<int>(mDepth);
758 // Size negotiation virtual functions
761 * @brief Called after the size negotiation has been finished for this control.
763 * The control is expected to assign this given size to itself/its children.
765 * Should be overridden by derived classes if they need to layout
766 * actors differently after certain operations like add or remove
767 * actors, resize or after changing specific properties.
769 * Note! As this function is called from inside the size negotiation algorithm, you cannot
770 * call RequestRelayout (the call would just be ignored)
772 * @param[in] size The allocated size.
773 * @param[in,out] container The control should add actors to this container that it is not able
774 * to allocate a size for.
776 virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
781 * @brief Notification for deriving classes when the resize policy is set
783 * @param[in] policy The policy being set
784 * @param[in] dimension The dimension the policy is being set for
786 virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ) {}
789 * @brief Virtual method to notify deriving classes that relayout dependencies have been
790 * met and the size for this object is about to be calculated for the given dimension
792 * @param dimension The dimension that is about to be calculated
794 virtual void OnCalculateRelayoutSize( Dimension::Type dimension );
797 * @brief Virtual method to notify deriving classes that the size for a dimension
798 * has just been negotiated
800 * @param[in] size The new size for the given dimension
801 * @param[in] dimension The dimension that was just negotiated
803 virtual void OnLayoutNegotiated( float size, Dimension::Type dimension );
806 * @brief Determine if this actor is dependent on it's children for relayout
808 * @param dimension The dimension(s) to check for
809 * @return Return if the actor is dependent on it's children
811 virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
814 * @brief Determine if this actor is dependent on it's children for relayout.
816 * Called from deriving classes
818 * @param dimension The dimension(s) to check for
819 * @return Return if the actor is dependent on it's children
821 virtual bool RelayoutDependentOnChildrenBase( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
824 * @brief Calculate the size for a child
826 * @param[in] child The child actor to calculate the size for
827 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
828 * @return Return the calculated size for the given dimension
830 virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension );
833 * @brief This method is called during size negotiation when a height is required for a given width.
835 * Derived classes should override this if they wish to customize the height returned.
837 * @param width to use.
838 * @return the height based on the width.
840 virtual float GetHeightForWidth( float width );
843 * @brief This method is called during size negotiation when a width is required for a given height.
845 * Derived classes should override this if they wish to customize the width returned.
847 * @param height to use.
848 * @return the width based on the width.
850 virtual float GetWidthForHeight( float height );
857 * @brief Called by the RelayoutController to negotiate the size of an actor.
859 * The size allocated by the the algorithm is passed in which the
860 * actor must adhere to. A container is passed in as well which
861 * the actor should populate with actors it has not / or does not
862 * need to handle in its size negotiation.
864 * @param[in] size The allocated size.
865 * @param[in,out] container The container that holds actors that are fed back into the
866 * RelayoutController algorithm.
868 void NegotiateSize( const Vector2& size, RelayoutContainer& container );
871 * @copydoc Dali::Actor::SetResizePolicy()
873 void SetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
876 * @copydoc Dali::Actor::GetResizePolicy()
878 ResizePolicy::Type GetResizePolicy( Dimension::Type dimension ) const;
881 * @copydoc Dali::Actor::SetSizeScalePolicy()
883 void SetSizeScalePolicy( SizeScalePolicy::Type policy );
886 * @copydoc Dali::Actor::GetSizeScalePolicy()
888 SizeScalePolicy::Type GetSizeScalePolicy() const;
891 * @copydoc Dali::Actor::SetDimensionDependency()
893 void SetDimensionDependency( Dimension::Type dimension, Dimension::Type dependency );
896 * @copydoc Dali::Actor::GetDimensionDependency()
898 Dimension::Type GetDimensionDependency( Dimension::Type dimension ) const;
901 * @brief Set the size negotiation relayout enabled on this actor
903 * @param[in] relayoutEnabled Boolean to enable or disable relayout
905 void SetRelayoutEnabled( bool relayoutEnabled );
908 * @brief Return if relayout is enabled
910 * @return Return if relayout is enabled or not for this actor
912 bool IsRelayoutEnabled() const;
915 * @brief Mark an actor as having it's layout dirty
917 * @param dirty Whether to mark actor as dirty or not
918 * @param dimension The dimension(s) to mark as dirty
920 void SetLayoutDirty( bool dirty, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
923 * @brief Return if any of an actor's dimensions are marked as dirty
925 * @param dimension The dimension(s) to check
926 * @return Return if any of the requested dimensions are dirty
928 bool IsLayoutDirty( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) const;
931 * @brief Returns if relayout is enabled and the actor is not dirty
933 * @return Return if it is possible to relayout the actor
935 bool RelayoutPossible( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) const;
938 * @brief Returns if relayout is enabled and the actor is dirty
940 * @return Return if it is required to relayout the actor
942 bool RelayoutRequired( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) const;
945 * @brief Request a relayout, which means performing a size negotiation on this actor, its parent and children (and potentially whole scene)
947 * This method is automatically called from OnStageConnection(), OnChildAdd(),
948 * OnChildRemove(), SetSizePolicy(), SetMinimumSize() and SetMaximumSize().
950 * This method can also be called from a derived class every time it needs a different size.
951 * At the end of event processing, the relayout process starts and
952 * all controls which requested Relayout will have their sizes (re)negotiated.
954 * @note RelayoutRequest() can be called multiple times; the size negotiation is still
955 * only performed once, i.e. there is no need to keep track of this in the calling side.
957 void RelayoutRequest( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
960 * @brief Determine if this actor is dependent on it's parent for relayout
962 * @param dimension The dimension(s) to check for
963 * @return Return if the actor is dependent on it's parent
965 bool RelayoutDependentOnParent( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
968 * @brief Determine if this actor has another dimension depedent on the specified one
970 * @param dimension The dimension to check for
971 * @param dependentDimension The dimension to check for dependency with
972 * @return Return if the actor is dependent on this dimension
974 bool RelayoutDependentOnDimension( Dimension::Type dimension, Dimension::Type dependentDimension );
977 * Negotiate sizes for a control in all dimensions
979 * @param[in] allocatedSize The size constraint that the control must respect
981 void NegotiateDimensions( const Vector2& allocatedSize );
984 * Negotiate size for a specific dimension
986 * The algorithm adopts a recursive dependency checking approach. Meaning, that wherever dependencies
987 * are found, e.g. an actor dependent on its parent, the dependency will be calculated first with NegotiatedDimension and
988 * LayoutDimensionNegotiated flags being filled in on the actor.
990 * @post All actors that exist in the dependency chain connected to the given actor will have had their NegotiatedDimensions
991 * calculated and set as well as the LayoutDimensionNegotiated flags.
993 * @param[in] dimension The dimension to negotiate on
994 * @param[in] allocatedSize The size constraint that the actor must respect
996 void NegotiateDimension( Dimension::Type dimension, const Vector2& allocatedSize, ActorDimensionStack& recursionStack );
999 * @brief Calculate the size of a dimension
1001 * @param[in] dimension The dimension to calculate the size for
1002 * @param[in] maximumSize The upper bounds on the size
1003 * @return Return the calculated size for the dimension
1005 float CalculateSize( Dimension::Type dimension, const Vector2& maximumSize );
1008 * @brief Clamp a dimension given the relayout constraints on this actor
1010 * @param[in] size The size to constrain
1011 * @param[in] dimension The dimension the size exists in
1012 * @return Return the clamped size
1014 float ClampDimension( float size, Dimension::Type dimension );
1017 * Negotiate a dimension based on the size of the parent
1019 * @param[in] dimension The dimension to negotiate on
1020 * @return Return the negotiated size
1022 float NegotiateFromParent( Dimension::Type dimension );
1025 * Negotiate a dimension based on the size of the parent. Fitting inside.
1027 * @param[in] dimension The dimension to negotiate on
1028 * @return Return the negotiated size
1030 float NegotiateFromParentFit( Dimension::Type dimension );
1033 * Negotiate a dimension based on the size of the parent. Flooding the whole space.
1035 * @param[in] dimension The dimension to negotiate on
1036 * @return Return the negotiated size
1038 float NegotiateFromParentFlood( Dimension::Type dimension );
1041 * @brief Negotiate a dimension based on the size of the children
1043 * @param[in] dimension The dimension to negotiate on
1044 * @return Return the negotiated size
1046 float NegotiateFromChildren( Dimension::Type dimension );
1049 * Set the negotiated dimension value for the given dimension(s)
1051 * @param negotiatedDimension The value to set
1052 * @param dimension The dimension(s) to set the value for
1054 void SetNegotiatedDimension( float negotiatedDimension, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
1057 * Return the value of negotiated dimension for the given dimension
1059 * @param dimension The dimension to retrieve
1060 * @return Return the value of the negotiated dimension
1062 float GetNegotiatedDimension( Dimension::Type dimension ) const;
1065 * @brief Set the padding for a dimension
1067 * @param[in] padding Padding for the dimension. X = start (e.g. left, bottom), y = end (e.g. right, top)
1068 * @param[in] dimension The dimension to set
1070 void SetPadding( const Vector2& padding, Dimension::Type dimension );
1073 * Return the value of padding for the given dimension
1075 * @param dimension The dimension to retrieve
1076 * @return Return the value of padding for the dimension
1078 Vector2 GetPadding( Dimension::Type dimension ) const;
1081 * Return the actor size for a given dimension
1083 * @param[in] dimension The dimension to retrieve the size for
1084 * @return Return the size for the given dimension
1086 float GetSize( Dimension::Type dimension ) const;
1089 * Return the natural size of the actor for a given dimension
1091 * @param[in] dimension The dimension to retrieve the size for
1092 * @return Return the natural size for the given dimension
1094 float GetNaturalSize( Dimension::Type dimension ) const;
1097 * @brief Return the amount of size allocated for relayout
1099 * May include padding
1101 * @param[in] dimension The dimension to retrieve
1102 * @return Return the size
1104 float GetRelayoutSize( Dimension::Type dimension ) const;
1107 * @brief If the size has been negotiated return that else return normal size
1109 * @param[in] dimension The dimension to retrieve
1110 * @return Return the size
1112 float GetLatestSize( Dimension::Type dimension ) const;
1115 * Apply the negotiated size to the actor
1117 * @param[in] container The container to fill with actors that require further relayout
1119 void SetNegotiatedSize( RelayoutContainer& container );
1122 * @brief Flag the actor as having it's layout dimension negotiated.
1124 * @param[in] negotiated The status of the flag to set.
1125 * @param[in] dimension The dimension to set the flag for
1127 void SetLayoutNegotiated( bool negotiated, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
1130 * @brief Test whether the layout dimension for this actor has been negotiated or not.
1132 * @param[in] dimension The dimension to determine the value of the flag for
1133 * @return Return if the layout dimension is negotiated or not.
1135 bool IsLayoutNegotiated( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) const;
1138 * @brief provides the Actor implementation of GetHeightForWidth
1139 * @param width to use.
1140 * @return the height based on the width.
1142 float GetHeightForWidthBase( float width );
1145 * @brief provides the Actor implementation of GetWidthForHeight
1146 * @param height to use.
1147 * @return the width based on the height.
1149 float GetWidthForHeightBase( float height );
1152 * @brief Calculate the size for a child
1154 * @param[in] child The child actor to calculate the size for
1155 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
1156 * @return Return the calculated size for the given dimension
1158 float CalculateChildSizeBase( const Dali::Actor& child, Dimension::Type dimension );
1161 * @brief Set the preferred size for size negotiation
1163 * @param[in] size The preferred size to set
1165 void SetPreferredSize( const Vector2& size );
1168 * @brief Return the preferred size used for size negotiation
1170 * @return Return the preferred size
1172 Vector2 GetPreferredSize() const;
1175 * @copydoc Dali::Actor::SetMinimumSize
1177 void SetMinimumSize( float size, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
1180 * @copydoc Dali::Actor::GetMinimumSize
1182 float GetMinimumSize( Dimension::Type dimension ) const;
1185 * @copydoc Dali::Actor::SetMaximumSize
1187 void SetMaximumSize( float size, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
1190 * @copydoc Dali::Actor::GetMaximumSize
1192 float GetMaximumSize( Dimension::Type dimension ) const;
1195 * @copydoc Dali::Actor::AddRenderer()
1197 unsigned int AddRenderer( Renderer& renderer );
1200 * @copydoc Dali::Actor::GetRendererCount()
1202 unsigned int GetRendererCount() const;
1205 * @copydoc Dali::Actor::GetRendererAt()
1207 RendererPtr GetRendererAt( unsigned int index );
1210 * @copydoc Dali::Actor::RemoveRenderer()
1212 void RemoveRenderer( Renderer& renderer );
1215 * @copydoc Dali::Actor::RemoveRenderer()
1217 void RemoveRenderer( unsigned int index );
1222 * Converts screen coordinates into the actor's coordinate system.
1223 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1224 * @param[out] localX On return, the X-coordinate relative to the actor.
1225 * @param[out] localY On return, the Y-coordinate relative to the actor.
1226 * @param[in] screenX The screen X-coordinate.
1227 * @param[in] screenY The screen Y-coordinate.
1228 * @return True if the conversion succeeded.
1230 bool ScreenToLocal( float& localX, float& localY, float screenX, float screenY ) const;
1233 * Converts screen coordinates into the actor's coordinate system.
1234 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1235 * @param[in] renderTask The render-task used to display the actor.
1236 * @param[out] localX On return, the X-coordinate relative to the actor.
1237 * @param[out] localY On return, the Y-coordinate relative to the actor.
1238 * @param[in] screenX The screen X-coordinate.
1239 * @param[in] screenY The screen Y-coordinate.
1240 * @return True if the conversion succeeded.
1242 bool ScreenToLocal( const RenderTask& renderTask, float& localX, float& localY, float screenX, float screenY ) const;
1245 * Converts from the actor's coordinate system to screen coordinates.
1246 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1247 * @param[in] viewMatrix The view-matrix
1248 * @param[in] projectionMatrix The projection-matrix
1249 * @param[in] viewport The view-port
1250 * @param[out] localX On return, the X-coordinate relative to the actor.
1251 * @param[out] localY On return, the Y-coordinate relative to the actor.
1252 * @param[in] screenX The screen X-coordinate.
1253 * @param[in] screenY The screen Y-coordinate.
1254 * @return True if the conversion succeeded.
1256 bool ScreenToLocal( const Matrix& viewMatrix,
1257 const Matrix& projectionMatrix,
1258 const Viewport& viewport,
1262 float screenY ) const;
1265 * Performs a ray-sphere test with the given pick-ray and the actor's bounding sphere.
1266 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1267 * @param[in] rayOrigin The ray origin in the world's reference system.
1268 * @param[in] rayDir The ray director vector in the world's reference system.
1269 * @return True if the ray intersects the actor's bounding sphere.
1271 bool RaySphereTest( const Vector4& rayOrigin, const Vector4& rayDir ) const;
1274 * Performs a ray-actor test with the given pick-ray and the actor's geometry.
1275 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1276 * @param[in] rayOrigin The ray origin in the world's reference system.
1277 * @param[in] rayDir The ray director vector in the world's reference system.
1278 * @param[out] hitPointLocal The hit point in the Actor's local reference system.
1279 * @param[out] distance The distance from the hit point to the camera.
1280 * @return True if the ray intersects the actor's geometry.
1282 bool RayActorTest( const Vector4& rayOrigin,
1283 const Vector4& rayDir,
1284 Vector2& hitPointLocal,
1285 float& distance ) const;
1288 * Sets whether the actor should receive a notification when touch or hover motion events leave
1289 * the boundary of the actor.
1291 * @note By default, this is set to false as most actors do not require this.
1292 * @note Need to connect to the SignalTouch or SignalHover to actually receive this event.
1294 * @param[in] required Should be set to true if a Leave event is required
1296 void SetLeaveRequired( bool required );
1299 * This returns whether the actor requires touch or hover events whenever touch or hover motion events leave
1300 * the boundary of the actor.
1301 * @return true if a Leave event is required, false otherwise.
1303 bool GetLeaveRequired() const;
1306 * @copydoc Dali::Actor::SetKeyboardFocusable()
1308 void SetKeyboardFocusable( bool focusable );
1311 * @copydoc Dali::Actor::IsKeyboardFocusable()
1313 bool IsKeyboardFocusable() const;
1316 * Query whether the application or derived actor type requires touch events.
1317 * @return True if touch events are required.
1319 bool GetTouchRequired() const;
1322 * Query whether the application or derived actor type requires hover events.
1323 * @return True if hover events are required.
1325 bool GetHoverRequired() const;
1328 * Query whether the application or derived actor type requires wheel events.
1329 * @return True if wheel events are required.
1331 bool GetWheelEventRequired() const;
1334 * Query whether the actor is actually hittable. This method checks whether the actor is
1335 * sensitive, has the visibility flag set to true and is not fully transparent.
1336 * @return true, if it can be hit, false otherwise.
1338 bool IsHittable() const;
1343 * Retrieve the gesture data associated with this actor. The first call to this method will
1344 * allocate space for the ActorGestureData so this should only be called if an actor really does
1346 * @return Reference to the ActorGestureData for this actor.
1347 * @note Once the gesture-data is created for an actor it is likely that gestures are required
1348 * throughout the actor's lifetime so it will only be deleted when the actor is destroyed.
1350 ActorGestureData& GetGestureData();
1353 * Queries whether the actor requires the gesture type.
1354 * @param[in] type The gesture type.
1356 bool IsGestureRequred( Gesture::Type type ) const;
1361 * Used by the EventProcessor to emit touch event signals.
1362 * @param[in] event The touch event (Old API).
1363 * @param[in] touch The touch data.
1364 * @return True if the event was consumed.
1366 bool EmitTouchEventSignal( const TouchEvent& event, const Dali::TouchData& touch );
1369 * Used by the EventProcessor to emit hover event signals.
1370 * @param[in] event The hover event.
1371 * @return True if the event was consumed.
1373 bool EmitHoverEventSignal( const HoverEvent& event );
1376 * Used by the EventProcessor to emit wheel event signals.
1377 * @param[in] event The wheel event.
1378 * @return True if the event was consumed.
1380 bool EmitWheelEventSignal( const WheelEvent& event );
1383 * @copydoc Dali::Actor::TouchedSignal()
1385 Dali::Actor::TouchSignalType& TouchedSignal();
1388 * @copydoc Dali::Actor::TouchEventSignal()
1390 Dali::Actor::TouchDataSignalType& TouchSignal();
1393 * @copydoc Dali::Actor::HoveredSignal()
1395 Dali::Actor::HoverSignalType& HoveredSignal();
1398 * @copydoc Dali::Actor::WheelEventSignal()
1400 Dali::Actor::WheelEventSignalType& WheelEventSignal();
1403 * @copydoc Dali::Actor::OnStageSignal()
1405 Dali::Actor::OnStageSignalType& OnStageSignal();
1408 * @copydoc Dali::Actor::OffStageSignal()
1410 Dali::Actor::OffStageSignalType& OffStageSignal();
1413 * @copydoc Dali::Actor::OnRelayoutSignal()
1415 Dali::Actor::OnRelayoutSignalType& OnRelayoutSignal();
1418 * Connects a callback function with the object's signals.
1419 * @param[in] object The object providing the signal.
1420 * @param[in] tracker Used to disconnect the signal.
1421 * @param[in] signalName The signal to connect to.
1422 * @param[in] functor A newly allocated FunctorDelegate.
1423 * @return True if the signal was connected.
1424 * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
1426 static bool DoConnectSignal( BaseObject* object,
1427 ConnectionTrackerInterface* tracker,
1428 const std::string& signalName,
1429 FunctorDelegate* functor );
1432 * Performs actions as requested using the action name.
1433 * @param[in] object The object on which to perform the action.
1434 * @param[in] actionName The action to perform.
1435 * @param[in] attributes The attributes with which to perfrom this action.
1436 * @return true if the action was done.
1438 static bool DoAction( BaseObject* object,
1439 const std::string& actionName,
1440 const Property::Map& attributes );
1446 * This should only be called by Animation, when the actors SIZE property is animated.
1448 * @param[in] animation The animation that resized the actor
1449 * @param[in] targetSize The new target size of the actor
1451 void NotifySizeAnimation( Animation& animation, const Vector3& targetSize );
1454 * This should only be called by Animation, when the actors SIZE_WIDTH or SIZE_HEIGHT or SIZE_DEPTH property is animated.
1456 * @param[in] animation The animation that resized the actor
1457 * @param[in] targetSize The new target size of the actor
1458 * @param[in] property The index of the property being animated
1460 void NotifySizeAnimation( Animation& animation, float targetSize, Property::Index property );
1463 * For use in derived classes.
1464 * This should only be called by Animation, when the actor is resized using Animation::Resize().
1466 virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize )
1471 * This should only be called by Animation, when the actors POSITION property is animated.
1473 * @param[in] animation The animation that repositioned the actor
1474 * @param[in] targetPosition The new target position of the actor
1476 void NotifyPositionAnimation( Animation& animation, const Vector3& targetPosition );
1479 * This should only be called by Animation, when the actors POSITION_X or POSITION_Y or POSITION_Z property is animated.
1481 * @param[in] animation The animation that repositioned the actor
1482 * @param[in] targetPosition The new target position of the actor
1483 * @param[in] property The index of the property being animated
1485 void NotifyPositionAnimation( Animation& animation, float targetPosition, Property::Index property );
1491 BASIC, LAYER, ROOT_LAYER
1495 * Protected Constructor. See Actor::New().
1496 * The second-phase construction Initialize() member should be called immediately after this.
1497 * @param[in] derivedType The derived type of actor (if any).
1499 Actor( DerivedType derivedType );
1502 * Second-phase constructor. Must be called immediately after creating a new Actor;
1504 void Initialize( void );
1507 * A reference counted object may only be deleted by calling Unreference()
1512 * Called on a child during Add() when the parent actor is connected to the Stage.
1513 * @param[in] parentDepth The depth of the parent in the hierarchy.
1515 void ConnectToStage( unsigned int parentDepth );
1518 * Helper for ConnectToStage, to recursively connect a tree of actors.
1519 * This is atomic i.e. not interrupted by user callbacks.
1520 * @param[in] depth The depth in the hierarchy of the actor
1521 * @param[out] connectionList On return, the list of connected actors which require notification.
1523 void RecursiveConnectToStage( ActorContainer& connectionList, unsigned int depth );
1526 * Connect the Node associated with this Actor to the scene-graph.
1528 void ConnectToSceneGraph();
1531 * Helper for ConnectToStage, to notify a connected actor through the public API.
1533 void NotifyStageConnection();
1536 * Called on a child during Remove() when the actor was previously on the Stage.
1538 void DisconnectFromStage();
1541 * Helper for DisconnectFromStage, to recursively disconnect a tree of actors.
1542 * This is atomic i.e. not interrupted by user callbacks.
1543 * @param[out] disconnectionList On return, the list of disconnected actors which require notification.
1545 void RecursiveDisconnectFromStage( ActorContainer& disconnectionList );
1548 * Disconnect the Node associated with this Actor from the scene-graph.
1550 void DisconnectFromSceneGraph();
1553 * Helper for DisconnectFromStage, to notify a disconnected actor through the public API.
1555 void NotifyStageDisconnection();
1558 * When the Actor is OnStage, checks whether the corresponding Node is connected to the scene graph.
1559 * @return True if the Actor is OnStage & has a Node connected to the scene graph.
1561 bool IsNodeConnected() const;
1565 // Default property extensions from Object
1568 * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
1570 virtual unsigned int GetDefaultPropertyCount() const;
1573 * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
1575 virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
1578 * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
1580 virtual const char* GetDefaultPropertyName( Property::Index index ) const;
1583 * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
1585 virtual Property::Index GetDefaultPropertyIndex( const std::string& name ) const;
1588 * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
1590 virtual bool IsDefaultPropertyWritable( Property::Index index ) const;
1593 * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
1595 virtual bool IsDefaultPropertyAnimatable( Property::Index index ) const;
1598 * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
1600 virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
1603 * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
1605 virtual Property::Type GetDefaultPropertyType( Property::Index index ) const;
1608 * @copydoc Dali::Internal::Object::SetDefaultProperty()
1610 virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue );
1613 * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
1615 virtual void SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value );
1618 * @copydoc Dali::Internal::Object::GetDefaultProperty()
1620 virtual Property::Value GetDefaultProperty( Property::Index index ) const;
1623 * @copydoc Dali::Internal::Object::GetPropertyOwner()
1625 virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
1628 * @copydoc Dali::Internal::Object::GetSceneObject()
1630 virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
1633 * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
1635 virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
1638 * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
1640 virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
1643 * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
1645 virtual int GetPropertyComponentIndex( Property::Index index ) const;
1653 Actor( const Actor& );
1656 Actor& operator=( const Actor& rhs );
1659 * Set the actors parent.
1660 * @param[in] parent The new parent.
1662 void SetParent( Actor* parent );
1665 * Helper to create a Node for this Actor.
1666 * To be overriden in derived classes.
1667 * @return A newly allocated node.
1669 virtual SceneGraph::Node* CreateNode() const;
1672 * For use in derived classes, called after Initialize()
1674 virtual void OnInitialize()
1679 * For use in internal derived classes.
1680 * This is called during ConnectToStage(), after the actor has finished adding its node to the scene-graph.
1681 * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1683 virtual void OnStageConnectionInternal()
1688 * For use in internal derived classes.
1689 * This is called during DisconnectFromStage(), before the actor removes its node from the scene-graph.
1690 * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1692 virtual void OnStageDisconnectionInternal()
1697 * For use in external (CustomActor) derived classes.
1698 * This is called after the atomic ConnectToStage() traversal has been completed.
1700 virtual void OnStageConnectionExternal( int depth )
1705 * For use in external (CustomActor) derived classes.
1706 * This is called after the atomic DisconnectFromStage() traversal has been completed.
1708 virtual void OnStageDisconnectionExternal()
1713 * For use in derived classes; this is called after Add() has added a child.
1714 * @param[in] child The child that was added.
1716 virtual void OnChildAdd( Actor& child )
1721 * For use in derived classes; this is called after Remove() has attempted to remove a child( regardless of whether it succeeded or not ).
1722 * @param[in] child The child that was removed.
1724 virtual void OnChildRemove( Actor& child )
1729 * For use in derived classes.
1730 * This is called after SizeSet() has been called.
1732 virtual void OnSizeSet( const Vector3& targetSize )
1737 * For use in derived classes.
1738 * This is only called if mDerivedRequiresTouch is true, and the touch-signal was not consumed.
1739 * @param[in] event The touch event.
1740 * @return True if the event should be consumed.
1742 virtual bool OnTouchEvent( const TouchEvent& event )
1748 * For use in derived classes.
1749 * This is only called if mDerivedRequiresHover is true, and the hover-signal was not consumed.
1750 * @param[in] event The hover event.
1751 * @return True if the event should be consumed.
1753 virtual bool OnHoverEvent( const HoverEvent& event )
1759 * For use in derived classes.
1760 * This is only called if the wheel signal was not consumed.
1761 * @param[in] event The wheel event.
1762 * @return True if the event should be consumed.
1764 virtual bool OnWheelEvent( const WheelEvent& event )
1770 * @brief Ensure the relayout data is allocated
1772 void EnsureRelayoutData();
1775 * @brief Apply the size set policy to the input size
1777 * @param[in] size The size to apply the policy to
1778 * @return Return the adjusted size
1780 Vector2 ApplySizeSetPolicy( const Vector2 size );
1783 * Retrieve the parent object of an Actor.
1784 * @return The parent object, or NULL if the Actor does not have a parent.
1786 virtual Object* GetParentObject() const;
1790 Actor* mParent; ///< Each actor (except the root) can have one parent
1791 ActorContainer* mChildren; ///< Container of referenced actors
1792 RendererContainer* mRenderers; ///< Renderer container
1794 const SceneGraph::Node* mNode; ///< Not owned
1795 Vector3* mParentOrigin; ///< NULL means ParentOrigin::DEFAULT. ParentOrigin is non-animatable
1796 Vector3* mAnchorPoint; ///< NULL means AnchorPoint::DEFAULT. AnchorPoint is non-animatable
1798 struct RelayoutData;
1799 RelayoutData* mRelayoutData; ///< Struct to hold optional collection of relayout variables
1801 ActorGestureData* mGestureData; ///< Optional Gesture data. Only created when actor requires gestures
1804 Dali::Actor::TouchSignalType mTouchedSignal;
1805 Dali::Actor::TouchDataSignalType mTouchSignal;
1806 Dali::Actor::HoverSignalType mHoveredSignal;
1807 Dali::Actor::WheelEventSignalType mWheelEventSignal;
1808 Dali::Actor::OnStageSignalType mOnStageSignal;
1809 Dali::Actor::OffStageSignalType mOffStageSignal;
1810 Dali::Actor::OnRelayoutSignalType mOnRelayoutSignal;
1812 Vector3 mTargetSize; ///< Event-side storage for size (not a pointer as most actors will have a size)
1813 Vector3 mTargetPosition; ///< Event-side storage for position (not a pointer as most actors will have a position)
1815 std::string mName; ///< Name of the actor
1816 unsigned int mId; ///< A unique ID to identify the actor starting from 1, and 0 is reserved
1818 unsigned short mDepth :12; ///< Cached: The depth in the hierarchy of the actor. Only 4096 levels of depth are supported
1819 const bool mIsRoot : 1; ///< Flag to identify the root actor
1820 const bool mIsLayer : 1; ///< Flag to identify that this is a layer
1821 bool mIsOnStage : 1; ///< Flag to identify whether the actor is on-stage
1822 bool mSensitive : 1; ///< Whether the actor emits touch event signals
1823 bool mLeaveRequired : 1; ///< Whether a touch event signal is emitted when the a touch leaves the actor's bounds
1824 bool mKeyboardFocusable : 1; ///< Whether the actor should be focusable by keyboard navigation
1825 bool mDerivedRequiresTouch : 1; ///< Whether the derived actor type requires touch event signals
1826 bool mDerivedRequiresHover : 1; ///< Whether the derived actor type requires hover event signals
1827 bool mDerivedRequiresWheelEvent : 1; ///< Whether the derived actor type requires wheel event signals
1828 bool mOnStageSignalled : 1; ///< Set to true before OnStageConnection signal is emitted, and false before OnStageDisconnection
1829 bool mInsideOnSizeSet : 1; ///< Whether we are inside OnSizeSet
1830 bool mInheritPosition : 1; ///< Cached: Whether the parent's position should be inherited.
1831 bool mInheritOrientation : 1; ///< Cached: Whether the parent's orientation should be inherited.
1832 bool mInheritScale : 1; ///< Cached: Whether the parent's scale should be inherited.
1833 DrawMode::Type mDrawMode : 2; ///< Cached: How the actor and its children should be drawn
1834 PositionInheritanceMode mPositionInheritanceMode : 2; ///< Cached: Determines how position is inherited
1835 ColorMode mColorMode : 2; ///< Cached: Determines whether mWorldColor is inherited
1836 ClippingMode::Type mClippingMode : 2; ///< Cached: Determines which clipping mode (if any) to use.
1840 static ActorContainer mNullChildren; ///< Empty container (shared by all actors, returned by GetChildren() const)
1841 static unsigned int mActorCounter; ///< A counter to track the actor instance creation
1845 } // namespace Internal
1847 // Helpers for public-api forwarding methods
1849 inline Internal::Actor& GetImplementation( Dali::Actor& actor )
1851 DALI_ASSERT_ALWAYS( actor && "Actor handle is empty" );
1853 BaseObject& handle = actor.GetBaseObject();
1855 return static_cast< Internal::Actor& >( handle );
1858 inline const Internal::Actor& GetImplementation( const Dali::Actor& actor )
1860 DALI_ASSERT_ALWAYS( actor && "Actor handle is empty" );
1862 const BaseObject& handle = actor.GetBaseObject();
1864 return static_cast< const Internal::Actor& >( handle );
1869 #endif // DALI_INTERNAL_ACTOR_H