2 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali-toolkit/devel-api/styling/style-manager-devel.h>
22 #include <dali-csharp-binder/common/common.h>
24 /* Callback for returning strings to C# without leaking memory */
25 typedef char *(SWIGSTDCALL *SWIG_CSharpStringHelperCallback)(const char*);
26 extern SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback;
32 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_StyleManager_SetBrokenImageUrl(void * nuiStyleManager, unsigned int brokenType, char * nuiUrl) {
33 Dali::Toolkit::StyleManager *styleManager = (Dali::Toolkit::StyleManager *) 0 ;
34 std::string *url = 0 ;
37 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
41 std::string url_str(nuiUrl);
43 styleManager = (Dali::Toolkit::StyleManager *)nuiStyleManager;
46 Dali::Toolkit::DevelStyleManager::SetBrokenImageUrl(*styleManager,Dali::Toolkit::DevelStyleManager::BrokenImageType(brokenType),(std::string const &)*url);
47 } CALL_CATCH_EXCEPTION();
51 SWIGEXPORT char * SWIGSTDCALL CSharp_Dali_StyleManager_GetBrokenImageUrl(void * nuiStyleManager, unsigned int brokenType) {
53 Dali::Toolkit::StyleManager *styleManager = (Dali::Toolkit::StyleManager *) 0 ;
56 styleManager = (Dali::Toolkit::StyleManager *)nuiStyleManager;
59 result = Dali::Toolkit::DevelStyleManager::GetBrokenImageUrl(*styleManager,Dali::Toolkit::DevelStyleManager::BrokenImageType(brokenType));
60 } CALL_CATCH_EXCEPTION(0);
63 jresult = SWIG_csharp_string_callback((&result)->c_str());