1 #ifndef CSHARP_PROCESSOR_CONTROLLER_H
2 #define CSHARP_PROCESSOR_CONTROLLER_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/integration-api/processor-interface.h>
28 * @brief Implements a Integration::Processor interface so can be registered with dali-core as
29 * a Processor. Enables the setting of a callback so dali-core can execute this callback when
32 class ProcessorController : public Dali::Integration::Processor
36 // Function pointer matching delegate in C# ProcessorController
37 using ProcessorControllerProcessCallback = void (SWIGSTDCALL*)();
41 * @brief Constructor - creates a ProcessorController and registers it with dali-core.
44 ProcessorController();
47 * @brief Destructor - Unregisters itself from dali-core.
49 ~ProcessorController();
52 * @copydoc Dali::Integration::Processor::Process()
54 void Process(bool postProcessor) override;
57 * @brief Set the callback to be executed when dali-core calls the overriden Process() api.
58 * @param[in] callback, function to be called
60 void SetCallback( ProcessorControllerProcessCallback callback );
63 * @brief Set the postcallback to be executed when dali-core calls the overriden Process(true) api.
64 * @param[in] postCallback, function to be called
66 void SetPostCallback( ProcessorControllerProcessCallback postCallback );
69 * @brief Remove callback on this ProcessorController.
70 * The removed callback will not be called anymore.
71 * @param[in] callback, function will be removed
73 void RemoveCallback( ProcessorControllerProcessCallback callback );
76 * @brief Remove postcallback on this ProcessorController.
77 * The removed callback will not be called anymore.
78 * @param[in] postCallback, function will be removed
80 void RemovePostCallback( ProcessorControllerProcessCallback postCallback );
83 * @brief Awake update thread so dali-core calls the overriden Process() api.
89 ProcessorControllerProcessCallback mHandler; ///< PreProcessHandler before Relayout
90 ProcessorControllerProcessCallback mPostHandler; ///< PostProcessHandler after Relayout
91 bool mKeepRenderingApplied; ///< True if we call Stage::KeepRendering(0.0f). It need to avoid duplicated keep rendering call
94 #endif // CSHARP_PROCESSOR_CONTROLLER_H