Revert "[Tizen] Fix build errors in adaptor-uv by ecore wayland"
[platform/core/uifw/dali-adaptor.git] / adaptors / public-api / adaptor-framework / application.cpp
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include "application.h"
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23
24 // INTERNAL INCLUDES
25 #include <application-impl.h>
26
27 namespace Dali
28 {
29
30 Application Application::New()
31 {
32   return New( NULL, NULL );
33 }
34
35 Application Application::New( int* argc, char **argv[] )
36 {
37   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "", OPAQUE,
38     Internal::Adaptor::Framework::NORMAL);
39   return Application(internal.Get());
40 }
41
42 Application Application::New( int* argc, char **argv[], const std::string& stylesheet )
43 {
44   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, OPAQUE,
45     Internal::Adaptor::Framework::NORMAL);
46   return Application(internal.Get());
47 }
48
49 Application Application::New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode )
50 {
51   Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode,
52     Internal::Adaptor::Framework::NORMAL);
53   return Application(internal.Get());
54 }
55
56 Application::~Application()
57 {
58 }
59
60 Application::Application()
61 {
62 }
63
64 Application::Application(const Application& application)
65 : BaseHandle(application)
66 {
67 }
68
69 Application& Application::operator=(const Application& application)
70 {
71   if( *this != application )
72   {
73     BaseHandle::operator=( application );
74   }
75   return *this;
76 }
77
78 void Application::MainLoop()
79 {
80   Internal::Adaptor::GetImplementation(*this).MainLoop(Configuration::APPLICATION_HANDLES_CONTEXT_LOSS);
81 }
82
83 void Application::MainLoop(Configuration::ContextLoss configuration)
84 {
85   Internal::Adaptor::GetImplementation(*this).MainLoop(configuration);
86 }
87
88 void Application::Lower()
89 {
90   Internal::Adaptor::GetImplementation(*this).Lower();
91 }
92
93 void Application::Quit()
94 {
95   Internal::Adaptor::GetImplementation(*this).Quit();
96 }
97
98 bool Application::AddIdle( CallbackBase* callback )
99 {
100   return Internal::Adaptor::GetImplementation(*this).AddIdle( callback );
101 }
102
103 Window Application::GetWindow()
104 {
105   return Internal::Adaptor::GetImplementation(*this).GetWindow();
106 }
107
108 void Application::ReplaceWindow(PositionSize windowPosition, const std::string& name)
109 {
110   Internal::Adaptor::GetImplementation(*this).ReplaceWindow(windowPosition, name);
111 }
112
113 std::string Application::GetResourcePath()
114 {
115   return Internal::Adaptor::Application::GetResourcePath();
116 }
117
118 void Application::SetViewMode( ViewMode viewMode )
119 {
120   Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
121 }
122
123 ViewMode Application::GetViewMode() const
124 {
125   return Internal::Adaptor::GetImplementation(*this).GetViewMode();
126 }
127
128 void Application::SetStereoBase( float stereoBase )
129 {
130   Internal::Adaptor::GetImplementation(*this).SetStereoBase( stereoBase );
131 }
132
133 float Application::GetStereoBase() const
134 {
135   return Internal::Adaptor::GetImplementation(*this).GetStereoBase();
136 }
137
138 Application::AppSignalType& Application::InitSignal()
139 {
140   return Internal::Adaptor::GetImplementation(*this).InitSignal();
141 }
142
143 Application::AppSignalType& Application::TerminateSignal()
144 {
145   return Internal::Adaptor::GetImplementation(*this).TerminateSignal();
146 }
147
148 Application::AppSignalType& Application::PauseSignal()
149 {
150   return Internal::Adaptor::GetImplementation(*this).PauseSignal();
151 }
152
153 Application::AppSignalType& Application::ResumeSignal()
154 {
155   return Internal::Adaptor::GetImplementation(*this).ResumeSignal();
156 }
157
158 Application::AppSignalType& Application::ResetSignal()
159 {
160   return Internal::Adaptor::GetImplementation(*this).ResetSignal();
161 }
162
163 Application::AppSignalType& Application::ResizeSignal()
164 {
165   DALI_LOG_WARNING_NOFN( "DEPRECATION WARNING: ResizeSignal() is deprecated and will be removed from next release. Use Window::ResizedSignal() instead.\n" );
166
167   return Internal::Adaptor::GetImplementation(*this).ResizeSignal();
168 }
169
170 Application::AppControlSignalType & Application::AppControlSignal()
171 {
172   return Internal::Adaptor::GetImplementation(*this).AppControlSignal();
173 }
174
175 Application::AppSignalType& Application::LanguageChangedSignal()
176 {
177   return Internal::Adaptor::GetImplementation(*this).LanguageChangedSignal();
178 }
179
180 Application::AppSignalType& Application::RegionChangedSignal()
181 {
182   return Internal::Adaptor::GetImplementation(*this).RegionChangedSignal();
183 }
184
185 Application::AppSignalType& Application::BatteryLowSignal()
186 {
187   return Internal::Adaptor::GetImplementation(*this).BatteryLowSignal();
188 }
189
190 Application::AppSignalType& Application::MemoryLowSignal()
191 {
192   return Internal::Adaptor::GetImplementation(*this).MemoryLowSignal();
193 }
194
195 Application::Application(Internal::Adaptor::Application* application)
196 : BaseHandle(application)
197 {
198 }
199
200
201 } // namespace Dali