1 #ifndef DALI_RENDER_CALLBACK_H
2 #define DALI_RENDER_CALLBACK_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.
22 #include <dali/public-api/math/matrix.h>
23 #include <dali/public-api/math/vector2.h>
24 #include <dali/public-api/signals/callback.h>
32 * @class RenderCallbackInput
34 * This structure contains data to be passed into the RenderCallback
37 * RenderCallbackInput inherits from Graphics::NativeDrawInput
41 struct RenderCallbackInput
49 * @class DrawableCallback
51 * The class wraps CallbackBase object ensuring its type-safe assignment
59 * Templated member function type
62 using FuncType = bool (T::*)(const RenderCallbackInput&);
65 * @brief Constructor of RenderCallback
67 * @param[in] object Object to invoke
68 * @param[in] func Member function to invoke
73 RenderCallback(T* object, FuncType<T> func)
74 : mCallback(MakeCallback(object, func))
79 * @brief Creates new instance of RenderCallback
82 * @param[in] object Object to invoke
83 * @param[in] func Member function to invoke
84 * @return Unique pointer to the RenderCallback instance
87 static std::unique_ptr<RenderCallback> New(T* object, FuncType<T> func)
89 return std::make_unique<RenderCallback>(object, func);
93 * @brief Explicit cast operator
96 * @return casts RenderCallback to CallbackBase object
98 explicit operator CallbackBase*()
100 return mCallback.get();
104 * @brief Explicit cast operator
107 * @return casts RenderCallback to CallbackBase object
109 explicit operator CallbackBase&()
115 std::unique_ptr<CallbackBase> mCallback; //< Callback base object
119 #endif // DALI_RENDER_CALLBACK_H