Removing rendering backend
[platform/core/uifw/dali-core.git] / dali / integration-api / core.cpp
1 /*
2  * Copyright (c) 2018 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/debug.h>
25 #include <dali/integration-api/graphics/graphics.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                  Graphics::Graphics& graphics,
37                  GestureManager& gestureManager,
38                  ResourcePolicy::DataRetention policy,
39                  bool renderToFboEnabled )
40 {
41   Core* instance = new Core;
42   instance->mImpl = new Internal::Core( renderController,
43                                         platformAbstraction,
44                                         graphics,
45                                         gestureManager,
46                                         policy,
47                                         renderToFboEnabled );
48
49   return instance;
50 }
51
52 Core::~Core()
53 {
54   delete mImpl;
55 }
56
57 void Core::SurfaceResized( unsigned int width, unsigned int height )
58 {
59   mImpl->SurfaceResized(width, height);
60 }
61
62 void Core::SetTopMargin( unsigned int margin )
63 {
64   mImpl->SetTopMargin(margin);
65 }
66
67 void Core::SetDpi( unsigned int dpiHorizontal, unsigned int dpiVertical )
68 {
69   mImpl->SetDpi(dpiHorizontal, dpiVertical);
70 }
71
72 void Core::SceneCreated()
73 {
74   mImpl->SceneCreated();
75 }
76
77 void Core::QueueEvent( const Event& event )
78 {
79   mImpl->QueueEvent(event);
80 }
81
82 void Core::ProcessEvents()
83 {
84   mImpl->ProcessEvents();
85 }
86
87 unsigned int Core::GetMaximumUpdateCount() const
88 {
89   return mImpl->GetMaximumUpdateCount();
90 }
91
92 void Core::Update(
93   float elapsedSeconds,
94   unsigned int lastVSyncTimeMilliseconds,
95   unsigned int nextVSyncTimeMilliseconds,
96   UpdateStatus& status,
97   bool renderToFboEnabled,
98   bool isRenderingToFbo )
99 {
100   mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status,
101                  renderToFboEnabled, isRenderingToFbo );
102 }
103
104 void Core::Render( RenderStatus& status )
105 {
106   DALI_LOG_ERROR("Core::Render() called in error");
107 }
108
109 SystemOverlay& Core::GetSystemOverlay()
110 {
111   return mImpl->GetSystemOverlay();
112 }
113
114 void Core::SetViewMode( ViewMode viewMode )
115 {
116   mImpl->SetViewMode( viewMode );
117 }
118
119 ViewMode Core::GetViewMode() const
120 {
121   return mImpl->GetViewMode();
122 }
123
124 void Core::SetStereoBase( float stereoBase )
125 {
126   mImpl->SetStereoBase( stereoBase );
127 }
128
129 float Core::GetStereoBase() const
130 {
131   return mImpl->GetStereoBase();
132 }
133
134 Core::Core()
135 : mImpl( NULL )
136 {
137 }
138
139 } // namespace Integration
140
141 } // namespace Dali