Bind setter and getter for front buffer rendering in WindowData
[platform/core/uifw/dali-csharp-binder.git] / dali-csharp-binder / dali-adaptor / window-data-wrap.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 #include <dali/public-api/adaptor-framework/window-data.h>
19
20 #include <dali-csharp-binder/common/common.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_WindowData()
27 {
28   void*             nuiResult;
29   Dali::WindowData* result = 0;
30
31   {
32     try
33     {
34       result = (Dali::WindowData*)new Dali::WindowData();
35     }
36     CALL_CATCH_EXCEPTION(0);
37   }
38
39   nuiResult = (void*)result;
40   return nuiResult;
41 }
42
43 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_WindowData(void* nuiWindowData)
44 {
45   Dali::WindowData* handle = (Dali::WindowData*)0;
46
47   handle = (Dali::WindowData*)nuiWindowData;
48   {
49     try
50     {
51       delete handle;
52     }
53     CALL_CATCH_EXCEPTION();
54   }
55 }
56
57 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_WindowData_SetPositionSize(void* nuiWindowData, void* nuiPositionSize)
58 {
59   Dali::WindowData* pWindowData;
60   Dali::Rect<int>*  rect = 0;
61
62   pWindowData = (Dali::WindowData*)nuiWindowData;
63   if(!pWindowData)
64   {
65     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowData", 0);
66     return;
67   }
68
69   rect = (Dali::Rect<int>*)nuiPositionSize;
70   if(!rect)
71   {
72     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Rect< int > const & type is null", 0);
73     return;
74   }
75   {
76     try
77     {
78       pWindowData->SetPositionSize(*rect);
79     }
80     CALL_CATCH_EXCEPTION();
81   }
82 }
83
84 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_WindowData_GetPositionSize(void* nuiWindowData)
85 {
86   void*             nuiResult;
87   Dali::WindowData* pWindowData;
88   Dali::Rect<int>   result;
89
90   pWindowData = (Dali::WindowData*)nuiWindowData;
91   if(!pWindowData)
92   {
93     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowData", 0);
94     return nullptr;
95   }
96
97   {
98     try
99     {
100       result = pWindowData->GetPositionSize();
101     }
102     CALL_CATCH_EXCEPTION(0);
103   }
104
105   nuiResult = new Dali::Rect<int>((const Dali::Rect<int>&)result);
106   return nuiResult;
107 }
108
109 // --
110 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_WindowData_SetWindowType(void* nuiWindowData, int nuiWindowType)
111 {
112   Dali::WindowData* pWindowData;
113   Dali::WindowType  windowType;
114
115   pWindowData = (Dali::WindowData*)nuiWindowData;
116   if(!pWindowData)
117   {
118     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowData", 0);
119     return;
120   }
121
122   windowType = (Dali::WindowType)nuiWindowType;
123   {
124     try
125     {
126       pWindowData->SetWindowType(windowType);
127     }
128     CALL_CATCH_EXCEPTION();
129   }
130 }
131
132 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_WindowData_GetWindowType(void* nuiWindowData)
133 {
134   int               nuiResult;
135   Dali::WindowData* pWindowData;
136   Dali::WindowType  result;
137
138   pWindowData = (Dali::WindowData*)nuiWindowData;
139   if(!pWindowData)
140   {
141     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowData", 0);
142     return 0;
143   }
144
145   {
146     try
147     {
148       result = (Dali::WindowType)pWindowData->GetWindowType();
149     }
150     CALL_CATCH_EXCEPTION(0);
151   }
152
153   nuiResult = (int)result;
154   return nuiResult;
155 }
156
157 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_WindowData_SetTransparency(void* nuiWindowData, bool nuiTransparency)
158 {
159   Dali::WindowData* pWindowData;
160
161   pWindowData = (Dali::WindowData*)nuiWindowData;
162   if(!pWindowData)
163   {
164     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowData", 0);
165     return;
166   }
167
168   {
169     try
170     {
171       pWindowData->SetTransparency(nuiTransparency);
172     }
173     CALL_CATCH_EXCEPTION();
174   }
175 }
176
177 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_WindowData_GetTransparency(void* nuiWindowData)
178 {
179   Dali::WindowData* pWindowData;
180   bool              result;
181
182   pWindowData = (Dali::WindowData*)nuiWindowData;
183   if(!pWindowData)
184   {
185     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowData", 0);
186     return 0;
187   }
188
189   {
190     try
191     {
192       result = (bool)pWindowData->GetTransparency();
193     }
194     CALL_CATCH_EXCEPTION(0);
195   }
196
197   return result;
198 }
199
200 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_WindowData_SetFrontBufferRendering(void* nuiWindowData, bool nuiEnable)
201 {
202   Dali::WindowData* pWindowData;
203
204   pWindowData = (Dali::WindowData*)nuiWindowData;
205   if(!pWindowData)
206   {
207     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowData", 0);
208     return;
209   }
210
211   {
212     try
213     {
214       pWindowData->SetFrontBufferRendering(nuiEnable);
215     }
216     CALL_CATCH_EXCEPTION();
217   }
218 }
219
220 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_WindowData_GetFrontBufferRendering(void* nuiWindowData)
221 {
222   Dali::WindowData* pWindowData;
223   bool              result;
224
225   pWindowData = (Dali::WindowData*)nuiWindowData;
226   if(!pWindowData)
227   {
228     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowData", 0);
229     return 0;
230   }
231
232   {
233     try
234     {
235       result = (bool)pWindowData->GetFrontBufferRendering();
236     }
237     CALL_CATCH_EXCEPTION(0);
238   }
239
240   return result;
241 }
242
243
244 #ifdef __cplusplus
245 }
246 #endif