Merge "Remove SystemOverlay." into devel/master
[platform/core/uifw/dali-core.git] / dali / integration-api / core.cpp
1 /*
2  * Copyright (c) 2019 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/integration-api/processor-interface.h>
26 #include <dali/internal/common/core-impl.h>
27
28 namespace Dali
29 {
30
31 namespace Integration
32 {
33
34 Core* Core::New( RenderController& renderController,
35                  PlatformAbstraction& platformAbstraction,
36                  GlAbstraction& glAbstraction,
37                  GlSyncAbstraction& glSyncAbstraction,
38                  GestureManager& gestureManager,
39                  ResourcePolicy::DataRetention policy,
40                  RenderToFrameBuffer renderToFboEnabled,
41                  DepthBufferAvailable depthBufferAvailable,
42                  StencilBufferAvailable stencilBufferAvailable )
43 {
44   Core* instance = new Core;
45   instance->mImpl = new Internal::Core( renderController,
46                                         platformAbstraction,
47                                         glAbstraction,
48                                         glSyncAbstraction,
49                                         gestureManager,
50                                         policy,
51                                         renderToFboEnabled,
52                                         depthBufferAvailable,
53                                         stencilBufferAvailable );
54
55   return instance;
56 }
57
58 Core::~Core()
59 {
60   delete mImpl;
61 }
62
63 ContextNotifierInterface* Core::GetContextNotifier()
64 {
65   return mImpl->GetContextNotifier();
66 }
67
68 void Core::ContextCreated()
69 {
70   mImpl->ContextCreated();
71 }
72
73 void Core::ContextDestroyed()
74 {
75   mImpl->ContextDestroyed();
76 }
77
78 void Core::RecoverFromContextLoss()
79 {
80   mImpl->RecoverFromContextLoss();
81 }
82
83 void Core::SurfaceResized(uint32_t width, uint32_t height)
84 {
85   mImpl->SurfaceResized(width, height);
86 }
87
88 void Core::SetTopMargin( uint32_t margin )
89 {
90   mImpl->SetTopMargin(margin);
91 }
92
93 void Core::SetDpi( uint32_t dpiHorizontal, uint32_t dpiVertical)
94 {
95   mImpl->SetDpi(dpiHorizontal, dpiVertical);
96 }
97
98 void Core::SceneCreated()
99 {
100   mImpl->SceneCreated();
101 }
102
103 void Core::QueueEvent(const Event& event)
104 {
105   mImpl->QueueEvent(event);
106 }
107
108 void Core::ProcessEvents()
109 {
110   mImpl->ProcessEvents();
111 }
112
113 uint32_t Core::GetMaximumUpdateCount() const
114 {
115   return mImpl->GetMaximumUpdateCount();
116 }
117
118 void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
119 {
120   mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo );
121 }
122
123 void Core::Render( RenderStatus& status, bool forceClear )
124 {
125   mImpl->Render( status, forceClear );
126 }
127
128 void Core::RegisterProcessor( Processor& processor )
129 {
130   mImpl->RegisterProcessor( processor );
131 }
132
133 void Core::UnregisterProcessor( Processor& processor )
134 {
135   mImpl->UnregisterProcessor( processor );
136 }
137
138 Core::Core()
139 : mImpl( NULL )
140 {
141 }
142
143 } // namespace Integration
144
145 } // namespace Dali