From c9702062a74bfb26b72e748622506f1ea450a268 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Artur=20=C5=9Awigo=C5=84?= Date: Fri, 18 Feb 2022 14:27:19 +0100 Subject: [PATCH] [AT-SPI] Pass a Control to DevelControl functions A related dali-toolkit change narrows down the expected type from an Actor to a Control. These functions did not work for non-Control Actors anyway. Change-Id: I2fde58bfee6eb1daba32becd690ea217c32f7077 --- dali-csharp-binder/src/control-devel-wrap.cpp | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/dali-csharp-binder/src/control-devel-wrap.cpp b/dali-csharp-binder/src/control-devel-wrap.cpp index 527f12e5..8c427c69 100644 --- a/dali-csharp-binder/src/control-devel-wrap.cpp +++ b/dali-csharp-binder/src/control-devel-wrap.cpp @@ -129,9 +129,9 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_AppendAccessibility GUARD_ON_NULL_RET(arg1); GUARD_ON_NULL_RET(arg2); try_catch(([&]() { - Dali::Actor *control = (Dali::Actor*) arg1; - Dali::Actor *destination = (Dali::Actor*) arg2; - Dali::Accessibility::RelationType relation = (Dali::Accessibility::RelationType) arg3; + auto *control = (Dali::Toolkit::Control*)arg1; + auto *destination = (Dali::Actor*)arg2; + auto relation = (Dali::Accessibility::RelationType)arg3; AppendAccessibilityRelation(*control, *destination, relation); })); } @@ -140,9 +140,9 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_RemoveAccessibility GUARD_ON_NULL_RET(arg1); GUARD_ON_NULL_RET(arg2); try_catch(([&]() { - Dali::Actor *control = (Dali::Actor*) arg1; - Dali::Actor *destination = (Dali::Actor*) arg2; - Dali::Accessibility::RelationType relation = (Dali::Accessibility::RelationType) arg3; + auto *control = (Dali::Toolkit::Control*)arg1; + auto *destination = (Dali::Actor*)arg2; + auto relation = (Dali::Accessibility::RelationType)arg3; RemoveAccessibilityRelation(*control, *destination, relation); })); } @@ -151,7 +151,7 @@ SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_new_GetAccessibili std::vector> *result = nullptr; GUARD_ON_NULL_RET0(arg1); try_catch(([&]() { - Dali::Actor *control = (Dali::Actor*) arg1; + auto *control = (Dali::Toolkit::Control*)arg1; result = new std::vector>(GetAccessibilityRelations(*control)); })); return (void*)result; @@ -206,7 +206,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_delete_Accessibilit SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_ClearAccessibilityRelations(void *arg1) { GUARD_ON_NULL_RET(arg1); try_catch(([&]() { - Dali::Actor *control = (Dali::Actor*) arg1; + auto *control = (Dali::Toolkit::Control*)arg1; ClearAccessibilityRelations(*control); })); } @@ -216,7 +216,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_AppendAccessibility GUARD_ON_NULL_RET(arg2); GUARD_ON_NULL_RET(arg3); try_catch(([&]() { - Dali::Actor *control = (Dali::Actor*) arg1; + auto *control = (Dali::Toolkit::Control*)arg1; const std::string key(arg2); const std::string value(arg3); AppendAccessibilityAttribute(*control, key, value); @@ -227,7 +227,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_RemoveAccessibility GUARD_ON_NULL_RET(arg1); GUARD_ON_NULL_RET(arg2); try_catch(([&]() { - Dali::Actor *control = (Dali::Actor*) arg1; + auto *control = (Dali::Toolkit::Control*)arg1; const std::string key(arg2); RemoveAccessibilityAttribute(*control, key); })); @@ -236,7 +236,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_RemoveAccessibility SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_ClearAccessibilityAttributes(void *arg1) { GUARD_ON_NULL_RET(arg1); try_catch(([&]() { - Dali::Actor *control = (Dali::Actor*) arg1; + auto *control = (Dali::Toolkit::Control*)arg1; ClearAccessibilityAttributes(*control); })); } @@ -250,10 +250,8 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_SetAccessibilityRea GUARD_ON_NULL_RET(arg1); try_catch(([&]() { - std::array data; - data[0] = arg2; - Dali::Actor *control = (Dali::Actor*) arg1; - SetAccessibilityReadingInfoType(*control, ReadingInfoTypes(data)); + auto *control = (Dali::Toolkit::Control*)arg1; + SetAccessibilityReadingInfoType(*control, ReadingInfoTypes{static_cast(arg2)}); })); } @@ -261,7 +259,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_GetAccessibilityRead int result = 0; GUARD_ON_NULL_RET0(arg1); try_catch(([&]() { - Dali::Actor *control = (Dali::Actor*) arg1; + auto *control = (Dali::Toolkit::Control*)arg1; auto readingInfo = GetAccessibilityReadingInfoType(*control); result = readingInfo.GetRawData()[0]; })); @@ -272,7 +270,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_ClearAccess bool result = false; GUARD_ON_NULL_RET0(arg1); try_catch(([&]() { - Dali::Actor *control = (Dali::Actor*) arg1; + auto *control = (Dali::Toolkit::Control*)arg1; result = ClearAccessibilityHighlight(*control); })); return result; @@ -282,7 +280,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_GrabAccessi bool result = false; GUARD_ON_NULL_RET0(arg1); try_catch(([&]() { - Dali::Actor *control = (Dali::Actor*) arg1; + auto *control = (Dali::Toolkit::Control*)arg1; result = GrabAccessibilityHighlight(*control); })); return result; @@ -292,7 +290,7 @@ SWIGEXPORT uint64_t SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_GetAccessibilit uint64_t result = 0; GUARD_ON_NULL_RET0(arg1); try_catch(([&]() { - Dali::Actor *control = (Dali::Actor*) arg1; + auto *control = (Dali::Toolkit::Control*)arg1; auto states = GetAccessibilityStates(*control); result = states.GetRawData64(); })); @@ -303,9 +301,8 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Toolkit_DevelControl_NotifyAccessibility GUARD_ON_NULL_RET(arg1); try_catch(([&]() { Dali::Accessibility::States states(arg2); - Dali::Actor *control = (Dali::Actor*) arg1; - bool doRecursive = arg3 ? true : false; - NotifyAccessibilityStateChange(*control, states, doRecursive); + auto *control = (Dali::Toolkit::Control*)arg1; + NotifyAccessibilityStateChange(*control, states, static_cast(arg3)); })); } -- 2.34.1