Refactoring window system
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-render-surface.h
1 #ifndef DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_RENDER_SURFACE_H
2 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_RENDER_SURFACE_H
3
4 /*
5  * Copyright (c) 2018 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/integration-api/render-surface.h>
23
24 namespace Dali
25 {
26
27 class TriggerEventInterface;
28
29 namespace Internal
30 {
31 namespace Adaptor
32 {
33
34 /**
35  * Window interface of render surface.
36  */
37 class WindowRenderSurface : public Dali::RenderSurface
38 {
39 public:
40
41   /**
42    * @brief Default constructor
43    */
44   WindowRenderSurface() = default;
45
46   /**
47    * @brief Destructor
48    */
49   virtual ~WindowRenderSurface() = default;
50
51 public: // API
52
53   /**
54    * @brief Get the render surface the adaptor is using to render to.
55    * @return reference to current render surface
56    */
57   virtual Any GetWindow() = 0;
58
59   /**
60    * @brief Map window
61    */
62   virtual void Map() = 0;
63
64   /**
65    * @brief Sets the render notification trigger to call when render thread is completed a frame
66    * @param renderNotification to use
67    */
68   virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) = 0;
69
70   /**
71    * @brief Sets whether the surface is transparent or not.
72    * @param[in] transparent Whether the surface is transparent
73    */
74   virtual void SetTransparency( bool transparent ) = 0;
75
76   /**
77    * Request surface rotation
78    * @param[in] angle A new angle of the surface
79    * @param[in] width A new width of the surface
80    * @param[in] height A new height of the surface
81    */
82   virtual void RequestRotation( int angle, int width, int height ) = 0;
83
84 protected:
85
86   /**
87    * @brief Second stage construction
88    */
89   virtual void Initialize( Any surface ) = 0;
90
91   /**
92    * @brief Create window
93    */
94   virtual void CreateRenderable() = 0;
95
96   /**
97    * @brief Use an existing render surface
98    * @param surfaceId the id of the surface
99    */
100   virtual void UseExistingRenderable( unsigned int surfaceId ) = 0;
101
102 protected:
103
104   // Undefined
105   WindowRenderSurface(const WindowRenderSurface&) = delete;
106
107   // Undefined
108   WindowRenderSurface& operator=(const WindowRenderSurface& rhs) = delete;
109
110 }; // class WindowRenderSurface
111
112 } // namespace Adaptor
113
114 } // namespace internal
115
116 } // namespace Dali
117
118 #endif // DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_RENDER_SURFACE_H