2 * Copyright (c) 2014 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 <orientation.h>
23 #include <dali/integration-api/debug.h>
26 #include <application-impl.h>
27 #include <orientation-impl.h>
32 Application Application::New( int* argc, char **argv[] )
34 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "Dali Application", DeviceLayout::DEFAULT_BASE_LAYOUT, OPAQUE );
35 return Application(internal.Get());
38 Application Application::New( int* argc, char **argv[], const std::string& name )
40 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, name, DeviceLayout::DEFAULT_BASE_LAYOUT, OPAQUE );
41 return Application(internal.Get());
44 Application Application::New( int* argc, char **argv[], const std::string& name, WINDOW_MODE windowMode )
46 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, name, DeviceLayout::DEFAULT_BASE_LAYOUT, windowMode );
47 return Application(internal.Get());
50 Application Application::New(int* argc, char **argv[], const DeviceLayout& baseLayout)
52 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "Dali Application", baseLayout, OPAQUE );
53 return Application(internal.Get());
56 Application Application::New(int* argc, char **argv[], const std::string& name, const DeviceLayout& baseLayout)
58 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, name, baseLayout, OPAQUE );
59 return Application(internal.Get());
62 Application::~Application()
66 Application::Application(const Application& application)
67 : BaseHandle(application)
71 Application& Application::operator=(const Application& application)
73 if( *this != application )
75 BaseHandle::operator=( application );
80 void Application::MainLoop()
82 Internal::Adaptor::GetImplementation(*this).MainLoop();
85 void Application::Lower()
87 Internal::Adaptor::GetImplementation(*this).Lower();
90 void Application::Quit()
92 Internal::Adaptor::GetImplementation(*this).Quit();
95 Orientation Application::GetOrientation()
97 Window window = GetWindow();
100 return window.GetOrientation();
102 return Orientation();
105 bool Application::AddIdle(boost::function<void(void)> callBack)
107 return Internal::Adaptor::GetImplementation(*this).AddIdle(callBack);
110 Window Application::GetWindow()
112 return Internal::Adaptor::GetImplementation(*this).GetWindow();
115 Application Application::Get()
117 return Internal::Adaptor::Application::Get();
120 void Application::SetViewMode( ViewMode viewMode )
122 Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
125 ViewMode Application::GetViewMode() const
127 return Internal::Adaptor::GetImplementation(*this).GetViewMode();
130 void Application::SetStereoBase( float stereoBase )
132 Internal::Adaptor::GetImplementation(*this).SetStereoBase( stereoBase );
135 float Application::GetStereoBase() const
137 return Internal::Adaptor::GetImplementation(*this).GetStereoBase();
140 Application::AppSignalV2& Application::InitSignal()
142 return Internal::Adaptor::GetImplementation(*this).InitSignal();
145 Application::AppSignalV2& Application::TerminateSignal()
147 return Internal::Adaptor::GetImplementation(*this).TerminateSignal();
150 Application::AppSignalV2& Application::PauseSignal()
152 return Internal::Adaptor::GetImplementation(*this).PauseSignal();
155 Application::AppSignalV2& Application::ResumeSignal()
157 return Internal::Adaptor::GetImplementation(*this).ResumeSignal();
160 Application::AppSignalV2& Application::ResetSignal()
162 return Internal::Adaptor::GetImplementation(*this).ResetSignal();
165 Application::AppSignalV2& Application::ResizeSignal()
167 return Internal::Adaptor::GetImplementation(*this).ResizeSignal();
170 Application::AppSignalV2& Application::LanguageChangedSignal()
172 return Internal::Adaptor::GetImplementation(*this).LanguageChangedSignal();
175 Application::Application(Internal::Adaptor::Application* application)
176 : BaseHandle(application)