Keep node by id + Make SceneGraphTraveler don't travel anymore
[platform/core/uifw/dali-core.git] / dali / internal / event / common / stage-impl.cpp
index ae0b7d2..09cfc38 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -350,6 +350,15 @@ void Stage::AddFrameCallback(FrameCallbackInterface& frameCallback, Actor& rootA
   AddFrameCallbackMessage(mUpdateManager, transferOwnership, rootActor.GetNode());
 }
 
+void Stage::AddGlobalFrameCallback(FrameCallbackInterface& frameCallback)
+{
+  DALI_ASSERT_ALWAYS((!FrameCallbackInterface::Impl::Get(frameCallback).IsConnectedToSceneGraph()) && "FrameCallbackInterface implementation already added");
+
+  // Create scene-graph object and transfer to UpdateManager
+  OwnerPointer<SceneGraph::FrameCallback> transferOwnership(SceneGraph::FrameCallback::New(frameCallback));
+  AddGlobalFrameCallbackMessage(mUpdateManager, transferOwnership);
+}
+
 void Stage::RemoveFrameCallback(FrameCallbackInterface& frameCallback)
 {
   FrameCallbackInterface::Impl::Get(frameCallback).Invalidate();