Add FrontBufferRendering property in WindowData
[platform/core/uifw/dali-adaptor.git] / dali / public-api / adaptor-framework / window-data.cpp
1 /*
2  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/public-api/adaptor-framework/window-data.h>
20
21 namespace Dali
22 {
23 struct WindowData::Impl
24 {
25   Impl()
26   : mPositionSize(0, 0, 0, 0),
27     mIsTransparent(true),
28     mWindowType(WindowType::NORMAL),
29     mIsFrontBufferRendering(false)
30   {
31   }
32
33   Dali::Rect<int> mPositionSize;            ///< The position and size of the Window
34   bool            mIsTransparent;           ///< The transparency of the Window
35   WindowType      mWindowType;              ///< The window type of the Window
36   bool            mIsFrontBufferRendering;  ///< The front buffer rendering of the Window
37 };
38
39 WindowData::WindowData()
40 : mImpl(std::make_unique<Impl>())
41 {
42 }
43
44 WindowData::~WindowData() = default;
45
46 void WindowData::SetPositionSize(Dali::Rect<int>& positionSize)
47 {
48   mImpl->mPositionSize = positionSize;
49 }
50
51 Dali::Rect<int> WindowData::GetPositionSize() const
52 {
53   return mImpl->mPositionSize;
54 }
55
56 void WindowData::SetTransparency(bool transparent)
57 {
58   mImpl->mIsTransparent = transparent;
59 }
60
61 bool WindowData::GetTransparency() const
62 {
63   return mImpl->mIsTransparent;
64 }
65
66 void WindowData::SetWindowType(WindowType type)
67 {
68   mImpl->mWindowType = type;
69 }
70
71 WindowType WindowData::GetWindowType() const
72 {
73   return mImpl->mWindowType;
74 }
75
76 void WindowData::SetFrontBufferRendering(bool enable)
77 {
78   mImpl->mIsFrontBufferRendering = enable;
79 }
80
81 bool WindowData::GetFrontBufferRendering() const
82 {
83   return mImpl->mIsFrontBufferRendering;
84 }
85
86 } // namespace Dali