From a57dc40ade4422e443739de240a987b7d9c9c851 Mon Sep 17 00:00:00 2001 From: Seungho Baek Date: Thu, 8 May 2025 16:07:51 +0900 Subject: [PATCH] Binds Spring AlphaFunction. Change-Id: I70b332737d75a40b61474d3c7ab377f28b80f7af Signed-off-by: Seungho Baek --- dali-csharp-binder/common/dali-wrap.cpp | 142 ------------ .../alpha-function-spring-data-wrap.cpp | 48 ++++ .../dali-core/alpha-function-wrap.cpp | 215 ++++++++++++++++++ dali-csharp-binder/file.list | 2 + 4 files changed, 265 insertions(+), 142 deletions(-) create mode 100644 dali-csharp-binder/dali-core/alpha-function-spring-data-wrap.cpp create mode 100644 dali-csharp-binder/dali-core/alpha-function-wrap.cpp diff --git a/dali-csharp-binder/common/dali-wrap.cpp b/dali-csharp-binder/common/dali-wrap.cpp index 1910abc9..6adf42c2 100644 --- a/dali-csharp-binder/common/dali-wrap.cpp +++ b/dali-csharp-binder/common/dali-wrap.cpp @@ -16694,148 +16694,6 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_TapGesture_localPoint_get(void * jarg1 } -SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_AlphaFunction__SWIG_0() { - void * jresult ; - Dali::AlphaFunction *result = 0 ; - - { - try { - result = (Dali::AlphaFunction *)new Dali::AlphaFunction(); - } CALL_CATCH_EXCEPTION(0); - } - - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_AlphaFunction__SWIG_1(int jarg1) { - void * jresult ; - Dali::AlphaFunction::BuiltinFunction arg1 ; - Dali::AlphaFunction *result = 0 ; - - arg1 = (Dali::AlphaFunction::BuiltinFunction)jarg1; - { - try { - result = (Dali::AlphaFunction *)new Dali::AlphaFunction(arg1); - } CALL_CATCH_EXCEPTION(0); - } - - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_AlphaFunction__SWIG_2(void * jarg1) { - void * jresult ; - Dali::AlphaFunctionPrototype arg1 = (Dali::AlphaFunctionPrototype) 0 ; - Dali::AlphaFunction *result = 0 ; - - arg1 = (Dali::AlphaFunctionPrototype)jarg1; - { - try { - result = (Dali::AlphaFunction *)new Dali::AlphaFunction(arg1); - } CALL_CATCH_EXCEPTION(0); - } - - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_AlphaFunction__SWIG_3(void * jarg1, void * jarg2) { - void * jresult ; - Dali::Vector2 *arg1 = 0 ; - Dali::Vector2 *arg2 = 0 ; - Dali::AlphaFunction *result = 0 ; - - arg1 = (Dali::Vector2 *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Vector2 const & type is null", 0); - return 0; - } - arg2 = (Dali::Vector2 *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Vector2 const & type is null", 0); - return 0; - } - { - try { - result = (Dali::AlphaFunction *)new Dali::AlphaFunction((Dali::Vector2 const &)*arg1,(Dali::Vector2 const &)*arg2); - } CALL_CATCH_EXCEPTION(0); - } - - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_AlphaFunction_GetBezierControlPoints(void * jarg1) { - void * jresult ; - Dali::AlphaFunction *arg1 = (Dali::AlphaFunction *) 0 ; - Dali::Vector4 result; - - arg1 = (Dali::AlphaFunction *)jarg1; - { - try { - result = ((Dali::AlphaFunction const *)arg1)->GetBezierControlPoints(); - } CALL_CATCH_EXCEPTION(0); - } - - jresult = new Dali::Vector4((const Dali::Vector4 &)result); - return jresult; -} - - - - -SWIGEXPORT int SWIGSTDCALL CSharp_Dali_AlphaFunction_GetBuiltinFunction(void * jarg1) { - int jresult ; - Dali::AlphaFunction *arg1 = (Dali::AlphaFunction *) 0 ; - Dali::AlphaFunction::BuiltinFunction result; - - arg1 = (Dali::AlphaFunction *)jarg1; - { - try { - result = (Dali::AlphaFunction::BuiltinFunction)((Dali::AlphaFunction const *)arg1)->GetBuiltinFunction(); - } CALL_CATCH_EXCEPTION(0); - } - - jresult = (int)result; - return jresult; -} - - -SWIGEXPORT int SWIGSTDCALL CSharp_Dali_AlphaFunction_GetMode(void * jarg1) { - int jresult ; - Dali::AlphaFunction *arg1 = (Dali::AlphaFunction *) 0 ; - Dali::AlphaFunction::Mode result; - - arg1 = (Dali::AlphaFunction *)jarg1; - { - try { - result = (Dali::AlphaFunction::Mode)((Dali::AlphaFunction const *)arg1)->GetMode(); - } CALL_CATCH_EXCEPTION(0); - } - - jresult = (int)result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_AlphaFunction(void * jarg1) { - Dali::AlphaFunction *arg1 = (Dali::AlphaFunction *) 0 ; - - arg1 = (Dali::AlphaFunction *)jarg1; - { - try { - delete arg1; - } CALL_CATCH_EXCEPTION(); - } - -} - - SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_KeyFrames_New() { void * jresult ; Dali::KeyFrames result; diff --git a/dali-csharp-binder/dali-core/alpha-function-spring-data-wrap.cpp b/dali-csharp-binder/dali-core/alpha-function-spring-data-wrap.cpp new file mode 100644 index 00000000..ebc85cdb --- /dev/null +++ b/dali-csharp-binder/dali-core/alpha-function-spring-data-wrap.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2025 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +SWIGEXPORT float SWIGSTDCALL CSharp_Dali_AlphaFunctionSpringData_GetDuration(float stiffness, float damping, float mass) +{ + float duration = 0.0f; + + Dali::SpringData springData(stiffness, damping, mass); + { + try + { + duration = springData.GetDuration(); + } + CALL_CATCH_EXCEPTION(0); + } + + return duration; +} + +#ifdef __cplusplus +} +#endif diff --git a/dali-csharp-binder/dali-core/alpha-function-wrap.cpp b/dali-csharp-binder/dali-core/alpha-function-wrap.cpp new file mode 100644 index 00000000..e811e3cb --- /dev/null +++ b/dali-csharp-binder/dali-core/alpha-function-wrap.cpp @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2025 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include + +#ifdef __cplusplus +extern "C" { +#endif + +SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_AlphaFunction_0() +{ + void* jresult; + Dali::AlphaFunction* result = 0; + + { + try + { + result = (Dali::AlphaFunction*)new Dali::AlphaFunction(); + } + CALL_CATCH_EXCEPTION(0); + } + + jresult = (void*)result; + return jresult; +} + +SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_AlphaFunction_BuiltInFunction(int csBuiltInFunction) +{ + void* jresult; + Dali::AlphaFunction::BuiltinFunction builtInFunction; + Dali::AlphaFunction* result = 0; + + builtInFunction = (Dali::AlphaFunction::BuiltinFunction)csBuiltInFunction; + { + try + { + result = (Dali::AlphaFunction*)new Dali::AlphaFunction(builtInFunction); + } + CALL_CATCH_EXCEPTION(0); + } + + jresult = (void*)result; + return jresult; +} + +SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_AlphaFunction_CustomAlphaFunction(void* csAlphaFunction) +{ + void* jresult; + Dali::AlphaFunctionPrototype alphaFunction = (Dali::AlphaFunctionPrototype)csAlphaFunction; + Dali::AlphaFunction* result = 0; + { + try + { + result = (Dali::AlphaFunction*)new Dali::AlphaFunction(alphaFunction); + } + CALL_CATCH_EXCEPTION(0); + } + + jresult = (void*)result; + return jresult; +} + +SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_AlphaFunction_Bezier(void* csControlPoint0, void* csControlPoint1) +{ + void* jresult; + Dali::AlphaFunction* result = 0; + + Dali::Vector2* controlPoint0 = (Dali::Vector2*)csControlPoint0; + if(!controlPoint0) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Vector2 const & type is null", 0); + return 0; + } + Dali::Vector2* controlPoint1 = (Dali::Vector2*)csControlPoint1; + if(!controlPoint1) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Vector2 const & type is null", 0); + return 0; + } + { + try + { + result = (Dali::AlphaFunction*)new Dali::AlphaFunction((Dali::Vector2 const&)*controlPoint0, (Dali::Vector2 const&)*controlPoint1); + } + CALL_CATCH_EXCEPTION(0); + } + + jresult = (void*)result; + return jresult; +} + +SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_AlphaFunction_BuiltInSpring(int csSpringType) +{ + void* jresult; + Dali::AlphaFunction* result = 0; + + Dali::AlphaFunction::SpringType springType = (Dali::AlphaFunction::SpringType)csSpringType; + { + try + { + result = (Dali::AlphaFunction*)new Dali::AlphaFunction(springType); + } + CALL_CATCH_EXCEPTION(0); + } + + jresult = (void*)result; + return jresult; +} + +SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_AlphaFunction_CustomSpring(float stiffness, float damping, float mass) +{ + void* jresult; + Dali::AlphaFunction* result = 0; + + Dali::SpringData springData(stiffness, damping, mass); + { + try + { + result = (Dali::AlphaFunction*)new Dali::AlphaFunction(springData); + } + CALL_CATCH_EXCEPTION(0); + } + + jresult = (void*)result; + return jresult; +} + +SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_AlphaFunction_GetBezierControlPoints(void* csAlphaFunction) +{ + void* jresult; + Dali::Vector4 result; + + Dali::AlphaFunction* alphaFunction = (Dali::AlphaFunction*)csAlphaFunction; + { + try + { + result = ((Dali::AlphaFunction const*)alphaFunction)->GetBezierControlPoints(); + } + CALL_CATCH_EXCEPTION(0); + } + + jresult = new Dali::Vector4((const Dali::Vector4&)result); + return jresult; +} + +SWIGEXPORT int SWIGSTDCALL CSharp_Dali_AlphaFunction_GetBuiltinFunction(void* csAlphaFunction) +{ + int jresult; + Dali::AlphaFunction::BuiltinFunction result; + + Dali::AlphaFunction* alphaFunction = (Dali::AlphaFunction*)csAlphaFunction; + { + try + { + result = (Dali::AlphaFunction::BuiltinFunction)((Dali::AlphaFunction const*)alphaFunction)->GetBuiltinFunction(); + } + CALL_CATCH_EXCEPTION(0); + } + + jresult = (int)result; + return jresult; +} + +SWIGEXPORT int SWIGSTDCALL CSharp_Dali_AlphaFunction_GetMode(void* csAlphaFunction) +{ + int jresult; + Dali::AlphaFunction::Mode result; + + Dali::AlphaFunction* alphaFunction = (Dali::AlphaFunction*)csAlphaFunction; + { + try + { + result = (Dali::AlphaFunction::Mode)((Dali::AlphaFunction const*)alphaFunction)->GetMode(); + } + CALL_CATCH_EXCEPTION(0); + } + + jresult = (int)result; + return jresult; +} + +SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_AlphaFunction(void* csAlphaFunction) +{ + Dali::AlphaFunction* alphaFunction = (Dali::AlphaFunction*)csAlphaFunction; + { + try + { + delete alphaFunction; + } + CALL_CATCH_EXCEPTION(); + } +} + +#ifdef __cplusplus +} +#endif diff --git a/dali-csharp-binder/file.list b/dali-csharp-binder/file.list index c52419e8..110beb49 100755 --- a/dali-csharp-binder/file.list +++ b/dali-csharp-binder/file.list @@ -24,6 +24,8 @@ SET( dali_csharp_binder_common_src_files ${dali_csharp_binder_dir}/dali-core/dali-core-wrap.cpp ${dali_csharp_binder_dir}/dali-core/actor-wrap.cpp + ${dali_csharp_binder_dir}/dali-core/alpha-function-spring-data-wrap.cpp + ${dali_csharp_binder_dir}/dali-core/alpha-function-wrap.cpp ${dali_csharp_binder_dir}/dali-core/animation-wrap.cpp ${dali_csharp_binder_dir}/dali-core/capabilities-wrap.cpp ${dali_csharp_binder_dir}/dali-core/constraint-wrap.cpp -- 2.34.1