Add new APIs so that NUI can get/set Vector without alloc ptr 34/323134/2
authorXiaohui Fang <xiaohui.fang@samsung.com>
Wed, 23 Apr 2025 08:31:06 +0000 (16:31 +0800)
committerXiaohui Fang <xiaohui.fang@samsung.com>
Wed, 30 Apr 2025 02:04:27 +0000 (10:04 +0800)
Change-Id: I1871333d8fb289a5bf2b55f106981d646eb3be0a

dali-csharp-binder/common/dali-wrap.cpp
dali-csharp-binder/dali-core/actor-wrap.cpp
dali-csharp-binder/dali-core/internal-property-get-set-wrap.cpp
dali-csharp-binder/dali-toolkit/internal-visual-property-get-set-wrap.cpp

index e28c3cfa2a59d8c4c237eb83a34245f1bd0ac731..284178b968bbd9b102edf8b58e258ed3434dbe7a 100644 (file)
@@ -17008,6 +17008,18 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Path_AddPoint(void * jarg1, void * jarg2
 
 }
 
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Path_AddPoint_3FloatValues(void * jarg1, float x, float y, float z) {
+  Dali::Path *arg1 = (Dali::Path *) 0 ;
+
+  arg1 = (Dali::Path *)jarg1;
+  {
+    try {
+      const Dali::Vector3 point(x, y, z);
+      (arg1)->AddPoint(point);
+    } CALL_CATCH_EXCEPTION();
+  }
+
+}
 
 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Path_AddControlPoint(void * jarg1, void * jarg2) {
   Dali::Path *arg1 = (Dali::Path *) 0 ;
index 40c4edf7ec83c63f35fa5bb589d4c0336bdf598d..5fc2402a49f318b2a80c8b274d2e1be4262f47cb 100644 (file)
@@ -1081,6 +1081,26 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Actor_SetParentOrigin(void* jarg1, void*
   }
 }
 
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Actor_SetParentOrigin_3FloatValues(void* jarg1, float x, float y, float z)
+{
+  Dali::Actor*   arg1 = (Dali::Actor*)0;
+
+  if(!jarg1)
+  {
+    SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "jarg1 is null!");
+    return;
+  }
+
+  arg1 = (Dali::Actor*)jarg1;
+  {
+    try
+    {
+      const Dali::Vector3 vector3(x, y, z);
+      (arg1)->SetProperty(Actor::Property::PARENT_ORIGIN, vector3);
+    }
+    CALL_CATCH_EXCEPTION();
+  }
+}
 
 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Actor_SetAnchorPoint(void* jarg1, void* jarg2)
 {
@@ -1109,6 +1129,26 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Actor_SetAnchorPoint(void* jarg1, void*
   }
 }
 
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Actor_SetAnchorPoint_3FloatValues(void* jarg1, float x, float y, float z)
+{
+  Dali::Actor*   arg1 = (Dali::Actor*)0;
+
+  if(!jarg1)
+  {
+    SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "jarg1 is null!");
+    return;
+  }
+
+  arg1 = (Dali::Actor*)jarg1;
+  {
+    try
+    {
+      const Dali::Vector3 vector(x, y, z);
+      (arg1)->SetProperty(Actor::Property::ANCHOR_POINT, vector);
+    }
+    CALL_CATCH_EXCEPTION();
+  }
+}
 
 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Actor_SetSize__SWIG_0(void* jarg1, float jarg2, float jarg3)
 {
@@ -2212,6 +2252,27 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Actor_SetColor(void* jarg1, void* jarg2)
   }
 }
 
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Actor_SetColor_4FloatValues(void* jarg1, float r, float g, float b, float a)
+{
+  Dali::Actor*   arg1 = (Dali::Actor*)0;
+
+  if(!jarg1)
+  {
+    SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "jarg1 is null!");
+    return;
+  }
+
+  arg1 = (Dali::Actor*)jarg1;
+
+  {
+    try
+    {
+      const Dali::Vector4 color(r, g, b, a);
+      (arg1)->SetProperty(Actor::Property::COLOR, color);
+    }
+    CALL_CATCH_EXCEPTION();
+  }
+}
 
 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Actor_SetColorMode(void* jarg1, int jarg2)
 {
index efed885304e70cf728bd8e62c41ec6bd093297b8..bbec6b86058abcbe0d2e901703f53692ce1d949a 100755 (executable)
@@ -63,6 +63,26 @@ extern "C"
     return (int)InternalPropertyReturnType::NO_ERROR;
   }
 
+  SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetProperty2FloatValues(void *actor, int propertyType, float x, float y)
+  {
+    Dali::Handle *pActor = (Dali::Handle *)actor;
+
+    if (!pActor)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    try
+    {
+      Dali::Vector2 vector2(x, y);
+      pActor->SetProperty((Dali::Property::Index)propertyType, vector2);
+    }
+    CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
+
+    return (int)InternalPropertyReturnType::NO_ERROR;
+  }
+
   SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetPropertyVector3(void *actor, int propertyType, void *vector3)
   {
     Dali::Handle *pActor = (Dali::Handle *)actor;
@@ -88,6 +108,26 @@ extern "C"
     return (int)InternalPropertyReturnType::NO_ERROR;
   }
 
+  SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetProperty3FloatValues(void *actor, int propertyType, float x, float y, float z)
+  {
+    Dali::Handle *pActor = (Dali::Handle *)actor;
+
+    if (!pActor)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    try
+    {
+      Dali::Vector3 vector3(x, y, z);
+      pActor->SetProperty((Dali::Property::Index)propertyType, vector3);
+    }
+    CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
+
+    return (int)InternalPropertyReturnType::NO_ERROR;
+  }
+
   SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetPropertyVector4(void *actor, int propertyType, void *vector4)
   {
     Dali::Handle *pActor = (Dali::Handle *)actor;
@@ -113,6 +153,26 @@ extern "C"
     return (int)InternalPropertyReturnType::NO_ERROR;
   }
 
+  SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetProperty4FloatValues(void *actor, int propertyType, float x, float y, float z, float w)
+  {
+    Dali::Handle *pActor = (Dali::Handle *)actor;
+
+    if (!pActor)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    try
+    {
+      Dali::Vector4 vector4(x, y, z, w);
+      pActor->SetProperty((Dali::Property::Index)propertyType, vector4);
+    }
+    CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
+
+    return (int)InternalPropertyReturnType::NO_ERROR;
+  }
+
   SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalSetPropertyVector2ActualVector3(void *actor, int propertyType, void *vector2)
   {
     Dali::Handle *pActor = (Dali::Handle *)actor;
@@ -316,6 +376,40 @@ extern "C"
     return (int)InternalPropertyReturnType::NO_ERROR;
   }
 
+  SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalRetrievingProperty2FloatValues(void *actor, int propertyType, float* x, float* y)
+  {
+    Dali::Handle *pActor = (Dali::Handle *)actor;
+
+    if (!pActor)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!x)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "x is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!y)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "y is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    try
+    {
+      Dali::Vector2 result;
+      result = ((Dali::Handle const *)pActor)->GetProperty<Dali::Vector2>((Dali::Property::Index)propertyType);
+      *x = result.x;
+      *y = result.y;
+    }
+    CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
+
+    return (int)InternalPropertyReturnType::NO_ERROR;
+  }
+
   SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalRetrievingPropertyVector3(void *actor, int propertyType, void *retrievingVector3)
   {
     Dali::Handle *pActor = (Dali::Handle *)actor;
@@ -345,6 +439,47 @@ extern "C"
     return (int)InternalPropertyReturnType::NO_ERROR;
   }
 
+  SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalRetrievingProperty3FloatValues(void *actor, int propertyType, float* x, float* y, float* z)
+  {
+    Dali::Handle *pActor = (Dali::Handle *)actor;
+
+    if (!pActor)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!x)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "x is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!y)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "y is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!z)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "z is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    try
+    {
+      Dali::Vector3 result;
+      result = ((Dali::Handle const *)pActor)->GetProperty<Dali::Vector3>((Dali::Property::Index)propertyType);
+      *x = result.x;
+      *y = result.y;
+      *z = result.z;
+    }
+    CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
+
+    return (int)InternalPropertyReturnType::NO_ERROR;
+  }
+
   SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalRetrievingPropertyVector4(void *actor, int propertyType, void *retrievingVector4)
   {
     Dali::Handle *pActor = (Dali::Handle *)actor;
@@ -375,6 +510,54 @@ extern "C"
     return (int)InternalPropertyReturnType::NO_ERROR;
   }
 
+  SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalRetrievingProperty4FloatValues(void *actor, int propertyType, float* x, float* y, float* z, float* w)
+  {
+    Dali::Handle *pActor = (Dali::Handle *)actor;
+
+    if (!pActor)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!x)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "x is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!y)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "y is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!z)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "z is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!w)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "w is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    try
+    {
+      Dali::Vector4 result;
+      result = ((Dali::Handle const *)pActor)->GetProperty<Dali::Vector4>((Dali::Property::Index)propertyType);
+      *x = result.x;
+      *y = result.y;
+      *z = result.z;
+      *w = result.w;
+    }
+    CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
+
+    return (int)InternalPropertyReturnType::NO_ERROR;
+  }
+
   SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalRetrievingPropertyVector2ActualVector3(void *actor, int propertyType, void *retrievingVector2)
   {
     Dali::Handle *pActor = (Dali::Handle *)actor;
@@ -569,6 +752,47 @@ extern "C"
     return (int)InternalPropertyReturnType::NO_ERROR;
   }
 
+  SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_RetrieveCurrentProperty3FloatValues(void *actor, int propertyType, float* x, float* y, float* z)
+  {
+    Dali::Handle *pActor = (Dali::Handle *)actor;
+
+    if (!pActor)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!x)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "x is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!y)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "y is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!z)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "z is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    try
+    {
+      Dali::Vector3 result;
+      result = ((Dali::Handle const *)pActor)->GetCurrentProperty<Dali::Vector3>((Dali::Property::Index)propertyType);
+      *x = result.x;
+      *y = result.y;
+      *z = result.z;
+    }
+    CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
+
+    return (int)InternalPropertyReturnType::NO_ERROR;
+  }
+
   SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_RetrieveCurrentPropertyVector2ActualVector3(void *actor, int propertyType, void *retrievingVector2)
   {
     Dali::Handle *pActor = (Dali::Handle *)actor;
@@ -656,6 +880,53 @@ extern "C"
     return (int)InternalPropertyReturnType::NO_ERROR;
   }
 
+  SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_RetrieveCurrentProperty4FloatValues(void *actor, int propertyType, float* x, float* y, float* z, float* w)
+  {
+    Dali::Handle *pActor = (Dali::Handle *)actor;
+
+    if (!pActor)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "actor is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!x)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "x is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!y)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "y is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!z)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "z is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!w)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "w is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    try
+    {
+      Dali::Vector4 result;
+      result = ((Dali::Handle const *)pActor)->GetCurrentProperty<Dali::Vector4>((Dali::Property::Index)propertyType);
+      *x = result.x;
+      *y = result.y;
+      *z = result.z;
+      *w = result.w;
+    }
+    CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
+
+    return (int)InternalPropertyReturnType::NO_ERROR;
+  }
 #ifdef __cplusplus
 }
 #endif
index 4c1414e0ae80dcd0bc66b994e50c14b597637fed..ace7355819d6411654eebca760afe8c384aea343 100755 (executable)
@@ -373,6 +373,65 @@ extern "C"
 
     return (int)InternalPropertyReturnType::NO_ERROR;
   }
+
+  SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Actor_InternalRetrievingVisualProperty4FloatValues(void *view, int visualIndex, int visualPropertyIndex, float* x, float* y, float* z, float* w)
+  {
+    Dali::Toolkit::Control *pControl  = (Dali::Toolkit::Control *)view;
+
+    if (!pControl)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "view is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!x)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "x is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!y)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "y is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!z)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "z is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    if (!w)
+    {
+      SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_CSharpArgumentNullException, "w is null!");
+      return (int)InternalPropertyReturnType::ERROR_UNKNOWN;
+    }
+
+    try
+    {
+      Dali::Toolkit::Internal::Control& internalControl = Dali::Toolkit::Internal::GetImplementation(*pControl);
+      Dali::Toolkit::Visual::Base       visualBase      = Dali::Toolkit::DevelControl::GetVisual(internalControl, visualIndex);
+      if(visualBase)
+      {
+        Dali::Property::Map tempMap;
+        visualBase.CreatePropertyMap(tempMap);
+        Dali::Property::Value* retValuePtr = tempMap.Find(visualPropertyIndex);
+        if(retValuePtr)
+        {
+            Dali::Vector4 result;
+            result = retValuePtr->Get<Dali::Vector4>();
+            *x = result.x;
+            *y = result.y;
+            *z = result.z;
+            *w = result.w;
+        }
+      }
+    }
+    CALL_CATCH_EXCEPTION((int)InternalPropertyReturnType::ERROR_UNKNOWN);
+
+    return (int)InternalPropertyReturnType::NO_ERROR;
+  }
 #ifdef __cplusplus
 }
 #endif