2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include "application.h"
22 #include <dali/integration-api/debug.h>
25 #include <application-impl.h>
30 Application Application::New()
32 return New( NULL, NULL );
35 Application Application::New( int* argc, char **argv[] )
37 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "Dali Application", DeviceLayout::DEFAULT_BASE_LAYOUT, OPAQUE );
38 return Application(internal.Get());
41 Application Application::New( int* argc, char **argv[], const std::string& name )
43 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, name, DeviceLayout::DEFAULT_BASE_LAYOUT, OPAQUE );
44 return Application(internal.Get());
47 Application Application::New( int* argc, char **argv[], const std::string& name, WINDOW_MODE windowMode )
49 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, name, DeviceLayout::DEFAULT_BASE_LAYOUT, windowMode );
50 return Application(internal.Get());
53 Application Application::New(int* argc, char **argv[], const DeviceLayout& baseLayout)
55 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "Dali Application", baseLayout, OPAQUE );
56 return Application(internal.Get());
59 Application Application::New(int* argc, char **argv[], const std::string& name, const DeviceLayout& baseLayout)
61 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, name, baseLayout, OPAQUE );
62 return Application(internal.Get());
65 Application::~Application()
69 Application::Application()
73 Application::Application(const Application& application)
74 : BaseHandle(application)
78 Application& Application::operator=(const Application& application)
80 if( *this != application )
82 BaseHandle::operator=( application );
87 void Application::MainLoop()
89 Internal::Adaptor::GetImplementation(*this).MainLoop(Configuration::APPLICATION_HANDLES_CONTEXT_LOSS);
92 void Application::MainLoop(Configuration::ContextLoss configuration)
94 Internal::Adaptor::GetImplementation(*this).MainLoop(configuration);
97 void Application::Lower()
99 Internal::Adaptor::GetImplementation(*this).Lower();
102 void Application::Quit()
104 Internal::Adaptor::GetImplementation(*this).Quit();
107 bool Application::AddIdle( CallbackBase* callback )
109 return Internal::Adaptor::GetImplementation(*this).AddIdle( callback );
112 Window Application::GetWindow()
114 return Internal::Adaptor::GetImplementation(*this).GetWindow();
117 void Application::ReplaceWindow(PositionSize windowPosition, const std::string& name)
119 Internal::Adaptor::GetImplementation(*this).ReplaceWindow(windowPosition, name);
122 void Application::SetViewMode( ViewMode viewMode )
124 Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
127 ViewMode Application::GetViewMode() const
129 return Internal::Adaptor::GetImplementation(*this).GetViewMode();
132 void Application::SetStereoBase( float stereoBase )
134 Internal::Adaptor::GetImplementation(*this).SetStereoBase( stereoBase );
137 float Application::GetStereoBase() const
139 return Internal::Adaptor::GetImplementation(*this).GetStereoBase();
142 Application::AppSignalType& Application::InitSignal()
144 return Internal::Adaptor::GetImplementation(*this).InitSignal();
147 Application::AppSignalType& Application::TerminateSignal()
149 return Internal::Adaptor::GetImplementation(*this).TerminateSignal();
152 Application::AppSignalType& Application::PauseSignal()
154 return Internal::Adaptor::GetImplementation(*this).PauseSignal();
157 Application::AppSignalType& Application::ResumeSignal()
159 return Internal::Adaptor::GetImplementation(*this).ResumeSignal();
162 Application::AppSignalType& Application::ResetSignal()
164 return Internal::Adaptor::GetImplementation(*this).ResetSignal();
167 Application::AppSignalType& Application::ResizeSignal()
169 return Internal::Adaptor::GetImplementation(*this).ResizeSignal();
172 Application::AppControlSignalType & Application::AppControlSignal()
174 return Internal::Adaptor::GetImplementation(*this).AppControlSignal();
177 Application::AppSignalType& Application::LanguageChangedSignal()
179 return Internal::Adaptor::GetImplementation(*this).LanguageChangedSignal();
182 Application::AppSignalType& Application::RegionChangedSignal()
184 return Internal::Adaptor::GetImplementation(*this).RegionChangedSignal();
187 Application::AppSignalType& Application::BatteryLowSignal()
189 return Internal::Adaptor::GetImplementation(*this).BatteryLowSignal();
192 Application::AppSignalType& Application::MemoryLowSignal()
194 return Internal::Adaptor::GetImplementation(*this).MemoryLowSignal();
197 Application::Application(Internal::Adaptor::Application* application)
198 : BaseHandle(application)