From 4c306360ad7cfdc76534e2d78fafd08011ca297b Mon Sep 17 00:00:00 2001 From: sarajammal Date: Mon, 28 Nov 2022 16:20:22 +0300 Subject: [PATCH] Open the existing GetTextBoundingRectangle API Change-Id: Ie79225262cedf906fac35e3f62bd2a2320ac010c --- dali-csharp-binder/src/text-editor-wrap.cpp | 17 +++++++++++++++++ dali-csharp-binder/src/text-field-wrap.cpp | 17 +++++++++++++++++ dali-csharp-binder/src/text-label-wrap.cpp | 17 +++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/dali-csharp-binder/src/text-editor-wrap.cpp b/dali-csharp-binder/src/text-editor-wrap.cpp index 13f4d1a3..e1299ba6 100755 --- a/dali-csharp-binder/src/text-editor-wrap.cpp +++ b/dali-csharp-binder/src/text-editor-wrap.cpp @@ -1044,6 +1044,23 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_TextEditor_GetTextPosition(void * pTex return sizeList; } +SWIGEXPORT void * SWIGSTDCALL CSharp_TextGeometry_TextEditor_GetTextBoundingRectangle(void * pTextEditor, uint32_t startIndex, uint32_t endIndex) +{ + Dali::Toolkit::TextEditor *textEditor = (Dali::Toolkit::TextEditor *) 0; + void* boundingRect; + + textEditor = (Dali::Toolkit::TextEditor *)pTextEditor; + { + try { + boundingRect = new Dali::Rect<> + ((const Dali::Rect<> &)(Dali::Toolkit::DevelTextEditor::GetTextBoundingRectangle( *textEditor, startIndex, endIndex))); + } + CALL_CATCH_EXCEPTION(0); + } + + return boundingRect; +} + SWIGEXPORT char* SWIGSTDCALL CSharp_Dali_TextEditor_CopyText(void *pTextEditor) { char *csCopiedText; diff --git a/dali-csharp-binder/src/text-field-wrap.cpp b/dali-csharp-binder/src/text-field-wrap.cpp index 2cff05d3..94544422 100755 --- a/dali-csharp-binder/src/text-field-wrap.cpp +++ b/dali-csharp-binder/src/text-field-wrap.cpp @@ -996,6 +996,23 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_TextField_GetTextPosition(void * pText return sizeList; } +SWIGEXPORT void * SWIGSTDCALL CSharp_TextGeometry_TextField_GetTextBoundingRectangle(void * pTextField, uint32_t startIndex, uint32_t endIndex) +{ + Dali::Toolkit::TextField *textField = (Dali::Toolkit::TextField *) 0; + void* boundingRect; + + textField = (Dali::Toolkit::TextField *)pTextField; + { + try { + boundingRect = new Dali::Rect<> + ((const Dali::Rect<> &)(Dali::Toolkit::DevelTextField::GetTextBoundingRectangle( *textField, startIndex, endIndex))); + } + CALL_CATCH_EXCEPTION(0); + } + + return boundingRect; +} + SWIGEXPORT char* SWIGSTDCALL CSharp_Dali_TextField_CopyText(void *pTextField) { char *csCopiedText; diff --git a/dali-csharp-binder/src/text-label-wrap.cpp b/dali-csharp-binder/src/text-label-wrap.cpp index 9a5d4712..d7346cc2 100755 --- a/dali-csharp-binder/src/text-label-wrap.cpp +++ b/dali-csharp-binder/src/text-label-wrap.cpp @@ -106,6 +106,23 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_TextLabel_GetTextPosition(void * pText return sizeList; } +SWIGEXPORT void * SWIGSTDCALL CSharp_TextGeometry_TextLabel_GetTextBoundingRectangle(void * pTextLabel, uint32_t startIndex, uint32_t endIndex) +{ + Dali::Toolkit::TextLabel *textLabel = (Dali::Toolkit::TextLabel *) 0; + void* boundingRect; + + textLabel = (Dali::Toolkit::TextLabel *)pTextLabel; + { + try { + boundingRect = new Dali::Rect<> + ((const Dali::Rect<> &)(Dali::Toolkit::DevelTextLabel::GetTextBoundingRectangle( *textLabel, startIndex, endIndex))); + } + CALL_CATCH_EXCEPTION(0); + } + + return boundingRect; +} + SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_TextLabel_AnchorClickedSignal(void * jarg1) { void * jresult ; Dali::Toolkit::TextLabel *arg1 = (Dali::Toolkit::TextLabel *) 0 ; -- 2.34.1