Refactored more code into Actor::Relayouter
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / actor-impl.h
index 11bbfa7..73a98aa 100644 (file)
@@ -30,6 +30,7 @@
 #include <dali/internal/event/actors/actor-declarations.h>
 #include <dali/internal/event/actors/actor-parent-impl.h>
 #include <dali/internal/event/actors/actor-parent.h>
+#include <dali/internal/event/actors/actor-renderer-container.h>
 #include <dali/internal/event/common/object-impl.h>
 #include <dali/internal/event/common/stage-def.h>
 #include <dali/internal/update/nodes/node-declarations.h>
@@ -57,10 +58,6 @@ class RenderTask;
 class Renderer;
 class Scene;
 
-using RendererPtr       = IntrusivePtr<Renderer>;
-using RendererContainer = std::vector<RendererPtr>;
-using RendererIter      = RendererContainer::iterator;
-
 class ActorDepthTreeNode;
 using DepthNodeMemoryPool = Dali::Internal::MemoryPoolObjectAllocator<ActorDepthTreeNode>;
 
@@ -170,7 +167,7 @@ public:
   bool IsRenderable() const
   {
     // inlined as this is called a lot in hit testing
-    return mRenderers && !mRenderers->empty();
+    return mRenderers && !mRenderers->IsEmpty();
   }
 
   /**
@@ -261,13 +258,19 @@ public:
   /**
    * @copydoc DevelActor::SetNeedGesturePropagation.
    */
-  void SetNeedGesturePropagation(bool propagation);
+  void SetNeedGesturePropagation(bool propagation)
+  {
+    mNeedGesturePropagation = propagation;
+  }
 
   /**
    * Retrieve need gesture propagation value
    * @return The actor's need gesture propagation value.
    */
-  bool NeedGesturePropagation();
+  bool NeedGesturePropagation() const
+  {
+    return mNeedGesturePropagation;
+  }
 
   /**
    * Sets the size of an actor.
@@ -386,6 +389,13 @@ public:
   const Vector3& GetCurrentAnchorPoint() const;
 
   /**
+   * If the position uses the anchor point, return the anchor point, otherwise
+   * return top left.
+   * @return The anchor point for positioning.
+   */
+  Vector3 GetAnchorPointForPosition() const;
+
+  /**
    * Sets the position of the Actor.
    * The coordinates are relative to the Actor's parent.
    * The Actor's z position will be set to 0.0f.
@@ -770,11 +780,20 @@ public:
    *
    * @return The depth used for hit-testing and renderer sorting
    */
-  uint32_t GetSortingDepth()
+  inline uint32_t GetSortingDepth()
   {
     return mSortedDepth;
   }
 
+  /**
+   * Set the actor's sorted depth. Used during recreation of depth tree
+   * @param[in] sortedDepth the new sorted depth
+   */
+  inline void SetSortingDepth(uint32_t sortedDepth)
+  {
+    mSortedDepth = sortedDepth;
+  }
+
 public:
   // Size negotiation virtual functions
 
@@ -1035,22 +1054,6 @@ public:
   float NegotiateFromParent(Dimension::Type dimension);
 
   /**
-   * Negotiate a dimension based on the size of the parent. Fitting inside.
-   *
-   * @param[in] dimension The dimension to negotiate on
-   * @return Return the negotiated size
-   */
-  float NegotiateFromParentFit(Dimension::Type dimension);
-
-  /**
-   * Negotiate a dimension based on the size of the parent. Flooding the whole space.
-   *
-   * @param[in] dimension The dimension to negotiate on
-   * @return Return the negotiated size
-   */
-  float NegotiateFromParentFlood(Dimension::Type dimension);
-
-  /**
    * @brief Negotiate a dimension based on the size of the children
    *
    * @param[in] dimension The dimension to negotiate on
@@ -1589,31 +1592,6 @@ public:
    */
   DevelActor::ChildOrderChangedSignalType& ChildOrderChangedSignal();
 
-  /**
-   * Connects a callback function with the object's signals.
-   * @param[in] object The object providing the signal.
-   * @param[in] tracker Used to disconnect the signal.
-   * @param[in] signalName The signal to connect to.
-   * @param[in] functor A newly allocated FunctorDelegate.
-   * @return True if the signal was connected.
-   * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
-   */
-  static bool DoConnectSignal(BaseObject*                 object,
-                              ConnectionTrackerInterface* tracker,
-                              const std::string&          signalName,
-                              FunctorDelegate*            functor);
-
-  /**
-   * Performs actions as requested using the action name.
-   * @param[in] object The object on which to perform the action.
-   * @param[in] actionName The action to perform.
-   * @param[in] attributes The attributes with which to perfrom this action.
-   * @return true if the action was done.
-   */
-  static bool DoAction(BaseObject*          object,
-                       const std::string&   actionName,
-                       const Property::Map& attributes);
-
 public:
   // For Animation
 
@@ -1659,14 +1637,6 @@ protected:
   void ConnectToScene(uint32_t parentDepth, bool notify);
 
   /**
-   * Helper for ConnectToScene, to recursively connect a tree of actors.
-   * This is atomic i.e. not interrupted by user callbacks.
-   * @param[in]  depth The depth in the hierarchy of the actor
-   * @param[out] connectionList On return, the list of connected actors which require notification.
-   */
-  void RecursiveConnectToScene(ActorContainer& connectionList, uint32_t depth);
-
-  /**
    * Connect the Node associated with this Actor to the scene-graph.
    */
   void ConnectToSceneGraph();
@@ -1684,13 +1654,6 @@ protected:
   void DisconnectFromStage(bool notify);
 
   /**
-   * Helper for DisconnectFromStage, to recursively disconnect a tree of actors.
-   * This is atomic i.e. not interrupted by user callbacks.
-   * @param[out] disconnectionList On return, the list of disconnected actors which require notification.
-   */
-  void RecursiveDisconnectFromStage(ActorContainer& disconnectionList);
-
-  /**
    * Disconnect the Node associated with this Actor from the scene-graph.
    */
   void DisconnectFromSceneGraph();
@@ -1715,14 +1678,6 @@ public:
    */
   void RebuildDepthTree();
 
-protected:
-  /**
-   * Traverse the actor tree, inserting actors into the depth tree in sibling order.
-   * @param[in] sceneGraphNodeDepths A vector capturing the nodes and their depth index
-   * @param[in,out] depthIndex The current depth index (traversal index)
-   */
-  void DepthTraverseActorTree(OwnerPointer<SceneGraph::NodeDepths>& sceneGraphNodeDepths, int32_t& depthIndex);
-
 public:
   // Default property extensions from Object
 
@@ -2042,26 +1997,11 @@ private:
   }
 
   /**
-   * @brief Propagates layout direction recursively.
-   * @param[in] direction New layout direction.
-   */
-  void InheritLayoutDirectionRecursively(Dali::LayoutDirection::Type direction, bool set = false);
-
-  /**
    * @brief Sets the update size hint of an actor.
    * @param [in] updateSizeHint The update size hint.
    */
   void SetUpdateSizeHint(const Vector2& updateSizeHint);
 
-  /**
-   * @brief Recursively emits the visibility-changed-signal on the actor tree.
-   *
-   * @param[in] visible The new visibility of the actor
-   * @param[in] type Whether the actor's visible property has changed or a parent's
-   */
-  void EmitVisibilityChangedSignalRecursively(bool                               visible,
-                                              DevelActor::VisibilityChange::Type type);
-
 protected:
   ActorParentImpl    mParentImpl;   ///< Implementation of ActorParent;
   ActorParent*       mParent;       ///< Each actor (except the root) can have one parent