Add GetCharacterBoundingRectangle wrapper 20/283020/11
authorsarajammal <s.al-jammal@partner.samsung.com>
Sun, 16 Oct 2022 16:03:03 +0000 (19:03 +0300)
committersarajammal <s.al-jammal@partner.samsung.com>
Thu, 8 Dec 2022 14:09:30 +0000 (17:09 +0300)
Wrapper API for GetCharacterBoundingRectangle in TextGeometry, that calculates the:
- X, Y positions
- Width and Height

Those are returned in a Rect<float>

The patch depends on:
https://review.tizen.org/gerrit/c/platform/core/uifw/dali-toolkit/+/282872

Change-Id: I65fc1e5de90e6e70133a7ebbc5ebeed67a3ce9b1

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

index 7d70c138e46825500c7037ed5a2e7b23f60d3b02..62cfe6ac80b749d1d8541bba6aa002c6ee5acb57 100644 (file)
@@ -82,6 +82,57 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_TextGeometry_TextEditor_GetLineBoundingRect
   return resultRect;
 }
 
+SWIGEXPORT void * SWIGSTDCALL CSharp_TextGeometry_TextLabel_GetCharacterBoundingRectangle(void * pTextLabel, uint32_t charIndex)
+{
+  Dali::Toolkit::TextLabel *textLabel = (Dali::Toolkit::TextLabel *) 0;
+  void* resultRect;
+
+  textLabel = (Dali::Toolkit::TextLabel *)pTextLabel;
+  {
+    try {
+      resultRect = new Dali::Rect<>
+      ((const Dali::Rect<> &)(Dali::Toolkit::Text::TextGeometry::GetCharacterBoundingRectangle( *textLabel, charIndex)));
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return resultRect;
+}
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_TextGeometry_TextField_GetCharacterBoundingRectangle(void * pTextField, uint32_t charIndex)
+{
+  Dali::Toolkit::TextField *textField = (Dali::Toolkit::TextField *) 0;
+  void* resultRect;
+
+  textField = (Dali::Toolkit::TextField *)pTextField;
+  {
+    try {
+      resultRect = new Dali::Rect<>
+      ((const Dali::Rect<> &)(Dali::Toolkit::Text::TextGeometry::GetCharacterBoundingRectangle( *textField, charIndex)));
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return resultRect;
+}
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_TextGeometry_TextEditor_GetCharacterBoundingRectangle(void * pTextEditor, uint32_t charIndex)
+{
+  Dali::Toolkit::TextEditor *textEditor = (Dali::Toolkit::TextEditor *) 0;
+  void* resultRect;
+
+  textEditor = (Dali::Toolkit::TextEditor *)pTextEditor;
+  {
+    try {
+      resultRect = new Dali::Rect<>
+      ((const Dali::Rect<> &)(Dali::Toolkit::Text::TextGeometry::GetCharacterBoundingRectangle( *textEditor, charIndex)));
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return resultRect;
+}
+
 #ifdef __cplusplus
 }
 #endif