1 #ifndef DALI_FRAME_CALLBACK_INTERFACE_IMPL_H
2 #define DALI_FRAME_CALLBACK_INTERFACE_IMPL_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.
22 #include <dali/devel-api/update/frame-callback-interface.h>
32 } // namespace Internal
35 * The Implementation of the FrameCallbackInterface
36 * @see FrameCallbackInterface
38 class FrameCallbackInterface::Impl final
41 Impl() = default; ///< Default constructor.
42 ~Impl() = default; ///< Default non-virtual destructor.
45 * Retrieve the Impl of a FrameCallbackInterface.
46 * @param[in] frameCallback The frame-callb
48 static inline Impl& Get(FrameCallbackInterface& frameCallback)
50 return *frameCallback.mImpl;
54 * Links this FrameCallback to the given scene-graph-frame-callback.
55 * @param[in] sceneGraphObject The scene-graph-frame-callback to link this with.
57 void ConnectToSceneGraphObject(Internal::SceneGraph::FrameCallback& sceneGraphObject)
59 mSceneGraphFrameCallback = &sceneGraphObject;
63 * Disconnects this FrameCallback from the scene-graph-frame-callback.
65 void DisconnectFromSceneGraphObject()
67 mSceneGraphFrameCallback = nullptr;
71 * Checks whether we are connected to a scene-graph-frame-callback.
72 * @return True if connected, false otherwise.
74 bool IsConnectedToSceneGraph() const
76 return mSceneGraphFrameCallback;
80 * Invalidates this FrameCallback and linked SceneGraph::FrameCallback.
84 if(mSceneGraphFrameCallback)
86 mSceneGraphFrameCallback->Invalidate();
91 Internal::SceneGraph::FrameCallback* mSceneGraphFrameCallback{nullptr}; ///< Pointer to the scene-graph object, not owned.
96 #endif // DALI_FRAME_CALLBACK_INTERFACE_IMPL_H