Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-core.git] / dali / integration-api / core.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/integration-api/core.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/common/dali-common.h>
23 #include <dali/integration-api/events/event.h>
24 #include <dali/integration-api/gl-sync-abstraction.h>
25 #include <dali/internal/common/core-impl.h>
26
27 namespace Dali
28 {
29
30 namespace Integration
31 {
32
33 Core* Core::New(RenderController& renderController, PlatformAbstraction& platformAbstraction,
34                 GlAbstraction& glAbstraction, GlSyncAbstraction& glSyncAbstraction, GestureManager& gestureManager, ResourcePolicy::DataRetention policy )
35 {
36   Core* instance = new Core;
37   instance->mImpl = new Internal::Core( renderController, platformAbstraction, glAbstraction, glSyncAbstraction, gestureManager, policy );
38
39   return instance;
40 }
41
42 Core::~Core()
43 {
44   delete mImpl;
45 }
46
47 ContextNotifierInterface* Core::GetContextNotifier()
48 {
49   return mImpl->GetContextNotifier();
50 }
51
52 void Core::ContextCreated()
53 {
54   mImpl->ContextCreated();
55 }
56
57 void Core::ContextDestroyed()
58 {
59   mImpl->ContextDestroyed();
60 }
61
62 void Core::RecoverFromContextLoss()
63 {
64   mImpl->RecoverFromContextLoss();
65 }
66
67 void Core::SurfaceResized(unsigned int width, unsigned int height)
68 {
69   mImpl->SurfaceResized(width, height);
70 }
71
72 void Core::SetTopMargin( unsigned int margin )
73 {
74   mImpl->SetTopMargin(margin);
75 }
76
77 void Core::SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical)
78 {
79   mImpl->SetDpi(dpiHorizontal, dpiVertical);
80 }
81
82 void Core::Suspend()
83 {
84   mImpl->Suspend();
85 }
86
87 void Core::Resume()
88 {
89   mImpl->Resume();
90 }
91
92 void Core::SceneCreated()
93 {
94   mImpl->SceneCreated();
95 }
96
97 void Core::QueueEvent(const Event& event)
98 {
99   mImpl->QueueEvent(event);
100 }
101
102 void Core::ProcessEvents()
103 {
104   mImpl->ProcessEvents();
105 }
106
107 unsigned int Core::GetMaximumUpdateCount() const
108 {
109   return mImpl->GetMaximumUpdateCount();
110 }
111
112 void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, UpdateStatus& status )
113 {
114   mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status );
115 }
116
117 void Core::Render( RenderStatus& status )
118 {
119   mImpl->Render( status );
120 }
121
122 SystemOverlay& Core::GetSystemOverlay()
123 {
124   return mImpl->GetSystemOverlay();
125 }
126
127 void Core::SetViewMode( ViewMode viewMode )
128 {
129   mImpl->SetViewMode( viewMode );
130 }
131
132 ViewMode Core::GetViewMode() const
133 {
134   return mImpl->GetViewMode();
135 }
136
137 void Core::SetStereoBase( float stereoBase )
138 {
139   mImpl->SetStereoBase( stereoBase );
140 }
141
142 float Core::GetStereoBase() const
143 {
144   return mImpl->GetStereoBase();
145 }
146
147 Core::Core()
148 : mImpl( NULL )
149 {
150 }
151
152 } // namespace Integration
153
154 } // namespace Dali