1 #ifndef DALI_OFFSCREEN_APPLICATION_H
2 #define DALI_OFFSCREEN_APPLICATION_H
5 * Copyright (c) 2020 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/signals/dali-signal.h>
23 #include <dali/public-api/object/any.h>
24 #include <dali/public-api/object/base-handle.h>
30 * @addtogroup dali_adaptor_framework
34 class OffscreenWindow;
38 class OffscreenApplication;
42 * @brief Appliations can draw UI on offscreen surface with the OffscreenApplication.
43 * When you use a OffscreenApplication, you don't have to create a Window.
45 class DALI_IMPORT_API OffscreenApplication : public Dali::BaseHandle
51 AUTO, // UI is rendered automatically
52 MANUAL // UI is rendered by RenderOnce()
55 typedef Signal<void (void)> OffscreenApplicationSignalType;
60 * @brief This is the constructor of OffscreenApplication
62 * @param[in] width The initial width of the default OffscreenWindow
63 * @param[in] height The initial height of the default OffscreenWindow
64 * @param[in] isTranslucent Whether the OffscreenWindow is translucent or not
65 * @param[in] renderMode The RenderMode of the OffscreenApplication
67 static OffscreenApplication New( uint16_t width, uint16_t height, bool isTranslucent,
68 RenderMode renderMode = RenderMode::AUTO );
71 * @brief This is the constructor of OffscreenApplication
73 * @param[in] surface The native surface handle to create the OffscreenWindow
74 * @param[in] isTranslucent Whether the OffscreenWindow is translucent or not
75 * @param[in] renderMode The RenderMode of the OffscreenApplication
77 static OffscreenApplication New( Dali::Any surface, bool isTranslucent,
78 RenderMode renderMode = RenderMode::AUTO );
81 * @brief Constructs an empty handle
83 OffscreenApplication();
86 * @brief Copy constructor
88 OffscreenApplication( const OffscreenApplication& offscreenApplication );
91 * @brief Assignment operator
93 OffscreenApplication& operator=( const OffscreenApplication& offscreenApplication );
98 ~OffscreenApplication();
103 * @brief Starts the OffscreenApplication (rendering, event handling, etc)
108 * @brief Stops the OffscreenApplication
114 * @brief Get the default Window handle
115 * @return The default Window
117 OffscreenWindow GetWindow();
120 * @brief Renders once more even if we're paused
127 * @brief Signal to notify the client when the application is ready to be initialized
129 * @note OffscreenApplication::Start() should be called to be initialized
133 OffscreenApplicationSignalType& InitSignal();
136 * @brief Signal to notify the user when the application is about to be terminated
140 OffscreenApplicationSignalType& TerminateSignal();
142 public: // Not intended for application developers
144 * @brief Internal constructor
146 explicit DALI_INTERNAL OffscreenApplication( Internal::OffscreenApplication* offscreenApplication );
156 #endif // DALI_OFFSCREEN_APPLICATION_H