Spannable: BackgroundColorSpan wrapper 14/285214/5
authorabedalrhman rasem <a.sheikha@partner.samsung.com>
Wed, 7 Dec 2022 14:06:41 +0000 (17:06 +0300)
committerabedalrhman rasem <a.sheikha@partner.samsung.com>
Tue, 10 Jan 2023 11:39:26 +0000 (14:39 +0300)
Wrap and bind BackgroundColorSpan methods:
  - New
  - BackgroundColorSpan
  - IsBackgroundColorDefined

Span's toolkit patch:
https://review.tizen.org/gerrit/c/platform/core/uifw/dali-toolkit/+/285049

Change-Id: Ia86bc3c8ae8a4781224482b95d212c9e5ca070ee

dali-csharp-binder/src/text-spans-wrap.cpp

index 56fdfc49843a8ec1baf1425d9dbc811e0fb5786e..543a27d0c0bf84b1441600a5408690bacfe3ff1f 100644 (file)
@@ -20,6 +20,7 @@
 #include <dali-toolkit/devel-api/text/spans/base-span.h>
 #include <dali-toolkit/devel-api/text/spans/foreground-color-span.h>
 #include <dali-toolkit/devel-api/text/spans/character-spacing-span.h>
+#include <dali-toolkit/devel-api/text/spans/background-color-span.h>
 #include <dali/dali.h>
 
 // INTERNAL INCLUDES
@@ -208,6 +209,94 @@ SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_CharacterSpacingSpan_IsCharacterSpacingD
   return result;
 }
 
+// BackgroundColorSpan
+
+SWIGEXPORT void SWIGSTDCALL
+CSharp_Dali_delete_BackgroundColorSpan(void *refSpan) {
+  BackgroundColorSpan *spanPtr = (BackgroundColorSpan *)0;
+  spanPtr = (BackgroundColorSpan *)refSpan;
+
+  {
+    try {
+      delete spanPtr;
+    }
+    CALL_CATCH_EXCEPTION();
+  }
+}
+
+SWIGEXPORT void *SWIGSTDCALL
+CSharp_Dali_BackgroundColorSpan_New(void *argColor) {
+
+  Dali::Vector4 *colorPtr = 0;
+  colorPtr = (Dali::Vector4 *)argColor;
+  if (!colorPtr) {
+
+    SWIG_CSharpSetPendingExceptionArgument(
+        SWIG_CSharpArgumentNullException,
+        "Attempt to dereference null Dali::Vector4", 0);
+    return 0;
+  }
+
+  BackgroundColorSpan *spanPtr = 0;
+  {
+    try {
+      spanPtr = (BackgroundColorSpan *)new BackgroundColorSpan(
+          BackgroundColorSpan::New((Dali::Vector4 const &)*colorPtr));
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return (void *)spanPtr;
+}
+
+SWIGEXPORT void *SWIGSTDCALL
+CSharp_Dali_BackgroundColorSpan_GetBackgroundColor(void *refSpan) {
+
+  BackgroundColorSpan *spanPtr;
+  Dali::Vector4 result;
+
+  spanPtr = (BackgroundColorSpan *)refSpan;
+  if (!spanPtr) {
+    SWIG_CSharpSetPendingExceptionArgument(
+        SWIG_CSharpArgumentNullException,
+        "Attempt to dereference null BackgroundColorSpan", 0);
+    return 0;
+  }
+
+  {
+    try {
+      result = spanPtr->GetBackgroundColor();
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return new Dali::Vector4((const Dali::Vector4 &)result);
+}
+
+SWIGEXPORT bool SWIGSTDCALL
+CSharp_Dali_BackgroundColorSpan_IsBackgroundColorDefined(void *refSpan) {
+
+  BackgroundColorSpan *spanPtr;
+  bool result = false;
+
+  spanPtr = (BackgroundColorSpan *)refSpan;
+  if (!spanPtr) {
+    SWIG_CSharpSetPendingExceptionArgument(
+        SWIG_CSharpArgumentNullException,
+        "Attempt to dereference null BackgroundColorSpan", 0);
+    return 0;
+  }
+
+  {
+    try {
+      result = spanPtr->IsBackgroundColorDefined();
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return result;
+}
+
 #ifdef __cplusplus
 }
 #endif