Fix svace issue : nullptr check for inputMethodContextP
[platform/core/uifw/dali-csharp-binder.git] / dali-csharp-binder / dali-scene3d / light-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 // EXTERNAL INCLUDES
19 #include <dali-scene3d/public-api/light/light.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-csharp-binder/common/common.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Light_New_SWIG_0()
29 {
30   Dali::Scene3D::Light result;
31
32   {
33     try
34     {
35       result = Dali::Scene3D::Light::New();
36     }
37     CALL_CATCH_EXCEPTION(0);
38   }
39
40   return new Dali::Scene3D::Light((const Dali::Scene3D::Light&)result);
41 }
42
43 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_Light_SWIG_0()
44 {
45   Dali::Scene3D::Light* result = 0;
46
47   {
48     try
49     {
50       result = (Dali::Scene3D::Light*)new Dali::Scene3D::Light();
51     }
52     CALL_CATCH_EXCEPTION(0);
53   }
54
55   return (void*)result;
56 }
57
58 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_Light_SWIG_1(void* csLight)
59 {
60   Dali::Scene3D::Light* light  = (Dali::Scene3D::Light*)csLight;
61   Dali::Scene3D::Light* result = 0;
62
63   if(!light)
64   {
65     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Scene3D::Light const & type is null", 0);
66     return 0;
67   }
68   {
69     try
70     {
71       result = (Dali::Scene3D::Light*)new Dali::Scene3D::Light((Dali::Scene3D::Light const&)*light);
72     }
73     CALL_CATCH_EXCEPTION(0);
74   }
75
76   return (void*)result;
77 }
78
79 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_Light(void* csLight)
80 {
81   Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
82   {
83     try
84     {
85       delete light;
86     }
87     CALL_CATCH_EXCEPTION();
88   }
89 }
90
91 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Light_Assign(void* csDestination, void* csSource)
92 {
93   Dali::Scene3D::Light* destination = (Dali::Scene3D::Light*)csDestination;
94   Dali::Scene3D::Light* source      = (Dali::Scene3D::Light*)csSource;
95   Dali::Scene3D::Light* result      = 0;
96
97   if(!source)
98   {
99     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Scene3D::Light const & type is null", 0);
100     return 0;
101   }
102   {
103     try
104     {
105       result = (Dali::Scene3D::Light*)&(destination)->operator=((Dali::Scene3D::Light const&)*source);
106     }
107     CALL_CATCH_EXCEPTION(0);
108   }
109
110   return (void*)result;
111 }
112
113 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Light_DownCast(void* csHandle)
114 {
115   Dali::BaseHandle*    handle = (Dali::BaseHandle*)csHandle;
116   Dali::Scene3D::Light result;
117
118   if(!handle)
119   {
120     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
121     return 0;
122   }
123   {
124     try
125     {
126       result = Dali::Scene3D::Light::DownCast(*handle);
127     }
128     CALL_CATCH_EXCEPTION(0);
129   }
130
131   return new Dali::Scene3D::Light((const Dali::Scene3D::Light&)result);
132 }
133
134 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Light_Enable(void* csLight, bool enable)
135 {
136   Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
137
138   if(!light)
139   {
140     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
141     return;
142   }
143
144   try
145   {
146     light->Enable(enable);
147   }
148   CALL_CATCH_EXCEPTION();
149 }
150
151 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Light_IsEnabled(void* csLight)
152 {
153   Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
154   bool                  result;
155
156   if(!light)
157   {
158     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
159     return false;
160   }
161
162   try
163   {
164     result = light->IsEnabled();
165   }
166   CALL_CATCH_EXCEPTION(0);
167
168   return result;
169 }
170
171 SWIGEXPORT uint32_t SWIGSTDCALL CSharp_Dali_Light_GetMaximumEnabledLightCount()
172 {
173   uint32_t result = 0u;
174   try
175   {
176     result = static_cast<uint32_t>(Dali::Scene3D::Light::GetMaximumEnabledLightCount());
177   }
178   CALL_CATCH_EXCEPTION(0);
179   return result;
180 }
181
182 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Light_EnableShadow(void* csLight, bool enable)
183 {
184   Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
185
186   if(!light)
187   {
188     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
189     return;
190   }
191
192   try
193   {
194     light->EnableShadow(enable);
195   }
196   CALL_CATCH_EXCEPTION();
197 }
198
199 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Light_IsShadowEnabled(void* csLight)
200 {
201   Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
202   bool                  result;
203
204   if(!light)
205   {
206     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
207     return false;
208   }
209
210   try
211   {
212     result = light->IsShadowEnabled();
213   }
214   CALL_CATCH_EXCEPTION(0);
215
216   return result;
217 }
218
219 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Light_EnableShadowSoftFiltering(void* csLight, bool enable)
220 {
221   Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
222
223   if(!light)
224   {
225     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
226     return;
227   }
228
229   try
230   {
231     light->EnableShadowSoftFiltering(enable);
232   }
233   CALL_CATCH_EXCEPTION();
234 }
235
236 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Light_IsShadowSoftFilteringEnabled(void* csLight)
237 {
238   Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
239   bool                  result;
240
241   if(!light)
242   {
243     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
244     return false;
245   }
246
247   try
248   {
249     result = light->IsShadowSoftFilteringEnabled();
250   }
251   CALL_CATCH_EXCEPTION(0);
252
253   return result;
254 }
255
256 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Light_SetShadowIntensity(void* csLight, float shadowIntensity)
257 {
258   Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
259
260   if(!light)
261   {
262     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
263     return;
264   }
265
266   try
267   {
268     light->SetShadowIntensity(shadowIntensity);
269   }
270   CALL_CATCH_EXCEPTION();
271 }
272
273 SWIGEXPORT float SWIGSTDCALL CSharp_Dali_Light_GetShadowIntensity(void* csLight)
274 {
275   float result = 0.0f;
276
277   Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
278
279   if(!light)
280   {
281     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
282     return 0.0f;
283   }
284
285   try
286   {
287     result = light->GetShadowIntensity();
288   }
289   CALL_CATCH_EXCEPTION(0);
290   return result;
291 }
292
293 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Light_SetShadowBias(void* csLight, float shadowBias)
294 {
295   Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
296
297   if(!light)
298   {
299     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
300     return;
301   }
302
303   try
304   {
305     light->SetShadowBias(shadowBias);
306   }
307   CALL_CATCH_EXCEPTION();
308 }
309
310 SWIGEXPORT float SWIGSTDCALL CSharp_Dali_Light_GetShadowBias(void* csLight)
311 {
312   float result = 0.0f;
313
314   Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
315
316   if(!light)
317   {
318     SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
319     return 0.0f;
320   }
321
322   try
323   {
324     result = light->GetShadowBias();
325   }
326   CALL_CATCH_EXCEPTION(0);
327   return result;
328 }
329
330 #ifdef __cplusplus
331 }
332 #endif