[dali_2.3.25] Merge branch 'devel/master'
[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) 2021 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/internal/window-system/ubuntu-x11/ecore-x-types.h>
24
25 namespace Dali
26 {
27 class DisplayConnection;
28
29 namespace Internal
30 {
31 namespace Adaptor
32 {
33 class Impl
34 {
35 public:
36   XDisplay* mDisplay; ///< X-display for rendering
37 };
38
39 /**
40  * DisplayConnection implementation
41  */
42 class DisplayConnectionX11 : public Dali::Internal::Adaptor::DisplayConnection
43 {
44 public:
45   /**
46    * @brief Default constructor
47    */
48   DisplayConnectionX11();
49
50   /**
51    * @brief Create an initialized DisplayConnection.
52    *
53    * @return A handle to a newly allocated DisplayConnection resource.
54    */
55   static DisplayConnection* New();
56
57 public:
58   /**
59    * @copydoc Dali::DisplayConnection::GetDisplay
60    */
61   Any GetDisplay();
62
63   /**
64    * @copydoc Dali::DisplayConnection::ConsumeEvents
65    */
66   void ConsumeEvents();
67
68   /**
69    * @copydoc Dali::DisplayConnection::InitializeGraphics
70    */
71   bool InitializeGraphics();
72
73   /**
74    * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetSurfaceType
75    */
76   void SetSurfaceType(Dali::RenderSurfaceInterface::Type type);
77
78   /**
79    * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetGraphicsInterface
80    */
81   void SetGraphicsInterface(GraphicsInterface& graphics);
82
83 public:
84   /**
85    * Destructor
86    */
87   virtual ~DisplayConnectionX11();
88
89 protected:
90   // Undefined
91   DisplayConnectionX11(const DisplayConnectionX11&) = delete;
92
93   // Undefined
94   DisplayConnectionX11& operator=(const DisplayConnectionX11& rhs) = delete;
95
96 private:
97   GraphicsInterface* mGraphics; ///< The graphics interface
98
99 public:
100   XDisplay* mDisplay; ///< X-display for rendering
101 };
102
103 } // namespace Adaptor
104
105 } // namespace Internal
106
107 } // namespace Dali
108
109 #endif // DALI_INTERNAL_WINDOWSYSTEM_ECOREX_DISPLAY_CONNECTION_IMPL_ECORE_X_H