[Tizen] Add OffscreenApplication
[platform/core/uifw/dali-adaptor.git] / dali / internal / offscreen / ubuntu-x11 / offscreen-window-impl-x.h
1 #ifndef DALI_INTERNAL_OFFSCREEN_WINDOW_IMPL_X_H
2 #define DALI_INTERNAL_OFFSCREEN_WINDOW_IMPL_X_H
3
4 /*
5  * Copyright (c) 2020 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/offscreen/common/offscreen-window-impl.h>
23
24 namespace Dali
25 {
26 class Adaptor;
27 class Layer;
28 class NativeRenderSurface;
29 class TriggerEventInterface;
30
31 namespace Internal
32 {
33
34 class OffscreenWindowX : public Dali::Internal::OffscreenWindow
35 {
36 public:
37
38   static OffscreenWindowX* New( uint16_t width, uint16_t height, Dali::Any surface, bool isTranslucent );
39
40 public:
41
42   /**
43    * @copydoc Dali::OffscreenWindow::GetLayerCount
44    */
45   uint32_t GetLayerCount() const;
46
47   /**
48    * @copydoc Dali::OffscreenWindow::GetLayer
49    */
50   Dali::Layer GetLayer( uint32_t depth ) const;
51
52   /**
53    * @copydoc Dali::OffscreenWindow::GetSize
54    */
55   WindowSize GetSize() const;
56
57   /**
58    * @copydoc Dali::OffscreenWindow::GetNativeHandle
59    */
60   Dali::Any GetNativeHandle() const override;
61
62   /*
63    * @brief Initialize the OffscreenWindow
64    * @param[in] isDefaultWindow Whether the OffscreenWindow is a default one or not
65    */
66   void Initialize( bool isDefaultWindow );
67
68 public:  // Signals
69
70   /**
71    * @copydoc Dali::OffscreenWindow::PostRenderSignal
72    */
73   OffscreenWindow::PostRenderSignalType& PostRenderSignal();
74
75 private:
76   /**
77    * This function is called after drawing by dali.
78    */
79   void OnPostRender();
80
81   /**
82    * @brief Get the native render surface
83    * @return The render surface
84    */
85   NativeRenderSurface* GetNativeRenderSurface() const;
86
87 private:
88
89   /**
90    * Private constructor
91    *
92    * @param[in] width The initial width of the OffscreenWindow
93    * @param[in] height The initial height of the OffscreenWindow
94    * @param[in] surface The tbm surface queue handle
95    * @param[in] isTranslucent Whether the OffscreenWindow is translucent or not
96    */
97   OffscreenWindowX( uint16_t width, uint16_t height, Dali::Any surface, bool isTranslucent );
98
99   /**
100    * Destructor
101    */
102   virtual ~OffscreenWindowX();
103
104   // Undefined
105   OffscreenWindowX( const OffscreenWindowX& );
106   OffscreenWindowX& operator=( OffscreenWindowX& );
107
108   /*
109    * @brief Initialize the OffscreenWindow (for internal use)
110    */
111   void Initialize();
112
113 private:
114
115   PostRenderSignalType                      mPostRenderSignal;
116   bool                                      mIsTranslucent;
117 };
118
119 } // namespace Internal
120
121 } // namespace Dali
122
123 #endif // DALI_INTERNAL_OFFSCREEN_WINDOW_IMPL_X_H