1 #ifndef DALI_INTERNAL_ECORE_WIN_WINDOW_RENDER_SURFACE_H
2 #define DALI_INTERNAL_ECORE_WIN_WINDOW_RENDER_SURFACE_H
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/integration-api/egl-interface.h>
23 #include <dali/internal/window-system/common/window-render-surface.h>
24 #include <dali/internal/window-system/windows/ecore-win-types.h>
25 #include <Win32WindowSystem.h>
35 * Ecore Win Window implementation of render surface.
37 class WindowRenderSurfaceEcoreWin : public WindowRenderSurface
42 * Uses an Windows surface to render to.
43 * @param [in] positionSize the position and size of the surface
44 * @param [in] surface can be a Windows-window or Windows-pixmap (type must be unsigned int).
45 * @param [in] name optional name of surface passed in
46 * @param [in] className optional class name of the surface passed in
47 * @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
49 WindowRenderSurfaceEcoreWin( Dali::PositionSize positionSize,
51 const std::string& name,
52 const std::string& className,
53 bool isTransparent = false );
58 virtual ~WindowRenderSurfaceEcoreWin();
63 * @brief Get window handle
64 * @return the Ecore win window handle
66 Ecore_Win_Window GetWinWindow();
69 * Request to approve deiconify operation
70 * If it is requested, it will send ECORE_WIN_ATOM_E_DEICONIFY_APPROVE event to window manager after rendering
72 void RequestToApproveDeiconify();
74 public: // from WindowRenderSurface
77 * @copydoc Dali::Internal::Adaptor::WindowRenderSurface::GetWindow()
79 virtual Any GetWindow() override;
82 * @copydoc Dali::Internal::Adaptor::WindowRenderSurface::Map()
84 virtual void Map() override;
87 * @copydoc Dali::Internal::Adaptor::WindowRenderSurface::SetRenderNotification()
89 virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) override;
92 * @copydoc Dali::Internal::Adaptor::WindowRenderSurface::SetTransparency()
94 virtual void SetTransparency( bool transparent ) override;
97 * @copydoc Dali::Internal::Adaptor::WindowRenderSurface::RequestRotation()
99 virtual void RequestRotation( int angle, int width, int height ) override;
101 public: // from Dali::RenderSurface
104 * @copydoc Dali::RenderSurface::GetPositionSize()
106 virtual PositionSize GetPositionSize() const override;
109 * @copydoc Dali::RenderSurface::GetDpi()
111 virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
114 * @copydoc Dali::RenderSurface::InitializeEgl()
116 virtual void InitializeEgl( EglInterface& egl ) override;
119 * @copydoc Dali::RenderSurface::CreateEglSurface()
121 virtual void CreateEglSurface( EglInterface& egl ) override;
124 * @copydoc Dali::RenderSurface::DestroyEglSurface()
126 virtual void DestroyEglSurface( EglInterface& egl ) override;
129 * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
131 virtual bool ReplaceEGLSurface( EglInterface& egl ) override;
134 * @copydoc Dali::RenderSurface::MoveResize()
136 virtual void MoveResize( Dali::PositionSize positionSize) override;
139 * @copydoc Dali::RenderSurface::SetViewMode()
141 virtual void SetViewMode( ViewMode viewMode ) override;
144 * @copydoc Dali::RenderSurface::StartRender()
146 virtual void StartRender() override;
149 * @copydoc Dali::RenderSurface::PreRender()
151 virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) override;
154 * @copydoc Dali::RenderSurface::PostRender()
156 virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
159 * @copydoc Dali::RenderSurface::StopRender()
161 virtual void StopRender() override;
164 * @copydoc Dali::RenderSurface::SetThreadSynchronization
166 virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
169 * @copydoc Dali::RenderSurface::ReleaseLock()
171 virtual void ReleaseLock() override;
174 * @copydoc Dali::RenderSurface::GetSurfaceType()
176 virtual RenderSurface::Type GetSurfaceType() override;
178 private: // from WindowRenderSurface
181 * @copydoc Dali::Internal::Adaptor::WindowRenderSurface::Initialize()
183 void Initialize( Any surface ) override;
186 * @copydoc Dali::Internal::Adaptor::WindowRenderSurface::CreateRenderable()
188 void CreateRenderable() override;
191 * @copydoc Dali::Internal::Adaptor::WindowRenderSurface::UseExistingRenderable()
193 void UseExistingRenderable( unsigned int surfaceId ) override;
198 * Get the surface id if the surface parameter is not empty
199 * @param surface Any containing a surface id, or can be empty
200 * @return surface id, or zero if surface is empty
202 unsigned int GetSurfaceId( Any surface ) const;
206 std::string mTitle; ///< Title of window which shows from "xinfo -topvwins" command
207 std::string mClassName; ///< The class name of the window
208 PositionSize mPosition; ///< Position
209 ColorDepth mColorDepth; ///< Color depth of surface (32 bit or 24 bit)
210 Ecore_Win_Window mWinWindow; ///< Win-Window
211 bool mOwnSurface; ///< Whether we own the surface (responsible for deleting it)
212 bool mNeedToApproveDeiconify; ///< Whether need to send ECORE_WIN_ATOM_E_DEICONIFY_APPROVE event
214 }; // class WindowRenderSurfaceEcoreWin
216 } // namespace Adaptor
218 } // namespace internal
222 #endif // __DALI_INTERNAL_ECORE_WIN_WINDOW_RENDER_SURFACE_H__