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 );
38 return Application(internal.Get());
41 Application Application::New( int* argc, char **argv[], const std::string& stylesheet )
43 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, OPAQUE );
44 return Application(internal.Get());
47 Application Application::New( int* argc, char **argv[], const std::string& stylesheet, WINDOW_MODE windowMode )
49 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode );
50 return Application(internal.Get());
53 Application::~Application()
57 Application::Application()
61 Application::Application(const Application& application)
62 : BaseHandle(application)
66 Application& Application::operator=(const Application& application)
68 if( *this != application )
70 BaseHandle::operator=( application );
75 void Application::MainLoop()
77 Internal::Adaptor::GetImplementation(*this).MainLoop(Configuration::APPLICATION_HANDLES_CONTEXT_LOSS);
80 void Application::MainLoop(Configuration::ContextLoss configuration)
82 Internal::Adaptor::GetImplementation(*this).MainLoop(configuration);
85 void Application::Lower()
87 Internal::Adaptor::GetImplementation(*this).Lower();
90 void Application::Quit()
92 Internal::Adaptor::GetImplementation(*this).Quit();
95 bool Application::AddIdle( CallbackBase* callback )
97 return Internal::Adaptor::GetImplementation(*this).AddIdle( callback );
100 Window Application::GetWindow()
102 return Internal::Adaptor::GetImplementation(*this).GetWindow();
105 void Application::ReplaceWindow(PositionSize windowPosition, const std::string& name)
107 Internal::Adaptor::GetImplementation(*this).ReplaceWindow(windowPosition, name);
110 void Application::SetViewMode( ViewMode viewMode )
112 Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
115 ViewMode Application::GetViewMode() const
117 return Internal::Adaptor::GetImplementation(*this).GetViewMode();
120 void Application::SetStereoBase( float stereoBase )
122 Internal::Adaptor::GetImplementation(*this).SetStereoBase( stereoBase );
125 float Application::GetStereoBase() const
127 return Internal::Adaptor::GetImplementation(*this).GetStereoBase();
130 Application::AppSignalType& Application::InitSignal()
132 return Internal::Adaptor::GetImplementation(*this).InitSignal();
135 Application::AppSignalType& Application::TerminateSignal()
137 return Internal::Adaptor::GetImplementation(*this).TerminateSignal();
140 Application::AppSignalType& Application::PauseSignal()
142 return Internal::Adaptor::GetImplementation(*this).PauseSignal();
145 Application::AppSignalType& Application::ResumeSignal()
147 return Internal::Adaptor::GetImplementation(*this).ResumeSignal();
150 Application::AppSignalType& Application::ResetSignal()
152 return Internal::Adaptor::GetImplementation(*this).ResetSignal();
155 Application::AppSignalType& Application::ResizeSignal()
157 return Internal::Adaptor::GetImplementation(*this).ResizeSignal();
160 Application::AppControlSignalType & Application::AppControlSignal()
162 return Internal::Adaptor::GetImplementation(*this).AppControlSignal();
165 Application::AppSignalType& Application::LanguageChangedSignal()
167 return Internal::Adaptor::GetImplementation(*this).LanguageChangedSignal();
170 Application::AppSignalType& Application::RegionChangedSignal()
172 return Internal::Adaptor::GetImplementation(*this).RegionChangedSignal();
175 Application::AppSignalType& Application::BatteryLowSignal()
177 return Internal::Adaptor::GetImplementation(*this).BatteryLowSignal();
180 Application::AppSignalType& Application::MemoryLowSignal()
182 return Internal::Adaptor::GetImplementation(*this).MemoryLowSignal();
185 Application::Application(Internal::Adaptor::Application* application)
186 : BaseHandle(application)