f74def4b2e10ddb1e3c5820448e682a13aecfc94
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / ubuntu-x11 / display-connection-impl-x.h
1 #ifndef DALI_INTERNAL_WINDOWSYSTEM_ECOREX_DISPLAY_CONNECTION_IMPL_ECORE_X_H
2 #define DALI_INTERNAL_WINDOWSYSTEM_ECOREX_DISPLAY_CONNECTION_IMPL_ECORE_X_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 // INTERNAL INCLUDES
22 #include <dali/internal/window-system/common/display-connection-impl.h>
23 #include <dali/public-api/object/base-object.h>
24 #include <dali/internal/graphics/gles20/egl-implementation.h>
25 #include <dali/internal/window-system/ubuntu-x11/ecore-x-types.h>
26
27 namespace Dali
28 {
29
30 class RenderSurface;
31 class DisplayConnection;
32
33 namespace Internal
34 {
35
36 namespace Adaptor
37 {
38
39
40 class Impl
41 {
42 public:
43
44   XDisplay*  mDisplay;        ///< X-display for rendering
45 };
46
47
48 /**
49  * DisplayConnection implementation
50  */
51 class DisplayConnectionX11 : public Dali::Internal::Adaptor::DisplayConnection
52 {
53 public:
54
55   /**
56    * @brief Default constructor
57    */
58   DisplayConnectionX11();
59
60   /**
61    * @brief Create an initialized DisplayConnection.
62    *
63    * @return A handle to a newly allocated DisplayConnection resource.
64    */
65   static DisplayConnection* New();
66
67 public:
68
69   /**
70    * @copydoc Dali::DisplayConnection::GetDisplay
71    */
72   Any GetDisplay();
73
74   /**
75    * @copydoc Dali::DisplayConnection::GetDpi
76    */
77   static void GetDpi(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   void SetSurfaceType( RenderSurface::Type type );
90
91 public:
92
93   /**
94    * Destructor
95    */
96   virtual ~DisplayConnectionX11();
97
98 protected:
99
100   // Undefined
101   DisplayConnectionX11(const DisplayConnectionX11&) = delete;
102
103   // Undefined
104   DisplayConnectionX11& operator=(const DisplayConnectionX11& rhs) = delete;
105
106 private:
107
108 public:
109
110   XDisplay*  mDisplay;        ///< X-display for rendering
111
112 };
113
114 } // namespace Adaptor
115
116 } // namespace internal
117
118 } // namespace Dali
119
120 #endif // DALI_INTERNAL_WINDOWSYSTEM_ECOREX_DISPLAY_CONNECTION_IMPL_ECORE_X_H