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, "", OPAQUE, PositionSize(),
38 Internal::Adaptor::Framework::NORMAL);
39 return Application(internal.Get());
42 Application Application::New( int* argc, char **argv[], const std::string& stylesheet )
44 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, OPAQUE, PositionSize(),
45 Internal::Adaptor::Framework::NORMAL);
46 return Application(internal.Get());
49 Application Application::New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode )
51 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode, PositionSize(),
52 Internal::Adaptor::Framework::NORMAL);
53 return Application(internal.Get());
56 Application::~Application()
60 Application::Application()
64 Application::Application(const Application& application)
65 : BaseHandle(application)
69 Application& Application::operator=(const Application& application)
71 if( *this != application )
73 BaseHandle::operator=( application );
78 void Application::MainLoop()
80 Internal::Adaptor::GetImplementation(*this).MainLoop(Configuration::APPLICATION_HANDLES_CONTEXT_LOSS);
83 void Application::MainLoop(Configuration::ContextLoss configuration)
85 Internal::Adaptor::GetImplementation(*this).MainLoop(configuration);
88 void Application::Lower()
90 Internal::Adaptor::GetImplementation(*this).Lower();
93 void Application::Quit()
95 Internal::Adaptor::GetImplementation(*this).Quit();
98 bool Application::AddIdle( CallbackBase* callback )
100 return Internal::Adaptor::GetImplementation(*this).AddIdle( callback );
103 Window Application::GetWindow()
105 return Internal::Adaptor::GetImplementation(*this).GetWindow();
108 void Application::ReplaceWindow(PositionSize windowPosition, const std::string& name)
110 Internal::Adaptor::GetImplementation(*this).ReplaceWindow(windowPosition, name);
113 std::string Application::GetResourcePath()
115 return Internal::Adaptor::Application::GetResourcePath();
118 void Application::SetViewMode( ViewMode viewMode )
120 Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
123 ViewMode Application::GetViewMode() const
125 return Internal::Adaptor::GetImplementation(*this).GetViewMode();
128 void Application::SetStereoBase( float stereoBase )
130 Internal::Adaptor::GetImplementation(*this).SetStereoBase( stereoBase );
133 float Application::GetStereoBase() const
135 return Internal::Adaptor::GetImplementation(*this).GetStereoBase();
138 Application::AppSignalType& Application::InitSignal()
140 return Internal::Adaptor::GetImplementation(*this).InitSignal();
143 Application::AppSignalType& Application::TerminateSignal()
145 return Internal::Adaptor::GetImplementation(*this).TerminateSignal();
148 Application::AppSignalType& Application::PauseSignal()
150 return Internal::Adaptor::GetImplementation(*this).PauseSignal();
153 Application::AppSignalType& Application::ResumeSignal()
155 return Internal::Adaptor::GetImplementation(*this).ResumeSignal();
158 Application::AppSignalType& Application::ResetSignal()
160 return Internal::Adaptor::GetImplementation(*this).ResetSignal();
163 Application::AppSignalType& Application::ResizeSignal()
165 DALI_LOG_WARNING_NOFN( "DEPRECATION WARNING: ResizeSignal() is deprecated and will be removed from next release. Use Window::ResizedSignal() instead.\n" );
167 return Internal::Adaptor::GetImplementation(*this).ResizeSignal();
170 Application::AppControlSignalType & Application::AppControlSignal()
172 return Internal::Adaptor::GetImplementation(*this).AppControlSignal();
175 Application::AppSignalType& Application::LanguageChangedSignal()
177 return Internal::Adaptor::GetImplementation(*this).LanguageChangedSignal();
180 Application::AppSignalType& Application::RegionChangedSignal()
182 return Internal::Adaptor::GetImplementation(*this).RegionChangedSignal();
185 Application::AppSignalType& Application::BatteryLowSignal()
187 return Internal::Adaptor::GetImplementation(*this).BatteryLowSignal();
190 Application::AppSignalType& Application::MemoryLowSignal()
192 return Internal::Adaptor::GetImplementation(*this).MemoryLowSignal();
195 Application::Application(Internal::Adaptor::Application* application)
196 : BaseHandle(application)