Remove RenderSurface from Core
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / common / adaptor-internal-services.h
1 #ifndef DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H
2 #define DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/core.h>
23 #include <dali/integration-api/gl-abstraction.h>
24
25 // INTERNAL INCLUDES
26 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
27 #include <dali/integration-api/adaptor-framework/trigger-event-interface.h>
28 #include <dali/internal/graphics/common/graphics-interface.h>
29 #include <dali/internal/graphics/gles/egl-factory-interface.h>
30 #include <dali/internal/network/common/socket-factory-interface.h>
31 #include <dali/internal/network/common/trace-interface.h>
32 #include <dali/internal/system/common/performance-interface.h>
33 #include <dali/internal/window-system/common/display-connection.h>
34
35 namespace Dali
36 {
37
38 namespace Internal
39 {
40
41 namespace Adaptor
42 {
43
44 class SceneHolder;
45 using WindowContainer = std::vector<Internal::Adaptor::SceneHolder*>;
46
47 /**
48  * A class to contain various interfaces provided by the adaptor which
49  * can be used by the cross platform parts of adaptor.
50  * E.g. any files held in adaptors/base/ directory
51  *
52  */
53 class AdaptorInternalServices
54 {
55
56 public:
57
58   /**
59    * @return core
60    */
61   virtual Dali::Integration::Core& GetCore() = 0;
62
63   /**
64    * @return platform abstraction
65    */
66   virtual Dali::Integration::PlatformAbstraction& GetPlatformAbstractionInterface() = 0;
67
68   /**
69    * Used to access the Display Connection interface from the Render thread
70    * @return the Display Connection interface
71    */
72   virtual Dali::DisplayConnection& GetDisplayConnectionInterface() = 0;
73
74   /**
75    * Used to access the abstracted graphics interface
76    * This also contains the depth and stencil buffers
77    * @return the graphics interface
78    */
79   virtual GraphicsInterface& GetGraphicsInterface() = 0;
80
81   /**
82    * Used by update-thread to notify core (main-thread) it has messages to process
83    * @return trigger event ProcessCoreEvents
84    */
85   virtual TriggerEventInterface& GetProcessCoreEventsTrigger() = 0;
86
87   /**
88    * @return socket factory interface
89    */
90   virtual SocketFactoryInterface& GetSocketFactoryInterface() = 0;
91
92   /**
93    * @return render surface
94    */
95   virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface() = 0;
96
97   /**
98    * @return performance interface
99    */
100   virtual PerformanceInterface* GetPerformanceInterface() = 0;
101
102   /**
103    * @return interface for logging to the kernel ( e.g. using ftrace )
104    */
105   virtual TraceInterface& GetKernelTraceInterface() = 0;
106
107   /**
108    * @return system trace interface, e.g. for using Tizen Trace (ttrace) or Android Trace (atrace)
109    */
110   virtual TraceInterface& GetSystemTraceInterface() = 0;
111
112   /**
113    * Used to access the list of windows from the Render thread
114    * @param[out] windows The list of created windows
115    */
116   virtual void GetWindowContainerInterface( WindowContainer& windows ) = 0;
117
118 protected:
119
120   /**
121    * constructor
122    */
123   AdaptorInternalServices()
124   {
125   };
126
127   /**
128    * virtual destructor
129    */
130   virtual ~AdaptorInternalServices()
131   {
132   };
133
134   // Undefined copy constructor.
135   AdaptorInternalServices( const AdaptorInternalServices& ) = delete;
136
137   // Undefined assignment operator.
138   AdaptorInternalServices& operator=( const AdaptorInternalServices& ) = delete;
139 };
140
141 } // namespace Internal
142
143 } // namespace Adaptor
144
145 } // namespace Dali
146
147 #endif // DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H