Keep node by id + Make SceneGraphTraveler don't travel anymore
[platform/core/uifw/dali-core.git] / dali / internal / update / manager / update-manager.h
index 8499642..a5702a0 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -683,6 +683,14 @@ public:
   void RequestRendering();
 
   /**
+   * @brief Get the active Node pointer by node id.
+   *
+   * @param[in] nodeId The id of node what we want to get.
+   * @return The pointer of node, or nullptr if given node id is not exist, or discarded.
+   */
+  Node* GetNodePointerById(uint32_t nodeId) const;
+
+  /**
    * Sets the depths of all layers.
    * @param layers The layers in depth order.
    * @param[in] rootLayer The root layer of the sorted layers.
@@ -1608,6 +1616,17 @@ inline void AddFrameCallbackMessage(UpdateManager& manager, OwnerPointer<FrameCa
   new(slot) LocalType(&manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode);
 }
 
+inline void AddGlobalFrameCallbackMessage(UpdateManager& manager, OwnerPointer<FrameCallback>& frameCallback)
+{
+  using LocalType = MessageValue2<UpdateManager, OwnerPointer<FrameCallback>, const Node*>;
+
+  // Reserve some memory inside the message queue
+  uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new(slot) LocalType(&manager, &UpdateManager::AddFrameCallback, frameCallback, nullptr);
+}
+
 inline void RemoveFrameCallbackMessage(UpdateManager& manager, FrameCallbackInterface& frameCallback)
 {
   using LocalType = MessageValue1<UpdateManager, FrameCallbackInterface*>;