[dali_2.2.32] Merge branch 'devel/master' 07/294707/1
authorAdam Bialogonski <adam.b@samsung.com>
Fri, 23 Jun 2023 10:04:33 +0000 (11:04 +0100)
committerAdam Bialogonski <adam.b@samsung.com>
Fri, 23 Jun 2023 10:04:33 +0000 (11:04 +0100)
Change-Id: I0a2aa981773cfa35861669e8dcec783237484b2e

dali-csharp-binder/file.list
dali-csharp-binder/src/actor-wrap.cpp
dali-csharp-binder/src/application-wrap.cpp
dali-csharp-binder/src/dali-wrap.cpp
dali-csharp-binder/src/light-wrap.cpp [new file with mode: 0644]
packaging/dali-csharp-binder.spec

index 5b1cf25..cad1abc 100755 (executable)
@@ -97,6 +97,7 @@ SET( dali_csharp_binder_tizen_wearable_src_files
 
 # module: scene3d
 SET( dali_csharp_binder_scene3d_src_files
+  ${dali_csharp_binder_dir}/src/light-wrap.cpp
   ${dali_csharp_binder_dir}/src/material-wrap.cpp
   ${dali_csharp_binder_dir}/src/model-primitive-wrap.cpp
   ${dali_csharp_binder_dir}/src/model-node-wrap.cpp
index 4cdc0c1..9800085 100644 (file)
@@ -3567,6 +3567,32 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Actor_SetNeedGesturePropagation(void* ja
   return;
 }
 
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Actor_CalculateScreenPosition(void* actor)
+{
+  void*         jresult;
+  Dali::Actor   arg1;
+  Dali::Actor*  argp1 = (Dali::Actor*)0;
+  Dali::Vector2 result;
+
+  argp1 = (Dali::Actor*)actor;
+  if(!argp1)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Actor", 0);
+    return 0;
+  }
+  arg1 = *argp1;
+  {
+    try
+    {
+      result = Dali::DevelActor::CalculateScreenPosition(arg1);
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  jresult = new Dali::Vector2((const Dali::Vector2&)result);
+  return jresult;
+}
+
 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Actor_CalculateScreenExtents(void* actor)
 {
   Dali::Actor       arg1;
@@ -3583,7 +3609,34 @@ SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Actor_CalculateScreenExtents(void* acto
   {
     try
     {
-      result = Dali::DevelActor::CalculateScreenExtents(arg1);
+      result = Dali::DevelActor::CalculateScreenExtentsAtEvent(arg1); ///< TODO : Change API name
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  // Note: The float type Rectangle class is not ready yet.
+  //      Therefore, it transmits data in Vector4 class.
+  //      This type should later be changed to the appropriate data type.
+  return new Dali::Vector4(result.x, result.y, result.width, result.height);
+}
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Actor_CurrentScreenExtents(void* actor)
+{
+  Dali::Actor       arg1;
+  Dali::Actor*      argp1 = (Dali::Actor*)0;
+  Dali::Rect<float> result;
+
+  argp1 = (Dali::Actor*)actor;
+  if(!argp1)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Actor", 0);
+    return 0;
+  }
+  arg1 = *argp1;
+  {
+    try
+    {
+      result = Dali::DevelActor::CalculateCurrentScreenExtents(arg1);
     }
     CALL_CATCH_EXCEPTION(0);
   }
index 2543f72..d8ea941 100644 (file)
@@ -49,6 +49,42 @@ void ReleaseArgVMemory()
   }
   gArgC = 0;
 }
+
+void GenerationArgV(int argc, char* argv)
+{
+  // TODO : What should we do if already generated argv exist?
+  ReleaseArgVMemory();
+  // generate argv data from the C# args
+  int   index  = 0;
+  int   length = 0;
+  char* retPtr = NULL;
+  char* nextPtr;
+
+  gArgV = new char*[argc + 1];
+
+  for(retPtr = strtok_r(argv, " ", &nextPtr);
+      retPtr != NULL && index < argc;
+      retPtr = strtok_r(NULL, " ", &nextPtr))
+  {
+    length       = 0;
+    length       = strlen(retPtr);
+    gArgV[index] = new char[length + 1];
+    strncpy(gArgV[index], retPtr, length);
+    gArgV[index][length] = '\0';
+    index++;
+  }
+
+  while(index < argc)
+  {
+    //if jarg1 - index >1, maybe cause error.
+    gArgV[index] = NULL;
+    index++;
+  }
+
+  gArgV[argc] = NULL;
+  gArgC        = argc;
+}
+
 } // unnamed namespace
 
 SWIGINTERN bool Dali_Signal_Sl_void_Sp_Dali_DeviceStatus_Battery_Status_SP__Sg__Empty(Dali::Signal<void(Dali::DeviceStatus::Battery::Status)> const* self)
@@ -1614,7 +1650,7 @@ SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Application_New__SWIG_5(int jarg1, char
   return jresult;
 }
 
-SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Application_New__SWIG_6(int nuiArgc, char* nuiStyleSheet, int nuiWindowMode, void* nuiPositionSize, bool nuiUseUiThread)
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Application_New__SWIG_6(int nuiArgc, char* nuiArgv, char* nuiStyleSheet, int nuiWindowMode, void* nuiPositionSize, bool nuiUseUiThread)
 {
   void*                          jresult;
   int*                           argc = nullptr;
@@ -1641,6 +1677,10 @@ SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Application_New__SWIG_6(int nuiArgc, ch
     return 0;
   }
 
+  GenerationArgV(nuiArgc, nuiArgv);
+  argc = &gArgC;
+  argv = &gArgV;
+
   positionSize = *positionSizeP;
   {
     try
index 067ed27..e2b4d91 100644 (file)
@@ -24531,12 +24531,35 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_KeyFrames_Add__SWIG_1(void * jarg1, floa
 
 SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Dali_KeyFrames_GetKeyFrameCount(void* keyFrames)
 {
-  return (unsigned int) Dali::DevelKeyFrames::GetKeyFrameCount(*((Dali::KeyFrames*)keyFrames));
+  unsigned int jresult;
+  {
+    try {
+      jresult = Dali::DevelKeyFrames::GetKeyFrameCount(*((Dali::KeyFrames*)keyFrames));
+    } CALL_CATCH_EXCEPTION(0);
+  }
+  return jresult;
 }
 
 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_KeyFrames_GetKeyFrame(void* keyFrames, unsigned int index, float* time, void* value)
 {
-  Dali::DevelKeyFrames::GetKeyFrame(*((Dali::KeyFrames*)keyFrames), (size_t)index, *time, *((Property::Value*)value));
+  if (!value) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Property::Value", 0);
+    return ;
+  }
+  try {
+    Dali::DevelKeyFrames::GetKeyFrame(*((Dali::KeyFrames*)keyFrames), (size_t)index, *time, *((Property::Value*)value));
+  } CALL_CATCH_EXCEPTION();
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_KeyFrames_SetKeyFrameValue(void* keyFrames, unsigned int index, void* value)
+{
+  if (!value) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Property::Value", 0);
+    return ;
+  }
+  try {
+    Dali::DevelKeyFrames::SetKeyFrameValue(*((Dali::KeyFrames*)keyFrames), (size_t)index, *((const Property::Value*)value));
+  } CALL_CATCH_EXCEPTION();
 }
 
 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Path_Property_POINTS_get() {
diff --git a/dali-csharp-binder/src/light-wrap.cpp b/dali-csharp-binder/src/light-wrap.cpp
new file mode 100644 (file)
index 0000000..858cabd
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) 2023 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 <dali-scene3d/public-api/light/light.h>
+
+// INTERNAL INCLUDES
+#include "common.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Light_New_SWIG_0()
+{
+  Dali::Scene3D::Light result;
+
+  {
+    try
+    {
+      result = Dali::Scene3D::Light::New();
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return new Dali::Scene3D::Light((const Dali::Scene3D::Light&)result);
+}
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_Light_SWIG_0()
+{
+  Dali::Scene3D::Light* result = 0;
+
+  {
+    try
+    {
+      result = (Dali::Scene3D::Light*)new Dali::Scene3D::Light();
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return (void*)result;
+}
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_Light_SWIG_1(void* csLight)
+{
+  Dali::Scene3D::Light* light  = (Dali::Scene3D::Light*)csLight;
+  Dali::Scene3D::Light* result = 0;
+
+  if(!light)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Scene3D::Light const & type is null", 0);
+    return 0;
+  }
+  {
+    try
+    {
+      result = (Dali::Scene3D::Light*)new Dali::Scene3D::Light((Dali::Scene3D::Light const&)*light);
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return (void*)result;
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_Light(void* csLight)
+{
+  Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
+  {
+    try
+    {
+      delete light;
+    }
+    CALL_CATCH_EXCEPTION();
+  }
+}
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Light_Assign(void* csDestination, void* csSource)
+{
+  Dali::Scene3D::Light* destination = (Dali::Scene3D::Light*)csDestination;
+  Dali::Scene3D::Light* source      = (Dali::Scene3D::Light*)csSource;
+  Dali::Scene3D::Light* result      = 0;
+
+  if(!source)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Scene3D::Light const & type is null", 0);
+    return 0;
+  }
+  {
+    try
+    {
+      result = (Dali::Scene3D::Light*)&(destination)->operator=((Dali::Scene3D::Light const&)*source);
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return (void*)result;
+}
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Light_DownCast(void* csHandle)
+{
+  Dali::BaseHandle*    handle = (Dali::BaseHandle*)csHandle;
+  Dali::Scene3D::Light result;
+
+  if(!handle)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
+    return 0;
+  }
+  {
+    try
+    {
+      result = Dali::Scene3D::Light::DownCast(*handle);
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return new Dali::Scene3D::Light((const Dali::Scene3D::Light&)result);
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Light_Enable(void* csLight, bool enable)
+{
+  Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
+
+  if(!light)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
+    return;
+  }
+
+  try
+  {
+    light->Enable(enable);
+  }
+  CALL_CATCH_EXCEPTION();
+}
+
+SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Light_IsEnabled(void* csLight)
+{
+  Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
+  bool                  result;
+
+  if(!light)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
+    return false;
+  }
+
+  try
+  {
+    result = light->IsEnabled();
+  }
+  CALL_CATCH_EXCEPTION(0);
+
+  return result;
+}
+
+SWIGEXPORT uint32_t SWIGSTDCALL CSharp_Dali_SceneView_GetMaximumEnabledLightCount()
+{
+  uint32_t result = 0u;
+  try
+  {
+    result = static_cast<uint32_t>(Dali::Scene3D::Light::GetMaximumEnabledLightCount());
+  }
+  CALL_CATCH_EXCEPTION(0);
+  return result;
+}
+
+#ifdef __cplusplus
+}
+#endif
index 3f3c999..6d9230c 100644 (file)
@@ -21,7 +21,7 @@
 
 Name: dali2-csharp-binder
 Summary: The DALI Csharp Binder
-Version: 2.2.31
+Version: 2.2.32
 Release: 1
 Group: uifw/graphic
 License: Apache-2.0 and BSD-3-Clause and MIT