2 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/dali.h>
20 #include <dali/devel-api/actors/actor-devel.h>
21 #include <dali/integration-api/debug.h>
24 #include <dali-csharp-binder/common/common.h>
31 typedef char *(SWIGSTDCALL *SWIG_CSharpStringHelperCallback)(const char *);
32 extern SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback;
34 enum InternalPropertyReturnType
38 ERROR_IMPOSSIBLE_SET = 2,
41 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetPropertyVector2(void *actor, int propertyType, void *vector2)
43 Dali::Actor *pActor = (Dali::Actor *)actor;
44 Dali::Vector2 *pVector2 = (Dali::Vector2 *)vector2;
48 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
49 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
53 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "vector2 is null!");
54 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
59 pActor->SetProperty((Dali::Property::Index)propertyType, *pVector2);
61 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
63 return (int)InternalPropertyReturnType::NO_ERROR;
66 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetPropertyVector3(void *actor, int propertyType, void *vector3)
68 Dali::Actor *pActor = (Dali::Actor *)actor;
69 Dali::Vector3 *pVector3 = (Dali::Vector3 *)vector3;
73 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
74 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
78 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "vector3 is null!");
79 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
84 pActor->SetProperty((Dali::Property::Index)propertyType, *pVector3);
86 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
88 return (int)InternalPropertyReturnType::NO_ERROR;
91 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetPropertyVector4(void *actor, int propertyType, void *vector4)
93 Dali::Actor *pActor = (Dali::Actor *)actor;
94 Dali::Vector4 *pVector4 = (Dali::Vector4 *)vector4;
98 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
99 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
103 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "vector4 is null!");
104 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
109 pActor->SetProperty((Dali::Property::Index)propertyType, *pVector4);
111 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
113 return (int)InternalPropertyReturnType::NO_ERROR;
116 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetPropertyVector2ActualVector3(void *actor, int propertyType, void *vector2)
118 Dali::Actor *pActor = (Dali::Actor *)actor;
119 Dali::Vector2 *pVector2 = (Dali::Vector2 *)vector2;
123 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
124 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
128 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "vector2 is null!");
129 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
134 pActor->SetProperty((Dali::Property::Index)propertyType, Dali::Vector3(pVector2->x, pVector2->y, 0));
136 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
138 return (int)InternalPropertyReturnType::NO_ERROR;
141 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetPropertyFloat(void *actor, int propertyType, float valFloat)
143 Dali::Actor *pActor = (Dali::Actor *)actor;
147 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
148 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
153 pActor->SetProperty((Dali::Property::Index)propertyType, valFloat);
155 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
157 return (int)InternalPropertyReturnType::NO_ERROR;
160 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetPropertyBool(void *actor, int propertyType, bool valBool)
162 Dali::Actor *pActor = (Dali::Actor *)actor;
166 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
167 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
172 pActor->SetProperty((Dali::Property::Index)propertyType, valBool);
174 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
176 return (int)InternalPropertyReturnType::NO_ERROR;
179 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetPropertyString(void *actor, int propertyType, char *valString)
181 Dali::Actor *pActor = (Dali::Actor *)actor;
185 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
186 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
190 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "valString is null!");
191 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
196 pActor->SetProperty((Dali::Property::Index)propertyType, (std::string const &)std::string(valString));
198 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
200 return (int)InternalPropertyReturnType::NO_ERROR;
203 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetPropertyInt(void *actor, int propertyType, int valInt)
205 Dali::Actor *pActor = (Dali::Actor *)actor;
209 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
210 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
215 pActor->SetProperty((Dali::Property::Index)propertyType, valInt);
217 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
219 return (int)InternalPropertyReturnType::NO_ERROR;
222 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalRetrievingPropertyVector2(void *actor, int propertyType, void *retrievingVector2)
224 Dali::Actor *pActor = (Dali::Actor *)actor;
225 Dali::Vector2 *pVector2 = (Dali::Vector2 *)retrievingVector2;
229 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
230 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
234 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "vector2 is null!");
235 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
240 Dali::Vector2 result;
241 result = ((Dali::Actor const *)pActor)->GetProperty<Dali::Vector2>((Dali::Property::Index)propertyType);
242 pVector2->x = result.x;
243 pVector2->y = result.y;
245 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
247 return (int)InternalPropertyReturnType::NO_ERROR;
250 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalRetrievingPropertyVector3(void *actor, int propertyType, void *retrievingVector3)
252 Dali::Actor *pActor = (Dali::Actor *)actor;
253 Dali::Vector3 *pVector3 = (Dali::Vector3 *)retrievingVector3;
257 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
258 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
262 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "vector3 is null!");
263 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
268 Dali::Vector3 result;
269 result = ((Dali::Actor const *)pActor)->GetProperty<Dali::Vector3>((Dali::Property::Index)propertyType);
270 pVector3->x = result.x;
271 pVector3->y = result.y;
272 pVector3->z = result.z;
274 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
276 return (int)InternalPropertyReturnType::NO_ERROR;
279 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalRetrievingPropertyVector4(void *actor, int propertyType, void *retrievingVector4)
281 Dali::Actor *pActor = (Dali::Actor *)actor;
282 Dali::Vector4 *pVector4 = (Dali::Vector4 *)retrievingVector4;
286 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
287 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
291 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "vector4 is null!");
292 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
297 Dali::Vector4 result;
298 result = ((Dali::Actor const *)pActor)->GetProperty<Dali::Vector4>((Dali::Property::Index)propertyType);
299 pVector4->x = result.x;
300 pVector4->y = result.y;
301 pVector4->z = result.z;
302 pVector4->w = result.w;
304 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
306 return (int)InternalPropertyReturnType::NO_ERROR;
309 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalRetrievingPropertyVector2ActualVector3(void *actor, int propertyType, void *retrievingVector2)
311 Dali::Actor *pActor = (Dali::Actor *)actor;
312 Dali::Vector2 *pVector2 = (Dali::Vector2 *)retrievingVector2;
316 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
317 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
321 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "vector2 is null!");
322 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
327 Dali::Vector3 result;
328 result = ((Dali::Actor const *)pActor)->GetProperty<Dali::Vector3>((Dali::Property::Index)propertyType);
329 pVector2->x = result.x;
330 pVector2->y = result.y;
332 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
334 return (int)InternalPropertyReturnType::NO_ERROR;
338 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalRetrievingPropertyFloat(void *actor, int propertyType, float *valFloat)
340 Dali::Actor *pActor = (Dali::Actor *)actor;
344 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
345 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
349 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "valFloat is null!");
350 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
355 *valFloat = ((Dali::Actor const *)pActor)->GetProperty<float>((Dali::Property::Index)propertyType);
357 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
359 return (int)InternalPropertyReturnType::NO_ERROR;
363 SWIGEXPORT float SWIGSTDCALL CSharp_Dali_Actor_InternalGetPropertyFloat(void *actor, int propertyType)
365 Dali::Actor *pActor = (Dali::Actor *)actor;
370 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
376 ret = ((Dali::Actor const *)pActor)->GetProperty<float>((Dali::Property::Index)propertyType);
378 CALL_CATCH_EXCEPTION(ret);
383 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Actor_InternalGetPropertyBool(void *actor, int propertyType)
385 Dali::Actor *pActor = (Dali::Actor *)actor;
390 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
396 ret = ((Dali::Actor const *)pActor)->GetProperty<bool>((Dali::Property::Index)propertyType);
398 CALL_CATCH_EXCEPTION(ret);
403 SWIGEXPORT char *SWIGSTDCALL CSharp_Dali_Actor_InternalGetPropertyString(void *actor, int propertyType)
405 Dali::Actor *pActor = (Dali::Actor *)actor;
406 std::string result = "";
411 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
417 result = ((Dali::Actor const *)pActor)->GetProperty<std::string>((Dali::Property::Index)propertyType);
418 ret = SWIG_csharp_string_callback(result.c_str());
420 CALL_CATCH_EXCEPTION(ret);
425 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalGetPropertyInt(void *actor, int propertyType)
427 Dali::Actor *pActor = (Dali::Actor *)actor;
432 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
438 ret = ((Dali::Actor const *)pActor)->GetProperty<int>((Dali::Property::Index)propertyType);
440 CALL_CATCH_EXCEPTION(ret);
445 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_RetrieveTargetSize(void *actor, void *retrievingVector3)
447 Dali::Actor *pActor = (Dali::Actor *)actor;
448 Dali::Vector3 *pVector3 = (Dali::Vector3 *)retrievingVector3;
452 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
453 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
457 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "vector3 is null!");
458 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
463 Dali::Vector3 result;
464 result = ((Dali::Actor const *)pActor)->GetTargetSize();
465 pVector3->x = result.x;
466 pVector3->y = result.y;
467 pVector3->z = result.z;
469 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
471 return (int)InternalPropertyReturnType::NO_ERROR;
474 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_RetrieveCurrentPropertyVector3(void *actor, int propertyType, void *retrievingVector3)
476 Dali::Actor *pActor = (Dali::Actor *)actor;
477 Dali::Vector3 *pVector3 = (Dali::Vector3 *)retrievingVector3;
481 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
482 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
486 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "vector3 is null!");
487 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
492 Dali::Vector3 result;
493 result = ((Dali::Actor const *)pActor)->GetCurrentProperty<Dali::Vector3>((Dali::Property::Index)propertyType);
494 pVector3->x = result.x;
495 pVector3->y = result.y;
496 pVector3->z = result.z;
498 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
500 return (int)InternalPropertyReturnType::NO_ERROR;
503 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_RetrieveCurrentPropertyVector2ActualVector3(void *actor, int propertyType, void *retrievingVector2)
505 Dali::Actor *pActor = (Dali::Actor *)actor;
506 Dali::Vector2 *pVector2 = (Dali::Vector2 *)retrievingVector2;
510 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
511 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
515 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "vector2 is null!");
516 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
521 Dali::Vector3 result;
522 result = ((Dali::Actor const *)pActor)->GetCurrentProperty<Dali::Vector3>((Dali::Property::Index)propertyType);
523 pVector2->x = result.x;
524 pVector2->y = result.y;
526 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
528 return (int)InternalPropertyReturnType::NO_ERROR;
531 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_RetrieveNaturalSize(void *actor, void *retrievingVector3)
533 Dali::Actor *pActor = (Dali::Actor *)actor;
534 Dali::Vector3 *pVector3 = (Dali::Vector3 *)retrievingVector3;
538 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
539 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
543 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "vector3 is null!");
544 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
549 Dali::Vector3 result;
550 result = ((Dali::Actor const *)pActor)->GetNaturalSize();
551 pVector3->x = result.x;
552 pVector3->y = result.y;
553 pVector3->z = result.z;
555 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
557 return (int)InternalPropertyReturnType::NO_ERROR;
560 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_RetrieveCurrentPropertyVector4(void *actor, int propertyType, void *retrievingVector4)
562 Dali::Actor *pActor = (Dali::Actor *)actor;
563 Dali::Vector4 *pVector4 = (Dali::Vector4 *)retrievingVector4;
567 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
568 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
572 SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "vector4 is null!");
573 return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
578 Dali::Vector4 result;
579 result = ((Dali::Actor const *)pActor)->GetCurrentProperty<Dali::Vector4>((Dali::Property::Index)propertyType);
580 pVector4->x = result.x;
581 pVector4->y = result.y;
582 pVector4->z = result.z;
583 pVector4->w = result.w;
585 CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
587 return (int)InternalPropertyReturnType::NO_ERROR;