1 #ifndef DALI_INTERNAL_ACTOR_H
2 #define DALI_INTERNAL_ACTOR_H
5 * Copyright (c) 2021 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/dali-common.h>
27 #include <dali/public-api/common/vector-wrapper.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>
33 #include <dali/devel-api/actors/actor-devel.h>
34 #include <dali/devel-api/rendering/renderer-devel.h>
36 #include <dali/internal/common/const-string.h>
37 #include <dali/internal/common/internal-constants.h>
38 #include <dali/internal/common/memory-pool-object-allocator.h>
39 #include <dali/internal/event/actors/actor-declarations.h>
40 #include <dali/internal/event/actors/actor-parent-impl.h>
41 #include <dali/internal/event/actors/actor-parent.h>
42 #include <dali/internal/event/actors/actor-renderer-container.h>
43 #include <dali/internal/event/actors/actor-sizer.h>
44 #include <dali/internal/event/common/object-impl.h>
45 #include <dali/internal/event/common/stage-def.h>
46 #include <dali/internal/update/nodes/node-declarations.h>
58 class ActorGestureData;
64 class ActorDepthTreeNode;
65 using DepthNodeMemoryPool = Dali::Internal::MemoryPoolObjectAllocator<ActorDepthTreeNode>;
68 * Actor is the primary object with which Dali applications interact.
69 * UI controls can be built by combining multiple actors.
70 * Multi-Touch events are received through signals emitted by the actor tree.
72 * An Actor is a proxy for a Node in the scene graph.
73 * When an Actor is added to the Stage, it creates a node and connects it to the scene graph.
74 * The scene-graph can be updated in a separate thread, so the connection is done using an asynchronous message.
75 * When a tree of Actors is detached from the Stage, a message is sent to destroy the associated nodes.
77 class Actor : public Object, public ActorParent
82 * @return A smart-pointer to the newly allocated Actor.
84 static ActorPtr New();
87 * Helper to create node for derived classes who don't have their own node type
88 * @return pointer to newly created unique node
90 static const SceneGraph::Node* CreateNode();
93 * Retrieve the name of the actor.
96 std::string_view GetName() const
98 return mName.GetStringView();
102 * Set the name of the actor.
103 * @param[in] name The new name.
105 void SetName(std::string_view name);
108 * @copydoc Dali::Actor::GetId
110 uint32_t GetId() const;
115 * Query whether an actor is the root actor, which is owned by the Stage.
116 * @return True if the actor is a root actor.
124 * Query whether the actor is connected to the Scene.
132 * Query whether the actor has any renderers.
133 * @return True if the actor is renderable.
135 bool IsRenderable() const
137 // inlined as this is called a lot in hit testing
138 return mRenderers && !mRenderers->IsEmpty();
142 * Query whether the actor is of class Dali::Layer
143 * @return True if the actor is a layer.
147 // inlined as this is called a lot in hit testing
152 * Gets the layer in which the actor is present
153 * @return The layer, which will be uninitialized if the actor is off-stage.
155 Dali::Layer GetLayer();
158 * @copydoc Dali::Internal::ActorParent::Add()
160 void Add(Actor& child, bool notify = true) override;
163 * @copydoc Dali::Internal::ActorParent::Remove()
165 void Remove(Actor& child, bool notify = true) override;
168 * @copydoc Dali::DevelActor::SwitchParent()
170 void SwitchParent(Actor& newParent);
173 * @copydoc Dali::Actor::Unparent
178 * @copydoc Dali::Internal::ActorParent::GetChildCount()
180 uint32_t GetChildCount() const override;
183 * @copydoc Dali::Internal::ActorParent::GetChildAt
185 ActorPtr GetChildAt(uint32_t index) const override;
188 * Retrieve a reference to Actor's children.
189 * @note Not for public use.
190 * @return A reference to the container of children.
191 * @note The internal container is lazily initialized so ensure you check the child count before using the value returned by this method.
193 ActorContainer& GetChildrenInternal();
196 * @copydoc Dali::Internal::ActorParent::FindChildByName
198 ActorPtr FindChildByName(ConstString actorName) override;
201 * @copydoc Dali::Internal::ActorParent::FindChildById
203 ActorPtr FindChildById(const uint32_t id) override;
206 * @copydoc Dali::Internal::ActorParent::UnparentChildren
208 void UnparentChildren() override;
211 * Retrieve the parent of an Actor.
212 * @return The parent actor, or NULL if the Actor does not have a parent.
214 Actor* GetParent() const
216 return static_cast<Actor*>(mParent);
220 * Calculates screen position and size.
222 * @return pair of two values, position of top-left corner on screen and size respectively.
224 Rect<> CalculateScreenExtents() const;
227 * @copydoc DevelActor::SetNeedGesturePropagation.
229 void SetNeedGesturePropagation(bool propagation)
231 mNeedGesturePropagation = propagation;
235 * Retrieve need gesture propagation value
236 * @return The actor's need gesture propagation value.
238 bool NeedGesturePropagation() const
240 return mNeedGesturePropagation;
244 * Sets the size of an actor.
245 * This does not interfere with the actors scale factor.
246 * @param [in] width The new width.
247 * @param [in] height The new height.
249 void SetSize(float width, float height);
252 * Sets the size of an actor.
253 * This does not interfere with the actors scale factor.
254 * @param [in] width The size of the actor along the x-axis.
255 * @param [in] height The size of the actor along the y-axis.
256 * @param [in] depth The size of the actor along the z-axis.
258 void SetSize(float width, float height, float depth);
261 * Sets the size of an actor.
262 * This does not interfere with the actors scale factor.
263 * @param [in] size The new size.
265 void SetSize(const Vector2& size);
268 * Sets the size of an actor.
269 * This does not interfere with the actors scale factor.
270 * @param [in] size The new size.
272 void SetSize(const Vector3& size);
275 * Set the width component of the Actor's size.
276 * @param [in] width The new width component.
278 void SetWidth(float width);
281 * Set the height component of the Actor's size.
282 * @param [in] height The new height component.
284 void SetHeight(float height);
287 * Set the depth component of the Actor's size.
288 * @param [in] depth The new depth component.
290 void SetDepth(float depth);
293 * Retrieve the Actor's size from event side.
294 * This size will be the size set or if animating then the target size.
295 * @return The Actor's size.
297 Vector3 GetTargetSize() const;
300 * Retrieve the Actor's size from update side.
301 * This size will be the size set or animating but will be a frame behind.
302 * @return The Actor's size.
304 const Vector3& GetCurrentSize() const;
307 * Return the natural size of the actor
309 * @return The actor's natural size
311 virtual Vector3 GetNaturalSize() const;
314 * Set the origin of an actor, within its parent's area.
315 * This is expressed in 2D unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent,
316 * and (1.0, 1.0, 0.5) is the bottom-right corner.
317 * The default parent-origin is top-left (0.0, 0.0, 0.5).
318 * An actor position is the distance between this origin, and the actors anchor-point.
319 * @param [in] origin The new parent-origin.
321 void SetParentOrigin(const Vector3& origin);
324 * Retrieve the parent-origin of an actor.
325 * @return The parent-origin.
327 const Vector3& GetCurrentParentOrigin() const;
330 * Set the anchor-point of an actor. This is expressed in 2D unit coordinates, such that
331 * (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.
332 * The default anchor point is top-left (0.0, 0.0, 0.5).
333 * An actor position is the distance between its parent-origin, and this anchor-point.
334 * An actor's rotation is centered around its anchor-point.
335 * @param [in] anchorPoint The new anchor-point.
337 void SetAnchorPoint(const Vector3& anchorPoint);
340 * Retrieve the anchor-point of an actor.
341 * @return The anchor-point.
343 const Vector3& GetCurrentAnchorPoint() const;
346 * If the position uses the anchor point, return the anchor point, otherwise
348 * @return The anchor point for positioning.
350 Vector3 GetAnchorPointForPosition() const;
353 * Sets the position of the Actor.
354 * The coordinates are relative to the Actor's parent.
355 * The Actor's z position will be set to 0.0f.
356 * @param [in] x The new x position
357 * @param [in] y The new y position
359 void SetPosition(float x, float y);
362 * Sets the position of the Actor.
363 * The coordinates are relative to the Actor's parent.
364 * @param [in] x The new x position
365 * @param [in] y The new y position
366 * @param [in] z The new z position
368 void SetPosition(float x, float y, float z);
371 * Sets the position of the Actor.
372 * The coordinates are relative to the Actor's parent.
373 * @param [in] position The new position.
375 void SetPosition(const Vector3& position);
378 * Set the position of an actor along the X-axis.
379 * @param [in] x The new x position
384 * Set the position of an actor along the Y-axis.
385 * @param [in] y The new y position.
390 * Set the position of an actor along the Z-axis.
391 * @param [in] z The new z position
396 * Translate an actor relative to its existing position.
397 * @param[in] distance The actor will move by this distance.
399 void TranslateBy(const Vector3& distance);
402 * Retrieve the position of the Actor.
403 * The coordinates are relative to the Actor's parent.
404 * @return the Actor's position.
406 const Vector3& GetCurrentPosition() const;
409 * Retrieve the target position of the Actor.
410 * The coordinates are relative to the Actor's parent.
411 * @return the Actor's position.
413 const Vector3& GetTargetPosition() const
415 return mTargetPosition;
419 * @copydoc Dali::Actor::GetCurrentWorldPosition()
421 const Vector3& GetCurrentWorldPosition() const;
424 * @copydoc Dali::Actor::SetInheritPosition()
426 void SetInheritPosition(bool inherit);
429 * @copydoc Dali::Actor::IsPositionInherited()
431 bool IsPositionInherited() const
433 return mInheritPosition;
437 * Sets the orientation of the Actor.
438 * @param [in] angleRadians The new orientation angle in radians.
439 * @param [in] axis The new axis of orientation.
441 void SetOrientation(const Radian& angleRadians, const Vector3& axis);
444 * Sets the orientation of the Actor.
445 * @param [in] orientation The new orientation.
447 void SetOrientation(const Quaternion& orientation);
450 * Rotate an actor around its existing rotation axis.
451 * @param[in] angleRadians The angle to the rotation to combine with the existing rotation.
452 * @param[in] axis The axis of the rotation to combine with the existing rotation.
454 void RotateBy(const Radian& angleRadians, const Vector3& axis);
457 * Apply a relative rotation to an actor.
458 * @param[in] relativeRotation The rotation to combine with the actors existing rotation.
460 void RotateBy(const Quaternion& relativeRotation);
463 * Retreive the Actor's orientation.
464 * @return the orientation.
466 const Quaternion& GetCurrentOrientation() const;
469 * Set whether a child actor inherits it's parent's orientation. Default is to inherit.
470 * Switching this off means that using SetOrientation() sets the actor's world orientation.
471 * @param[in] inherit - true if the actor should inherit orientation, false otherwise.
473 void SetInheritOrientation(bool inherit);
476 * Returns whether the actor inherit's it's parent's orientation.
477 * @return true if the actor inherit's it's parent orientation, false if it uses world orientation.
479 bool IsOrientationInherited() const
481 return mInheritOrientation;
485 * Sets the factor of the parents size used for the child actor.
486 * Note: Only used if ResizePolicy is ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
487 * @param[in] factor The vector to multiply the parents size by to get the childs size.
489 void SetSizeModeFactor(const Vector3& factor);
492 * Gets the factor of the parents size used for the child actor.
493 * Note: Only used if ResizePolicy is ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
494 * @return The vector being used to multiply the parents size by to get the childs size.
496 const Vector3& GetSizeModeFactor() const;
499 * @copydoc Dali::Actor::GetCurrentWorldOrientation()
501 const Quaternion& GetCurrentWorldOrientation() const;
504 * Sets a scale factor applied to an actor.
505 * @param [in] scale The scale factor applied on all axes.
507 void SetScale(float scale);
510 * Sets a scale factor applied to an actor.
511 * @param [in] scaleX The scale factor applied along the x-axis.
512 * @param [in] scaleY The scale factor applied along the y-axis.
513 * @param [in] scaleZ The scale factor applied along the z-axis.
515 void SetScale(float scaleX, float scaleY, float scaleZ);
518 * Sets a scale factor applied to an actor.
519 * @param [in] scale A vector representing the scale factor for each axis.
521 void SetScale(const Vector3& scale);
524 * Set the x component of the scale factor.
525 * @param [in] x The new x value.
527 void SetScaleX(float x);
530 * Set the y component of the scale factor.
531 * @param [in] y The new y value.
533 void SetScaleY(float y);
536 * Set the z component of the scale factor.
537 * @param [in] z The new z value.
539 void SetScaleZ(float z);
542 * Apply a relative scale to an actor.
543 * @param[in] relativeScale The scale to combine with the actors existing scale.
545 void ScaleBy(const Vector3& relativeScale);
548 * Retrieve the scale factor applied to an actor.
549 * @return A vector representing the scale factor for each axis.
551 const Vector3& GetCurrentScale() const;
554 * @copydoc Dali::Actor::GetCurrentWorldScale()
556 const Vector3& GetCurrentWorldScale() const;
559 * @copydoc Dali::Actor::SetInheritScale()
561 void SetInheritScale(bool inherit);
564 * @copydoc Dali::Actor::IsScaleInherited()
566 bool IsScaleInherited() const
568 return mInheritScale;
572 * @copydoc Dali::Actor::GetCurrentWorldMatrix()
574 Matrix GetCurrentWorldMatrix() const;
579 * Sets the visibility flag of an actor.
580 * @param[in] visible The new visibility flag.
582 void SetVisible(bool visible);
585 * Retrieve the visibility flag of an actor.
586 * @return The visibility flag.
588 bool IsVisible() const;
591 * Sets the opacity of an actor.
592 * @param [in] opacity The new opacity.
594 void SetOpacity(float opacity);
597 * Retrieve the actor's opacity.
598 * @return The actor's opacity.
600 float GetCurrentOpacity() const;
603 * Retrieve the actor's clipping mode.
604 * @return The actor's clipping mode (cached)
606 ClippingMode::Type GetClippingMode() const
608 return mClippingMode;
612 * Sets whether an actor should emit touch or hover signals; see SignalTouch() and SignalHover().
613 * An actor is sensitive by default, which means that as soon as an application connects to the SignalTouch(),
614 * the touch event signal will be emitted, and as soon as an application connects to the SignalHover(), the
615 * hover event signal will be emitted.
617 * If the application wishes to temporarily disable the touch or hover event signal emission, then they can do so by calling:
619 * actor.SetSensitive(false);
622 * Then, to re-enable the touch or hover event signal emission, the application should call:
624 * actor.SetSensitive(true);
627 * @see SignalTouch() and SignalHover().
628 * @note If an actor's sensitivity is set to false, then it's children will not emit a touch or hover event signal either.
629 * @param[in] sensitive true to enable emission of the touch or hover event signals, false otherwise.
631 void SetSensitive(bool sensitive)
633 mSensitive = sensitive;
637 * Query whether an actor emits touch or hover event signals.
638 * @see SetSensitive(bool)
639 * @return true, if emission of touch or hover event signals is enabled, false otherwise.
641 bool IsSensitive() const
647 * Sets whether an actor should be enabled all user interaction including touch, focus and activation.
648 * This value have higher priority over the sensitve and focusable in negative action,
649 * which means IsSensitive() or IsFocusable() and enable is false, actor will not emits touch or focus event.
650 * An actor is enabled by default.
652 * If the application wishes to temporarily disable user interaction:
654 * actor.SetUserInteractionEnabled(false);
657 * Then, to re-enable user interaction, the application should call:
659 * actor.SetUserInteractionEnabled(true);
662 * @see IsSensitive(), IsHittable(), IsKeyboardFocusable() and IsTouchFocusable().
663 * @note If an actor's disabled, child still can be enabled.
664 * @param[in] enabled true to enable user interaction, false otherwise.
666 void SetUserInteractionEnabled(bool enabled)
668 mUserInteractionEnabled = enabled;
672 * Query whether an actor is enabled user interaction.
673 * @see SetSensitive(bool)
674 * @return true, if user interaction is enabled, false otherwise.
676 bool IsUserInteractionEnabled() const
678 return mUserInteractionEnabled;
682 * @copydoc Dali::Actor::SetDrawMode
684 void SetDrawMode(DrawMode::Type drawMode);
687 * @copydoc Dali::Actor::GetDrawMode
689 DrawMode::Type GetDrawMode() const
695 * @copydoc Dali::Actor::IsOverlay
697 bool IsOverlay() const
699 return (DrawMode::OVERLAY_2D == mDrawMode);
703 * Sets the actor's color. The final color of actor depends on its color mode.
704 * This final color is applied to the drawable elements of an actor.
705 * @param [in] color The new color.
707 void SetColor(const Vector4& color);
710 * Set the red component of the color.
711 * @param [in] red The new red component.
713 void SetColorRed(float red);
716 * Set the green component of the color.
717 * @param [in] green The new green component.
719 void SetColorGreen(float green);
722 * Set the blue component of the scale factor.
723 * @param [in] blue The new blue value.
725 void SetColorBlue(float blue);
728 * Retrieve the actor's color.
731 const Vector4& GetCurrentColor() const;
734 * Sets the actor's color mode.
735 * Color mode specifies whether Actor uses its own color or inherits its parent color
736 * @param [in] colorMode to use.
738 void SetColorMode(ColorMode colorMode);
741 * Returns the actor's color mode.
742 * @return currently used colorMode.
744 ColorMode GetColorMode() const
750 * @copydoc Dali::Actor::GetCurrentWorldColor()
752 const Vector4& GetCurrentWorldColor() const;
755 * @copydoc Dali::Actor::GetHierarchyDepth()
757 inline int32_t GetHierarchyDepth() const
768 * Get the actor's sorting depth
770 * @return The depth used for hit-testing and renderer sorting
772 inline uint32_t GetSortingDepth()
778 * Set the actor's sorted depth. Used during recreation of depth tree
779 * @param[in] sortedDepth the new sorted depth
781 inline void SetSortingDepth(uint32_t sortedDepth)
783 mSortedDepth = sortedDepth;
787 // Size negotiation virtual functions
790 * @brief Called after the size negotiation has been finished for this control.
792 * The control is expected to assign this given size to itself/its children.
794 * Should be overridden by derived classes if they need to layout
795 * actors differently after certain operations like add or remove
796 * actors, resize or after changing specific properties.
798 * Note! As this function is called from inside the size negotiation algorithm, you cannot
799 * call RequestRelayout (the call would just be ignored)
801 * @param[in] size The allocated size.
802 * @param[in,out] container The control should add actors to this container that it is not able
803 * to allocate a size for.
805 virtual void OnRelayout(const Vector2& size, RelayoutContainer& container)
810 * @brief Notification for deriving classes when the resize policy is set
812 * @param[in] policy The policy being set
813 * @param[in] dimension The dimension the policy is being set for
815 virtual void OnSetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension)
820 * @brief Virtual method to notify deriving classes that relayout dependencies have been
821 * met and the size for this object is about to be calculated for the given dimension
823 * @param dimension The dimension that is about to be calculated
825 virtual void OnCalculateRelayoutSize(Dimension::Type dimension)
830 * @brief Virtual method to notify deriving classes that the size for a dimension
831 * has just been negotiated
833 * @param[in] size The new size for the given dimension
834 * @param[in] dimension The dimension that was just negotiated
836 virtual void OnLayoutNegotiated(float size, Dimension::Type dimension)
841 * @brief Determine if this actor is dependent on it's children for relayout
843 * @param dimension The dimension(s) to check for
844 * @return Return if the actor is dependent on it's children
846 virtual bool RelayoutDependentOnChildren(Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
849 * @brief Calculate the size for a child
851 * @param[in] child The child actor to calculate the size for
852 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
853 * @return Return the calculated size for the given dimension
855 virtual float CalculateChildSize(const Dali::Actor& child, Dimension::Type dimension);
858 * @brief This method is called during size negotiation when a height is required for a given width.
860 * Derived classes should override this if they wish to customize the height returned.
862 * @param width to use.
863 * @return the height based on the width.
865 virtual float GetHeightForWidth(float width);
868 * @brief This method is called during size negotiation when a width is required for a given height.
870 * Derived classes should override this if they wish to customize the width returned.
872 * @param height to use.
873 * @return the width based on the width.
875 virtual float GetWidthForHeight(float height);
881 * @brief Called by the RelayoutController to negotiate the size of an actor.
883 * The size allocated by the the algorithm is passed in which the
884 * actor must adhere to. A container is passed in as well which
885 * the actor should populate with actors it has not / or does not
886 * need to handle in its size negotiation.
888 * @param[in] size The allocated size.
889 * @param[in,out] container The container that holds actors that are fed back into the
890 * RelayoutController algorithm.
892 void NegotiateSize(const Vector2& size, RelayoutContainer& container);
895 * @copydoc Dali::Actor::SetResizePolicy()
897 void SetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
900 * @copydoc Dali::Actor::GetResizePolicy()
902 ResizePolicy::Type GetResizePolicy(Dimension::Type dimension) const;
905 * @brief Set the size negotiation relayout enabled on this actor
907 * @param[in] relayoutEnabled Boolean to enable or disable relayout
909 void SetRelayoutEnabled(bool relayoutEnabled);
912 * @brief Return if relayout is enabled
914 * @return Return if relayout is enabled or not for this actor
916 bool IsRelayoutEnabled() const;
919 * @brief Mark an actor as having it's layout dirty
920 * @note Only called from RelayoutController
922 * @param dirty Whether to mark actor as dirty or not
923 * @param dimension The dimension(s) to mark as dirty
925 void SetLayoutDirty(bool dirty, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
928 * @brief Return if any of an actor's dimensions are marked as dirty
929 * @note Only called from RelayoutController
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
938 * @note Only called from RelayoutController
940 * @return Return if it is possible to relayout the actor
942 bool RelayoutPossible(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) const;
945 * @brief Returns if relayout is enabled and the actor is dirty
946 * @note Only called from RelayoutController
948 * @return Return if it is required to relayout the actor
950 bool RelayoutRequired(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) const;
953 * @brief Request a relayout, which means performing a size negotiation on this actor, its parent and children (and potentially whole scene)
955 * This method is automatically called from OnSceneConnection(), OnChildAdd(),
956 * OnChildRemove(), SetSizePolicy(), SetMinimumSize() and SetMaximumSize().
958 * This method can also be called from a derived class every time it needs a different size.
959 * At the end of event processing, the relayout process starts and
960 * all controls which requested Relayout will have their sizes (re)negotiated.
962 * @note RelayoutRequest() can be called multiple times; the size negotiation is still
963 * only performed once, i.e. there is no need to keep track of this in the calling side.
965 void RelayoutRequest(Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
968 * @brief Determine if this actor is dependent on it's parent for relayout
969 * @note Only called from RelayoutController
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
978 * @note Only called from RelayoutController
980 * @param dimension The dimension to check for
981 * @param dependentDimension The dimension to check for dependency with
982 * @return Return if the actor is dependent on this dimension
984 bool RelayoutDependentOnDimension(Dimension::Type dimension, Dimension::Type dependentDimension);
987 * @brief Set the padding for a dimension
989 * @param[in] padding Padding for the dimension. X = start (e.g. left, bottom), y = end (e.g. right, top)
990 * @param[in] dimension The dimension to set
992 void SetPadding(const Vector2& padding, Dimension::Type dimension);
995 * Return the value of padding for the given dimension
997 * @param dimension The dimension to retrieve
998 * @return Return the value of padding for the dimension
1000 Vector2 GetPadding(Dimension::Type dimension) const;
1003 * @brief Return the amount of size allocated for relayout
1005 * May include padding
1007 * @param[in] dimension The dimension to retrieve
1008 * @return Return the size
1010 float GetRelayoutSize(Dimension::Type dimension) const;
1013 * @brief Flag the actor as having it's layout dimension negotiated.
1015 * @param[in] negotiated The status of the flag to set.
1016 * @param[in] dimension The dimension to set the flag for
1018 void SetLayoutNegotiated(bool negotiated, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
1021 * @brief Test whether the layout dimension for this actor has been negotiated or not.
1023 * @param[in] dimension The dimension to determine the value of the flag for
1024 * @return Return if the layout dimension is negotiated or not.
1026 bool IsLayoutNegotiated(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) const;
1029 * @brief provides the Actor implementation of GetHeightForWidth
1030 * @param width to use.
1031 * @return the height based on the width.
1033 float GetHeightForWidthBase(float width);
1036 * @brief provides the Actor implementation of GetWidthForHeight
1037 * @param height to use.
1038 * @return the width based on the height.
1040 float GetWidthForHeightBase(float height);
1043 * @brief provides the Actor implementation of CalculateChildSize
1045 * @param[in] child The child actor to calculate the size for
1046 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
1047 * @return Return the calculated size for the given dimension
1049 float CalculateChildSizeBase(const Dali::Actor& child, Dimension::Type dimension);
1052 * @brief Determine if this actor is dependent on it's children for relayout.
1054 * @param dimension The dimension(s) to check for
1055 * @return Return if the actor is dependent on it's children
1057 bool RelayoutDependentOnChildrenBase(Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
1060 * @copydoc Dali::Actor::SetMinimumSize
1062 void SetMinimumSize(float size, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
1065 * @copydoc Dali::Actor::GetMinimumSize
1067 float GetMinimumSize(Dimension::Type dimension) const;
1070 * @copydoc Dali::Actor::SetMaximumSize
1072 void SetMaximumSize(float size, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
1075 * @copydoc Dali::Actor::GetMaximumSize
1077 float GetMaximumSize(Dimension::Type dimension) const;
1080 * @copydoc Dali::Actor::AddRenderer()
1082 uint32_t AddRenderer(Renderer& renderer);
1085 * @copydoc Dali::Actor::GetRendererCount()
1087 uint32_t GetRendererCount() const;
1090 * @copydoc Dali::Actor::GetRendererAt()
1092 RendererPtr GetRendererAt(uint32_t index);
1095 * @copydoc Dali::Actor::RemoveRenderer()
1097 void RemoveRenderer(Renderer& renderer);
1100 * @copydoc Dali::Actor::RemoveRenderer()
1102 void RemoveRenderer(uint32_t index);
1105 * @brief Set BlendEquation at each renderer that added on this Actor.
1107 void SetBlendEquation(DevelBlendEquation::Type blendEquation);
1110 * @brief Get Blend Equation that applied to this Actor
1112 DevelBlendEquation::Type GetBlendEquation() const;
1115 * @brief Set this Actor is transparent or not without any affection on the child Actors.
1117 void SetTransparent(bool transparent);
1120 * @brief Get this Actor is transparent or not.
1122 bool IsTransparent() const;
1126 * Converts screen coordinates into the actor's coordinate system.
1127 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1128 * @param[out] localX On return, the X-coordinate relative to the actor.
1129 * @param[out] localY On return, the Y-coordinate relative to the actor.
1130 * @param[in] screenX The screen X-coordinate.
1131 * @param[in] screenY The screen Y-coordinate.
1132 * @return True if the conversion succeeded.
1134 bool ScreenToLocal(float& localX, float& localY, float screenX, float screenY) const;
1137 * Converts screen coordinates into the actor's coordinate system.
1138 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1139 * @param[in] renderTask The render-task used to display the actor.
1140 * @param[out] localX On return, the X-coordinate relative to the actor.
1141 * @param[out] localY On return, the Y-coordinate relative to the actor.
1142 * @param[in] screenX The screen X-coordinate.
1143 * @param[in] screenY The screen Y-coordinate.
1144 * @return True if the conversion succeeded.
1146 bool ScreenToLocal(const RenderTask& renderTask, float& localX, float& localY, float screenX, float screenY) const;
1149 * Converts from the actor's coordinate system to screen coordinates.
1150 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1151 * @param[in] viewMatrix The view-matrix
1152 * @param[in] projectionMatrix The projection-matrix
1153 * @param[in] viewport The view-port
1154 * @param[out] localX On return, the X-coordinate relative to the actor.
1155 * @param[out] localY On return, the Y-coordinate relative to the actor.
1156 * @param[in] screenX The screen X-coordinate.
1157 * @param[in] screenY The screen Y-coordinate.
1158 * @return True if the conversion succeeded.
1160 bool ScreenToLocal(const Matrix& viewMatrix,
1161 const Matrix& projectionMatrix,
1162 const Viewport& viewport,
1166 float screenY) const;
1169 * Sets whether the actor should receive a notification when touch or hover motion events leave
1170 * the boundary of the actor.
1172 * @note By default, this is set to false as most actors do not require this.
1173 * @note Need to connect to the SignalTouch or SignalHover to actually receive this event.
1175 * @param[in] required Should be set to true if a Leave event is required
1177 void SetLeaveRequired(bool required)
1179 mLeaveRequired = required;
1183 * This returns whether the actor requires touch or hover events whenever touch or hover motion events leave
1184 * the boundary of the actor.
1185 * @return true if a Leave event is required, false otherwise.
1187 bool GetLeaveRequired() const
1189 return mLeaveRequired;
1193 * @copydoc Dali::Actor::SetKeyboardFocusable()
1195 void SetKeyboardFocusable(bool focusable)
1197 mKeyboardFocusable = focusable;
1201 * @copydoc Dali::Actor::IsKeyboardFocusable()
1203 bool IsKeyboardFocusable() const
1205 return mKeyboardFocusable;
1209 * @copydoc Dali::Actor::SetKeyboardFocusableChildren()
1211 void SetKeyboardFocusableChildren(bool focusable)
1213 mKeyboardFocusableChildren = focusable;
1217 * @copydoc Dali::Actor::AreChildrenKeyBoardFocusable()
1219 bool AreChildrenKeyBoardFocusable() const
1221 return mKeyboardFocusableChildren;
1225 * Set whether this view can focus by touch.
1226 * @param[in] focusable focuable by touch.
1228 void SetTouchFocusable(bool focusable)
1230 mTouchFocusable = focusable;
1234 * This returns whether this actor can focus by touch.
1235 * @return true if this actor can focus by touch.
1237 bool IsTouchFocusable() const
1239 return mTouchFocusable;
1243 * Query whether the application or derived actor type requires intercept touch events.
1244 * @return True if intercept touch events are required.
1246 bool GetInterceptTouchRequired() const
1248 return !mInterceptTouchedSignal.Empty();
1252 * Query whether the application or derived actor type requires touch events.
1253 * @return True if touch events are required.
1255 bool GetTouchRequired() const
1257 return !mTouchedSignal.Empty();
1261 * Query whether the application or derived actor type requires hover events.
1262 * @return True if hover events are required.
1264 bool GetHoverRequired() const
1266 return !mHoveredSignal.Empty();
1270 * Query whether the application or derived actor type requires wheel events.
1271 * @return True if wheel events are required.
1273 bool GetWheelEventRequired() const
1275 return !mWheelEventSignal.Empty();
1279 * Query whether the actor is actually hittable. This method checks whether the actor is
1280 * sensitive, has the visibility flag set to true and is not fully transparent.
1281 * @return true, if it can be hit, false otherwise.
1283 bool IsHittable() const
1285 return (IsUserInteractionEnabled()) && IsSensitive() && IsVisible() && (GetCurrentWorldColor().a > FULLY_TRANSPARENT) && IsNodeConnected();
1289 * Query whether the actor captures all touch after it starts even if touch leaves its boundary.
1290 * @return true, if it captures all touch after start
1292 bool CapturesAllTouchAfterStart() const
1294 return mCaptureAllTouchAfterStart;
1298 * Sets the touch area offset of an actor.
1299 * @param [in] offset The new offset of area (left, right, bottom, top).
1301 void SetTouchAreaOffset(Rect<int> offset)
1303 mTouchAreaOffset = offset;
1307 * Retrieve the Actor's touch area offset.
1308 * @return The Actor's touch area offset.
1310 const Rect<int>& GetTouchAreaOffset() const
1312 return mTouchAreaOffset;
1318 * Retrieve the gesture data associated with this actor. The first call to this method will
1319 * allocate space for the ActorGestureData so this should only be called if an actor really does
1321 * @return Reference to the ActorGestureData for this actor.
1322 * @note Once the gesture-data is created for an actor it is likely that gestures are required
1323 * throughout the actor's lifetime so it will only be deleted when the actor is destroyed.
1325 ActorGestureData& GetGestureData();
1328 * Queries whether the actor requires the gesture type.
1329 * @param[in] type The gesture type.
1330 * @return True if the gesture is required, false otherwise.
1332 bool IsGestureRequired(GestureType::Value type) const;
1337 * Used by the EventProcessor to emit intercept touch event signals.
1338 * @param[in] touch The touch data.
1339 * @return True if the event was intercepted.
1341 bool EmitInterceptTouchEventSignal(const Dali::TouchEvent& touch);
1344 * Used by the EventProcessor to emit touch event signals.
1345 * @param[in] touch The touch data.
1346 * @return True if the event was consumed.
1348 bool EmitTouchEventSignal(const Dali::TouchEvent& touch);
1351 * Used by the EventProcessor to emit hover event signals.
1352 * @param[in] event The hover event.
1353 * @return True if the event was consumed.
1355 bool EmitHoverEventSignal(const Dali::HoverEvent& event);
1358 * Used by the EventProcessor to emit wheel event signals.
1359 * @param[in] event The wheel event.
1360 * @return True if the event was consumed.
1362 bool EmitWheelEventSignal(const Dali::WheelEvent& event);
1365 * @brief Emits the visibility change signal for this actor and all its children.
1366 * @param[in] visible Whether the actor has become visible or not.
1367 * @param[in] type Whether the actor's visible property has changed or a parent's.
1369 void EmitVisibilityChangedSignal(bool visible, DevelActor::VisibilityChange::Type type);
1372 * @brief Emits the layout direction change signal for this actor and all its children.
1373 * @param[in] type Whether the actor's layout direction property has changed or a parent's.
1375 void EmitLayoutDirectionChangedSignal(LayoutDirection::Type type);
1378 * @copydoc DevelActor::InterceptTouchedSignal()
1380 Dali::Actor::TouchEventSignalType& InterceptTouchedSignal()
1382 return mInterceptTouchedSignal;
1386 * @copydoc Dali::Actor::TouchedSignal()
1388 Dali::Actor::TouchEventSignalType& TouchedSignal()
1390 return mTouchedSignal;
1394 * @copydoc Dali::Actor::HoveredSignal()
1396 Dali::Actor::HoverSignalType& HoveredSignal()
1398 return mHoveredSignal;
1402 * @copydoc Dali::Actor::WheelEventSignal()
1404 Dali::Actor::WheelEventSignalType& WheelEventSignal()
1406 return mWheelEventSignal;
1410 * @copydoc Dali::Actor::OnSceneSignal()
1412 Dali::Actor::OnSceneSignalType& OnSceneSignal()
1414 return mOnSceneSignal;
1418 * @copydoc Dali::Actor::OffSceneSignal()
1420 Dali::Actor::OffSceneSignalType& OffSceneSignal()
1422 return mOffSceneSignal;
1426 * @copydoc Dali::Actor::OnRelayoutSignal()
1428 Dali::Actor::OnRelayoutSignalType& OnRelayoutSignal()
1430 return mOnRelayoutSignal;
1434 * @copydoc DevelActor::VisibilityChangedSignal
1436 DevelActor::VisibilityChangedSignalType& VisibilityChangedSignal()
1438 return mVisibilityChangedSignal;
1442 * @copydoc LayoutDirectionChangedSignal
1444 Dali::Actor::LayoutDirectionChangedSignalType& LayoutDirectionChangedSignal()
1446 return mLayoutDirectionChangedSignal;
1450 * @copydoc DevelActor::ChildAddedSignal
1452 DevelActor::ChildChangedSignalType& ChildAddedSignal();
1455 * @copydoc DevelActor::ChildRemovedSignal
1457 DevelActor::ChildChangedSignalType& ChildRemovedSignal();
1460 * @copydoc DevelActor::ChildOrderChangedSignal
1462 DevelActor::ChildOrderChangedSignalType& ChildOrderChangedSignal();
1468 * For use in derived classes.
1469 * This should only be called by Animation, when the actor is resized using Animation::Resize().
1471 virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
1484 * Protected Constructor. See Actor::New().
1485 * The second-phase construction Initialize() member should be called immediately after this.
1486 * @param[in] derivedType The derived type of actor (if any).
1487 * @param[in] reference to the node
1489 Actor(DerivedType derivedType, const SceneGraph::Node& node);
1492 * Second-phase constructor. Must be called immediately after creating a new Actor;
1494 void Initialize(void);
1497 * A reference counted object may only be deleted by calling Unreference()
1502 * Called on a child during Add() when the parent actor is connected to the Scene.
1503 * @param[in] parentDepth The depth of the parent in the hierarchy.
1504 * @param[in] notify Emits notification if set to true.
1506 void ConnectToScene(uint32_t parentDepth, bool notify);
1509 * Connect the Node associated with this Actor to the scene-graph.
1511 void ConnectToSceneGraph();
1514 * Helper for ConnectToScene, to notify a connected actor through the public API.
1515 * @param[in] notify Emits notification if set to true.
1517 void NotifyStageConnection(bool notify);
1520 * Called on a child during Remove() when the actor was previously on the Stage.
1521 * @param[in] notify Emits notification if set to true.
1523 void DisconnectFromStage(bool notify);
1526 * Disconnect the Node associated with this Actor from the scene-graph.
1528 void DisconnectFromSceneGraph();
1531 * Helper for DisconnectFromStage, to notify a disconnected actor through the public API.
1532 * @param[in] notify Emits notification if set to true.
1534 void NotifyStageDisconnection(bool notify);
1537 * When the Actor is OnScene, checks whether the corresponding Node is connected to the scene graph.
1538 * @return True if the Actor is OnScene & has a Node connected to the scene graph.
1540 bool IsNodeConnected() const;
1544 * Trigger a rebuild of the actor depth tree from this root
1545 * If a Layer3D is encountered, then this doesn't descend any further.
1546 * The mSortedDepth of each actor is set appropriately.
1548 void RebuildDepthTree();
1551 // Default property extensions from Object
1554 * @copydoc Dali::Internal::Object::SetDefaultProperty()
1556 void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue) override;
1559 * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
1561 void SetSceneGraphProperty(Property::Index index, const PropertyMetadata& entry, const Property::Value& value) override;
1564 * @copydoc Dali::Internal::Object::GetDefaultProperty()
1566 Property::Value GetDefaultProperty(Property::Index index) const override;
1569 * @copydoc Dali::Internal::Object::GetDefaultPropertyCurrentValue()
1571 Property::Value GetDefaultPropertyCurrentValue(Property::Index index) const override;
1574 * @copydoc Dali::Internal::Object::OnNotifyDefaultPropertyAnimation()
1576 void OnNotifyDefaultPropertyAnimation(Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType) override;
1579 * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
1581 const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty(Property::Index index) const override;
1584 * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
1586 const PropertyInputImpl* GetSceneObjectInputProperty(Property::Index index) const override;
1589 * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
1591 int32_t GetPropertyComponentIndex(Property::Index index) const override;
1594 * @copydoc Dali::Internal::Object::IsAnimationPossible()
1596 bool IsAnimationPossible() const override
1602 * Retrieve the actor's node.
1603 * @return The node used by this actor
1605 const SceneGraph::Node& GetNode() const;
1608 * @copydoc Dali::DevelActor::Raise()
1613 * @copydoc Dali::DevelActor::Lower()
1618 * @copydoc Dali::DevelActor::RaiseToTop()
1623 * @copydoc Dali::DevelActor::LowerToBottom()
1625 void LowerToBottom();
1628 * @copydoc Dali::DevelActor::RaiseAbove()
1630 void RaiseAbove(Internal::Actor& target);
1633 * @copydoc Dali::DevelActor::LowerBelow()
1635 void LowerBelow(Internal::Actor& target);
1639 * Sets the scene which this actor is added to.
1640 * @param[in] scene The scene
1642 void SetScene(Scene& scene)
1648 * Gets the scene which this actor is added to.
1651 Scene& GetScene() const
1656 LayoutDirection::Type GetLayoutDirection() const
1658 return mLayoutDirection;
1671 // Remove default constructor and copy constructor
1673 Actor(const Actor&) = delete;
1674 Actor& operator=(const Actor& rhs) = delete;
1677 * Set the actor's parent.
1678 * @param[in] parent The new parent.
1679 * @param[in] notify Emits notification if set to true. Default is true.
1681 void SetParent(ActorParent* parent, bool notify = true);
1684 * For use in derived classes, called after Initialize()
1686 virtual void OnInitialize()
1691 * For use in internal derived classes.
1692 * This is called during ConnectToScene(), after the actor has finished adding its node to the scene-graph.
1693 * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1695 virtual void OnSceneConnectionInternal()
1700 * For use in internal derived classes.
1701 * This is called during DisconnectFromStage(), before the actor removes its node from the scene-graph.
1702 * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1704 virtual void OnSceneDisconnectionInternal()
1709 * For use in external (CustomActor) derived classes.
1710 * This is called after the atomic ConnectToScene() traversal has been completed.
1712 virtual void OnSceneConnectionExternal(int depth)
1717 * For use in external (CustomActor) derived classes.
1718 * This is called after the atomic DisconnectFromStage() traversal has been completed.
1720 virtual void OnSceneDisconnectionExternal()
1725 * For use in derived classes; this is called after Add() has added a child.
1726 * @param[in] child The child that was added.
1728 virtual void OnChildAdd(Actor& child)
1733 * For use in derived classes; this is called after Remove() has attempted to remove a child( regardless of whether it succeeded or not ).
1734 * @param[in] child The child that was removed.
1736 virtual void OnChildRemove(Actor& child)
1741 * For use in derived classes.
1742 * This is called after SizeSet() has been called.
1744 virtual void OnSizeSet(const Vector3& targetSize)
1749 * @brief Retrieves the cached event side value of a default property.
1750 * @param[in] index The index of the property
1751 * @param[out] value Is set with the cached value of the property if found.
1752 * @return True if value set, false otherwise.
1754 bool GetCachedPropertyValue(Property::Index index, Property::Value& value) const;
1757 * @brief Retrieves the current value of a default property from the scene-graph.
1758 * @param[in] index The index of the property
1759 * @param[out] value Is set with the current scene-graph value of the property
1760 * @return True if value set, false otherwise.
1762 bool GetCurrentPropertyValue(Property::Index index, Property::Value& value) const;
1765 * Retrieve the parent object of an Actor.
1766 * @return The parent object, or NULL if the Actor does not have a parent.
1768 Object* GetParentObject() const override
1770 return static_cast<Actor*>(mParent);
1774 * @brief Get the current position of the actor in screen coordinates.
1776 * @return Returns the screen position of actor
1778 const Vector2 GetCurrentScreenPosition() const;
1781 * Sets the visibility flag of an actor.
1782 * @param[in] visible The new visibility flag.
1783 * @param[in] sendMessage Whether to send a message to the update thread or not.
1785 void SetVisibleInternal(bool visible, SendMessage::Type sendMessage);
1788 * @copydoc ActorParent::SetSiblingOrderOfChild
1790 void SetSiblingOrderOfChild(Actor& child, uint32_t order) override;
1793 * @copydoc ActorParent::GetSiblingOrderOfChild
1795 uint32_t GetSiblingOrderOfChild(const Actor& child) const override;
1798 * @copydoc ActorParent::RaiseChild
1800 void RaiseChild(Actor& child) override;
1803 * @copydoc ActorParent::LowerChild
1805 void LowerChild(Actor& child) override;
1808 * @copydoc ActorParent::RaiseChildToTop
1810 void RaiseChildToTop(Actor& child) override;
1813 * @copydoc ActorParent::LowerChildToBottom
1815 void LowerChildToBottom(Actor& child) override;
1818 * @copydoc ActorParent::RaiseChildAbove
1820 void RaiseChildAbove(Actor& child, Actor& target) override;
1823 * @copydoc ActorParent::LowerChildBelow()
1825 void LowerChildBelow(Actor& child, Actor& target) override;
1828 * Set whether a child actor inherits it's parent's layout direction. Default is to inherit.
1829 * @param[in] inherit - true if the actor should inherit layout direction, false otherwise.
1831 void SetInheritLayoutDirection(bool inherit);
1834 * Returns whether the actor inherits it's parent's layout direction.
1835 * @return true if the actor inherits it's parent's layout direction, false otherwise.
1837 bool IsLayoutDirectionInherited() const
1839 return mInheritLayoutDirection;
1843 * @brief Sets the update size hint of an actor.
1844 * @param [in] updateSizeHint The update size hint.
1846 void SetUpdateSizeHint(const Vector2& updateSizeHint);
1849 ActorParentImpl mParentImpl; ///< Implementation of ActorParent;
1850 ActorSizer mSizer; ///< Implementation for managing actor size
1851 ActorParent* mParent; ///< Each actor (except the root) can have one parent
1852 Scene* mScene; ///< The scene the actor is added to
1853 RendererContainer* mRenderers; ///< Renderer container
1854 Vector3* mParentOrigin; ///< NULL means ParentOrigin::DEFAULT. ParentOrigin is non-animatable
1855 Vector3* mAnchorPoint; ///< NULL means AnchorPoint::DEFAULT. AnchorPoint is non-animatable
1856 ActorGestureData* mGestureData; ///< Optional Gesture data. Only created when actor requires gestures
1859 Dali::Actor::TouchEventSignalType mInterceptTouchedSignal;
1860 Dali::Actor::TouchEventSignalType mTouchedSignal;
1861 Dali::Actor::HoverSignalType mHoveredSignal;
1862 Dali::Actor::WheelEventSignalType mWheelEventSignal;
1863 Dali::Actor::OnSceneSignalType mOnSceneSignal;
1864 Dali::Actor::OffSceneSignalType mOffSceneSignal;
1865 Dali::Actor::OnRelayoutSignalType mOnRelayoutSignal;
1866 DevelActor::VisibilityChangedSignalType mVisibilityChangedSignal;
1867 Dali::Actor::LayoutDirectionChangedSignalType mLayoutDirectionChangedSignal;
1869 Quaternion mTargetOrientation; ///< Event-side storage for orientation
1870 Vector4 mTargetColor; ///< Event-side storage for color
1871 Vector3 mTargetPosition; ///< Event-side storage for position (not a pointer as most actors will have a position)
1872 Vector3 mTargetScale; ///< Event-side storage for scale
1873 Rect<int> mTouchAreaOffset; ///< touch area offset (left, right, bottom, top)
1875 ConstString mName; ///< Name of the actor
1876 uint32_t mSortedDepth; ///< The sorted depth index. A combination of tree traversal and sibling order.
1877 int16_t mDepth; ///< The depth in the hierarchy of the actor. Only 32,767 levels of depth are supported
1879 const bool mIsRoot : 1; ///< Flag to identify the root actor
1880 const bool mIsLayer : 1; ///< Flag to identify that this is a layer
1881 bool mIsOnScene : 1; ///< Flag to identify whether the actor is on-scene
1882 bool mSensitive : 1; ///< Whether the actor emits touch event signals
1883 bool mLeaveRequired : 1; ///< Whether a touch event signal is emitted when the a touch leaves the actor's bounds
1884 bool mKeyboardFocusable : 1; ///< Whether the actor should be focusable by keyboard navigation
1885 bool mKeyboardFocusableChildren : 1; ///< Whether the children of this actor can be focusable by keyboard navigation.
1886 bool mTouchFocusable : 1; ///< Whether the actor should be focusable by touch
1887 bool mOnSceneSignalled : 1; ///< Set to true before OnSceneConnection signal is emitted, and false before OnSceneDisconnection
1888 bool mInheritPosition : 1; ///< Cached: Whether the parent's position should be inherited.
1889 bool mInheritOrientation : 1; ///< Cached: Whether the parent's orientation should be inherited.
1890 bool mInheritScale : 1; ///< Cached: Whether the parent's scale should be inherited.
1891 bool mPositionUsesAnchorPoint : 1; ///< Cached: Whether the position uses the anchor point or not.
1892 bool mVisible : 1; ///< Cached: Whether the actor is visible or not.
1893 bool mInheritLayoutDirection : 1; ///< Whether the actor inherits the layout direction from parent.
1894 bool mCaptureAllTouchAfterStart : 1; ///< Whether the actor should capture all touch after touch starts even if the motion moves outside of the actor area.
1895 bool mIsBlendEquationSet : 1; ///< Flag to identify whether the Blend equation is set
1896 bool mNeedGesturePropagation : 1; ///< Whether the parent listens for gesture events or not
1897 bool mUserInteractionEnabled : 1; ///< Whether the actor should be enabled user interaction.
1898 LayoutDirection::Type mLayoutDirection : 2; ///< Layout direction, Left to Right or Right to Left.
1899 DrawMode::Type mDrawMode : 3; ///< Cached: How the actor and its children should be drawn
1900 ColorMode mColorMode : 3; ///< Cached: Determines whether mWorldColor is inherited
1901 ClippingMode::Type mClippingMode : 3; ///< Cached: Determines which clipping mode (if any) to use.
1902 DevelBlendEquation::Type mBlendEquation : 16; ///< Cached: Determines which blend equation will be used to render renderers.
1905 static ActorContainer mNullChildren; ///< Empty container (shared by all actors, returned by GetChildren() const)
1907 struct PropertyHandler;
1908 struct SiblingHandler;
1910 friend class ActorParentImpl; // Allow impl to call private methods on actor
1911 friend class ActorSizer; // Allow sizer to call private methods on actor
1914 } // namespace Internal
1916 // Helpers for public-api forwarding methods
1918 inline Internal::Actor& GetImplementation(Dali::Actor& actor)
1920 DALI_ASSERT_ALWAYS(actor && "Actor handle is empty");
1922 BaseObject& handle = actor.GetBaseObject();
1924 return static_cast<Internal::Actor&>(handle);
1927 inline const Internal::Actor& GetImplementation(const Dali::Actor& actor)
1929 DALI_ASSERT_ALWAYS(actor && "Actor handle is empty");
1931 const BaseObject& handle = actor.GetBaseObject();
1933 return static_cast<const Internal::Actor&>(handle);
1938 #endif // DALI_INTERNAL_ACTOR_H