[Tizen] Revert "Support screen rotation"
[platform/core/uifw/dali-adaptor.git] / adaptors / wayland / render-surface / render-surface-wl.h
1 #ifndef __DALI_RENDER_SURFACE_WL_H__
2 #define __DALI_RENDER_SURFACE_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 <dali/public-api/common/dali-common.h>
23 #include <wayland-manager.h>
24 #include <wayland-egl.h>
25
26 // INTERNAL INCLUDES
27 #include <wayland-window.h>
28 #include <render-surface.h>
29 #include <egl-interface.h> // for color depth
30
31 namespace Dali
32 {
33
34 class TriggerEventInterface;
35
36 namespace Internal
37 {
38 namespace Adaptor
39 {
40 class WaylandManager;
41 class WindowEventInterface;
42 }
43 }
44
45 namespace Wayland
46 {
47
48
49 /**
50  * Wayland render surface.
51  */
52 class RenderSurface : public Dali::RenderSurface
53 {
54 public:
55
56   /**
57    * @brief Constructor.
58    *
59    * @param [in] positionSize the position and size of the surface
60    * @param [in] surface can be a X-window or X-pixmap (type must be unsigned int).
61    * @param [in] name optional name of surface passed in
62    * @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
63    */
64   RenderSurface(Dali::PositionSize positionSize,
65                        Any surface,
66                        const std::string& name,
67                        bool isTransparent = false);
68
69   /**
70    * @brief Destructor
71    */
72   virtual ~RenderSurface();
73
74 protected:
75
76
77   /**
78    * @Create the surface
79    */
80   void CreateSurface();
81
82 public:
83
84   /**
85    * @brief Get window handle
86    *
87    * @return the wayland window pointer
88    */
89   Window* GetWindow();
90
91   /**
92    * Assigns an event interface to the surface for getting
93    * input events / window notifications
94    */
95   void AssignWindowEventInterface( Dali::Internal::Adaptor::WindowEventInterface* eventInterface );
96
97 public: // from Dali::RenderSurface
98
99   /**
100    * @copydoc Dali::RenderSurface::GetPositionSize()
101    */
102   virtual PositionSize GetPositionSize() const;
103
104   /**
105    * @copydoc Dali::RenderSurface::InitializeEgl()
106    */
107   virtual void InitializeEgl( EglInterface& egl );
108
109   /**
110    * @copydoc Dali::RenderSurface::CreateEglSurface()
111    */
112   virtual void CreateEglSurface( EglInterface& egl );
113
114   /**
115    * @copydoc Dali::RenderSurface::DestroyEglSurface()
116    */
117   virtual void DestroyEglSurface( EglInterface& egl );
118
119   /**
120    * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
121    */
122   virtual bool ReplaceEGLSurface( EglInterface& egl );
123
124   /**
125    * @copydoc Dali::RenderSurface::MoveResize()
126    */
127   virtual void MoveResize( Dali::PositionSize positionSize);
128
129   /**
130    * @copydoc Dali::RenderSurface::SetViewMode()
131    */
132   virtual void SetViewMode( ViewMode viewMode );
133
134   /**
135    * @copydoc Dali::RenderSurface::StartRender()
136    */
137   virtual void StartRender();
138
139   /**
140    * @copydoc Dali::RenderSurface::PreRender()
141    */
142   virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
143
144   /**
145    * @copydoc Dali::RenderSurface::PostRender()
146    */
147   virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
148
149   /**
150    * @copydoc Dali::RenderSurface::StopRender();
151    */
152   virtual void StopRender();
153
154   /**
155    * @copydoc Dali::RenderSurface::ReleaseLock()
156    */
157   virtual void ReleaseLock();
158
159   /**
160    * @copydoc Dali::RenderSurface::SetThreadSynchronization()
161    */
162   virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
163
164   /**
165    * @copydoc Dali::RenderSurface::GetSurfaceType()
166    */
167   virtual RenderSurface::Type GetSurfaceType();
168
169 protected: // Data
170
171   Window                      mWindow;
172   TriggerEventInterface*      mRenderNotification; ///< Render notification trigger
173   Dali::ColorDepth            mColorDepth;         ///< Color depth
174   Dali::Internal::Adaptor::WaylandManager*   mWaylandManager; ///< wayland manager
175   wl_egl_window*              mEglWindow;
176
177 };
178
179 } // namespace Wayland
180
181 } // namespace Dali
182
183 #endif // __DALI_RENDER_SURFACE_WL_H__