Binds Scene3D::Panel 59/316259/4
authorSeungho Baek <sbsh.baek@samsung.com>
Fri, 16 Aug 2024 12:22:13 +0000 (21:22 +0900)
committerSeungho Baek <sbsh.baek@samsung.com>
Mon, 19 Aug 2024 06:27:19 +0000 (15:27 +0900)
Change-Id: Ieaa2c80872353b60f7e8a186e593128c99839759
Signed-off-by: Seungho Baek <sbsh.baek@samsung.com>
dali-csharp-binder/dali-scene3d/model-wrap.cpp
dali-csharp-binder/dali-scene3d/panel-wrap.cpp [new file with mode: 0644]
dali-csharp-binder/file.list

index e86d7712ea9c45a014db481549bbcaebfe84ee3f..e2d9637fdda4e3296bb7f7f4f28ac5a84ef43284 100644 (file)
@@ -107,29 +107,6 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_Model(void* csModel)
   }
 }
 
-SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Model_Assign(void* csDestination, void* csSource)
-{
-  Dali::Scene3D::Model* destination = (Dali::Scene3D::Model*)csDestination;
-  Dali::Scene3D::Model* source      = (Dali::Scene3D::Model*)csSource;
-  Dali::Scene3D::Model* result      = 0;
-
-  if(!source)
-  {
-    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Scene3D::Model const & type is null", 0);
-    return 0;
-  }
-  {
-    try
-    {
-      result = (Dali::Scene3D::Model*)&(destination)->operator=((Dali::Scene3D::Model const&)*source);
-    }
-    CALL_CATCH_EXCEPTION(0);
-  }
-
-  return (void*)result;
-}
-
-
 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Model_GetModelRoot(void* csModel)
 {
   Dali::Scene3D::Model*    model = (Dali::Scene3D::Model*)csModel;
diff --git a/dali-csharp-binder/dali-scene3d/panel-wrap.cpp b/dali-csharp-binder/dali-scene3d/panel-wrap.cpp
new file mode 100644 (file)
index 0000000..c3055c0
--- /dev/null
@@ -0,0 +1,258 @@
+/*
+ * Copyright (c) 2024 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/controls/panel/panel.h>
+
+// INTERNAL INCLUDES
+#include <dali-csharp-binder/common/common.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Panel_New_SWIG_0()
+{
+  Dali::Scene3D::Panel result;
+
+  {
+    try
+    {
+      result = Dali::Scene3D::Panel::New();
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return new Dali::Scene3D::Panel((const Dali::Scene3D::Panel&)result);
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_Panel(void* csPanel)
+{
+  Dali::Scene3D::Panel* panel = (Dali::Scene3D::Panel*)csPanel;
+  {
+    try
+    {
+      delete panel;
+    }
+    CALL_CATCH_EXCEPTION();
+  }
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Panel_SetPanelResolution(void* csPanel, void* csResolution)
+{
+  Dali::Scene3D::Panel* panel      = (Dali::Scene3D::Panel*)csPanel;
+  Dali::Vector2*        resolution = (Dali::Vector2*)csResolution;
+
+  if(!panel)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Panel", 0);
+    return;
+  }
+  if(!resolution)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Vector2", 0);
+    return;
+  }
+
+  try
+  {
+    panel->SetPanelResolution(*resolution);
+  }
+  CALL_CATCH_EXCEPTION();
+}
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Panel_GetPanelResolution(void* csPanel)
+{
+  Dali::Scene3D::Panel* panel = (Dali::Scene3D::Panel*)csPanel;
+  Dali::Vector2         resolution;
+
+  if(!panel)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Panel", 0);
+    return 0;
+  }
+  {
+    try
+    {
+      resolution = panel->GetPanelResolution();
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  Dali::Vector2* result = new Dali::Vector2((const Dali::Vector2&)resolution);
+  return result;
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Panel_SetContent(void* csPanel, void* csRootActor)
+{
+  Dali::Scene3D::Panel* panel     = (Dali::Scene3D::Panel*)csPanel;
+  Dali::Actor*          rootActor = (Dali::Actor*)csRootActor;
+
+  if(!panel)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Panel", 0);
+    return;
+  }
+  if(!rootActor)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Actor", 0);
+    return;
+  }
+
+  try
+  {
+    panel->SetContent(*rootActor);
+  }
+  CALL_CATCH_EXCEPTION();
+}
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Panel_GetContent(void* csPanel)
+{
+  Dali::Scene3D::Panel* panel = (Dali::Scene3D::Panel*)csPanel;
+  Dali::Actor           rootActor;
+
+  if(!panel)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Panel", 0);
+    return 0;
+  }
+  {
+    try
+    {
+      rootActor = panel->GetContent();
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  Dali::Actor* result = new Dali::Actor((const Dali::Actor&)rootActor);
+  return result;
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Panel_ClearPanel(void* csPanel)
+{
+  Dali::Scene3D::Panel* panel     = (Dali::Scene3D::Panel*)csPanel;
+
+  if(!panel)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Panel", 0);
+    return;
+  }
+
+  try
+  {
+    panel->ClearPanel();
+  }
+  CALL_CATCH_EXCEPTION();
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Panel_CastShadow(void* csPanel, bool csCastShadow)
+{
+  Dali::Scene3D::Panel* panel = (Dali::Scene3D::Panel*)csPanel;
+
+  if(!panel)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Panel", 0);
+    return;
+  }
+
+  try
+  {
+    panel->CastShadow(csCastShadow);
+  }
+  CALL_CATCH_EXCEPTION();
+}
+
+SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Panel_IsShadowCasting(void* csPanel)
+{
+  Dali::Scene3D::Panel* panel = (Dali::Scene3D::Panel*)csPanel;
+  bool                  result;
+
+  if(!panel)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Panel", 0);
+    return 0;
+  }
+
+  try
+  {
+    result = panel->IsShadowCasting();
+  }
+  CALL_CATCH_EXCEPTION(0);
+  return result;
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Panel_ReceiveShadow(void* csPanel, bool csReceiveShadow)
+{
+  Dali::Scene3D::Panel* panel = (Dali::Scene3D::Panel*)csPanel;
+
+  if(!panel)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Panel", 0);
+    return;
+  }
+
+  try
+  {
+    panel->ReceiveShadow(csReceiveShadow);
+  }
+  CALL_CATCH_EXCEPTION();
+}
+
+SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Panel_IsShadowReceiving(void* csPanel)
+{
+  Dali::Scene3D::Panel* panel = (Dali::Scene3D::Panel*)csPanel;
+  bool                  result;
+
+  if(!panel)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Panel", 0);
+    return 0;
+  }
+
+  try
+  {
+    result = panel->IsShadowReceiving();
+  }
+  CALL_CATCH_EXCEPTION(0);
+  return result;
+}
+
+
+// For Property index
+SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Panel_property_TRANSPARENT_get()
+{
+  return (int)Dali::Scene3D::Panel::Property::TRANSPARENT;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Panel_property_DOUBLE_SIDED_get()
+{
+  return (int)Dali::Scene3D::Panel::Property::DOUBLE_SIDED;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Panel_property_USE_BACK_FACE_PLANE_get()
+{
+  return (int)Dali::Scene3D::Panel::Property::USE_BACK_FACE_PLANE;
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Panel_property_BACK_FACE_PLANE_COLOR_get()
+{
+  return (int)Dali::Scene3D::Panel::Property::BACK_FACE_PLANE_COLOR;
+}
+
+#ifdef __cplusplus
+}
+#endif
index 489791e73437b82276eb9458825b9f755ebc27cc..df085250fbde8af7a793b0a8d68f0a08b183ca02 100755 (executable)
@@ -126,6 +126,7 @@ SET( dali_csharp_binder_scene3d_src_files
   ${dali_csharp_binder_dir}/dali-scene3d/motion-data-wrap.cpp
   ${dali_csharp_binder_dir}/dali-scene3d/motion-index-wrap.cpp
   ${dali_csharp_binder_dir}/dali-scene3d/motion-value-wrap.cpp
+  ${dali_csharp_binder_dir}/dali-scene3d/panel-wrap.cpp
   ${dali_csharp_binder_dir}/dali-scene3d/scene-view-wrap.cpp
 )