1 #ifndef DALI_INTERNAL_ACTOR_H
2 #define DALI_INTERNAL_ACTOR_H
5 * Copyright (c) 2022 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/integration-api/events/touch-event-integ.h>
38 #include <dali/internal/common/const-string.h>
39 #include <dali/internal/common/internal-constants.h>
40 #include <dali/internal/common/memory-pool-object-allocator.h>
41 #include <dali/internal/event/actors/actor-declarations.h>
42 #include <dali/internal/event/actors/actor-parent-impl.h>
43 #include <dali/internal/event/actors/actor-parent.h>
44 #include <dali/internal/event/actors/actor-renderer-container.h>
45 #include <dali/internal/event/actors/actor-sizer.h>
46 #include <dali/internal/event/common/object-impl.h>
47 #include <dali/internal/event/common/stage-def.h>
48 #include <dali/internal/update/nodes/node-declarations.h>
60 class ActorGestureData;
67 * Actor is the primary object with which Dali applications interact.
68 * UI controls can be built by combining multiple actors.
69 * Multi-Touch events are received through signals emitted by the actor tree.
71 * An Actor is a proxy for a Node in the scene graph.
72 * When an Actor is added to the Stage, it creates a node and connects it to the scene graph.
73 * The scene-graph can be updated in a separate thread, so the connection is done using an asynchronous message.
74 * When a tree of Actors is detached from the Stage, a message is sent to destroy the associated nodes.
76 class Actor : public Object, public ActorParent
81 * @return A smart-pointer to the newly allocated Actor.
83 static ActorPtr New();
86 * Helper to create node for derived classes who don't have their own node type
87 * @return pointer to newly created unique node
89 static const SceneGraph::Node* CreateNode();
92 * Retrieve the name of the actor.
95 std::string_view GetName() const
97 return mName.GetStringView();
101 * Set the name of the actor.
102 * @param[in] name The new name.
104 void SetName(std::string_view name);
107 * @copydoc Dali::Actor::GetId
109 uint32_t GetId() const;
114 * Query whether an actor is the root actor, which is owned by the Stage.
115 * @return True if the actor is a root actor.
123 * Query whether the actor is connected to the Scene.
131 * Query whether the actor has any renderers.
132 * @return True if the actor is renderable.
134 bool IsRenderable() const
136 // inlined as this is called a lot in hit testing
137 return mRenderers && !mRenderers->IsEmpty();
141 * Query whether the actor is of class Dali::Layer
142 * @return True if the actor is a layer.
146 // inlined as this is called a lot in hit testing
151 * Gets the layer in which the actor is present
152 * @return The layer, which will be uninitialized if the actor is off-stage.
154 Dali::Layer GetLayer();
157 * @copydoc Dali::Internal::ActorParent::Add()
159 void Add(Actor& child, bool notify = true) override;
162 * @copydoc Dali::Internal::ActorParent::Remove()
164 void Remove(Actor& child, bool notify = true) override;
167 * @copydoc Dali::DevelActor::SwitchParent()
169 void SwitchParent(Actor& newParent);
172 * @copydoc Dali::Actor::Unparent
177 * @copydoc Dali::Internal::ActorParent::GetChildCount()
179 uint32_t GetChildCount() const override;
182 * @copydoc Dali::Internal::ActorParent::GetChildAt
184 ActorPtr GetChildAt(uint32_t index) const override;
187 * Retrieve a reference to Actor's children.
188 * @note Not for public use.
189 * @return A reference to the container of children.
190 * @note The internal container is lazily initialized so ensure you check the child count before using the value returned by this method.
192 ActorContainer& GetChildrenInternal();
195 * @copydoc Dali::Internal::ActorParent::FindChildByName
197 ActorPtr FindChildByName(ConstString actorName) override;
200 * @copydoc Dali::Internal::ActorParent::FindChildById
202 ActorPtr FindChildById(const uint32_t id) override;
205 * @copydoc Dali::Internal::ActorParent::UnparentChildren
207 void UnparentChildren() override;
210 * Retrieve the parent of an Actor.
211 * @return The parent actor, or NULL if the Actor does not have a parent.
213 Actor* GetParent() const
215 return static_cast<Actor*>(mParent);
219 * Calculates screen position and size.
221 * @return pair of two values, position of top-left corner on screen and size respectively.
223 Rect<> CalculateScreenExtents() const;
226 * @copydoc DevelActor::SetNeedGesturePropagation.
228 void SetNeedGesturePropagation(bool propagation)
230 mNeedGesturePropagation = propagation;
234 * Retrieve need gesture propagation value
235 * @return The actor's need gesture propagation value.
237 bool NeedGesturePropagation() const
239 return mNeedGesturePropagation;
243 * Sets the size of an actor.
244 * This does not interfere with the actors scale factor.
245 * @param [in] width The new width.
246 * @param [in] height The new height.
248 void SetSize(float width, float height);
251 * Sets the size of an actor.
252 * This does not interfere with the actors scale factor.
253 * @param [in] width The size of the actor along the x-axis.
254 * @param [in] height The size of the actor along the y-axis.
255 * @param [in] depth The size of the actor along the z-axis.
257 void SetSize(float width, float height, float depth);
260 * Sets the size of an actor.
261 * This does not interfere with the actors scale factor.
262 * @param [in] size The new size.
264 void SetSize(const Vector2& size);
267 * Sets the size of an actor.
268 * This does not interfere with the actors scale factor.
269 * @param [in] size The new size.
271 void SetSize(const Vector3& size);
274 * Set the width component of the Actor's size.
275 * @param [in] width The new width component.
277 void SetWidth(float width);
280 * Set the height component of the Actor's size.
281 * @param [in] height The new height component.
283 void SetHeight(float height);
286 * Set the depth component of the Actor's size.
287 * @param [in] depth The new depth component.
289 void SetDepth(float depth);
292 * Retrieve the Actor's size from event side.
293 * This size will be the size set or if animating then the target size.
294 * @return The Actor's size.
296 Vector3 GetTargetSize() const;
299 * Retrieve the Actor's size from update side.
300 * This size will be the size set or animating but will be a frame behind.
301 * @return The Actor's size.
303 const Vector3& GetCurrentSize() const;
306 * Return the natural size of the actor
308 * @return The actor's natural size
310 virtual Vector3 GetNaturalSize() const;
313 * Set the origin of an actor, within its parent's area.
314 * This is expressed in 2D unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent,
315 * and (1.0, 1.0, 0.5) is the bottom-right corner.
316 * The default parent-origin is top-left (0.0, 0.0, 0.5).
317 * An actor position is the distance between this origin, and the actors anchor-point.
318 * @param [in] origin The new parent-origin.
320 void SetParentOrigin(const Vector3& origin);
323 * Retrieve the parent-origin of an actor.
324 * @return The parent-origin.
326 const Vector3& GetCurrentParentOrigin() const;
329 * Set the anchor-point of an actor. This is expressed in 2D unit coordinates, such that
330 * (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.
331 * The default anchor point is top-left (0.0, 0.0, 0.5).
332 * An actor position is the distance between its parent-origin, and this anchor-point.
333 * An actor's rotation is centered around its anchor-point.
334 * @param [in] anchorPoint The new anchor-point.
336 void SetAnchorPoint(const Vector3& anchorPoint);
339 * Retrieve the anchor-point of an actor.
340 * @return The anchor-point.
342 const Vector3& GetCurrentAnchorPoint() const;
345 * If the position uses the anchor point, return the anchor point, otherwise
347 * @return The anchor point for positioning.
349 Vector3 GetAnchorPointForPosition() const;
352 * Sets the position of the Actor.
353 * The coordinates are relative to the Actor's parent.
354 * The Actor's z position will be set to 0.0f.
355 * @param [in] x The new x position
356 * @param [in] y The new y position
358 void SetPosition(float x, float y);
361 * Sets the position of the Actor.
362 * The coordinates are relative to the Actor's parent.
363 * @param [in] x The new x position
364 * @param [in] y The new y position
365 * @param [in] z The new z position
367 void SetPosition(float x, float y, float z);
370 * Sets the position of the Actor.
371 * The coordinates are relative to the Actor's parent.
372 * @param [in] position The new position.
374 void SetPosition(const Vector3& position);
377 * Set the position of an actor along the X-axis.
378 * @param [in] x The new x position
383 * Set the position of an actor along the Y-axis.
384 * @param [in] y The new y position.
389 * Set the position of an actor along the Z-axis.
390 * @param [in] z The new z position
395 * Translate an actor relative to its existing position.
396 * @param[in] distance The actor will move by this distance.
398 void TranslateBy(const Vector3& distance);
401 * Retrieve the position of the Actor.
402 * The coordinates are relative to the Actor's parent.
403 * @return the Actor's position.
405 const Vector3& GetCurrentPosition() const;
408 * Retrieve the target position of the Actor.
409 * The coordinates are relative to the Actor's parent.
410 * @return the Actor's position.
412 const Vector3& GetTargetPosition() const
414 return mTargetPosition;
418 * @copydoc Dali::Actor::GetCurrentWorldPosition()
420 const Vector3& GetCurrentWorldPosition() const;
423 * @copydoc Dali::Actor::SetInheritPosition()
425 void SetInheritPosition(bool inherit);
428 * @copydoc Dali::Actor::IsPositionInherited()
430 bool IsPositionInherited() const
432 return mInheritPosition;
436 * Sets the orientation of the Actor.
437 * @param [in] angleRadians The new orientation angle in radians.
438 * @param [in] axis The new axis of orientation.
440 void SetOrientation(const Radian& angleRadians, const Vector3& axis);
443 * Sets the orientation of the Actor.
444 * @param [in] orientation The new orientation.
446 void SetOrientation(const Quaternion& orientation);
449 * Rotate an actor around its existing rotation axis.
450 * @param[in] angleRadians The angle to the rotation to combine with the existing rotation.
451 * @param[in] axis The axis of the rotation to combine with the existing rotation.
453 void RotateBy(const Radian& angleRadians, const Vector3& axis);
456 * Apply a relative rotation to an actor.
457 * @param[in] relativeRotation The rotation to combine with the actors existing rotation.
459 void RotateBy(const Quaternion& relativeRotation);
462 * Retreive the Actor's orientation.
463 * @return the orientation.
465 const Quaternion& GetCurrentOrientation() const;
468 * Set whether a child actor inherits it's parent's orientation. Default is to inherit.
469 * Switching this off means that using SetOrientation() sets the actor's world orientation.
470 * @param[in] inherit - true if the actor should inherit orientation, false otherwise.
472 void SetInheritOrientation(bool inherit);
475 * Returns whether the actor inherit's it's parent's orientation.
476 * @return true if the actor inherit's it's parent orientation, false if it uses world orientation.
478 bool IsOrientationInherited() const
480 return mInheritOrientation;
484 * Sets the factor of the parents size used for the child actor.
485 * Note: Only used if ResizePolicy is ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
486 * @param[in] factor The vector to multiply the parents size by to get the childs size.
488 void SetSizeModeFactor(const Vector3& factor);
491 * Gets the factor of the parents size used for the child actor.
492 * Note: Only used if ResizePolicy is ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
493 * @return The vector being used to multiply the parents size by to get the childs size.
495 const Vector3& GetSizeModeFactor() const;
498 * @copydoc Dali::Actor::GetCurrentWorldOrientation()
500 const Quaternion& GetCurrentWorldOrientation() const;
503 * Sets a scale factor applied to an actor.
504 * @param [in] scale The scale factor applied on all axes.
506 void SetScale(float scale);
509 * Sets a scale factor applied to an actor.
510 * @param [in] scaleX The scale factor applied along the x-axis.
511 * @param [in] scaleY The scale factor applied along the y-axis.
512 * @param [in] scaleZ The scale factor applied along the z-axis.
514 void SetScale(float scaleX, float scaleY, float scaleZ);
517 * Sets a scale factor applied to an actor.
518 * @param [in] scale A vector representing the scale factor for each axis.
520 void SetScale(const Vector3& scale);
523 * Set the x component of the scale factor.
524 * @param [in] x The new x value.
526 void SetScaleX(float x);
529 * Set the y component of the scale factor.
530 * @param [in] y The new y value.
532 void SetScaleY(float y);
535 * Set the z component of the scale factor.
536 * @param [in] z The new z value.
538 void SetScaleZ(float z);
541 * Apply a relative scale to an actor.
542 * @param[in] relativeScale The scale to combine with the actors existing scale.
544 void ScaleBy(const Vector3& relativeScale);
547 * Retrieve the scale factor applied to an actor.
548 * @return A vector representing the scale factor for each axis.
550 const Vector3& GetCurrentScale() const;
553 * @copydoc Dali::Actor::GetCurrentWorldScale()
555 const Vector3& GetCurrentWorldScale() const;
558 * @copydoc Dali::Actor::SetInheritScale()
560 void SetInheritScale(bool inherit);
563 * @copydoc Dali::Actor::IsScaleInherited()
565 bool IsScaleInherited() const
567 return mInheritScale;
571 * @copydoc Dali::Actor::GetCurrentWorldMatrix()
573 Matrix GetCurrentWorldMatrix() const;
578 * Sets the visibility flag of an actor.
579 * @param[in] visible The new visibility flag.
581 void SetVisible(bool visible);
584 * Retrieve the visibility flag of an actor.
585 * @return The visibility flag.
587 bool IsVisible() const;
590 * Sets the opacity of an actor.
591 * @param [in] opacity The new opacity.
593 void SetOpacity(float opacity);
596 * Retrieve the actor's opacity.
597 * @return The actor's opacity.
599 float GetCurrentOpacity() const;
602 * Retrieve the actor's clipping mode.
603 * @return The actor's clipping mode (cached)
605 ClippingMode::Type GetClippingMode() const
607 return mClippingMode;
611 * Sets whether an actor should emit touch or hover signals; see SignalTouch() and SignalHover().
612 * An actor is sensitive by default, which means that as soon as an application connects to the SignalTouch(),
613 * the touch event signal will be emitted, and as soon as an application connects to the SignalHover(), the
614 * hover event signal will be emitted.
616 * If the application wishes to temporarily disable the touch or hover event signal emission, then they can do so by calling:
618 * actor.SetSensitive(false);
621 * Then, to re-enable the touch or hover event signal emission, the application should call:
623 * actor.SetSensitive(true);
626 * @see SignalTouch() and SignalHover().
627 * @note If an actor's sensitivity is set to false, then it's children will not emit a touch or hover event signal either.
628 * @param[in] sensitive true to enable emission of the touch or hover event signals, false otherwise.
630 void SetSensitive(bool sensitive)
632 mSensitive = sensitive;
636 * Query whether an actor emits touch or hover event signals.
637 * @see SetSensitive(bool)
638 * @return true, if emission of touch or hover event signals is enabled, false otherwise.
640 bool IsSensitive() const
646 * Sets whether an actor should be enabled all user interaction including touch, focus and activation.
647 * This value have higher priority over the sensitve and focusable in negative action,
648 * which means IsSensitive() or IsFocusable() and enable is false, actor will not emits touch or focus event.
649 * An actor is enabled by default.
651 * If the application wishes to temporarily disable user interaction:
653 * actor.SetUserInteractionEnabled(false);
656 * Then, to re-enable user interaction, the application should call:
658 * actor.SetUserInteractionEnabled(true);
661 * @see IsSensitive(), IsHittable(), IsKeyboardFocusable() and IsTouchFocusable().
662 * @note If an actor's disabled, child still can be enabled.
663 * @param[in] enabled true to enable user interaction, false otherwise.
665 void SetUserInteractionEnabled(bool enabled)
667 mUserInteractionEnabled = enabled;
671 * Query whether an actor is enabled user interaction.
672 * @see SetSensitive(bool)
673 * @return true, if user interaction is enabled, false otherwise.
675 bool IsUserInteractionEnabled() const
677 return mUserInteractionEnabled;
681 * @copydoc Dali::Actor::SetDrawMode
683 void SetDrawMode(DrawMode::Type drawMode);
686 * @copydoc Dali::Actor::GetDrawMode
688 DrawMode::Type GetDrawMode() const
694 * @copydoc Dali::Actor::IsOverlay
696 bool IsOverlay() const
698 return (DrawMode::OVERLAY_2D == mDrawMode);
702 * Sets the actor's color. The final color of actor depends on its color mode.
703 * This final color is applied to the drawable elements of an actor.
704 * @param [in] color The new color.
706 void SetColor(const Vector4& color);
709 * Set the red component of the color.
710 * @param [in] red The new red component.
712 void SetColorRed(float red);
715 * Set the green component of the color.
716 * @param [in] green The new green component.
718 void SetColorGreen(float green);
721 * Set the blue component of the scale factor.
722 * @param [in] blue The new blue value.
724 void SetColorBlue(float blue);
727 * Retrieve the actor's color.
730 const Vector4& GetCurrentColor() const;
733 * Sets the actor's color mode.
734 * Color mode specifies whether Actor uses its own color or inherits its parent color
735 * @param [in] colorMode to use.
737 void SetColorMode(ColorMode colorMode);
740 * Returns the actor's color mode.
741 * @return currently used colorMode.
743 ColorMode GetColorMode() const
749 * @copydoc Dali::Actor::GetCurrentWorldColor()
751 const Vector4& GetCurrentWorldColor() const;
754 * @copydoc Dali::Actor::GetHierarchyDepth()
756 inline int32_t GetHierarchyDepth() const
767 * @brief Get the number of layer with 3D behaviour in ancestors include this. It will be 0 if actor is not on scene.
769 * @return currently the number of layer with 3D behaviour in ancestors.
771 inline int32_t GetLayer3DParentCount() const
775 return mLayer3DParentsCount;
782 * Get the actor's sorting depth
784 * @return The depth used for hit-testing and renderer sorting
786 inline uint32_t GetSortingDepth()
792 * Set the actor's sorted depth. Used during recreation of depth tree
793 * @param[in] sortedDepth the new sorted depth
795 inline void SetSortingDepth(uint32_t sortedDepth)
797 mSortedDepth = sortedDepth;
801 // Size negotiation virtual functions
804 * @brief Called after the size negotiation has been finished for this control.
806 * The control is expected to assign this given size to itself/its children.
808 * Should be overridden by derived classes if they need to layout
809 * actors differently after certain operations like add or remove
810 * actors, resize or after changing specific properties.
812 * Note! As this function is called from inside the size negotiation algorithm, you cannot
813 * call RequestRelayout (the call would just be ignored)
815 * @param[in] size The allocated size.
816 * @param[in,out] container The control should add actors to this container that it is not able
817 * to allocate a size for.
819 virtual void OnRelayout(const Vector2& size, RelayoutContainer& container)
824 * @brief Notification for deriving classes when the resize policy is set
826 * @param[in] policy The policy being set
827 * @param[in] dimension The dimension the policy is being set for
829 virtual void OnSetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension)
834 * @brief Virtual method to notify deriving classes that relayout dependencies have been
835 * met and the size for this object is about to be calculated for the given dimension
837 * @param dimension The dimension that is about to be calculated
839 virtual void OnCalculateRelayoutSize(Dimension::Type dimension)
844 * @brief Virtual method to notify deriving classes that the size for a dimension
845 * has just been negotiated
847 * @param[in] size The new size for the given dimension
848 * @param[in] dimension The dimension that was just negotiated
850 virtual void OnLayoutNegotiated(float size, Dimension::Type dimension)
855 * @brief Determine if this actor is dependent on it's children for relayout
857 * @param dimension The dimension(s) to check for
858 * @return Return if the actor is dependent on it's children
860 virtual bool RelayoutDependentOnChildren(Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
863 * @brief Calculate the size for a child
865 * @param[in] child The child actor to calculate the size for
866 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
867 * @return Return the calculated size for the given dimension
869 virtual float CalculateChildSize(const Dali::Actor& child, Dimension::Type dimension);
872 * @brief This method is called during size negotiation when a height is required for a given width.
874 * Derived classes should override this if they wish to customize the height returned.
876 * @param width to use.
877 * @return the height based on the width.
879 virtual float GetHeightForWidth(float width);
882 * @brief This method is called during size negotiation when a width is required for a given height.
884 * Derived classes should override this if they wish to customize the width returned.
886 * @param height to use.
887 * @return the width based on the width.
889 virtual float GetWidthForHeight(float height);
895 * @brief Called by the RelayoutController to negotiate the size of an actor.
897 * The size allocated by the the algorithm is passed in which the
898 * actor must adhere to. A container is passed in as well which
899 * the actor should populate with actors it has not / or does not
900 * need to handle in its size negotiation.
902 * @param[in] size The allocated size.
903 * @param[in,out] container The container that holds actors that are fed back into the
904 * RelayoutController algorithm.
906 void NegotiateSize(const Vector2& size, RelayoutContainer& container);
909 * @copydoc Dali::Actor::SetResizePolicy()
911 void SetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
914 * @copydoc Dali::Actor::GetResizePolicy()
916 ResizePolicy::Type GetResizePolicy(Dimension::Type dimension) const;
919 * @brief Set the size negotiation relayout enabled on this actor
921 * @param[in] relayoutEnabled Boolean to enable or disable relayout
923 void SetRelayoutEnabled(bool relayoutEnabled);
926 * @brief Return if relayout is enabled
928 * @return Return if relayout is enabled or not for this actor
930 bool IsRelayoutEnabled() const;
933 * @brief Mark an actor as having it's layout dirty
934 * @note Only called from RelayoutController
936 * @param dirty Whether to mark actor as dirty or not
937 * @param dimension The dimension(s) to mark as dirty
939 void SetLayoutDirty(bool dirty, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
942 * @brief Return if any of an actor's dimensions are marked as dirty
943 * @note Only called from RelayoutController
945 * @param dimension The dimension(s) to check
946 * @return Return if any of the requested dimensions are dirty
948 bool IsLayoutDirty(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) const;
951 * @brief Returns if relayout is enabled and the actor is not dirty
952 * @note Only called from RelayoutController
954 * @return Return if it is possible to relayout the actor
956 bool RelayoutPossible(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) const;
959 * @brief Returns if relayout is enabled and the actor is dirty
960 * @note Only called from RelayoutController
962 * @return Return if it is required to relayout the actor
964 bool RelayoutRequired(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) const;
967 * @brief Request a relayout, which means performing a size negotiation on this actor, its parent and children (and potentially whole scene)
969 * This method is automatically called from OnSceneConnection(), OnChildAdd(),
970 * OnChildRemove(), SetSizePolicy(), SetMinimumSize() and SetMaximumSize().
972 * This method can also be called from a derived class every time it needs a different size.
973 * At the end of event processing, the relayout process starts and
974 * all controls which requested Relayout will have their sizes (re)negotiated.
976 * @note RelayoutRequest() can be called multiple times; the size negotiation is still
977 * only performed once, i.e. there is no need to keep track of this in the calling side.
979 void RelayoutRequest(Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
982 * @brief Determine if this actor is dependent on it's parent for relayout
983 * @note Only called from RelayoutController
985 * @param dimension The dimension(s) to check for
986 * @return Return if the actor is dependent on it's parent
988 bool RelayoutDependentOnParent(Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
991 * @brief Determine if this actor has another dimension depedent on the specified one
992 * @note Only called from RelayoutController
994 * @param dimension The dimension to check for
995 * @param dependentDimension The dimension to check for dependency with
996 * @return Return if the actor is dependent on this dimension
998 bool RelayoutDependentOnDimension(Dimension::Type dimension, Dimension::Type dependentDimension);
1001 * @brief Set the padding for a dimension
1003 * @param[in] padding Padding for the dimension. X = start (e.g. left, bottom), y = end (e.g. right, top)
1004 * @param[in] dimension The dimension to set
1006 void SetPadding(const Vector2& padding, Dimension::Type dimension);
1009 * Return the value of padding for the given dimension
1011 * @param dimension The dimension to retrieve
1012 * @return Return the value of padding for the dimension
1014 Vector2 GetPadding(Dimension::Type dimension) const;
1017 * @brief Return the amount of size allocated for relayout
1019 * May include padding
1021 * @param[in] dimension The dimension to retrieve
1022 * @return Return the size
1024 float GetRelayoutSize(Dimension::Type dimension) const;
1027 * @brief Flag the actor as having it's layout dimension negotiated.
1029 * @param[in] negotiated The status of the flag to set.
1030 * @param[in] dimension The dimension to set the flag for
1032 void SetLayoutNegotiated(bool negotiated, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
1035 * @brief Test whether the layout dimension for this actor has been negotiated or not.
1037 * @param[in] dimension The dimension to determine the value of the flag for
1038 * @return Return if the layout dimension is negotiated or not.
1040 bool IsLayoutNegotiated(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) const;
1043 * @brief provides the Actor implementation of GetHeightForWidth
1044 * @param width to use.
1045 * @return the height based on the width.
1047 float GetHeightForWidthBase(float width);
1050 * @brief provides the Actor implementation of GetWidthForHeight
1051 * @param height to use.
1052 * @return the width based on the height.
1054 float GetWidthForHeightBase(float height);
1057 * @brief provides the Actor implementation of CalculateChildSize
1059 * @param[in] child The child actor to calculate the size for
1060 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
1061 * @return Return the calculated size for the given dimension
1063 float CalculateChildSizeBase(const Dali::Actor& child, Dimension::Type dimension);
1066 * @brief Determine if this actor is dependent on it's children for relayout.
1068 * @param dimension The dimension(s) to check for
1069 * @return Return if the actor is dependent on it's children
1071 bool RelayoutDependentOnChildrenBase(Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
1074 * @copydoc Dali::Actor::SetMinimumSize
1076 void SetMinimumSize(float size, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
1079 * @copydoc Dali::Actor::GetMinimumSize
1081 float GetMinimumSize(Dimension::Type dimension) const;
1084 * @copydoc Dali::Actor::SetMaximumSize
1086 void SetMaximumSize(float size, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
1089 * @copydoc Dali::Actor::GetMaximumSize
1091 float GetMaximumSize(Dimension::Type dimension) const;
1094 * @copydoc Dali::Actor::AddRenderer()
1096 uint32_t AddRenderer(Renderer& renderer);
1099 * @copydoc Dali::Actor::GetRendererCount()
1101 uint32_t GetRendererCount() const;
1104 * @copydoc Dali::Actor::GetRendererAt()
1106 RendererPtr GetRendererAt(uint32_t index);
1109 * @copydoc Dali::Actor::RemoveRenderer()
1111 void RemoveRenderer(Renderer& renderer);
1114 * @copydoc Dali::Actor::RemoveRenderer()
1116 void RemoveRenderer(uint32_t index);
1119 * @brief Set BlendEquation at each renderer that added on this Actor.
1121 void SetBlendEquation(DevelBlendEquation::Type blendEquation);
1124 * @brief Get Blend Equation that applied to this Actor
1126 DevelBlendEquation::Type GetBlendEquation() const;
1129 * @brief Set this Actor is transparent or not without any affection on the child Actors.
1131 void SetTransparent(bool transparent);
1134 * @brief Get this Actor is transparent or not.
1136 bool IsTransparent() const;
1140 * Converts screen coordinates into the actor's coordinate system.
1141 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1142 * @param[out] localX On return, the X-coordinate relative to the actor.
1143 * @param[out] localY On return, the Y-coordinate relative to the actor.
1144 * @param[in] screenX The screen X-coordinate.
1145 * @param[in] screenY The screen Y-coordinate.
1146 * @return True if the conversion succeeded.
1148 bool ScreenToLocal(float& localX, float& localY, float screenX, float screenY) const;
1151 * Converts screen coordinates into the actor's coordinate system.
1152 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1153 * @param[in] renderTask The render-task used to display the actor.
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 RenderTask& renderTask, float& localX, float& localY, float screenX, float screenY) const;
1163 * Converts from the actor's coordinate system to screen coordinates.
1164 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1165 * @param[in] viewMatrix The view-matrix
1166 * @param[in] projectionMatrix The projection-matrix
1167 * @param[in] viewport The view-port
1168 * @param[out] localX On return, the X-coordinate relative to the actor.
1169 * @param[out] localY On return, the Y-coordinate relative to the actor.
1170 * @param[in] screenX The screen X-coordinate.
1171 * @param[in] screenY The screen Y-coordinate.
1172 * @return True if the conversion succeeded.
1174 bool ScreenToLocal(const Matrix& viewMatrix,
1175 const Matrix& projectionMatrix,
1176 const Viewport& viewport,
1180 float screenY) const;
1183 * Sets whether the actor should receive a notification when touch or hover motion events leave
1184 * the boundary of the actor.
1186 * @note By default, this is set to false as most actors do not require this.
1187 * @note Need to connect to the SignalTouch or SignalHover to actually receive this event.
1189 * @param[in] required Should be set to true if a Leave event is required
1191 void SetLeaveRequired(bool required)
1193 mLeaveRequired = required;
1197 * This returns whether the actor requires touch or hover events whenever touch or hover motion events leave
1198 * the boundary of the actor.
1199 * @return true if a Leave event is required, false otherwise.
1201 bool GetLeaveRequired() const
1203 return mLeaveRequired;
1207 * @copydoc Dali::Actor::SetKeyboardFocusable()
1209 void SetKeyboardFocusable(bool focusable)
1211 mKeyboardFocusable = focusable;
1215 * @copydoc Dali::Actor::IsKeyboardFocusable()
1217 bool IsKeyboardFocusable() const
1219 return mKeyboardFocusable;
1223 * @copydoc Dali::Actor::SetKeyboardFocusableChildren()
1225 void SetKeyboardFocusableChildren(bool focusable)
1227 mKeyboardFocusableChildren = focusable;
1231 * @copydoc Dali::Actor::AreChildrenKeyBoardFocusable()
1233 bool AreChildrenKeyBoardFocusable() const
1235 return mKeyboardFocusableChildren;
1239 * Set whether this view can focus by touch.
1240 * @param[in] focusable focuable by touch.
1242 void SetTouchFocusable(bool focusable)
1244 mTouchFocusable = focusable;
1248 * This returns whether this actor can focus by touch.
1249 * @return true if this actor can focus by touch.
1251 bool IsTouchFocusable() const
1253 return mTouchFocusable;
1257 * Query whether the application or derived actor type requires hit-test result events.
1258 * @return True if hit-test result events are required.
1260 bool IsHitTestResultRequired() const
1262 return !mHitTestResultSignal.Empty();
1266 * Query whether the application or derived actor type requires intercept touch events.
1267 * @return True if intercept touch events are required.
1269 bool GetInterceptTouchRequired() const
1271 return !mInterceptTouchedSignal.Empty();
1275 * Query whether the application or derived actor type requires touch events.
1276 * @return True if touch events are required.
1278 bool GetTouchRequired() const
1280 return !mTouchedSignal.Empty();
1284 * Query whether the application or derived actor type requires hover events.
1285 * @return True if hover events are required.
1287 bool GetHoverRequired() const
1289 return !mHoveredSignal.Empty();
1293 * Query whether the application or derived actor type requires wheel events.
1294 * @return True if wheel events are required.
1296 bool GetWheelEventRequired() const
1298 return !mWheelEventSignal.Empty();
1302 * Query whether the actor is actually hittable. This method checks whether the actor is
1303 * sensitive, has the visibility flag set to true and is not fully transparent.
1304 * @return true, if it can be hit, false otherwise.
1306 bool IsHittable() const
1308 return (IsUserInteractionEnabled()) && IsSensitive() && IsVisible() && (GetCurrentWorldColor().a > FULLY_TRANSPARENT) && IsNodeConnected();
1312 * Query whether the actor captures all touch after it starts even if touch leaves its boundary.
1313 * @return true, if it captures all touch after start
1315 bool CapturesAllTouchAfterStart() const
1317 return mCaptureAllTouchAfterStart;
1321 * Sets the touch area offset of an actor.
1322 * @param [in] offset The new offset of area (left, right, bottom, top).
1324 void SetTouchAreaOffset(Rect<int> offset)
1326 mTouchAreaOffset = offset;
1330 * Retrieve the Actor's touch area offset.
1331 * @return The Actor's touch area offset.
1333 const Rect<int>& GetTouchAreaOffset() const
1335 return mTouchAreaOffset;
1339 * Query whether the actor will only receive own touch.
1340 * @return true, if it only receives touches that started from itself.
1342 bool IsAllowedOnlyOwnTouch() const
1344 return mAllowOnlyOwnTouch;
1350 * Retrieve the gesture data associated with this actor. The first call to this method will
1351 * allocate space for the ActorGestureData so this should only be called if an actor really does
1353 * @return Reference to the ActorGestureData for this actor.
1354 * @note Once the gesture-data is created for an actor it is likely that gestures are required
1355 * throughout the actor's lifetime so it will only be deleted when the actor is destroyed.
1357 ActorGestureData& GetGestureData();
1360 * Queries whether the actor requires the gesture type.
1361 * @param[in] type The gesture type.
1362 * @return True if the gesture is required, false otherwise.
1364 bool IsGestureRequired(GestureType::Value type) const;
1369 * Used by the EventProcessor to emit intercept touch event signals.
1370 * @param[in] touch The touch data.
1371 * @return True if the event was intercepted.
1373 bool EmitInterceptTouchEventSignal(const Dali::TouchEvent& touch);
1376 * Used by the EventProcessor to emit touch event signals.
1377 * @param[in] touch The touch data.
1378 * @return True if the event was consumed.
1380 bool EmitTouchEventSignal(const Dali::TouchEvent& touch);
1383 * Used by the EventProcessor to emit hover event signals.
1384 * @param[in] event The hover event.
1385 * @return True if the event was consumed.
1387 bool EmitHoverEventSignal(const Dali::HoverEvent& event);
1390 * Used by the EventProcessor to emit wheel event signals.
1391 * @param[in] event The wheel event.
1392 * @return True if the event was consumed.
1394 bool EmitWheelEventSignal(const Dali::WheelEvent& event);
1397 * @brief Emits the visibility change signal for this actor and all its children.
1398 * @param[in] visible Whether the actor has become visible or not.
1399 * @param[in] type Whether the actor's visible property has changed or a parent's.
1401 void EmitVisibilityChangedSignal(bool visible, DevelActor::VisibilityChange::Type type);
1404 * @brief Emits the layout direction change signal for this actor and all its children.
1405 * @param[in] type Whether the actor's layout direction property has changed or a parent's.
1407 void EmitLayoutDirectionChangedSignal(LayoutDirection::Type type);
1410 * Used by the EventProcessor to emit hit-test result touch event signals.
1411 * @param[in] point The point of event touched.
1412 * @param[in] hitPointLocal The hit point in the Actor's local reference system.
1413 * @param[in] timeStamp The time the event occurred.
1414 * @return True if the event was consumed.
1416 bool EmitHitTestResultSignal(Integration::Point point, Vector2 hitPointLocal, uint32_t timeStamp);
1419 * @copydoc DevelActor::HitTestResultSignal()
1421 Dali::Actor::TouchEventSignalType& HitTestResultSignal()
1423 return mHitTestResultSignal;
1427 * @copydoc DevelActor::InterceptTouchedSignal()
1429 Dali::Actor::TouchEventSignalType& InterceptTouchedSignal()
1431 return mInterceptTouchedSignal;
1435 * @copydoc Dali::Actor::TouchedSignal()
1437 Dali::Actor::TouchEventSignalType& TouchedSignal()
1439 return mTouchedSignal;
1443 * @copydoc Dali::Actor::HoveredSignal()
1445 Dali::Actor::HoverSignalType& HoveredSignal()
1447 return mHoveredSignal;
1451 * @copydoc Dali::Actor::WheelEventSignal()
1453 Dali::Actor::WheelEventSignalType& WheelEventSignal()
1455 return mWheelEventSignal;
1459 * @copydoc Dali::Actor::OnSceneSignal()
1461 Dali::Actor::OnSceneSignalType& OnSceneSignal()
1463 return mOnSceneSignal;
1467 * @copydoc Dali::Actor::OffSceneSignal()
1469 Dali::Actor::OffSceneSignalType& OffSceneSignal()
1471 return mOffSceneSignal;
1475 * @copydoc Dali::Actor::OnRelayoutSignal()
1477 Dali::Actor::OnRelayoutSignalType& OnRelayoutSignal()
1479 return mOnRelayoutSignal;
1483 * @copydoc DevelActor::VisibilityChangedSignal
1485 DevelActor::VisibilityChangedSignalType& VisibilityChangedSignal()
1487 return mVisibilityChangedSignal;
1491 * @copydoc LayoutDirectionChangedSignal
1493 Dali::Actor::LayoutDirectionChangedSignalType& LayoutDirectionChangedSignal()
1495 return mLayoutDirectionChangedSignal;
1499 * @copydoc DevelActor::ChildAddedSignal
1501 DevelActor::ChildChangedSignalType& ChildAddedSignal();
1504 * @copydoc DevelActor::ChildRemovedSignal
1506 DevelActor::ChildChangedSignalType& ChildRemovedSignal();
1509 * @copydoc DevelActor::ChildOrderChangedSignal
1511 DevelActor::ChildOrderChangedSignalType& ChildOrderChangedSignal();
1517 * For use in derived classes.
1518 * This should only be called by Animation, when the actor is resized using Animation::Resize().
1520 virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
1533 * Protected Constructor. See Actor::New().
1534 * The second-phase construction Initialize() member should be called immediately after this.
1535 * @param[in] derivedType The derived type of actor (if any).
1536 * @param[in] reference to the node
1538 Actor(DerivedType derivedType, const SceneGraph::Node& node);
1541 * Second-phase constructor. Must be called immediately after creating a new Actor;
1543 void Initialize(void);
1546 * A reference counted object may only be deleted by calling Unreference()
1551 * Called on a child during Add() when the parent actor is connected to the Scene.
1552 * @param[in] parentDepth The depth of the parent in the hierarchy.
1553 * @param[in] layer3DParentsCount The number of 3d layers in the hierarchy.
1554 * @param[in] notify Emits notification if set to true.
1556 void ConnectToScene(uint32_t parentDepth, uint32_t layer3DParentsCount, bool notify);
1559 * Connect the Node associated with this Actor to the scene-graph.
1561 void ConnectToSceneGraph();
1564 * Helper for ConnectToScene, to notify a connected actor through the public API.
1565 * @param[in] notify Emits notification if set to true.
1567 void NotifyStageConnection(bool notify);
1570 * Called on a child during Remove() when the actor was previously on the Stage.
1571 * @param[in] notify Emits notification if set to true.
1573 void DisconnectFromStage(bool notify);
1576 * Disconnect the Node associated with this Actor from the scene-graph.
1578 void DisconnectFromSceneGraph();
1581 * Helper for DisconnectFromStage, to notify a disconnected actor through the public API.
1582 * @param[in] notify Emits notification if set to true.
1584 void NotifyStageDisconnection(bool notify);
1587 * When the Actor is OnScene, checks whether the corresponding Node is connected to the scene graph.
1588 * @return True if the Actor is OnScene & has a Node connected to the scene graph.
1590 bool IsNodeConnected() const;
1594 * Trigger a rebuild of the actor depth tree from this root
1595 * If a Layer3D is encountered, then this doesn't descend any further.
1596 * The mSortedDepth of each actor is set appropriately.
1598 void RebuildDepthTree();
1601 // Default property extensions from Object
1604 * @copydoc Dali::Internal::Object::SetDefaultProperty()
1606 void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue) override;
1609 * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
1611 void SetSceneGraphProperty(Property::Index index, const PropertyMetadata& entry, const Property::Value& value) override;
1614 * @copydoc Dali::Internal::Object::GetDefaultProperty()
1616 Property::Value GetDefaultProperty(Property::Index index) const override;
1619 * @copydoc Dali::Internal::Object::GetDefaultPropertyCurrentValue()
1621 Property::Value GetDefaultPropertyCurrentValue(Property::Index index) const override;
1624 * @copydoc Dali::Internal::Object::OnNotifyDefaultPropertyAnimation()
1626 void OnNotifyDefaultPropertyAnimation(Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType) override;
1629 * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
1631 const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty(Property::Index index) const override;
1634 * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
1636 const PropertyInputImpl* GetSceneObjectInputProperty(Property::Index index) const override;
1639 * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
1641 int32_t GetPropertyComponentIndex(Property::Index index) const override;
1644 * @copydoc Dali::Internal::Object::IsAnimationPossible()
1646 bool IsAnimationPossible() const override
1652 * Retrieve the actor's node.
1653 * @return The node used by this actor
1655 const SceneGraph::Node& GetNode() const;
1658 * @copydoc Dali::DevelActor::Raise()
1663 * @copydoc Dali::DevelActor::Lower()
1668 * @copydoc Dali::DevelActor::RaiseToTop()
1673 * @copydoc Dali::DevelActor::LowerToBottom()
1675 void LowerToBottom();
1678 * @copydoc Dali::DevelActor::RaiseAbove()
1680 void RaiseAbove(Internal::Actor& target);
1683 * @copydoc Dali::DevelActor::LowerBelow()
1685 void LowerBelow(Internal::Actor& target);
1689 * Sets the scene which this actor is added to.
1690 * @param[in] scene The scene
1692 void SetScene(Scene& scene)
1698 * Gets the scene which this actor is added to.
1701 Scene& GetScene() const
1706 LayoutDirection::Type GetLayoutDirection() const
1708 return mLayoutDirection;
1721 // Remove default constructor and copy constructor
1723 Actor(const Actor&) = delete;
1724 Actor& operator=(const Actor& rhs) = delete;
1727 * Set the actor's parent.
1728 * @param[in] parent The new parent.
1729 * @param[in] notify Emits notification if set to true. Default is true.
1731 void SetParent(ActorParent* parent, bool notify = true);
1734 * For use in derived classes, called after Initialize()
1736 virtual void OnInitialize()
1741 * For use in internal derived classes.
1742 * This is called during ConnectToScene(), after the actor has finished adding its node to the scene-graph.
1743 * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1745 virtual void OnSceneConnectionInternal()
1750 * For use in internal derived classes.
1751 * This is called during DisconnectFromStage(), before the actor removes its node from the scene-graph.
1752 * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1754 virtual void OnSceneDisconnectionInternal()
1759 * For use in external (CustomActor) derived classes.
1760 * This is called after the atomic ConnectToScene() traversal has been completed.
1762 virtual void OnSceneConnectionExternal(int depth)
1767 * For use in external (CustomActor) derived classes.
1768 * This is called after the atomic DisconnectFromStage() traversal has been completed.
1770 virtual void OnSceneDisconnectionExternal()
1775 * For use in derived classes; this is called after Add() has added a child.
1776 * @param[in] child The child that was added.
1778 virtual void OnChildAdd(Actor& child)
1783 * For use in derived classes; this is called after Remove() has attempted to remove a child( regardless of whether it succeeded or not ).
1784 * @param[in] child The child that was removed.
1786 virtual void OnChildRemove(Actor& child)
1791 * For use in derived classes.
1792 * This is called after SizeSet() has been called.
1794 virtual void OnSizeSet(const Vector3& targetSize)
1799 * @brief Retrieves the cached event side value of a default property.
1800 * @param[in] index The index of the property
1801 * @param[out] value Is set with the cached value of the property if found.
1802 * @return True if value set, false otherwise.
1804 bool GetCachedPropertyValue(Property::Index index, Property::Value& value) const;
1807 * @brief Retrieves the current value of a default property from the scene-graph.
1808 * @param[in] index The index of the property
1809 * @param[out] value Is set with the current scene-graph value of the property
1810 * @return True if value set, false otherwise.
1812 bool GetCurrentPropertyValue(Property::Index index, Property::Value& value) const;
1815 * Retrieve the parent object of an Actor.
1816 * @return The parent object, or NULL if the Actor does not have a parent.
1818 Object* GetParentObject() const override
1820 return static_cast<Actor*>(mParent);
1824 * @brief Get the current position of the actor in screen coordinates.
1826 * @return Returns the screen position of actor
1828 const Vector2 GetCurrentScreenPosition() const;
1831 * Sets the visibility flag of an actor.
1832 * @param[in] visible The new visibility flag.
1833 * @param[in] sendMessage Whether to send a message to the update thread or not.
1835 void SetVisibleInternal(bool visible, SendMessage::Type sendMessage);
1838 * @copydoc ActorParent::SetSiblingOrderOfChild
1840 void SetSiblingOrderOfChild(Actor& child, uint32_t order) override;
1843 * @copydoc ActorParent::GetSiblingOrderOfChild
1845 uint32_t GetSiblingOrderOfChild(const Actor& child) const override;
1848 * @copydoc ActorParent::RaiseChild
1850 void RaiseChild(Actor& child) override;
1853 * @copydoc ActorParent::LowerChild
1855 void LowerChild(Actor& child) override;
1858 * @copydoc ActorParent::RaiseChildToTop
1860 void RaiseChildToTop(Actor& child) override;
1863 * @copydoc ActorParent::LowerChildToBottom
1865 void LowerChildToBottom(Actor& child) override;
1868 * @copydoc ActorParent::RaiseChildAbove
1870 void RaiseChildAbove(Actor& child, Actor& target) override;
1873 * @copydoc ActorParent::LowerChildBelow()
1875 void LowerChildBelow(Actor& child, Actor& target) override;
1878 * Set whether a child actor inherits it's parent's layout direction. Default is to inherit.
1879 * @param[in] inherit - true if the actor should inherit layout direction, false otherwise.
1881 void SetInheritLayoutDirection(bool inherit);
1884 * Returns whether the actor inherits it's parent's layout direction.
1885 * @return true if the actor inherits it's parent's layout direction, false otherwise.
1887 bool IsLayoutDirectionInherited() const
1889 return mInheritLayoutDirection;
1893 * @brief Sets the update area hint of an actor.
1894 * @param [in] updateAreaHint The update area hint.
1896 void SetUpdateAreaHint(const Vector4& updateAreaHint);
1899 ActorParentImpl mParentImpl; ///< Implementation of ActorParent;
1900 ActorSizer mSizer; ///< Implementation for managing actor size
1901 ActorParent* mParent; ///< Each actor (except the root) can have one parent
1902 Scene* mScene; ///< The scene the actor is added to
1903 RendererContainer* mRenderers; ///< Renderer container
1904 Vector3* mParentOrigin; ///< NULL means ParentOrigin::DEFAULT. ParentOrigin is non-animatable
1905 Vector3* mAnchorPoint; ///< NULL means AnchorPoint::DEFAULT. AnchorPoint is non-animatable
1906 ActorGestureData* mGestureData; ///< Optional Gesture data. Only created when actor requires gestures
1909 Dali::Actor::TouchEventSignalType mInterceptTouchedSignal;
1910 Dali::Actor::TouchEventSignalType mTouchedSignal;
1911 Dali::Actor::HoverSignalType mHoveredSignal;
1912 Dali::Actor::WheelEventSignalType mWheelEventSignal;
1913 Dali::Actor::OnSceneSignalType mOnSceneSignal;
1914 Dali::Actor::OffSceneSignalType mOffSceneSignal;
1915 Dali::Actor::OnRelayoutSignalType mOnRelayoutSignal;
1916 DevelActor::VisibilityChangedSignalType mVisibilityChangedSignal;
1917 Dali::Actor::LayoutDirectionChangedSignalType mLayoutDirectionChangedSignal;
1918 Dali::Actor::TouchEventSignalType mHitTestResultSignal;
1920 Quaternion mTargetOrientation; ///< Event-side storage for orientation
1921 Vector4 mTargetColor; ///< Event-side storage for color
1922 Vector3 mTargetPosition; ///< Event-side storage for position (not a pointer as most actors will have a position)
1923 Vector3 mTargetScale; ///< Event-side storage for scale
1924 Rect<int> mTouchAreaOffset; ///< touch area offset (left, right, bottom, top)
1926 ConstString mName; ///< Name of the actor
1927 uint32_t mSortedDepth; ///< The sorted depth index. A combination of tree traversal and sibling order.
1928 int16_t mDepth; ///< The depth in the hierarchy of the actor. Only 32,767 levels of depth are supported
1930 int16_t mLayer3DParentsCount; ///< The number of layer with 3D behaviour in ancestors include this. It will be 0 if actor is not on scene.
1932 const bool mIsRoot : 1; ///< Flag to identify the root actor
1933 const bool mIsLayer : 1; ///< Flag to identify that this is a layer
1934 bool mIsOnScene : 1; ///< Flag to identify whether the actor is on-scene
1935 bool mSensitive : 1; ///< Whether the actor emits touch event signals
1936 bool mLeaveRequired : 1; ///< Whether a touch event signal is emitted when the a touch leaves the actor's bounds
1937 bool mKeyboardFocusable : 1; ///< Whether the actor should be focusable by keyboard navigation
1938 bool mKeyboardFocusableChildren : 1; ///< Whether the children of this actor can be focusable by keyboard navigation.
1939 bool mTouchFocusable : 1; ///< Whether the actor should be focusable by touch
1940 bool mOnSceneSignalled : 1; ///< Set to true before OnSceneConnection signal is emitted, and false before OnSceneDisconnection
1941 bool mInheritPosition : 1; ///< Cached: Whether the parent's position should be inherited.
1942 bool mInheritOrientation : 1; ///< Cached: Whether the parent's orientation should be inherited.
1943 bool mInheritScale : 1; ///< Cached: Whether the parent's scale should be inherited.
1944 bool mPositionUsesAnchorPoint : 1; ///< Cached: Whether the position uses the anchor point or not.
1945 bool mVisible : 1; ///< Cached: Whether the actor is visible or not.
1946 bool mInheritLayoutDirection : 1; ///< Whether the actor inherits the layout direction from parent.
1947 bool mCaptureAllTouchAfterStart : 1; ///< Whether the actor should capture all touch after touch starts even if the motion moves outside of the actor area.
1948 bool mIsBlendEquationSet : 1; ///< Flag to identify whether the Blend equation is set
1949 bool mNeedGesturePropagation : 1; ///< Whether the parent listens for gesture events or not
1950 bool mUserInteractionEnabled : 1; ///< Whether the actor should be enabled user interaction.
1951 bool mAllowOnlyOwnTouch : 1; ///< whether the actor will only receive own touch. it only receives touches that started from itself.
1952 LayoutDirection::Type mLayoutDirection : 2; ///< Layout direction, Left to Right or Right to Left.
1953 DrawMode::Type mDrawMode : 3; ///< Cached: How the actor and its children should be drawn
1954 ColorMode mColorMode : 3; ///< Cached: Determines whether mWorldColor is inherited
1955 ClippingMode::Type mClippingMode : 3; ///< Cached: Determines which clipping mode (if any) to use.
1956 DevelBlendEquation::Type mBlendEquation : 16; ///< Cached: Determines which blend equation will be used to render renderers.
1959 static ActorContainer mNullChildren; ///< Empty container (shared by all actors, returned by GetChildren() const)
1961 struct PropertyHandler;
1962 struct SiblingHandler;
1964 friend class ActorParentImpl; // Allow impl to call private methods on actor
1965 friend class ActorSizer; // Allow sizer to call private methods on actor
1968 } // namespace Internal
1970 // Helpers for public-api forwarding methods
1972 inline Internal::Actor& GetImplementation(Dali::Actor& actor)
1974 DALI_ASSERT_ALWAYS(actor && "Actor handle is empty");
1976 BaseObject& handle = actor.GetBaseObject();
1978 return static_cast<Internal::Actor&>(handle);
1981 inline const Internal::Actor& GetImplementation(const Dali::Actor& actor)
1983 DALI_ASSERT_ALWAYS(actor && "Actor handle is empty");
1985 const BaseObject& handle = actor.GetBaseObject();
1987 return static_cast<const Internal::Actor&>(handle);
1992 #endif // DALI_INTERNAL_ACTOR_H