From: tscholb Date: Mon, 6 Sep 2021 11:13:38 +0000 (+0900) Subject: Add api for brokenImage X-Git-Tag: dali_2.0.48~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c28cb93be24d18f18f7f94509fd27248b84b459e;p=platform%2Fcore%2Fuifw%2Fdali-csharp-binder.git Add api for brokenImage Add api for setting broken Image. Using ThemeManager, nui application can set 3 type of the broken image. Change-Id: I86c4378869dcd6ce6201935af5e5c15f8a33a266 --- diff --git a/dali-csharp-binder/file.list b/dali-csharp-binder/file.list index 261006ad..1063b4b8 100755 --- a/dali-csharp-binder/file.list +++ b/dali-csharp-binder/file.list @@ -48,7 +48,8 @@ dali_csharp_binder_common_src_files = \ ${dali_csharp_binder_dir}/src/rotation-wrap.cpp \ ${dali_csharp_binder_dir}/src/input-options-wrap.cpp \ ${dali_csharp_binder_dir}/src/model3d-view-wrap.cpp \ - ${dali_csharp_binder_dir}/src/native-image-queue-wrap.cpp + ${dali_csharp_binder_dir}/src/native-image-queue-wrap.cpp \ + ${dali_csharp_binder_dir}/src/style-manager-wrap.cpp # added for key grab binding only for tizen # module: csharp-binder, backend: mobile,tv,ivi,watch diff --git a/dali-csharp-binder/src/style-manager-wrap.cpp b/dali-csharp-binder/src/style-manager-wrap.cpp new file mode 100644 index 00000000..053f8cfb --- /dev/null +++ b/dali-csharp-binder/src/style-manager-wrap.cpp @@ -0,0 +1,66 @@ +/** Copyright (c) 2021 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. +* +*/ +#include +#include "common.h" + +#include + +/* Callback for returning strings to C# without leaking memory */ +typedef char *(SWIGSTDCALL *SWIG_CSharpStringHelperCallback)(const char*); +extern SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback; + +#ifdef __cplusplus +extern "C" { +#endif + +SWIGEXPORT void SWIGSTDCALL CSharp_Dali_StyleManager_SetBrokenImageUrl(void * nuiStyleManager, unsigned int brokenType, char * nuiUrl) { + Dali::Toolkit::StyleManager *styleManager = (Dali::Toolkit::StyleManager *) 0 ; + std::string *url = 0 ; + + if(!nuiUrl) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0); + return; + } + + std::string url_str(nuiUrl); + url = &url_str; + styleManager = (Dali::Toolkit::StyleManager *)nuiStyleManager; + { + try { + Dali::Toolkit::DevelStyleManager::SetBrokenImageUrl(*styleManager,Dali::Toolkit::DevelStyleManager::BrokenImageType(brokenType),(std::string const &)*url); + } CALL_CATCH_EXCEPTION(); + } +} + +SWIGEXPORT char * SWIGSTDCALL CSharp_Dali_StyleManager_GetBrokenImageUrl(void * nuiStyleManager, unsigned int brokenType) { + char * jresult ; + Dali::Toolkit::StyleManager *styleManager = (Dali::Toolkit::StyleManager *) 0 ; + std::string result; + + styleManager = (Dali::Toolkit::StyleManager *)nuiStyleManager; + { + try { + result = Dali::Toolkit::DevelStyleManager::GetBrokenImageUrl(*styleManager,Dali::Toolkit::DevelStyleManager::BrokenImageType(brokenType)); + } CALL_CATCH_EXCEPTION(0); + } + + jresult = SWIG_csharp_string_callback((&result)->c_str()); + return jresult; +} + +#ifdef __cplusplus +} +#endif \ No newline at end of file