Add api for brokenImage 10/263610/6
authortscholb <scholb.kim@samsung.com>
Mon, 6 Sep 2021 11:13:38 +0000 (20:13 +0900)
committersunghyun kim <scholb.kim@samsung.com>
Wed, 13 Oct 2021 07:03:38 +0000 (07:03 +0000)
Add api for setting broken Image.
Using ThemeManager, nui application can set 3 type of the broken image.

Change-Id: I86c4378869dcd6ce6201935af5e5c15f8a33a266

dali-csharp-binder/file.list
dali-csharp-binder/src/style-manager-wrap.cpp [new file with mode: 0644]

index 261006a..1063b4b 100755 (executable)
@@ -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 (file)
index 0000000..053f8cf
--- /dev/null
@@ -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 <string.h>
+#include "common.h"
+
+#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
+
+/* 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