1 #ifndef __DALI_INTERNAL_ACTOR_H__
2 #define __DALI_INTERNAL_ACTOR_H__
5 * Copyright (c) 2014 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/actor-attachments/actor-attachment-declarations.h>
34 #include <dali/internal/event/common/object-impl.h>
35 #include <dali/internal/event/common/stage-def.h>
36 #include <dali/internal/event/rendering/renderer-impl.h>
37 #include <dali/internal/update/nodes/node-declarations.h>
51 class ActorGestureData;
56 typedef std::vector< ActorPtr > ActorContainer;
57 typedef ActorContainer::iterator ActorIter;
58 typedef ActorContainer::const_iterator ActorConstIter;
61 * Actor is the primary object which Dali applications interact with.
62 * UI controls can be built by combining multiple actors.
63 * Multi-Touch events are received through signals emitted by the actor tree.
65 * An Actor is a proxy for a Node in the scene graph.
66 * When an Actor is added to the Stage, it creates a node and attaches it to the scene graph.
67 * The scene-graph can be updated in a separate thread, so the attachment is done using an asynchronous message.
68 * When a tree of Actors is detached from the Stage, a message is sent to destroy the associated nodes.
70 class Actor : public Object
75 * @brief Struct to hold an actor and a dimension
77 struct ActorDimensionPair
82 * @param[in] newActor The actor to assign
83 * @param[in] newDimension The dimension to assign
85 ActorDimensionPair( Actor* newActor, Dimension::Type newDimension )
87 dimension( newDimension )
92 * @brief Equality operator
94 * @param[in] lhs The left hand side argument
95 * @param[in] rhs The right hand side argument
97 bool operator== ( const ActorDimensionPair& rhs )
99 return ( actor == rhs.actor ) && ( dimension == rhs.dimension );
102 Actor* actor; ///< The actor to hold
103 Dimension::Type dimension; ///< The dimension to hold
106 typedef std::vector< ActorDimensionPair > ActorDimensionStack;
111 * Create a new actor.
112 * @return A smart-pointer to the newly allocated Actor.
114 static ActorPtr New();
117 * Retrieve the name of the actor.
120 const std::string& GetName() const;
123 * Set the name of the actor.
124 * @param[in] name The new name.
126 void SetName( const std::string& name );
129 * @copydoc Dali::Actor::GetId
131 unsigned int GetId() const;
136 * Attach an object to an actor.
137 * @pre The actor does not already have an attachment.
138 * @param[in] attachment The object to attach.
140 void Attach( ActorAttachment& attachment );
143 * Retreive the object attached to an actor.
144 * @return The attachment.
146 ActorAttachmentPtr GetAttachment();
151 * Query whether an actor is the root actor, which is owned by the Stage.
152 * @return True if the actor is a root actor.
160 * Query whether the actor is connected to the Stage.
162 bool OnStage() const;
165 * Query whether the actor is a RenderableActor derived type.
166 * @return True if the actor is renderable.
168 bool IsRenderable() const
170 // inlined as this is called a lot in hit testing
171 return mIsRenderable;
175 * Query whether the actor is of class Dali::Layer
176 * @return True if the actor is a layer.
180 // inlined as this is called a lot in hit testing
185 * Gets the layer in which the actor is present
186 * @return The layer, which will be uninitialized if the actor is off-stage.
188 Dali::Layer GetLayer();
191 * Adds a child Actor to this Actor.
192 * @pre The child actor is not the same as the parent actor.
193 * @pre The child actor does not already have a parent.
194 * @param [in] child The child.
195 * @post The child will be referenced by its parent.
197 void Add( Actor& child );
200 * Removes a child Actor from this Actor.
201 * @param [in] child The child.
202 * @post The child will be unreferenced.
204 void Remove( Actor& child );
207 * @copydoc Dali::Actor::Unparent
212 * Retrieve the number of children held by the actor.
213 * @return The number of children
215 unsigned int GetChildCount() const;
218 * @copydoc Dali::Actor::GetChildAt
220 ActorPtr GetChildAt( unsigned int index ) const;
223 * Retrieve a reference to Actor's children.
224 * @note Not for public use.
225 * @return A reference to the container of children.
227 ActorContainer& GetChildrenInternal()
233 * @copydoc Dali::Actor::FindChildByName
235 ActorPtr FindChildByName( const std::string& actorName );
238 * @copydoc Dali::Actor::FindChildById
240 ActorPtr FindChildById( const unsigned int id );
243 * Retrieve the parent of an Actor.
244 * @return The parent actor, or NULL if the Actor does not have a parent.
246 Actor* GetParent() const
252 * Sets the size of an actor.
253 * ActorAttachments attached to the actor, can be scaled to fit within this area.
254 * This does not interfere with the actors scale factor.
255 * @param [in] width The new width.
256 * @param [in] height The new height.
258 void SetSize( float width, float height );
261 * Sets the size of an actor.
262 * ActorAttachments attached to the actor, can be scaled to fit within this area.
263 * This does not interfere with the actors scale factor.
264 * @param [in] width The size of the actor along the x-axis.
265 * @param [in] height The size of the actor along the y-axis.
266 * @param [in] depth The size of the actor along the z-axis.
268 void SetSize( float width, float height, float depth );
271 * Sets the size of an actor.
272 * ActorAttachments attached to the actor, can be scaled to fit within this area.
273 * This does not interfere with the actors scale factor.
274 * @param [in] size The new size.
276 void SetSize( const Vector2& size );
279 * Sets the update size for an actor.
281 * @param[in] size The size to set.
283 void SetSizeInternal( const Vector2& size );
286 * Sets the size of an actor.
287 * ActorAttachments attached to the actor, can be scaled to fit within this area.
288 * This does not interfere with the actors scale factor.
289 * @param [in] size The new size.
291 void SetSize( const Vector3& size );
294 * Sets the update size for an actor.
296 * @param[in] size The size to set.
298 void SetSizeInternal( const Vector3& size );
301 * Set the width component of the Actor's size.
302 * @param [in] width The new width component.
304 void SetWidth( float width );
307 * Set the height component of the Actor's size.
308 * @param [in] height The new height component.
310 void SetHeight( float height );
313 * Set the depth component of the Actor's size.
314 * @param [in] depth The new depth component.
316 void SetDepth( float depth );
319 * Retrieve the Actor's size from event side.
320 * This size will be the size set or if animating then the target size.
321 * @return The Actor's size.
323 const Vector3& GetTargetSize() const;
326 * Retrieve the Actor's size from update side.
327 * This size will be the size set or animating but will be a frame behind.
328 * @return The Actor's size.
330 const Vector3& GetCurrentSize() const;
333 * Return the natural size of the actor
335 * @return The actor's natural size
337 virtual Vector3 GetNaturalSize() const;
340 * Set the origin of an actor, within its parent's area.
341 * This is expressed in 2D unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent,
342 * and (1.0, 1.0, 0.5) is the bottom-right corner.
343 * The default parent-origin is top-left (0.0, 0.0, 0.5).
344 * An actor position is the distance between this origin, and the actors anchor-point.
345 * @param [in] origin The new parent-origin.
347 void SetParentOrigin( const Vector3& origin );
350 * Set the x component of the parent-origin
351 * @param [in] x The new x value.
353 void SetParentOriginX( float x );
356 * Set the y component of the parent-origin
357 * @param [in] y The new y value.
359 void SetParentOriginY( float y );
362 * Set the z component of the parent-origin
363 * @param [in] z The new z value.
365 void SetParentOriginZ( float z );
368 * Retrieve the parent-origin of an actor.
369 * @return The parent-origin.
371 const Vector3& GetCurrentParentOrigin() const;
374 * Set the anchor-point of an actor. This is expressed in 2D unit coordinates, such that
375 * (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.
376 * The default anchor point is top-left (0.0, 0.0, 0.5).
377 * An actor position is the distance between its parent-origin, and this anchor-point.
378 * An actor's rotation is centered around its anchor-point.
379 * @param [in] anchorPoint The new anchor-point.
381 void SetAnchorPoint( const Vector3& anchorPoint );
384 * Set the x component of the anchor-point.
385 * @param [in] x The new x value.
387 void SetAnchorPointX( float x );
390 * Set the y component of the anchor-point.
391 * @param [in] y The new y value.
393 void SetAnchorPointY( float y );
396 * Set the z component of the anchor-point.
397 * @param [in] z The new z value.
399 void SetAnchorPointZ( float z );
402 * Retrieve the anchor-point of an actor.
403 * @return The anchor-point.
405 const Vector3& GetCurrentAnchorPoint() const;
408 * Sets the position of the Actor.
409 * The coordinates are relative to the Actor's parent.
410 * The Actor's z position will be set to 0.0f.
411 * @param [in] x The new x position
412 * @param [in] y The new y position
414 void SetPosition( float x, float y );
417 * Sets the position of the Actor.
418 * The coordinates are relative to the Actor's parent.
419 * @param [in] x The new x position
420 * @param [in] y The new y position
421 * @param [in] z The new z position
423 void SetPosition( float x, float y, float z );
426 * Sets the position of the Actor.
427 * The coordinates are relative to the Actor's parent.
428 * @param [in] position The new position.
430 void SetPosition( const Vector3& position );
433 * Set the position of an actor along the X-axis.
434 * @param [in] x The new x position
436 void SetX( float x );
439 * Set the position of an actor along the Y-axis.
440 * @param [in] y The new y position.
442 void SetY( float y );
445 * Set the position of an actor along the Z-axis.
446 * @param [in] z The new z position
448 void SetZ( float z );
451 * Translate an actor relative to its existing position.
452 * @param[in] distance The actor will move by this distance.
454 void TranslateBy( const Vector3& distance );
457 * Retrieve the position of the Actor.
458 * The coordinates are relative to the Actor's parent.
459 * @return the Actor's position.
461 const Vector3& GetCurrentPosition() const;
464 * Retrieve the target position of the Actor.
465 * The coordinates are relative to the Actor's parent.
466 * @return the Actor's position.
468 const Vector3& GetTargetPosition() const;
471 * @copydoc Dali::Actor::GetCurrentWorldPosition()
473 const Vector3& GetCurrentWorldPosition() const;
476 * @copydoc Dali::Actor::SetPositionInheritanceMode()
478 void SetPositionInheritanceMode( PositionInheritanceMode mode );
481 * @copydoc Dali::Actor::GetPositionInheritanceMode()
483 PositionInheritanceMode GetPositionInheritanceMode() const;
486 * Sets the orientation of the Actor.
487 * @param [in] angleRadians The new orientation angle in radians.
488 * @param [in] axis The new axis of orientation.
490 void SetOrientation( const Radian& angleRadians, const Vector3& axis );
493 * Sets the orientation of the Actor.
494 * @param [in] orientation The new orientation.
496 void SetOrientation( const Quaternion& orientation );
499 * Rotate an actor around its existing rotation axis.
500 * @param[in] angleRadians The angle to the rotation to combine with the existing rotation.
501 * @param[in] axis The axis of the rotation to combine with the existing rotation.
503 void RotateBy( const Radian& angleRadians, const Vector3& axis );
506 * Apply a relative rotation to an actor.
507 * @param[in] relativeRotation The rotation to combine with the actors existing rotation.
509 void RotateBy( const Quaternion& relativeRotation );
512 * Retreive the Actor's orientation.
513 * @return the orientation.
515 const Quaternion& GetCurrentOrientation() const;
518 * Set whether a child actor inherits it's parent's orientation. Default is to inherit.
519 * Switching this off means that using SetOrientation() sets the actor's world orientation.
520 * @param[in] inherit - true if the actor should inherit orientation, false otherwise.
522 void SetInheritOrientation( bool inherit );
525 * Returns whether the actor inherit's it's parent's orientation.
526 * @return true if the actor inherit's it's parent orientation, false if it uses world orientation.
528 bool IsOrientationInherited() const;
531 * Sets 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 * @param[in] factor The vector to multiply the parents size by to get the childs size.
535 void SetSizeModeFactor( const Vector3& factor );
538 * Gets the factor of the parents size used for the child actor.
539 * Note: Only used if ResizePolicy is ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
540 * @return The vector being used to multiply the parents size by to get the childs size.
542 const Vector3& GetSizeModeFactor() const;
545 * @copydoc Dali::Actor::GetCurrentWorldOrientation()
547 const Quaternion& GetCurrentWorldOrientation() const;
550 * Sets a scale factor applied to an actor.
551 * @param [in] scale The scale factor applied on all axes.
553 void SetScale( float scale );
556 * Sets a scale factor applied to an actor.
557 * @param [in] scaleX The scale factor applied along the x-axis.
558 * @param [in] scaleY The scale factor applied along the y-axis.
559 * @param [in] scaleZ The scale factor applied along the z-axis.
561 void SetScale( float scaleX, float scaleY, float scaleZ );
564 * Sets a scale factor applied to an actor.
565 * @param [in] scale A vector representing the scale factor for each axis.
567 void SetScale( const Vector3& scale );
570 * Set the x component of the scale factor.
571 * @param [in] x The new x value.
573 void SetScaleX( float x );
576 * Set the y component of the scale factor.
577 * @param [in] y The new y value.
579 void SetScaleY( float y );
582 * Set the z component of the scale factor.
583 * @param [in] z The new z value.
585 void SetScaleZ( float z );
588 * Apply a relative scale to an actor.
589 * @param[in] relativeScale The scale to combine with the actors existing scale.
591 void ScaleBy( const Vector3& relativeScale );
594 * Retrieve the scale factor applied to an actor.
595 * @return A vector representing the scale factor for each axis.
597 const Vector3& GetCurrentScale() const;
600 * @copydoc Dali::Actor::GetCurrentWorldScale()
602 const Vector3& GetCurrentWorldScale() const;
605 * @copydoc Dali::Actor::SetInheritScale()
607 void SetInheritScale( bool inherit );
610 * @copydoc Dali::Actor::IsScaleInherited()
612 bool IsScaleInherited() const;
615 * @copydoc Dali::Actor::GetCurrentWorldMatrix()
617 Matrix GetCurrentWorldMatrix() const;
622 * Sets the visibility flag of an actor.
623 * @param [in] visible The new visibility flag.
625 void SetVisible( bool visible );
628 * Retrieve the visibility flag of an actor.
629 * @return The visibility flag.
631 bool IsVisible() const;
634 * Sets the opacity of an actor.
635 * @param [in] opacity The new opacity.
637 void SetOpacity( float opacity );
640 * Retrieve the actor's opacity.
641 * @return The actor's opacity.
643 float GetCurrentOpacity() const;
646 * Sets whether an actor should emit touch or hover signals; see SignalTouch() and SignalHover().
647 * An actor is sensitive by default, which means that as soon as an application connects to the SignalTouch(),
648 * the touch event signal will be emitted, and as soon as an application connects to the SignalHover(), the
649 * hover event signal will be emitted.
651 * If the application wishes to temporarily disable the touch or hover event signal emission, then they can do so by calling:
653 * actor.SetSensitive(false);
656 * Then, to re-enable the touch or hover event signal emission, the application should call:
658 * actor.SetSensitive(true);
661 * @see SignalTouch() and SignalHover().
662 * @note If an actor's sensitivity is set to false, then it's children will not emit a touch or hover event signal either.
663 * @param[in] sensitive true to enable emission of the touch or hover event signals, false otherwise.
665 void SetSensitive( bool sensitive )
667 mSensitive = sensitive;
671 * Query whether an actor emits touch or hover event signals.
672 * @see SetSensitive(bool)
673 * @return true, if emission of touch or hover event signals is enabled, false otherwise.
675 bool IsSensitive() const
681 * @copydoc Dali::Actor::SetDrawMode
683 void SetDrawMode( DrawMode::Type drawMode );
686 * @copydoc Dali::Actor::GetDrawMode
688 DrawMode::Type GetDrawMode() const;
691 * @copydoc Dali::Actor::SetOverlay
693 void SetOverlay( bool enable );
696 * @copydoc Dali::Actor::IsOverlay
698 bool IsOverlay() const;
701 * Sets the actor's color. The final color of actor depends on its color mode.
702 * This final color is applied to the drawable elements of an actor.
703 * @param [in] color The new color.
705 void SetColor( const Vector4& color );
708 * Set the red component of the color.
709 * @param [in] red The new red component.
711 void SetColorRed( float red );
714 * Set the green component of the color.
715 * @param [in] green The new green component.
717 void SetColorGreen( float green );
720 * Set the blue component of the scale factor.
721 * @param [in] blue The new blue value.
723 void SetColorBlue( float blue );
726 * Retrieve the actor's color.
729 const Vector4& GetCurrentColor() const;
732 * Sets the actor's color mode.
733 * Color mode specifies whether Actor uses its own color or inherits its parent color
734 * @param [in] colorMode to use.
736 void SetColorMode( ColorMode colorMode );
739 * Returns the actor's color mode.
740 * @return currently used colorMode.
742 ColorMode GetColorMode() const;
745 * @copydoc Dali::Actor::GetCurrentWorldColor()
747 const Vector4& GetCurrentWorldColor() const;
750 * @copydoc Dali::Actor::GetHierarchyDepth()
752 int GetHierarchyDepth() const
756 return static_cast<int>(mDepth);
764 // Size negotiation virtual functions
767 * @brief Called after the size negotiation has been finished for this control.
769 * The control is expected to assign this given size to itself/its children.
771 * Should be overridden by derived classes if they need to layout
772 * actors differently after certain operations like add or remove
773 * actors, resize or after changing specific properties.
775 * Note! As this function is called from inside the size negotiation algorithm, you cannot
776 * call RequestRelayout (the call would just be ignored)
778 * @param[in] size The allocated size.
779 * @param[in,out] container The control should add actors to this container that it is not able
780 * to allocate a size for.
782 virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
787 * @brief Notification for deriving classes when the resize policy is set
789 * @param[in] policy The policy being set
790 * @param[in] dimension The dimension the policy is being set for
792 virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ) {}
795 * @brief Virtual method to notify deriving classes that relayout dependencies have been
796 * met and the size for this object is about to be calculated for the given dimension
798 * @param dimension The dimension that is about to be calculated
800 virtual void OnCalculateRelayoutSize( Dimension::Type dimension );
803 * @brief Virtual method to notify deriving classes that the size for a dimension
804 * has just been negotiated
806 * @param[in] size The new size for the given dimension
807 * @param[in] dimension The dimension that was just negotiated
809 virtual void OnLayoutNegotiated( float size, Dimension::Type dimension );
812 * @brief Determine if this actor is dependent on it's children for relayout
814 * @param dimension The dimension(s) to check for
815 * @return Return if the actor is dependent on it's children
817 virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
820 * @brief Determine if this actor is dependent on it's children for relayout.
822 * Called from deriving classes
824 * @param dimension The dimension(s) to check for
825 * @return Return if the actor is dependent on it's children
827 virtual bool RelayoutDependentOnChildrenBase( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
830 * @brief Calculate the size for a child
832 * @param[in] child The child actor to calculate the size for
833 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
834 * @return Return the calculated size for the given dimension
836 virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension );
839 * @brief This method is called during size negotiation when a height is required for a given width.
841 * Derived classes should override this if they wish to customize the height returned.
843 * @param width to use.
844 * @return the height based on the width.
846 virtual float GetHeightForWidth( float width );
849 * @brief This method is called during size negotiation when a width is required for a given height.
851 * Derived classes should override this if they wish to customize the width returned.
853 * @param height to use.
854 * @return the width based on the width.
856 virtual float GetWidthForHeight( float height );
863 * @brief Called by the RelayoutController to negotiate the size of an actor.
865 * The size allocated by the the algorithm is passed in which the
866 * actor must adhere to. A container is passed in as well which
867 * the actor should populate with actors it has not / or does not
868 * need to handle in its size negotiation.
870 * @param[in] size The allocated size.
871 * @param[in,out] container The container that holds actors that are fed back into the
872 * RelayoutController algorithm.
874 void NegotiateSize( const Vector2& size, RelayoutContainer& container );
877 * @copydoc Dali::Actor::SetResizePolicy()
879 void SetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
882 * @copydoc Dali::Actor::GetResizePolicy()
884 ResizePolicy::Type GetResizePolicy( Dimension::Type dimension ) const;
887 * @copydoc Dali::Actor::SetSizeScalePolicy()
889 void SetSizeScalePolicy( SizeScalePolicy::Type policy );
892 * @copydoc Dali::Actor::GetSizeScalePolicy()
894 SizeScalePolicy::Type GetSizeScalePolicy() const;
897 * @copydoc Dali::Actor::SetDimensionDependency()
899 void SetDimensionDependency( Dimension::Type dimension, Dimension::Type dependency );
902 * @copydoc Dali::Actor::GetDimensionDependency()
904 Dimension::Type GetDimensionDependency( Dimension::Type dimension ) const;
907 * @brief Set the size negotiation relayout enabled on this actor
909 * @param[in] relayoutEnabled Boolean to enable or disable relayout
911 void SetRelayoutEnabled( bool relayoutEnabled );
914 * @brief Return if relayout is enabled
916 * @return Return if relayout is enabled or not for this actor
918 bool IsRelayoutEnabled() const;
921 * @brief Mark an actor as having it's layout dirty
923 * @param dirty Whether to mark actor as dirty or not
924 * @param dimension The dimension(s) to mark as dirty
926 void SetLayoutDirty( bool dirty, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
929 * @brief Return if any of an actor's dimensions are marked as dirty
931 * @param dimension The dimension(s) to check
932 * @return Return if any of the requested dimensions are dirty
934 bool IsLayoutDirty( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) const;
937 * @brief Returns if relayout is enabled and the actor is not dirty
939 * @return Return if it is possible to relayout the actor
941 bool RelayoutPossible( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) const;
944 * @brief Returns if relayout is enabled and the actor is dirty
946 * @return Return if it is required to relayout the actor
948 bool RelayoutRequired( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) const;
951 * @brief Request a relayout, which means performing a size negotiation on this actor, its parent and children (and potentially whole scene)
953 * This method is automatically called from OnStageConnection(), OnChildAdd(),
954 * OnChildRemove(), SetSizePolicy(), SetMinimumSize() and SetMaximumSize().
956 * This method can also be called from a derived class every time it needs a different size.
957 * At the end of event processing, the relayout process starts and
958 * all controls which requested Relayout will have their sizes (re)negotiated.
960 * @note RelayoutRequest() can be called multiple times; the size negotiation is still
961 * only performed once, i.e. there is no need to keep track of this in the calling side.
963 void RelayoutRequest( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
966 * @brief Determine if this actor is dependent on it's parent for relayout
968 * @param dimension The dimension(s) to check for
969 * @return Return if the actor is dependent on it's parent
971 bool RelayoutDependentOnParent( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
974 * @brief Determine if this actor has another dimension depedent on the specified one
976 * @param dimension The dimension to check for
977 * @param dependentDimension The dimension to check for dependency with
978 * @return Return if the actor is dependent on this dimension
980 bool RelayoutDependentOnDimension( Dimension::Type dimension, Dimension::Type dependentDimension );
983 * Negotiate sizes for a control in all dimensions
985 * @param[in] allocatedSize The size constraint that the control must respect
987 void NegotiateDimensions( const Vector2& allocatedSize );
990 * Negotiate size for a specific dimension
992 * The algorithm adopts a recursive dependency checking approach. Meaning, that wherever dependencies
993 * are found, e.g. an actor dependent on its parent, the dependency will be calculated first with NegotiatedDimension and
994 * LayoutDimensionNegotiated flags being filled in on the actor.
996 * @post All actors that exist in the dependency chain connected to the given actor will have had their NegotiatedDimensions
997 * calculated and set as well as the LayoutDimensionNegotiated flags.
999 * @param[in] dimension The dimension to negotiate on
1000 * @param[in] allocatedSize The size constraint that the actor must respect
1002 void NegotiateDimension( Dimension::Type dimension, const Vector2& allocatedSize, ActorDimensionStack& recursionStack );
1005 * @brief Calculate the size of a dimension
1007 * @param[in] dimension The dimension to calculate the size for
1008 * @param[in] maximumSize The upper bounds on the size
1009 * @return Return the calculated size for the dimension
1011 float CalculateSize( Dimension::Type dimension, const Vector2& maximumSize );
1014 * @brief Clamp a dimension given the relayout constraints on this actor
1016 * @param[in] size The size to constrain
1017 * @param[in] dimension The dimension the size exists in
1018 * @return Return the clamped size
1020 float ClampDimension( float size, Dimension::Type dimension );
1023 * Negotiate a dimension based on the size of the parent
1025 * @param[in] dimension The dimension to negotiate on
1026 * @return Return the negotiated size
1028 float NegotiateFromParent( Dimension::Type dimension );
1031 * Negotiate a dimension based on the size of the parent. Fitting inside.
1033 * @param[in] dimension The dimension to negotiate on
1034 * @return Return the negotiated size
1036 float NegotiateFromParentFit( Dimension::Type dimension );
1039 * Negotiate a dimension based on the size of the parent. Flooding the whole space.
1041 * @param[in] dimension The dimension to negotiate on
1042 * @return Return the negotiated size
1044 float NegotiateFromParentFlood( Dimension::Type dimension );
1047 * @brief Negotiate a dimension based on the size of the children
1049 * @param[in] dimension The dimension to negotiate on
1050 * @return Return the negotiated size
1052 float NegotiateFromChildren( Dimension::Type dimension );
1055 * Set the negotiated dimension value for the given dimension(s)
1057 * @param negotiatedDimension The value to set
1058 * @param dimension The dimension(s) to set the value for
1060 void SetNegotiatedDimension( float negotiatedDimension, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
1063 * Return the value of negotiated dimension for the given dimension
1065 * @param dimension The dimension to retrieve
1066 * @return Return the value of the negotiated dimension
1068 float GetNegotiatedDimension( Dimension::Type dimension ) const;
1071 * @brief Set the padding for a dimension
1073 * @param[in] padding Padding for the dimension. X = start (e.g. left, bottom), y = end (e.g. right, top)
1074 * @param[in] dimension The dimension to set
1076 void SetPadding( const Vector2& padding, Dimension::Type dimension );
1079 * Return the value of padding for the given dimension
1081 * @param dimension The dimension to retrieve
1082 * @return Return the value of padding for the dimension
1084 Vector2 GetPadding( Dimension::Type dimension ) const;
1087 * Return the actor size for a given dimension
1089 * @param[in] dimension The dimension to retrieve the size for
1090 * @return Return the size for the given dimension
1092 float GetSize( Dimension::Type dimension ) const;
1095 * Return the natural size of the actor for a given dimension
1097 * @param[in] dimension The dimension to retrieve the size for
1098 * @return Return the natural size for the given dimension
1100 float GetNaturalSize( Dimension::Type dimension ) const;
1103 * @brief Return the amount of size allocated for relayout
1105 * May include padding
1107 * @param[in] dimension The dimension to retrieve
1108 * @return Return the size
1110 float GetRelayoutSize( Dimension::Type dimension ) const;
1113 * @brief If the size has been negotiated return that else return normal size
1115 * @param[in] dimension The dimension to retrieve
1116 * @return Return the size
1118 float GetLatestSize( Dimension::Type dimension ) const;
1121 * Apply the negotiated size to the actor
1123 * @param[in] container The container to fill with actors that require further relayout
1125 void SetNegotiatedSize( RelayoutContainer& container );
1128 * @brief Flag the actor as having it's layout dimension negotiated.
1130 * @param[in] negotiated The status of the flag to set.
1131 * @param[in] dimension The dimension to set the flag for
1133 void SetLayoutNegotiated( bool negotiated, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
1136 * @brief Test whether the layout dimension for this actor has been negotiated or not.
1138 * @param[in] dimension The dimension to determine the value of the flag for
1139 * @return Return if the layout dimension is negotiated or not.
1141 bool IsLayoutNegotiated( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) const;
1144 * @brief provides the Actor implementation of GetHeightForWidth
1145 * @param width to use.
1146 * @return the height based on the width.
1148 float GetHeightForWidthBase( float width );
1151 * @brief provides the Actor implementation of GetWidthForHeight
1152 * @param height to use.
1153 * @return the width based on the height.
1155 float GetWidthForHeightBase( float height );
1158 * @brief Calculate the size for a child
1160 * @param[in] child The child actor to calculate the size for
1161 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
1162 * @return Return the calculated size for the given dimension
1164 float CalculateChildSizeBase( const Dali::Actor& child, Dimension::Type dimension );
1167 * @brief Set the preferred size for size negotiation
1169 * @param[in] size The preferred size to set
1171 void SetPreferredSize( const Vector2& size );
1174 * @brief Return the preferred size used for size negotiation
1176 * @return Return the preferred size
1178 Vector2 GetPreferredSize() const;
1181 * @copydoc Dali::Actor::SetMinimumSize
1183 void SetMinimumSize( float size, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
1186 * @copydoc Dali::Actor::GetMinimumSize
1188 float GetMinimumSize( Dimension::Type dimension ) const;
1191 * @copydoc Dali::Actor::SetMaximumSize
1193 void SetMaximumSize( float size, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
1196 * @copydoc Dali::Actor::GetMaximumSize
1198 float GetMaximumSize( Dimension::Type dimension ) const;
1201 * @copydoc Dali::Actor::AddRenderer()
1203 unsigned int AddRenderer( Renderer& renderer );
1206 * @copydoc Dali::Actor::GetRendererCount()
1208 unsigned int GetRendererCount() const;
1211 * @copydoc Dali::Actor::GetRendererAt()
1213 Renderer& GetRendererAt( unsigned int index );
1216 * @copydoc Dali::Actor::RemoveRenderer()
1218 void RemoveRenderer( Renderer& renderer );
1221 * @copydoc Dali::Actor::RemoveRenderer()
1223 void RemoveRenderer( unsigned int index );
1228 * Converts screen coordinates into the actor's coordinate system.
1229 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1230 * @param[out] localX On return, the X-coordinate relative to the actor.
1231 * @param[out] localY On return, the Y-coordinate relative to the actor.
1232 * @param[in] screenX The screen X-coordinate.
1233 * @param[in] screenY The screen Y-coordinate.
1234 * @return True if the conversion succeeded.
1236 bool ScreenToLocal( float& localX, float& localY, float screenX, float screenY ) const;
1239 * Converts screen coordinates into the actor's coordinate system.
1240 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1241 * @param[in] renderTask The render-task used to display the actor.
1242 * @param[out] localX On return, the X-coordinate relative to the actor.
1243 * @param[out] localY On return, the Y-coordinate relative to the actor.
1244 * @param[in] screenX The screen X-coordinate.
1245 * @param[in] screenY The screen Y-coordinate.
1246 * @return True if the conversion succeeded.
1248 bool ScreenToLocal( RenderTask& renderTask, float& localX, float& localY, float screenX, float screenY ) const;
1251 * Converts from the actor's coordinate system to screen coordinates.
1252 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1253 * @param[in] viewMatrix The view-matrix
1254 * @param[in] projectionMatrix The projection-matrix
1255 * @param[in] viewport The view-port
1256 * @param[out] localX On return, the X-coordinate relative to the actor.
1257 * @param[out] localY On return, the Y-coordinate relative to the actor.
1258 * @param[in] screenX The screen X-coordinate.
1259 * @param[in] screenY The screen Y-coordinate.
1260 * @return True if the conversion succeeded.
1262 bool ScreenToLocal( const Matrix& viewMatrix,
1263 const Matrix& projectionMatrix,
1264 const Viewport& viewport,
1268 float screenY ) const;
1271 * Performs a ray-sphere test with the given pick-ray and the actor's bounding sphere.
1272 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1273 * @param[in] rayOrigin The ray origin in the world's reference system.
1274 * @param[in] rayDir The ray director vector in the world's reference system.
1275 * @return True if the ray intersects the actor's bounding sphere.
1277 bool RaySphereTest( const Vector4& rayOrigin, const Vector4& rayDir ) const;
1280 * Performs a ray-actor test with the given pick-ray and the actor's geometry.
1281 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1282 * @param[in] rayOrigin The ray origin in the world's reference system.
1283 * @param[in] rayDir The ray director vector in the world's reference system.
1284 * @param[out] hitPointLocal The hit point in the Actor's local reference system.
1285 * @param[out] distance The distance from the hit point to the camera.
1286 * @return True if the ray intersects the actor's geometry.
1288 bool RayActorTest( const Vector4& rayOrigin,
1289 const Vector4& rayDir,
1290 Vector4& hitPointLocal,
1291 float& distance ) const;
1294 * Sets whether the actor should receive a notification when touch or hover motion events leave
1295 * the boundary of the actor.
1297 * @note By default, this is set to false as most actors do not require this.
1298 * @note Need to connect to the SignalTouch or SignalHover to actually receive this event.
1300 * @param[in] required Should be set to true if a Leave event is required
1302 void SetLeaveRequired( bool required );
1305 * This returns whether the actor requires touch or hover events whenever touch or hover motion events leave
1306 * the boundary of the actor.
1307 * @return true if a Leave event is required, false otherwise.
1309 bool GetLeaveRequired() const;
1312 * @copydoc Dali::Actor::SetKeyboardFocusable()
1314 void SetKeyboardFocusable( bool focusable );
1317 * @copydoc Dali::Actor::IsKeyboardFocusable()
1319 bool IsKeyboardFocusable() const;
1322 * Query whether the application or derived actor type requires touch events.
1323 * @return True if touch events are required.
1325 bool GetTouchRequired() const;
1328 * Query whether the application or derived actor type requires hover events.
1329 * @return True if hover events are required.
1331 bool GetHoverRequired() const;
1334 * Query whether the application or derived actor type requires wheel events.
1335 * @return True if wheel events are required.
1337 bool GetWheelEventRequired() const;
1340 * Query whether the actor is actually hittable. This method checks whether the actor is
1341 * sensitive, has the visibility flag set to true and is not fully transparent.
1342 * @return true, if it can be hit, false otherwise.
1344 bool IsHittable() const;
1349 * Retrieve the gesture data associated with this actor. The first call to this method will
1350 * allocate space for the ActorGestureData so this should only be called if an actor really does
1352 * @return Reference to the ActorGestureData for this actor.
1353 * @note Once the gesture-data is created for an actor it is likely that gestures are required
1354 * throughout the actor's lifetime so it will only be deleted when the actor is destroyed.
1356 ActorGestureData& GetGestureData();
1359 * Queries whether the actor requires the gesture type.
1360 * @param[in] type The gesture type.
1362 bool IsGestureRequred( Gesture::Type type ) const;
1367 * Used by the EventProcessor to emit touch event signals.
1368 * @param[in] event The touch event.
1369 * @return True if the event was consumed.
1371 bool EmitTouchEventSignal( const TouchEvent& event );
1374 * Used by the EventProcessor to emit hover event signals.
1375 * @param[in] event The hover event.
1376 * @return True if the event was consumed.
1378 bool EmitHoverEventSignal( const HoverEvent& event );
1381 * Used by the EventProcessor to emit wheel event signals.
1382 * @param[in] event The wheel event.
1383 * @return True if the event was consumed.
1385 bool EmitWheelEventSignal( const WheelEvent& event );
1388 * @copydoc Dali::Actor::TouchedSignal()
1390 Dali::Actor::TouchSignalType& TouchedSignal();
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 property is animated.
1456 * @param[in] animation The animation that resized the actor
1457 * @param[in] targetSize The new target size of the actor
1459 void NotifySizeAnimation( Animation& animation, float targetSize, Property::Index property );
1462 * For use in derived classes.
1463 * This should only be called by Animation, when the actor is resized using Animation::Resize().
1465 virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize )
1473 BASIC, RENDERABLE, LAYER, ROOT_LAYER
1477 * Protected Constructor. See Actor::New().
1478 * The second-phase construction Initialize() member should be called immediately after this.
1479 * @param[in] derivedType The derived type of actor (if any).
1481 Actor( DerivedType derivedType );
1484 * Second-phase constructor. Must be called immediately after creating a new Actor;
1486 void Initialize( void );
1489 * A reference counted object may only be deleted by calling Unreference()
1494 * Called on a child during Add() when the parent actor is connected to the Stage.
1495 * @param[in] stage The stage.
1496 * @param[in] parentDepth The depth of the parent in the hierarchy
1497 * @param[in] index If set, it is only used for positioning the actor within the parent's child list.
1499 void ConnectToStage( unsigned int parentDepth, int index = -1 );
1502 * Helper for ConnectToStage, to recursively connect a tree of actors.
1503 * This is atomic i.e. not interrupted by user callbacks.
1504 * @param[in] index If set, it is only used for positioning the actor within the parent's child list.
1505 * @param[in] depth The depth in the hierarchy of the actor
1506 * @param[out] connectionList On return, the list of connected actors which require notification.
1508 void RecursiveConnectToStage( ActorContainer& connectionList, unsigned int depth, int index = -1 );
1511 * Connect the Node associated with this Actor to the scene-graph.
1512 * @param[in] index If set, it is only used for positioning the actor within the parent's child list.
1514 void ConnectToSceneGraph( int index = -1 );
1517 * Helper for ConnectToStage, to notify a connected actor through the public API.
1519 void NotifyStageConnection();
1522 * Called on a child during Remove() when the actor was previously on the Stage.
1524 void DisconnectFromStage();
1527 * Helper for DisconnectFromStage, to recursively disconnect a tree of actors.
1528 * This is atomic i.e. not interrupted by user callbacks.
1529 * @param[out] disconnectionList On return, the list of disconnected actors which require notification.
1531 void RecursiveDisconnectFromStage( ActorContainer& disconnectionList );
1534 * Disconnect the Node associated with this Actor from the scene-graph.
1536 void DisconnectFromSceneGraph();
1539 * Helper for DisconnectFromStage, to notify a disconnected actor through the public API.
1541 void NotifyStageDisconnection();
1544 * When the Actor is OnStage, checks whether the corresponding Node is connected to the scene graph.
1545 * @return True if the Actor is OnStage & has a Node connected to the scene graph.
1547 bool IsNodeConnected() const;
1550 * Calculate the size of the z dimension for a 2D size
1552 * @param[in] size The 2D size (X, Y) to calculate Z from
1554 * @return Return the Z dimension for this size
1556 float CalculateSizeZ( const Vector2& size ) const;
1559 // Default property extensions from Object
1562 * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
1564 virtual unsigned int GetDefaultPropertyCount() const;
1567 * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
1569 virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
1572 * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
1574 virtual const char* GetDefaultPropertyName( Property::Index index ) const;
1577 * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
1579 virtual Property::Index GetDefaultPropertyIndex( const std::string& name ) const;
1582 * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
1584 virtual bool IsDefaultPropertyWritable( Property::Index index ) const;
1587 * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
1589 virtual bool IsDefaultPropertyAnimatable( Property::Index index ) const;
1592 * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
1594 virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
1597 * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
1599 virtual Property::Type GetDefaultPropertyType( Property::Index index ) const;
1602 * @copydoc Dali::Internal::Object::SetDefaultProperty()
1604 virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue );
1607 * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
1609 virtual void SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value );
1612 * @copydoc Dali::Internal::Object::GetDefaultProperty()
1614 virtual Property::Value GetDefaultProperty( Property::Index index ) const;
1617 * @copydoc Dali::Internal::Object::GetPropertyOwner()
1619 virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
1622 * @copydoc Dali::Internal::Object::GetSceneObject()
1624 virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
1627 * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
1629 virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
1632 * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
1634 virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
1637 * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
1639 virtual int GetPropertyComponentIndex( Property::Index index ) const;
1647 Actor( const Actor& );
1650 Actor& operator=( const Actor& rhs );
1653 * Set the actors parent.
1654 * @param[in] parent The new parent.
1655 * @param[in] index If set, it is only used for positioning the actor within the parent's child list.
1657 void SetParent( Actor* parent, int index = -1 );
1660 * Helper to create a Node for this Actor.
1661 * To be overriden in derived classes.
1662 * @return A newly allocated node.
1664 virtual SceneGraph::Node* CreateNode() const;
1667 * For use in derived classes, called after Initialize()
1669 virtual void OnInitialize()
1674 * For use in internal derived classes.
1675 * This is called during ConnectToStage(), after the actor has finished adding its node to the scene-graph.
1676 * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1678 virtual void OnStageConnectionInternal()
1683 * For use in internal derived classes.
1684 * This is called during DisconnectFromStage(), before the actor removes its node from the scene-graph.
1685 * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1687 virtual void OnStageDisconnectionInternal()
1692 * For use in external (CustomActor) derived classes.
1693 * This is called after the atomic ConnectToStage() traversal has been completed.
1695 virtual void OnStageConnectionExternal( int depth )
1700 * For use in external (CustomActor) derived classes.
1701 * This is called after the atomic DisconnectFromStage() traversal has been completed.
1703 virtual void OnStageDisconnectionExternal()
1708 * For use in derived classes; this is called after Add() has added a child.
1709 * @param[in] child The child that was added.
1711 virtual void OnChildAdd( Actor& child )
1716 * For use in derived classes; this is called after Remove() has removed a child.
1717 * @param[in] child The child that was removed.
1719 virtual void OnChildRemove( Actor& child )
1724 * For use in derived classes.
1725 * This is called after SizeSet() has been called.
1727 virtual void OnSizeSet( const Vector3& targetSize )
1732 * For use in derived classes.
1733 * This is only called if mDerivedRequiresTouch is true, and the touch-signal was not consumed.
1734 * @param[in] event The touch event.
1735 * @return True if the event should be consumed.
1737 virtual bool OnTouchEvent( const TouchEvent& event )
1743 * For use in derived classes.
1744 * This is only called if mDerivedRequiresHover is true, and the hover-signal was not consumed.
1745 * @param[in] event The hover event.
1746 * @return True if the event should be consumed.
1748 virtual bool OnHoverEvent( const HoverEvent& event )
1754 * For use in derived classes.
1755 * This is only called if the wheel signal was not consumed.
1756 * @param[in] event The wheel event.
1757 * @return True if the event should be consumed.
1759 virtual bool OnWheelEvent( const WheelEvent& event )
1765 * @brief Ensure the relayout data is allocated
1767 void EnsureRelayoutData();
1770 * @brief Apply the size set policy to the input size
1772 * @param[in] size The size to apply the policy to
1773 * @return Return the adjusted size
1775 Vector2 ApplySizeSetPolicy( const Vector2 size );
1779 Actor* mParent; ///< Each actor (except the root) can have one parent
1780 ActorContainer* mChildren; ///< Container of referenced actors
1781 const SceneGraph::Node* mNode; ///< Not owned
1782 Vector3* mParentOrigin; ///< NULL means ParentOrigin::DEFAULT. ParentOrigin is non-animatable
1783 Vector3* mAnchorPoint; ///< NULL means AnchorPoint::DEFAULT. AnchorPoint is non-animatable
1785 struct RelayoutData;
1786 RelayoutData* mRelayoutData; ///< Struct to hold optional collection of relayout variables
1788 ActorGestureData* mGestureData; ///< Optional Gesture data. Only created when actor requires gestures
1790 ActorAttachmentPtr mAttachment; ///< Optional referenced attachment
1793 Dali::Actor::TouchSignalType mTouchedSignal;
1794 Dali::Actor::HoverSignalType mHoveredSignal;
1795 Dali::Actor::WheelEventSignalType mWheelEventSignal;
1796 Dali::Actor::OnStageSignalType mOnStageSignal;
1797 Dali::Actor::OffStageSignalType mOffStageSignal;
1798 Dali::Actor::OnRelayoutSignalType mOnRelayoutSignal;
1800 Vector3 mTargetSize; ///< Event-side storage for size (not a pointer as most actors will have a size)
1801 Vector3 mTargetPosition; ///< Event-side storage for position (not a pointer as most actors will have a position)
1803 std::string mName; ///< Name of the actor
1804 unsigned int mId; ///< A unique ID to identify the actor starting from 1, and 0 is reserved
1806 unsigned short mDepth :12; ///< Cached: The depth in the hierarchy of the actor. Only 4096 levels of depth are supported
1807 const bool mIsRoot : 1; ///< Flag to identify the root actor
1808 const bool mIsRenderable : 1; ///< Flag to identify that this is a renderable actor
1809 const bool mIsLayer : 1; ///< Flag to identify that this is a layer
1810 bool mIsOnStage : 1; ///< Flag to identify whether the actor is on-stage
1811 bool mSensitive : 1; ///< Whether the actor emits touch event signals
1812 bool mLeaveRequired : 1; ///< Whether a touch event signal is emitted when the a touch leaves the actor's bounds
1813 bool mKeyboardFocusable : 1; ///< Whether the actor should be focusable by keyboard navigation
1814 bool mDerivedRequiresTouch : 1; ///< Whether the derived actor type requires touch event signals
1815 bool mDerivedRequiresHover : 1; ///< Whether the derived actor type requires hover event signals
1816 bool mDerivedRequiresWheelEvent : 1; ///< Whether the derived actor type requires wheel event signals
1817 bool mOnStageSignalled : 1; ///< Set to true before OnStageConnection signal is emitted, and false before OnStageDisconnection
1818 bool mInsideOnSizeSet : 1; ///< Whether we are inside OnSizeSet
1819 bool mInheritOrientation : 1; ///< Cached: Whether the parent's orientation should be inherited.
1820 bool mInheritScale : 1; ///< Cached: Whether the parent's scale should be inherited.
1821 DrawMode::Type mDrawMode : 2; ///< Cached: How the actor and its children should be drawn
1822 PositionInheritanceMode mPositionInheritanceMode : 2; ///< Cached: Determines how position is inherited
1823 ColorMode mColorMode : 2; ///< Cached: Determines whether mWorldColor is inherited
1827 static ActorContainer mNullChildren; ///< Empty container (shared by all actors, returned by GetChildren() const)
1828 static unsigned int mActorCounter; ///< A counter to track the actor instance creation
1832 } // namespace Internal
1834 // Helpers for public-api forwarding methods
1836 inline Internal::Actor& GetImplementation( Dali::Actor& actor )
1838 DALI_ASSERT_ALWAYS( actor && "Actor handle is empty" );
1840 BaseObject& handle = actor.GetBaseObject();
1842 return static_cast< Internal::Actor& >( handle );
1845 inline const Internal::Actor& GetImplementation( const Dali::Actor& actor )
1847 DALI_ASSERT_ALWAYS( actor && "Actor handle is empty" );
1849 const BaseObject& handle = actor.GetBaseObject();
1851 return static_cast< const Internal::Actor& >( handle );
1856 #endif // __DALI_INTERNAL_ACTOR_H__