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;
60 typedef std::vector< RendererPtr > RendererContainer;
61 typedef RendererContainer::iterator RendererIter;
64 * Actor is the primary object which Dali applications interact with.
65 * UI controls can be built by combining multiple actors.
66 * Multi-Touch events are received through signals emitted by the actor tree.
68 * An Actor is a proxy for a Node in the scene graph.
69 * When an Actor is added to the Stage, it creates a node and attaches it to the scene graph.
70 * The scene-graph can be updated in a separate thread, so the attachment is done using an asynchronous message.
71 * When a tree of Actors is detached from the Stage, a message is sent to destroy the associated nodes.
73 class Actor : public Object
78 * @brief Struct to hold an actor and a dimension
80 struct ActorDimensionPair
85 * @param[in] newActor The actor to assign
86 * @param[in] newDimension The dimension to assign
88 ActorDimensionPair( Actor* newActor, Dimension::Type newDimension )
90 dimension( newDimension )
95 * @brief Equality operator
97 * @param[in] lhs The left hand side argument
98 * @param[in] rhs The right hand side argument
100 bool operator== ( const ActorDimensionPair& rhs )
102 return ( actor == rhs.actor ) && ( dimension == rhs.dimension );
105 Actor* actor; ///< The actor to hold
106 Dimension::Type dimension; ///< The dimension to hold
109 typedef std::vector< ActorDimensionPair > ActorDimensionStack;
114 * Create a new actor.
115 * @return A smart-pointer to the newly allocated Actor.
117 static ActorPtr New();
120 * Retrieve the name of the actor.
123 const std::string& GetName() const;
126 * Set the name of the actor.
127 * @param[in] name The new name.
129 void SetName( const std::string& name );
132 * @copydoc Dali::Actor::GetId
134 unsigned int GetId() const;
139 * Attach an object to an actor.
140 * @pre The actor does not already have an attachment.
141 * @param[in] attachment The object to attach.
143 void Attach( ActorAttachment& attachment );
146 * Retreive the object attached to an actor.
147 * @return The attachment.
149 ActorAttachmentPtr GetAttachment();
154 * Query whether an actor is the root actor, which is owned by the Stage.
155 * @return True if the actor is a root actor.
163 * Query whether the actor is connected to the Stage.
165 bool OnStage() const;
168 * Query whether the actor is a RenderableActor derived type.
169 * @return True if the actor is renderable.
171 bool IsRenderable() const
173 // inlined as this is called a lot in hit testing
174 return mIsRenderable;
178 * Query whether the actor is of class Dali::Layer
179 * @return True if the actor is a layer.
183 // inlined as this is called a lot in hit testing
188 * Gets the layer in which the actor is present
189 * @return The layer, which will be uninitialized if the actor is off-stage.
191 Dali::Layer GetLayer();
194 * Adds a child Actor to this Actor.
195 * @pre The child actor is not the same as the parent actor.
196 * @pre The child actor does not already have a parent.
197 * @param [in] child The child.
198 * @post The child will be referenced by its parent.
200 void Add( Actor& child );
203 * Removes a child Actor from this Actor.
204 * @param [in] child The child.
205 * @post The child will be unreferenced.
207 void Remove( Actor& child );
210 * @copydoc Dali::Actor::Unparent
215 * Retrieve the number of children held by the actor.
216 * @return The number of children
218 unsigned int GetChildCount() const;
221 * @copydoc Dali::Actor::GetChildAt
223 ActorPtr GetChildAt( unsigned int index ) const;
226 * Retrieve a reference to Actor's children.
227 * @note Not for public use.
228 * @return A reference to the container of children.
230 ActorContainer& GetChildrenInternal()
236 * @copydoc Dali::Actor::FindChildByName
238 ActorPtr FindChildByName( const std::string& actorName );
241 * @copydoc Dali::Actor::FindChildById
243 ActorPtr FindChildById( const unsigned int id );
246 * Retrieve the parent of an Actor.
247 * @return The parent actor, or NULL if the Actor does not have a parent.
249 Actor* GetParent() const
255 * Sets the size of an actor.
256 * ActorAttachments attached to the actor, can be scaled to fit within this area.
257 * This does not interfere with the actors scale factor.
258 * @param [in] width The new width.
259 * @param [in] height The new height.
261 void SetSize( float width, float height );
264 * Sets the size of an actor.
265 * ActorAttachments attached to the actor, can be scaled to fit within this area.
266 * This does not interfere with the actors scale factor.
267 * @param [in] width The size of the actor along the x-axis.
268 * @param [in] height The size of the actor along the y-axis.
269 * @param [in] depth The size of the actor along the z-axis.
271 void SetSize( float width, float height, float depth );
274 * Sets the size of an actor.
275 * ActorAttachments attached to the actor, can be scaled to fit within this area.
276 * This does not interfere with the actors scale factor.
277 * @param [in] size The new size.
279 void SetSize( const Vector2& size );
282 * Sets the update size for an actor.
284 * @param[in] size The size to set.
286 void SetSizeInternal( const Vector2& size );
289 * Sets the size of an actor.
290 * ActorAttachments attached to the actor, can be scaled to fit within this area.
291 * This does not interfere with the actors scale factor.
292 * @param [in] size The new size.
294 void SetSize( const Vector3& size );
297 * Sets the update size for an actor.
299 * @param[in] size The size to set.
301 void SetSizeInternal( const Vector3& size );
304 * Set the width component of the Actor's size.
305 * @param [in] width The new width component.
307 void SetWidth( float width );
310 * Set the height component of the Actor's size.
311 * @param [in] height The new height component.
313 void SetHeight( float height );
316 * Set the depth component of the Actor's size.
317 * @param [in] depth The new depth component.
319 void SetDepth( float depth );
322 * Retrieve the Actor's size from event side.
323 * This size will be the size set or if animating then the target size.
324 * @return The Actor's size.
326 const Vector3& GetTargetSize() const;
329 * Retrieve the Actor's size from update side.
330 * This size will be the size set or animating but will be a frame behind.
331 * @return The Actor's size.
333 const Vector3& GetCurrentSize() const;
336 * Return the natural size of the actor
338 * @return The actor's natural size
340 virtual Vector3 GetNaturalSize() const;
343 * Set the origin of an actor, within its parent's area.
344 * This is expressed in 2D unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent,
345 * and (1.0, 1.0, 0.5) is the bottom-right corner.
346 * The default parent-origin is top-left (0.0, 0.0, 0.5).
347 * An actor position is the distance between this origin, and the actors anchor-point.
348 * @param [in] origin The new parent-origin.
350 void SetParentOrigin( const Vector3& origin );
353 * Set the x component of the parent-origin
354 * @param [in] x The new x value.
356 void SetParentOriginX( float x );
359 * Set the y component of the parent-origin
360 * @param [in] y The new y value.
362 void SetParentOriginY( float y );
365 * Set the z component of the parent-origin
366 * @param [in] z The new z value.
368 void SetParentOriginZ( float z );
371 * Retrieve the parent-origin of an actor.
372 * @return The parent-origin.
374 const Vector3& GetCurrentParentOrigin() const;
377 * Set the anchor-point of an actor. This is expressed in 2D unit coordinates, such that
378 * (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.
379 * The default anchor point is top-left (0.0, 0.0, 0.5).
380 * An actor position is the distance between its parent-origin, and this anchor-point.
381 * An actor's rotation is centered around its anchor-point.
382 * @param [in] anchorPoint The new anchor-point.
384 void SetAnchorPoint( const Vector3& anchorPoint );
387 * Set the x component of the anchor-point.
388 * @param [in] x The new x value.
390 void SetAnchorPointX( float x );
393 * Set the y component of the anchor-point.
394 * @param [in] y The new y value.
396 void SetAnchorPointY( float y );
399 * Set the z component of the anchor-point.
400 * @param [in] z The new z value.
402 void SetAnchorPointZ( float z );
405 * Retrieve the anchor-point of an actor.
406 * @return The anchor-point.
408 const Vector3& GetCurrentAnchorPoint() const;
411 * Sets the position of the Actor.
412 * The coordinates are relative to the Actor's parent.
413 * The Actor's z position will be set to 0.0f.
414 * @param [in] x The new x position
415 * @param [in] y The new y position
417 void SetPosition( float x, float y );
420 * Sets the position of the Actor.
421 * The coordinates are relative to the Actor's parent.
422 * @param [in] x The new x position
423 * @param [in] y The new y position
424 * @param [in] z The new z position
426 void SetPosition( float x, float y, float z );
429 * Sets the position of the Actor.
430 * The coordinates are relative to the Actor's parent.
431 * @param [in] position The new position.
433 void SetPosition( const Vector3& position );
436 * Set the position of an actor along the X-axis.
437 * @param [in] x The new x position
439 void SetX( float x );
442 * Set the position of an actor along the Y-axis.
443 * @param [in] y The new y position.
445 void SetY( float y );
448 * Set the position of an actor along the Z-axis.
449 * @param [in] z The new z position
451 void SetZ( float z );
454 * Translate an actor relative to its existing position.
455 * @param[in] distance The actor will move by this distance.
457 void TranslateBy( const Vector3& distance );
460 * Retrieve the position of the Actor.
461 * The coordinates are relative to the Actor's parent.
462 * @return the Actor's position.
464 const Vector3& GetCurrentPosition() const;
467 * Retrieve the target position of the Actor.
468 * The coordinates are relative to the Actor's parent.
469 * @return the Actor's position.
471 const Vector3& GetTargetPosition() const;
474 * @copydoc Dali::Actor::GetCurrentWorldPosition()
476 const Vector3& GetCurrentWorldPosition() const;
479 * @copydoc Dali::Actor::SetPositionInheritanceMode()
481 void SetPositionInheritanceMode( PositionInheritanceMode mode );
484 * @copydoc Dali::Actor::GetPositionInheritanceMode()
486 PositionInheritanceMode GetPositionInheritanceMode() const;
489 * Sets the orientation of the Actor.
490 * @param [in] angleRadians The new orientation angle in radians.
491 * @param [in] axis The new axis of orientation.
493 void SetOrientation( const Radian& angleRadians, const Vector3& axis );
496 * Sets the orientation of the Actor.
497 * @param [in] orientation The new orientation.
499 void SetOrientation( const Quaternion& orientation );
502 * Rotate an actor around its existing rotation axis.
503 * @param[in] angleRadians The angle to the rotation to combine with the existing rotation.
504 * @param[in] axis The axis of the rotation to combine with the existing rotation.
506 void RotateBy( const Radian& angleRadians, const Vector3& axis );
509 * Apply a relative rotation to an actor.
510 * @param[in] relativeRotation The rotation to combine with the actors existing rotation.
512 void RotateBy( const Quaternion& relativeRotation );
515 * Retreive the Actor's orientation.
516 * @return the orientation.
518 const Quaternion& GetCurrentOrientation() const;
521 * Set whether a child actor inherits it's parent's orientation. Default is to inherit.
522 * Switching this off means that using SetOrientation() sets the actor's world orientation.
523 * @param[in] inherit - true if the actor should inherit orientation, false otherwise.
525 void SetInheritOrientation( bool inherit );
528 * Returns whether the actor inherit's it's parent's orientation.
529 * @return true if the actor inherit's it's parent orientation, false if it uses world orientation.
531 bool IsOrientationInherited() const;
534 * Sets the factor of the parents size used for the child actor.
535 * Note: Only used if ResizePolicy is ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
536 * @param[in] factor The vector to multiply the parents size by to get the childs size.
538 void SetSizeModeFactor( const Vector3& factor );
541 * Gets the factor of the parents size used for the child actor.
542 * Note: Only used if ResizePolicy is ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
543 * @return The vector being used to multiply the parents size by to get the childs size.
545 const Vector3& GetSizeModeFactor() const;
548 * @copydoc Dali::Actor::GetCurrentWorldOrientation()
550 const Quaternion& GetCurrentWorldOrientation() const;
553 * Sets a scale factor applied to an actor.
554 * @param [in] scale The scale factor applied on all axes.
556 void SetScale( float scale );
559 * Sets a scale factor applied to an actor.
560 * @param [in] scaleX The scale factor applied along the x-axis.
561 * @param [in] scaleY The scale factor applied along the y-axis.
562 * @param [in] scaleZ The scale factor applied along the z-axis.
564 void SetScale( float scaleX, float scaleY, float scaleZ );
567 * Sets a scale factor applied to an actor.
568 * @param [in] scale A vector representing the scale factor for each axis.
570 void SetScale( const Vector3& scale );
573 * Set the x component of the scale factor.
574 * @param [in] x The new x value.
576 void SetScaleX( float x );
579 * Set the y component of the scale factor.
580 * @param [in] y The new y value.
582 void SetScaleY( float y );
585 * Set the z component of the scale factor.
586 * @param [in] z The new z value.
588 void SetScaleZ( float z );
591 * Apply a relative scale to an actor.
592 * @param[in] relativeScale The scale to combine with the actors existing scale.
594 void ScaleBy( const Vector3& relativeScale );
597 * Retrieve the scale factor applied to an actor.
598 * @return A vector representing the scale factor for each axis.
600 const Vector3& GetCurrentScale() const;
603 * @copydoc Dali::Actor::GetCurrentWorldScale()
605 const Vector3& GetCurrentWorldScale() const;
608 * @copydoc Dali::Actor::SetInheritScale()
610 void SetInheritScale( bool inherit );
613 * @copydoc Dali::Actor::IsScaleInherited()
615 bool IsScaleInherited() const;
618 * @copydoc Dali::Actor::GetCurrentWorldMatrix()
620 Matrix GetCurrentWorldMatrix() const;
625 * Sets the visibility flag of an actor.
626 * @param [in] visible The new visibility flag.
628 void SetVisible( bool visible );
631 * Retrieve the visibility flag of an actor.
632 * @return The visibility flag.
634 bool IsVisible() const;
637 * Sets the opacity of an actor.
638 * @param [in] opacity The new opacity.
640 void SetOpacity( float opacity );
643 * Retrieve the actor's opacity.
644 * @return The actor's opacity.
646 float GetCurrentOpacity() const;
649 * Sets whether an actor should emit touch or hover signals; see SignalTouch() and SignalHover().
650 * An actor is sensitive by default, which means that as soon as an application connects to the SignalTouch(),
651 * the touch event signal will be emitted, and as soon as an application connects to the SignalHover(), the
652 * hover event signal will be emitted.
654 * If the application wishes to temporarily disable the touch or hover event signal emission, then they can do so by calling:
656 * actor.SetSensitive(false);
659 * Then, to re-enable the touch or hover event signal emission, the application should call:
661 * actor.SetSensitive(true);
664 * @see SignalTouch() and SignalHover().
665 * @note If an actor's sensitivity is set to false, then it's children will not emit a touch or hover event signal either.
666 * @param[in] sensitive true to enable emission of the touch or hover event signals, false otherwise.
668 void SetSensitive( bool sensitive )
670 mSensitive = sensitive;
674 * Query whether an actor emits touch or hover event signals.
675 * @see SetSensitive(bool)
676 * @return true, if emission of touch or hover event signals is enabled, false otherwise.
678 bool IsSensitive() const
684 * @copydoc Dali::Actor::SetDrawMode
686 void SetDrawMode( DrawMode::Type drawMode );
689 * @copydoc Dali::Actor::GetDrawMode
691 DrawMode::Type GetDrawMode() const;
694 * @copydoc Dali::Actor::SetOverlay
696 void SetOverlay( bool enable );
699 * @copydoc Dali::Actor::IsOverlay
701 bool IsOverlay() const;
704 * Sets the actor's color. The final color of actor depends on its color mode.
705 * This final color is applied to the drawable elements of an actor.
706 * @param [in] color The new color.
708 void SetColor( const Vector4& color );
711 * Set the red component of the color.
712 * @param [in] red The new red component.
714 void SetColorRed( float red );
717 * Set the green component of the color.
718 * @param [in] green The new green component.
720 void SetColorGreen( float green );
723 * Set the blue component of the scale factor.
724 * @param [in] blue The new blue value.
726 void SetColorBlue( float blue );
729 * Retrieve the actor's color.
732 const Vector4& GetCurrentColor() const;
735 * Sets the actor's color mode.
736 * Color mode specifies whether Actor uses its own color or inherits its parent color
737 * @param [in] colorMode to use.
739 void SetColorMode( ColorMode colorMode );
742 * Returns the actor's color mode.
743 * @return currently used colorMode.
745 ColorMode GetColorMode() const;
748 * @copydoc Dali::Actor::GetCurrentWorldColor()
750 const Vector4& GetCurrentWorldColor() const;
753 * @copydoc Dali::Actor::GetHierarchyDepth()
755 int GetHierarchyDepth() const
759 return static_cast<int>(mDepth);
767 // Size negotiation virtual functions
770 * @brief Called after the size negotiation has been finished for this control.
772 * The control is expected to assign this given size to itself/its children.
774 * Should be overridden by derived classes if they need to layout
775 * actors differently after certain operations like add or remove
776 * actors, resize or after changing specific properties.
778 * Note! As this function is called from inside the size negotiation algorithm, you cannot
779 * call RequestRelayout (the call would just be ignored)
781 * @param[in] size The allocated size.
782 * @param[in,out] container The control should add actors to this container that it is not able
783 * to allocate a size for.
785 virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
790 * @brief Notification for deriving classes when the resize policy is set
792 * @param[in] policy The policy being set
793 * @param[in] dimension The dimension the policy is being set for
795 virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ) {}
798 * @brief Virtual method to notify deriving classes that relayout dependencies have been
799 * met and the size for this object is about to be calculated for the given dimension
801 * @param dimension The dimension that is about to be calculated
803 virtual void OnCalculateRelayoutSize( Dimension::Type dimension );
806 * @brief Virtual method to notify deriving classes that the size for a dimension
807 * has just been negotiated
809 * @param[in] size The new size for the given dimension
810 * @param[in] dimension The dimension that was just negotiated
812 virtual void OnLayoutNegotiated( float size, Dimension::Type dimension );
815 * @brief Determine if this actor is dependent on it's children for relayout
817 * @param dimension The dimension(s) to check for
818 * @return Return if the actor is dependent on it's children
820 virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
823 * @brief Determine if this actor is dependent on it's children for relayout.
825 * Called from deriving classes
827 * @param dimension The dimension(s) to check for
828 * @return Return if the actor is dependent on it's children
830 virtual bool RelayoutDependentOnChildrenBase( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
833 * @brief Calculate the size for a child
835 * @param[in] child The child actor to calculate the size for
836 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
837 * @return Return the calculated size for the given dimension
839 virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension );
842 * @brief This method is called during size negotiation when a height is required for a given width.
844 * Derived classes should override this if they wish to customize the height returned.
846 * @param width to use.
847 * @return the height based on the width.
849 virtual float GetHeightForWidth( float width );
852 * @brief This method is called during size negotiation when a width is required for a given height.
854 * Derived classes should override this if they wish to customize the width returned.
856 * @param height to use.
857 * @return the width based on the width.
859 virtual float GetWidthForHeight( float height );
866 * @brief Called by the RelayoutController to negotiate the size of an actor.
868 * The size allocated by the the algorithm is passed in which the
869 * actor must adhere to. A container is passed in as well which
870 * the actor should populate with actors it has not / or does not
871 * need to handle in its size negotiation.
873 * @param[in] size The allocated size.
874 * @param[in,out] container The container that holds actors that are fed back into the
875 * RelayoutController algorithm.
877 void NegotiateSize( const Vector2& size, RelayoutContainer& container );
880 * @copydoc Dali::Actor::SetResizePolicy()
882 void SetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
885 * @copydoc Dali::Actor::GetResizePolicy()
887 ResizePolicy::Type GetResizePolicy( Dimension::Type dimension ) const;
890 * @copydoc Dali::Actor::SetSizeScalePolicy()
892 void SetSizeScalePolicy( SizeScalePolicy::Type policy );
895 * @copydoc Dali::Actor::GetSizeScalePolicy()
897 SizeScalePolicy::Type GetSizeScalePolicy() const;
900 * @copydoc Dali::Actor::SetDimensionDependency()
902 void SetDimensionDependency( Dimension::Type dimension, Dimension::Type dependency );
905 * @copydoc Dali::Actor::GetDimensionDependency()
907 Dimension::Type GetDimensionDependency( Dimension::Type dimension ) const;
910 * @brief Set the size negotiation relayout enabled on this actor
912 * @param[in] relayoutEnabled Boolean to enable or disable relayout
914 void SetRelayoutEnabled( bool relayoutEnabled );
917 * @brief Return if relayout is enabled
919 * @return Return if relayout is enabled or not for this actor
921 bool IsRelayoutEnabled() const;
924 * @brief Mark an actor as having it's layout dirty
926 * @param dirty Whether to mark actor as dirty or not
927 * @param dimension The dimension(s) to mark as dirty
929 void SetLayoutDirty( bool dirty, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
932 * @brief Return if any of an actor's dimensions are marked as dirty
934 * @param dimension The dimension(s) to check
935 * @return Return if any of the requested dimensions are dirty
937 bool IsLayoutDirty( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) const;
940 * @brief Returns if relayout is enabled and the actor is not dirty
942 * @return Return if it is possible to relayout the actor
944 bool RelayoutPossible( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) const;
947 * @brief Returns if relayout is enabled and the actor is dirty
949 * @return Return if it is required to relayout the actor
951 bool RelayoutRequired( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) const;
954 * @brief Request a relayout, which means performing a size negotiation on this actor, its parent and children (and potentially whole scene)
956 * This method is automatically called from OnStageConnection(), OnChildAdd(),
957 * OnChildRemove(), SetSizePolicy(), SetMinimumSize() and SetMaximumSize().
959 * This method can also be called from a derived class every time it needs a different size.
960 * At the end of event processing, the relayout process starts and
961 * all controls which requested Relayout will have their sizes (re)negotiated.
963 * @note RelayoutRequest() can be called multiple times; the size negotiation is still
964 * only performed once, i.e. there is no need to keep track of this in the calling side.
966 void RelayoutRequest( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
969 * @brief Determine if this actor is dependent on it's parent for relayout
971 * @param dimension The dimension(s) to check for
972 * @return Return if the actor is dependent on it's parent
974 bool RelayoutDependentOnParent( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
977 * @brief Determine if this actor has another dimension depedent on the specified one
979 * @param dimension The dimension to check for
980 * @param dependentDimension The dimension to check for dependency with
981 * @return Return if the actor is dependent on this dimension
983 bool RelayoutDependentOnDimension( Dimension::Type dimension, Dimension::Type dependentDimension );
986 * Negotiate sizes for a control in all dimensions
988 * @param[in] allocatedSize The size constraint that the control must respect
990 void NegotiateDimensions( const Vector2& allocatedSize );
993 * Negotiate size for a specific dimension
995 * The algorithm adopts a recursive dependency checking approach. Meaning, that wherever dependencies
996 * are found, e.g. an actor dependent on its parent, the dependency will be calculated first with NegotiatedDimension and
997 * LayoutDimensionNegotiated flags being filled in on the actor.
999 * @post All actors that exist in the dependency chain connected to the given actor will have had their NegotiatedDimensions
1000 * calculated and set as well as the LayoutDimensionNegotiated flags.
1002 * @param[in] dimension The dimension to negotiate on
1003 * @param[in] allocatedSize The size constraint that the actor must respect
1005 void NegotiateDimension( Dimension::Type dimension, const Vector2& allocatedSize, ActorDimensionStack& recursionStack );
1008 * @brief Calculate the size of a dimension
1010 * @param[in] dimension The dimension to calculate the size for
1011 * @param[in] maximumSize The upper bounds on the size
1012 * @return Return the calculated size for the dimension
1014 float CalculateSize( Dimension::Type dimension, const Vector2& maximumSize );
1017 * @brief Clamp a dimension given the relayout constraints on this actor
1019 * @param[in] size The size to constrain
1020 * @param[in] dimension The dimension the size exists in
1021 * @return Return the clamped size
1023 float ClampDimension( float size, Dimension::Type dimension );
1026 * Negotiate a dimension based on the size of the parent
1028 * @param[in] dimension The dimension to negotiate on
1029 * @return Return the negotiated size
1031 float NegotiateFromParent( Dimension::Type dimension );
1034 * Negotiate a dimension based on the size of the parent. Fitting inside.
1036 * @param[in] dimension The dimension to negotiate on
1037 * @return Return the negotiated size
1039 float NegotiateFromParentFit( Dimension::Type dimension );
1042 * Negotiate a dimension based on the size of the parent. Flooding the whole space.
1044 * @param[in] dimension The dimension to negotiate on
1045 * @return Return the negotiated size
1047 float NegotiateFromParentFlood( Dimension::Type dimension );
1050 * @brief Negotiate a dimension based on the size of the children
1052 * @param[in] dimension The dimension to negotiate on
1053 * @return Return the negotiated size
1055 float NegotiateFromChildren( Dimension::Type dimension );
1058 * Set the negotiated dimension value for the given dimension(s)
1060 * @param negotiatedDimension The value to set
1061 * @param dimension The dimension(s) to set the value for
1063 void SetNegotiatedDimension( float negotiatedDimension, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
1066 * Return the value of negotiated dimension for the given dimension
1068 * @param dimension The dimension to retrieve
1069 * @return Return the value of the negotiated dimension
1071 float GetNegotiatedDimension( Dimension::Type dimension ) const;
1074 * @brief Set the padding for a dimension
1076 * @param[in] padding Padding for the dimension. X = start (e.g. left, bottom), y = end (e.g. right, top)
1077 * @param[in] dimension The dimension to set
1079 void SetPadding( const Vector2& padding, Dimension::Type dimension );
1082 * Return the value of padding for the given dimension
1084 * @param dimension The dimension to retrieve
1085 * @return Return the value of padding for the dimension
1087 Vector2 GetPadding( Dimension::Type dimension ) const;
1090 * Return the actor size for a given dimension
1092 * @param[in] dimension The dimension to retrieve the size for
1093 * @return Return the size for the given dimension
1095 float GetSize( Dimension::Type dimension ) const;
1098 * Return the natural size of the actor for a given dimension
1100 * @param[in] dimension The dimension to retrieve the size for
1101 * @return Return the natural size for the given dimension
1103 float GetNaturalSize( Dimension::Type dimension ) const;
1106 * @brief Return the amount of size allocated for relayout
1108 * May include padding
1110 * @param[in] dimension The dimension to retrieve
1111 * @return Return the size
1113 float GetRelayoutSize( Dimension::Type dimension ) const;
1116 * @brief If the size has been negotiated return that else return normal size
1118 * @param[in] dimension The dimension to retrieve
1119 * @return Return the size
1121 float GetLatestSize( Dimension::Type dimension ) const;
1124 * Apply the negotiated size to the actor
1126 * @param[in] container The container to fill with actors that require further relayout
1128 void SetNegotiatedSize( RelayoutContainer& container );
1131 * @brief Flag the actor as having it's layout dimension negotiated.
1133 * @param[in] negotiated The status of the flag to set.
1134 * @param[in] dimension The dimension to set the flag for
1136 void SetLayoutNegotiated( bool negotiated, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
1139 * @brief Test whether the layout dimension for this actor has been negotiated or not.
1141 * @param[in] dimension The dimension to determine the value of the flag for
1142 * @return Return if the layout dimension is negotiated or not.
1144 bool IsLayoutNegotiated( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) const;
1147 * @brief provides the Actor implementation of GetHeightForWidth
1148 * @param width to use.
1149 * @return the height based on the width.
1151 float GetHeightForWidthBase( float width );
1154 * @brief provides the Actor implementation of GetWidthForHeight
1155 * @param height to use.
1156 * @return the width based on the height.
1158 float GetWidthForHeightBase( float height );
1161 * @brief Calculate the size for a child
1163 * @param[in] child The child actor to calculate the size for
1164 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
1165 * @return Return the calculated size for the given dimension
1167 float CalculateChildSizeBase( const Dali::Actor& child, Dimension::Type dimension );
1170 * @brief Set the preferred size for size negotiation
1172 * @param[in] size The preferred size to set
1174 void SetPreferredSize( const Vector2& size );
1177 * @brief Return the preferred size used for size negotiation
1179 * @return Return the preferred size
1181 Vector2 GetPreferredSize() const;
1184 * @copydoc Dali::Actor::SetMinimumSize
1186 void SetMinimumSize( float size, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
1189 * @copydoc Dali::Actor::GetMinimumSize
1191 float GetMinimumSize( Dimension::Type dimension ) const;
1194 * @copydoc Dali::Actor::SetMaximumSize
1196 void SetMaximumSize( float size, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
1199 * @copydoc Dali::Actor::GetMaximumSize
1201 float GetMaximumSize( Dimension::Type dimension ) const;
1204 * @copydoc Dali::Actor::AddRenderer()
1206 unsigned int AddRenderer( Renderer& renderer );
1209 * @copydoc Dali::Actor::GetRendererCount()
1211 unsigned int GetRendererCount() const;
1214 * @copydoc Dali::Actor::GetRendererAt()
1216 RendererPtr GetRendererAt( unsigned int index );
1219 * @copydoc Dali::Actor::RemoveRenderer()
1221 void RemoveRenderer( Renderer& renderer );
1224 * @copydoc Dali::Actor::RemoveRenderer()
1226 void RemoveRenderer( unsigned int index );
1231 * Converts screen coordinates into the actor's coordinate system.
1232 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1233 * @param[out] localX On return, the X-coordinate relative to the actor.
1234 * @param[out] localY On return, the Y-coordinate relative to the actor.
1235 * @param[in] screenX The screen X-coordinate.
1236 * @param[in] screenY The screen Y-coordinate.
1237 * @return True if the conversion succeeded.
1239 bool ScreenToLocal( float& localX, float& localY, float screenX, float screenY ) const;
1242 * Converts screen coordinates into the actor's coordinate system.
1243 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1244 * @param[in] renderTask The render-task used to display the actor.
1245 * @param[out] localX On return, the X-coordinate relative to the actor.
1246 * @param[out] localY On return, the Y-coordinate relative to the actor.
1247 * @param[in] screenX The screen X-coordinate.
1248 * @param[in] screenY The screen Y-coordinate.
1249 * @return True if the conversion succeeded.
1251 bool ScreenToLocal( RenderTask& renderTask, float& localX, float& localY, float screenX, float screenY ) const;
1254 * Converts from the actor's coordinate system to screen coordinates.
1255 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1256 * @param[in] viewMatrix The view-matrix
1257 * @param[in] projectionMatrix The projection-matrix
1258 * @param[in] viewport The view-port
1259 * @param[out] localX On return, the X-coordinate relative to the actor.
1260 * @param[out] localY On return, the Y-coordinate relative to the actor.
1261 * @param[in] screenX The screen X-coordinate.
1262 * @param[in] screenY The screen Y-coordinate.
1263 * @return True if the conversion succeeded.
1265 bool ScreenToLocal( const Matrix& viewMatrix,
1266 const Matrix& projectionMatrix,
1267 const Viewport& viewport,
1271 float screenY ) const;
1274 * Performs a ray-sphere test with the given pick-ray and the actor's bounding sphere.
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 * @return True if the ray intersects the actor's bounding sphere.
1280 bool RaySphereTest( const Vector4& rayOrigin, const Vector4& rayDir ) const;
1283 * Performs a ray-actor test with the given pick-ray and the actor's geometry.
1284 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1285 * @param[in] rayOrigin The ray origin in the world's reference system.
1286 * @param[in] rayDir The ray director vector in the world's reference system.
1287 * @param[out] hitPointLocal The hit point in the Actor's local reference system.
1288 * @param[out] distance The distance from the hit point to the camera.
1289 * @return True if the ray intersects the actor's geometry.
1291 bool RayActorTest( const Vector4& rayOrigin,
1292 const Vector4& rayDir,
1293 Vector4& hitPointLocal,
1294 float& distance ) const;
1297 * Sets whether the actor should receive a notification when touch or hover motion events leave
1298 * the boundary of the actor.
1300 * @note By default, this is set to false as most actors do not require this.
1301 * @note Need to connect to the SignalTouch or SignalHover to actually receive this event.
1303 * @param[in] required Should be set to true if a Leave event is required
1305 void SetLeaveRequired( bool required );
1308 * This returns whether the actor requires touch or hover events whenever touch or hover motion events leave
1309 * the boundary of the actor.
1310 * @return true if a Leave event is required, false otherwise.
1312 bool GetLeaveRequired() const;
1315 * @copydoc Dali::Actor::SetKeyboardFocusable()
1317 void SetKeyboardFocusable( bool focusable );
1320 * @copydoc Dali::Actor::IsKeyboardFocusable()
1322 bool IsKeyboardFocusable() const;
1325 * Query whether the application or derived actor type requires touch events.
1326 * @return True if touch events are required.
1328 bool GetTouchRequired() const;
1331 * Query whether the application or derived actor type requires hover events.
1332 * @return True if hover events are required.
1334 bool GetHoverRequired() const;
1337 * Query whether the application or derived actor type requires wheel events.
1338 * @return True if wheel events are required.
1340 bool GetWheelEventRequired() const;
1343 * Query whether the actor is actually hittable. This method checks whether the actor is
1344 * sensitive, has the visibility flag set to true and is not fully transparent.
1345 * @return true, if it can be hit, false otherwise.
1347 bool IsHittable() const;
1352 * Retrieve the gesture data associated with this actor. The first call to this method will
1353 * allocate space for the ActorGestureData so this should only be called if an actor really does
1355 * @return Reference to the ActorGestureData for this actor.
1356 * @note Once the gesture-data is created for an actor it is likely that gestures are required
1357 * throughout the actor's lifetime so it will only be deleted when the actor is destroyed.
1359 ActorGestureData& GetGestureData();
1362 * Queries whether the actor requires the gesture type.
1363 * @param[in] type The gesture type.
1365 bool IsGestureRequred( Gesture::Type type ) const;
1370 * Used by the EventProcessor to emit touch event signals.
1371 * @param[in] event The touch event.
1372 * @return True if the event was consumed.
1374 bool EmitTouchEventSignal( const TouchEvent& event );
1377 * Used by the EventProcessor to emit hover event signals.
1378 * @param[in] event The hover event.
1379 * @return True if the event was consumed.
1381 bool EmitHoverEventSignal( const HoverEvent& event );
1384 * Used by the EventProcessor to emit wheel event signals.
1385 * @param[in] event The wheel event.
1386 * @return True if the event was consumed.
1388 bool EmitWheelEventSignal( const WheelEvent& event );
1391 * @copydoc Dali::Actor::TouchedSignal()
1393 Dali::Actor::TouchSignalType& TouchedSignal();
1396 * @copydoc Dali::Actor::HoveredSignal()
1398 Dali::Actor::HoverSignalType& HoveredSignal();
1401 * @copydoc Dali::Actor::WheelEventSignal()
1403 Dali::Actor::WheelEventSignalType& WheelEventSignal();
1406 * @copydoc Dali::Actor::OnStageSignal()
1408 Dali::Actor::OnStageSignalType& OnStageSignal();
1411 * @copydoc Dali::Actor::OffStageSignal()
1413 Dali::Actor::OffStageSignalType& OffStageSignal();
1416 * @copydoc Dali::Actor::OnRelayoutSignal()
1418 Dali::Actor::OnRelayoutSignalType& OnRelayoutSignal();
1421 * Connects a callback function with the object's signals.
1422 * @param[in] object The object providing the signal.
1423 * @param[in] tracker Used to disconnect the signal.
1424 * @param[in] signalName The signal to connect to.
1425 * @param[in] functor A newly allocated FunctorDelegate.
1426 * @return True if the signal was connected.
1427 * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
1429 static bool DoConnectSignal( BaseObject* object,
1430 ConnectionTrackerInterface* tracker,
1431 const std::string& signalName,
1432 FunctorDelegate* functor );
1435 * Performs actions as requested using the action name.
1436 * @param[in] object The object on which to perform the action.
1437 * @param[in] actionName The action to perform.
1438 * @param[in] attributes The attributes with which to perfrom this action.
1439 * @return true if the action was done.
1441 static bool DoAction( BaseObject* object,
1442 const std::string& actionName,
1443 const Property::Map& attributes );
1449 * This should only be called by Animation, when the actors SIZE property is animated.
1451 * @param[in] animation The animation that resized the actor
1452 * @param[in] targetSize The new target size of the actor
1454 void NotifySizeAnimation( Animation& animation, const Vector3& targetSize );
1457 * This should only be called by Animation, when the actors SIZE_WIDTH or SIZE_HEIGHT property is animated.
1459 * @param[in] animation The animation that resized the actor
1460 * @param[in] targetSize The new target size of the actor
1462 void NotifySizeAnimation( Animation& animation, float targetSize, Property::Index property );
1465 * For use in derived classes.
1466 * This should only be called by Animation, when the actor is resized using Animation::Resize().
1468 virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize )
1476 BASIC, RENDERABLE, LAYER, ROOT_LAYER
1480 * Protected Constructor. See Actor::New().
1481 * The second-phase construction Initialize() member should be called immediately after this.
1482 * @param[in] derivedType The derived type of actor (if any).
1484 Actor( DerivedType derivedType );
1487 * Second-phase constructor. Must be called immediately after creating a new Actor;
1489 void Initialize( void );
1492 * A reference counted object may only be deleted by calling Unreference()
1497 * Called on a child during Add() when the parent actor is connected to the Stage.
1498 * @param[in] parentDepth The depth of the parent in the hierarchy.
1500 void ConnectToStage( unsigned int parentDepth );
1503 * Helper for ConnectToStage, to recursively connect a tree of actors.
1504 * This is atomic i.e. not interrupted by user callbacks.
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 );
1511 * Connect the Node associated with this Actor to the scene-graph.
1513 void ConnectToSceneGraph();
1516 * Helper for ConnectToStage, to notify a connected actor through the public API.
1518 void NotifyStageConnection();
1521 * Called on a child during Remove() when the actor was previously on the Stage.
1523 void DisconnectFromStage();
1526 * Helper for DisconnectFromStage, to recursively disconnect a tree of actors.
1527 * This is atomic i.e. not interrupted by user callbacks.
1528 * @param[out] disconnectionList On return, the list of disconnected actors which require notification.
1530 void RecursiveDisconnectFromStage( ActorContainer& disconnectionList );
1533 * Disconnect the Node associated with this Actor from the scene-graph.
1535 void DisconnectFromSceneGraph();
1538 * Helper for DisconnectFromStage, to notify a disconnected actor through the public API.
1540 void NotifyStageDisconnection();
1543 * When the Actor is OnStage, checks whether the corresponding Node is connected to the scene graph.
1544 * @return True if the Actor is OnStage & has a Node connected to the scene graph.
1546 bool IsNodeConnected() const;
1550 // Default property extensions from Object
1553 * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
1555 virtual unsigned int GetDefaultPropertyCount() const;
1558 * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
1560 virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
1563 * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
1565 virtual const char* GetDefaultPropertyName( Property::Index index ) const;
1568 * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
1570 virtual Property::Index GetDefaultPropertyIndex( const std::string& name ) const;
1573 * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
1575 virtual bool IsDefaultPropertyWritable( Property::Index index ) const;
1578 * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
1580 virtual bool IsDefaultPropertyAnimatable( Property::Index index ) const;
1583 * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
1585 virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
1588 * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
1590 virtual Property::Type GetDefaultPropertyType( Property::Index index ) const;
1593 * @copydoc Dali::Internal::Object::SetDefaultProperty()
1595 virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue );
1598 * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
1600 virtual void SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value );
1603 * @copydoc Dali::Internal::Object::GetDefaultProperty()
1605 virtual Property::Value GetDefaultProperty( Property::Index index ) const;
1608 * @copydoc Dali::Internal::Object::GetPropertyOwner()
1610 virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
1613 * @copydoc Dali::Internal::Object::GetSceneObject()
1615 virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
1618 * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
1620 virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
1623 * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
1625 virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
1628 * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
1630 virtual int GetPropertyComponentIndex( Property::Index index ) const;
1638 Actor( const Actor& );
1641 Actor& operator=( const Actor& rhs );
1644 * Set the actors parent.
1645 * @param[in] parent The new parent.
1647 void SetParent( Actor* parent );
1650 * Helper to create a Node for this Actor.
1651 * To be overriden in derived classes.
1652 * @return A newly allocated node.
1654 virtual SceneGraph::Node* CreateNode() const;
1657 * For use in derived classes, called after Initialize()
1659 virtual void OnInitialize()
1664 * For use in internal derived classes.
1665 * This is called during ConnectToStage(), after the actor has finished adding its node to the scene-graph.
1666 * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1668 virtual void OnStageConnectionInternal()
1673 * For use in internal derived classes.
1674 * This is called during DisconnectFromStage(), before the actor removes its node from the scene-graph.
1675 * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1677 virtual void OnStageDisconnectionInternal()
1682 * For use in external (CustomActor) derived classes.
1683 * This is called after the atomic ConnectToStage() traversal has been completed.
1685 virtual void OnStageConnectionExternal( int depth )
1690 * For use in external (CustomActor) derived classes.
1691 * This is called after the atomic DisconnectFromStage() traversal has been completed.
1693 virtual void OnStageDisconnectionExternal()
1698 * For use in derived classes; this is called after Add() has added a child.
1699 * @param[in] child The child that was added.
1701 virtual void OnChildAdd( Actor& child )
1706 * For use in derived classes; this is called after Remove() has removed a child.
1707 * @param[in] child The child that was removed.
1709 virtual void OnChildRemove( Actor& child )
1714 * For use in derived classes.
1715 * This is called after SizeSet() has been called.
1717 virtual void OnSizeSet( const Vector3& targetSize )
1722 * For use in derived classes.
1723 * This is only called if mDerivedRequiresTouch is true, and the touch-signal was not consumed.
1724 * @param[in] event The touch event.
1725 * @return True if the event should be consumed.
1727 virtual bool OnTouchEvent( const TouchEvent& event )
1733 * For use in derived classes.
1734 * This is only called if mDerivedRequiresHover is true, and the hover-signal was not consumed.
1735 * @param[in] event The hover event.
1736 * @return True if the event should be consumed.
1738 virtual bool OnHoverEvent( const HoverEvent& event )
1744 * For use in derived classes.
1745 * This is only called if the wheel signal was not consumed.
1746 * @param[in] event The wheel event.
1747 * @return True if the event should be consumed.
1749 virtual bool OnWheelEvent( const WheelEvent& event )
1755 * @brief Ensure the relayout data is allocated
1757 void EnsureRelayoutData();
1760 * @brief Apply the size set policy to the input size
1762 * @param[in] size The size to apply the policy to
1763 * @return Return the adjusted size
1765 Vector2 ApplySizeSetPolicy( const Vector2 size );
1769 Actor* mParent; ///< Each actor (except the root) can have one parent
1770 ActorContainer* mChildren; ///< Container of referenced actors
1771 RendererContainer* mRenderers; ///< Renderer container
1773 const SceneGraph::Node* mNode; ///< Not owned
1774 Vector3* mParentOrigin; ///< NULL means ParentOrigin::DEFAULT. ParentOrigin is non-animatable
1775 Vector3* mAnchorPoint; ///< NULL means AnchorPoint::DEFAULT. AnchorPoint is non-animatable
1777 struct RelayoutData;
1778 RelayoutData* mRelayoutData; ///< Struct to hold optional collection of relayout variables
1780 ActorGestureData* mGestureData; ///< Optional Gesture data. Only created when actor requires gestures
1782 ActorAttachmentPtr mAttachment; ///< Optional referenced attachment
1785 Dali::Actor::TouchSignalType mTouchedSignal;
1786 Dali::Actor::HoverSignalType mHoveredSignal;
1787 Dali::Actor::WheelEventSignalType mWheelEventSignal;
1788 Dali::Actor::OnStageSignalType mOnStageSignal;
1789 Dali::Actor::OffStageSignalType mOffStageSignal;
1790 Dali::Actor::OnRelayoutSignalType mOnRelayoutSignal;
1792 Vector3 mTargetSize; ///< Event-side storage for size (not a pointer as most actors will have a size)
1793 Vector3 mTargetPosition; ///< Event-side storage for position (not a pointer as most actors will have a position)
1795 std::string mName; ///< Name of the actor
1796 unsigned int mId; ///< A unique ID to identify the actor starting from 1, and 0 is reserved
1798 unsigned short mDepth :12; ///< Cached: The depth in the hierarchy of the actor. Only 4096 levels of depth are supported
1799 const bool mIsRoot : 1; ///< Flag to identify the root actor
1800 const bool mIsRenderable : 1; ///< Flag to identify that this is a renderable actor
1801 const bool mIsLayer : 1; ///< Flag to identify that this is a layer
1802 bool mIsOnStage : 1; ///< Flag to identify whether the actor is on-stage
1803 bool mSensitive : 1; ///< Whether the actor emits touch event signals
1804 bool mLeaveRequired : 1; ///< Whether a touch event signal is emitted when the a touch leaves the actor's bounds
1805 bool mKeyboardFocusable : 1; ///< Whether the actor should be focusable by keyboard navigation
1806 bool mDerivedRequiresTouch : 1; ///< Whether the derived actor type requires touch event signals
1807 bool mDerivedRequiresHover : 1; ///< Whether the derived actor type requires hover event signals
1808 bool mDerivedRequiresWheelEvent : 1; ///< Whether the derived actor type requires wheel event signals
1809 bool mOnStageSignalled : 1; ///< Set to true before OnStageConnection signal is emitted, and false before OnStageDisconnection
1810 bool mInsideOnSizeSet : 1; ///< Whether we are inside OnSizeSet
1811 bool mInheritOrientation : 1; ///< Cached: Whether the parent's orientation should be inherited.
1812 bool mInheritScale : 1; ///< Cached: Whether the parent's scale should be inherited.
1813 DrawMode::Type mDrawMode : 2; ///< Cached: How the actor and its children should be drawn
1814 PositionInheritanceMode mPositionInheritanceMode : 2; ///< Cached: Determines how position is inherited
1815 ColorMode mColorMode : 2; ///< Cached: Determines whether mWorldColor is inherited
1819 static ActorContainer mNullChildren; ///< Empty container (shared by all actors, returned by GetChildren() const)
1820 static unsigned int mActorCounter; ///< A counter to track the actor instance creation
1824 } // namespace Internal
1826 // Helpers for public-api forwarding methods
1828 inline Internal::Actor& GetImplementation( Dali::Actor& actor )
1830 DALI_ASSERT_ALWAYS( actor && "Actor handle is empty" );
1832 BaseObject& handle = actor.GetBaseObject();
1834 return static_cast< Internal::Actor& >( handle );
1837 inline const Internal::Actor& GetImplementation( const Dali::Actor& actor )
1839 DALI_ASSERT_ALWAYS( actor && "Actor handle is empty" );
1841 const BaseObject& handle = actor.GetBaseObject();
1843 return static_cast< const Internal::Actor& >( handle );
1848 #endif // __DALI_INTERNAL_ACTOR_H__