[Tizen] Add api for brokenImage accepted/tizen/6.5/unified/20211028.114304 accepted/tizen/unified/20211001.001620 submit/tizen/20210927.083017 submit/tizen/20210928.035024 submit/tizen/20210928.095304 submit/tizen_6.5/20211028.163101 tizen_6.5.m2_release
authorBowon Ryu <bowon.ryu@samsung.com>
Mon, 27 Sep 2021 06:36:46 +0000 (15:36 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Mon, 27 Sep 2021 06:36:46 +0000 (15:36 +0900)
This reverts commit bbb3d7afce401e47c8af1855c192244bc9a84a75.

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

index a84d7c0..f43f01a 100755 (executable)
@@ -47,7 +47,8 @@ dali_csharp_binder_common_src_files = \
   ${dali_csharp_binder_dir}/src/atspi-wrap.cpp \
   ${dali_csharp_binder_dir}/src/rotation-wrap.cpp \
   ${dali_csharp_binder_dir}/src/input-options-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