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