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()
34 return New( NULL, NULL );
37 Application Application::New( int* argc, char **argv[] )
39 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "Dali Application", DeviceLayout::DEFAULT_BASE_LAYOUT, OPAQUE );
40 return Application(internal.Get());
43 Application Application::New( int* argc, char **argv[], const std::string& name )
45 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, name, DeviceLayout::DEFAULT_BASE_LAYOUT, OPAQUE );
46 return Application(internal.Get());
49 Application Application::New( int* argc, char **argv[], const std::string& name, WINDOW_MODE windowMode )
51 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, name, DeviceLayout::DEFAULT_BASE_LAYOUT, windowMode );
52 return Application(internal.Get());
55 Application Application::New(int* argc, char **argv[], const DeviceLayout& baseLayout)
57 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, "Dali Application", baseLayout, OPAQUE );
58 return Application(internal.Get());
61 Application Application::New(int* argc, char **argv[], const std::string& name, const DeviceLayout& baseLayout)
63 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::New( argc, argv, name, baseLayout, OPAQUE );
64 return Application(internal.Get());
67 Application::~Application()
71 Application::Application()
75 Application::Application(const Application& application)
76 : BaseHandle(application)
80 Application& Application::operator=(const Application& application)
82 if( *this != application )
84 BaseHandle::operator=( application );
89 void Application::MainLoop()
91 Internal::Adaptor::GetImplementation(*this).MainLoop();
94 void Application::Lower()
96 Internal::Adaptor::GetImplementation(*this).Lower();
99 void Application::Quit()
101 Internal::Adaptor::GetImplementation(*this).Quit();
104 Orientation Application::GetOrientation()
106 Window window = GetWindow();
109 return window.GetOrientation();
111 return Orientation();
114 bool Application::AddIdle(boost::function<void(void)> callBack)
116 return Internal::Adaptor::GetImplementation(*this).AddIdle(callBack);
119 Window Application::GetWindow()
121 return Internal::Adaptor::GetImplementation(*this).GetWindow();
124 void Application::SetViewMode( ViewMode viewMode )
126 Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
129 ViewMode Application::GetViewMode() const
131 return Internal::Adaptor::GetImplementation(*this).GetViewMode();
134 void Application::SetStereoBase( float stereoBase )
136 Internal::Adaptor::GetImplementation(*this).SetStereoBase( stereoBase );
139 float Application::GetStereoBase() const
141 return Internal::Adaptor::GetImplementation(*this).GetStereoBase();
144 Application::AppSignalV2& Application::InitSignal()
146 return Internal::Adaptor::GetImplementation(*this).InitSignal();
149 Application::AppSignalV2& Application::TerminateSignal()
151 return Internal::Adaptor::GetImplementation(*this).TerminateSignal();
154 Application::AppSignalV2& Application::PauseSignal()
156 return Internal::Adaptor::GetImplementation(*this).PauseSignal();
159 Application::AppSignalV2& Application::ResumeSignal()
161 return Internal::Adaptor::GetImplementation(*this).ResumeSignal();
164 Application::AppSignalV2& Application::ResetSignal()
166 return Internal::Adaptor::GetImplementation(*this).ResetSignal();
169 Application::AppSignalV2& Application::ResizeSignal()
171 return Internal::Adaptor::GetImplementation(*this).ResizeSignal();
174 Application::AppSignalV2& Application::LanguageChangedSignal()
176 return Internal::Adaptor::GetImplementation(*this).LanguageChangedSignal();
179 Application::Application(Internal::Adaptor::Application* application)
180 : BaseHandle(application)