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 * @addtogroup dali_adaptor_framework
27 #include <dali/public-api/signals/dali-signal.h>
28 #include <dali/public-api/object/any.h>
33 class OffscreenWindow;
37 class OffscreenApplication;
41 * @brief Appliations can draw UI on offscreen surface with the OffscreenApplication.
42 * When you use a OffscreenApplication, you don't have to make a Window.
44 class DALI_IMPORT_API OffscreenApplication : public Dali::BaseHandle
48 typedef Signal<void (void)> OffscreenApplicationSignalType;
53 * @brief This is the constructor of OffscreenApplication
55 * @param[in] width The initial width of the default OffscreenWindow
56 * @param[in] height The initial height of the default OffscreenWindow
57 * @param[in] isTranslucent Whether the OffscreenWindow is translucent or not
59 static OffscreenApplication New( uint16_t width, uint16_t height, bool isTranslucent );
62 * @brief This is the constructor of OffscreenApplication
64 * @param[in] surface The native surface handle to create the OffscreenWindow
65 * @param[in] isTranslucent Whether the OffscreenWindow is translucent or not
67 static OffscreenApplication New( Dali::Any surface, bool isTranslucent );
70 * @brief Constructs an empty handle
72 OffscreenApplication();
75 * @brief Copy constructor
77 OffscreenApplication( const OffscreenApplication& offscreenApplication );
80 * @brief Assignment operator
82 OffscreenApplication& operator=( const OffscreenApplication& offscreenApplication );
87 ~OffscreenApplication();
92 * @brief Runs the OffscreenApplication (rendering, event handling, etc)
97 * @brief Stops the OffscreenApplication
103 * @brief Get the default Window handle
104 * @return The default Window
106 OffscreenWindow GetWindow();
111 * @brief Signal to notify the client when the application is ready to be initialized
113 * @note OffscreenApplication::Run() should be called to be initialized
117 OffscreenApplicationSignalType& InitSignal();
120 * @brief Signal to notify the user when the application is about to be terminated
124 OffscreenApplicationSignalType& TerminateSignal();
126 public: // Not intended for application developers
128 * @brief Internal constructor
130 explicit DALI_INTERNAL OffscreenApplication( Internal::OffscreenApplication* offscreenApplication );
140 #endif // DALI_OFFSCREEN_APPLICATION_H