From: dongsug.song Date: Wed, 16 Oct 2019 04:19:17 +0000 (+0900) Subject: (ATSPI) Add ATSPI for Say(), Pause(), Resume(), SetForcefully(), GetStatus() X-Git-Tag: dali_1.4.52~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F80%2F220180%2F1;p=platform%2Fcore%2Fuifw%2Fdali-csharp-binder.git (ATSPI) Add ATSPI for Say(), Pause(), Resume(), SetForcefully(), GetStatus() This reverts commit 4ca314623f0a4ec3f60deace83ad572e4c597752. Change-Id: I0257c05a0002a7d14a6eb7792026998455b26e4c --- diff --git a/dali-csharp-binder/file.list b/dali-csharp-binder/file.list index b421389..d6e05e9 100755 --- a/dali-csharp-binder/file.list +++ b/dali-csharp-binder/file.list @@ -37,7 +37,8 @@ dali_csharp_binder_tizen_src_files = \ ${dali_csharp_binder_dir}/src/widget_view_manager.cpp \ ${dali_csharp_binder_dir}/src/font-client.cpp \ ${dali_csharp_binder_dir}/src/transition-effects.cpp \ - ${dali_csharp_binder_dir}/src/actor-devel.cpp + ${dali_csharp_binder_dir}/src/actor-devel.cpp \ + ${dali_csharp_binder_dir}/src/atspi.cpp # module: csharp-binder, backend: tizen-wearable dali_csharp_binder_tizen_wearable_src_files = \ diff --git a/dali-csharp-binder/src/atspi.cpp b/dali-csharp-binder/src/atspi.cpp new file mode 100755 index 0000000..a30b47e --- /dev/null +++ b/dali-csharp-binder/src/atspi.cpp @@ -0,0 +1,125 @@ +/** Copyright (c) 2019 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. +* +*/ + +#ifndef CSHARP_ATSPI +#define CSHARP_ATSPI +#endif + +#include "common.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +SWIGEXPORT int SWIGSTDCALL csharp_dali_accessibility_GetStatus(void *jarg1) +{ + Dali::Toolkit::Control *arg1 = (Dali::Toolkit::Control *)jarg1; + if (!arg1) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Toolkit::Control is null", 0); + return -1; + } + return Dali::AtspiAccessibility::GetStatus(); +} + +using callbackFuncType = void(*)(int); +callbackFuncType callBack; +void sayTestCallback(std::string result) +{ + DALI_LOG_ERROR("sayTestCallback() result=%s ", result.c_str()); + + if(callBack) + { + if(result == "ReadingCancelled") + { + callBack(1); + } + else if(result == "ReadingStopped") + { + callBack(2); + } + else if(result == "ReadingSkipped") + { + callBack(3); + } + else + { + callBack(-1); + } + } +} + +SWIGEXPORT void SWIGSTDCALL csharp_dali_accessibility_say(void *jarg1, char* jarg2, bool jarg3, void *jarg4) +{ + Dali::Toolkit::Control *arg1 = (Dali::Toolkit::Control *)jarg1; + std::string arg2(jarg2); + bool arg3 = jarg3; + callBack = (callbackFuncType)jarg4; + + if (!arg1) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Toolkit::Control is null", 0); + return; + } + + Dali::AtspiAccessibility::Say(arg2, jarg3, sayTestCallback); + + DALI_LOG_ERROR("csharp_dali_accessibility_say() arg3=%d", arg3); +} + +SWIGEXPORT void SWIGSTDCALL csharp_dali_accessibility_pause_resume(void *jarg1, bool jarg2) +{ + Dali::Toolkit::Control *arg1 = (Dali::Toolkit::Control *)jarg1; + bool arg2 = jarg2; + + if (!arg1) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Toolkit::Control is null", 0); + return; + } + + if(arg2 == true) + { + Dali::AtspiAccessibility::Pause(); + } + else + { + Dali::AtspiAccessibility::Resume(); + } + + DALI_LOG_ERROR("csharp_dali_accessibility_pause_resume() arg2=%d", arg2); +} + +SWIGEXPORT void SWIGSTDCALL csharp_dali_accessibility_Enable(void *jarg1, bool jarg2) +{ + Dali::Toolkit::Control *arg1 = (Dali::Toolkit::Control *)jarg1; + + if (!arg1) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Toolkit::Control is null", 0); + return; + } + + Dali::AtspiAccessibility::SetForcefully(jarg2); + + DALI_LOG_ERROR("csharp_dali_accessibility_Enable() jarg2=%d \n", jarg2); +} + +#ifdef __cplusplus +} +#endif \ No newline at end of file