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 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,
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,
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 void Application::SetViewMode( ViewMode viewMode )
115 Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
118 ViewMode Application::GetViewMode() const
120 return Internal::Adaptor::GetImplementation(*this).GetViewMode();
123 void Application::SetStereoBase( float stereoBase )
125 Internal::Adaptor::GetImplementation(*this).SetStereoBase( stereoBase );
128 float Application::GetStereoBase() const
130 return Internal::Adaptor::GetImplementation(*this).GetStereoBase();
133 Application::AppSignalType& Application::InitSignal()
135 return Internal::Adaptor::GetImplementation(*this).InitSignal();
138 Application::AppSignalType& Application::TerminateSignal()
140 return Internal::Adaptor::GetImplementation(*this).TerminateSignal();
143 Application::AppSignalType& Application::PauseSignal()
145 return Internal::Adaptor::GetImplementation(*this).PauseSignal();
148 Application::AppSignalType& Application::ResumeSignal()
150 return Internal::Adaptor::GetImplementation(*this).ResumeSignal();
153 Application::AppSignalType& Application::ResetSignal()
155 return Internal::Adaptor::GetImplementation(*this).ResetSignal();
158 Application::AppSignalType& Application::ResizeSignal()
160 return Internal::Adaptor::GetImplementation(*this).ResizeSignal();
163 Application::AppControlSignalType & Application::AppControlSignal()
165 return Internal::Adaptor::GetImplementation(*this).AppControlSignal();
168 Application::AppSignalType& Application::LanguageChangedSignal()
170 return Internal::Adaptor::GetImplementation(*this).LanguageChangedSignal();
173 Application::AppSignalType& Application::RegionChangedSignal()
175 return Internal::Adaptor::GetImplementation(*this).RegionChangedSignal();
178 Application::AppSignalType& Application::BatteryLowSignal()
180 return Internal::Adaptor::GetImplementation(*this).BatteryLowSignal();
183 Application::AppSignalType& Application::MemoryLowSignal()
185 return Internal::Adaptor::GetImplementation(*this).MemoryLowSignal();
188 Application::Application(Internal::Adaptor::Application* application)
189 : BaseHandle(application)