[Tizen] ecore-wl2: applying ecore-wl2
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / tizen-wayland / ecore-wl2 / display-connection-impl-ecore-wl2.h
1 #ifndef DALI_INTERNAL_WINDOWSYSTEM_ECOREWL_DISPLAY_CONNECTION_IMPL_ECORE_WL2_H
2 #define DALI_INTERNAL_WINDOWSYSTEM_ECOREWL_DISPLAY_CONNECTION_IMPL_ECORE_WL2_H
3
4 /*
5  * Copyright (c) 2017 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 <wayland-egl.h>
23 #include <Ecore_Wl2.h>
24 #include <dali/integration-api/wayland/wl-types.h>
25
26 // INTERNAL INCLUDES
27 #include <dali/internal/window-system/common/display-connection-impl.h>
28 #include <dali/public-api/object/base-object.h>
29 #include <dali/internal/graphics/gles20/egl-implementation.h>
30
31 namespace Dali
32 {
33
34 class RenderSurface;
35 class DisplayConnection;
36
37 namespace Internal
38 {
39
40 namespace Adaptor
41 {
42
43 /**
44  * DisplayConnection implementation
45  */
46 class DisplayConnectionEcoreWl2 : public Dali::Internal::Adaptor::DisplayConnection
47 {
48 public:
49
50   /**
51    * @brief Default constructor
52    */
53   DisplayConnectionEcoreWl2();
54
55   /**
56    * @brief Create an initialized DisplayConnection.
57    *
58    * @return A handle to a newly allocated DisplayConnection resource.
59    */
60   static DisplayConnection* New();
61
62 public:
63
64   /**
65    * @copydoc Dali::DisplayConnection::GetDisplay
66    */
67   Any GetDisplay();
68
69   /**
70    * @copydoc Dali::DisplayConnection::GetDpi
71    */
72   static void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical);
73
74   /**
75    * @copydoc Dali::DisplayConnection::GetDpi with native window
76    */
77   static void GetDpi(Any nativeWindow, unsigned int& dpiHorizontal, unsigned int& dpiVertical);
78
79   /**
80    * @copydoc Dali::DisplayConnection::ConsumeEvents
81    */
82   void ConsumeEvents();
83
84   /**
85    * @copydoc Dali::DisplayConnection::InitializeEgl
86    */
87   bool InitializeEgl(EglInterface& egl);
88
89   /**
90    * @brief Sets surface type
91    */
92   void SetSurfaceType( RenderSurface::Type type );
93
94
95
96 public:
97
98   /**
99    * Destructor
100    */
101   virtual ~DisplayConnectionEcoreWl2();
102
103 protected:
104
105   /**
106    * @brief Gets display connection for native surface
107    */
108   EGLNativeDisplayType GetNativeDisplay();
109
110   /**
111    * @brief Release display connection for native surface
112    */
113   void ReleaseNativeDisplay();
114
115   // Undefined
116   DisplayConnectionEcoreWl2(const DisplayConnectionEcoreWl2&);
117
118   // Undefined
119   DisplayConnectionEcoreWl2& operator=(const DisplayConnectionEcoreWl2& rhs);
120
121 private:
122   EGLNativeDisplayType mDisplay;        ///< Wayland-display for rendering
123   RenderSurface::Type mSurfaceType;
124 };
125
126 } // namespace Adaptor
127
128 } // namespace internal
129
130 } // namespace Dali
131
132 #endif // DALI_INTERNAL_WINDOWSYSTEM_ECOREWL_DISPLAY_CONNECTION_IMPL_ECORE_WL2_H