Bind AnimatedVectorImageVisual action : SET_DYNAMIC_PROPERTY
[platform/core/uifw/dali-csharp-binder.git] / dali-csharp-binder / src / 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 "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_SceneView_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 #ifdef __cplusplus
183 }
184 #endif