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