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