Separate out Render Helper
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / application-devel.h
1 #ifndef DALI_APPLICATION_DEVEL_H
2 #define DALI_APPLICATION_DEVEL_H
3
4 /*
5  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/adaptor-framework/application.h>
23
24 namespace Dali
25 {
26
27 namespace DevelApplication
28 {
29 /**
30  * @brief This is used to improve application launch performance.
31  * It preloads so files, initializes some functions in advance and makes a window in advance.
32  *
33  * @param[in,out]  argc         A pointer to the number of arguments
34  * @param[in,out]  argv         A pointer to the argument list
35  */
36 DALI_ADAPTOR_API void PreInitialize( int* argc, char** argv[] );
37
38 /**
39  * @brief Ensures that the function passed in is called from the main loop when it is idle.
40  * @param[in] application A handle to the Application
41  * @param[in] callback The function to call
42  * @return @c true if added successfully, @c false otherwise
43  *
44  * @note Function must be called from main event thread only
45  *
46  * A callback of the following type should be used:
47  * @code
48  *   bool MyFunction();
49  * @endcode
50  * This callback will be called repeatedly as long as it returns true. A return of 0 deletes this callback.
51  *
52  * @note Ownership of the callback is passed onto this class.
53  */
54 DALI_ADAPTOR_API bool AddIdleWithReturnValue( Application application, CallbackBase* callback );
55
56 /**
57  * @brief Create and Add a child window to the application instance
58  * @param[in] application A handle to the Application
59  * @param[in] childPosSize The position and size of the child window to be created
60  * @param[in] childWindowName The title of the child window
61  * @param[in] childWindowClassName The class name of the child window
62  * @param[in] childWindowMode The mode of the newly created child window
63  * @return @c a window handle if added successfully, @c null otherwise
64  *
65  * @note Function must be called from main event thread only
66  */
67 DALI_ADAPTOR_API Dali::Window CreateWindow( Application application, PositionSize childPosSize, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode );
68
69 /**
70  * @brief Removes a previously created Window instance from the Adaptor internal list
71  * @note Function must be called from the main event thread only.
72  * @param[in] application A handle to the Application
73  * @param[in] childWindow The created Window instance
74  * @return true if removed successfully, false otherwise
75  */
76 DALI_ADAPTOR_API bool DestroyWindow( Application application, Dali::Window* childWindow );
77
78 /**
79  * @brief Removes a previously created Window instance from the Adaptor internal list
80  * @note Function must be called from the main event thread only.
81  * @param[in] application A handle to the Application
82  * @param[in] childWindowName The title of the window
83  * @return true if removed successfully, false otherwise
84  */
85 DALI_ADAPTOR_API bool DestroyWindow( Application application, const std::string& childWindowName );
86
87 } // namespace DevelApplication
88
89 } // namespace Dali
90
91 #endif // DALI_APPLICATION_DEVEL_H