From 27acc74d8ba844c33d5656d9197742e278f29c41 Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Tue, 12 Jun 2018 15:19:15 +0900 Subject: [PATCH] Added binding for Keyboard RepeatInfo APIs - Added binding SetRepeatInfo and GetRepeatInfo Change-Id: Iad7db5714a0956ada38cbd0850a22c90370e6e2b Signed-off-by: Seoyeon Kim --- dali-csharp-binder/file.list | 1 + dali-csharp-binder/src/keyboard.cpp | 119 ++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100755 dali-csharp-binder/src/keyboard.cpp diff --git a/dali-csharp-binder/file.list b/dali-csharp-binder/file.list index d68e3d9..9c2be26 100755 --- a/dali-csharp-binder/file.list +++ b/dali-csharp-binder/file.list @@ -40,6 +40,7 @@ dali_csharp_binder_common_src_files = \ # module: csharp-binder, backend: mobile,tv,ivi,watch dali_csharp_binder_tizen_src_files = \ ${dali_csharp_binder_dir}/src/key-grab.cpp \ + ${dali_csharp_binder_dir}/src/keyboard.cpp \ ${dali_csharp_binder_dir}/src/widget_view.cpp \ ${dali_csharp_binder_dir}/src/widget_view_manager.cpp \ ${dali_csharp_binder_dir}/src/font-client.cpp \ diff --git a/dali-csharp-binder/src/keyboard.cpp b/dali-csharp-binder/src/keyboard.cpp new file mode 100755 index 0000000..c88516f --- /dev/null +++ b/dali-csharp-binder/src/keyboard.cpp @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2018 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 "common.h" + +#include +#include +#include +#include +#include + +#include +#include + + +#ifdef TIZEN_BUILD +#ifdef ECORE_WL2 +#include +#else +#include +#endif +#endif + +#undef LOG +//#define LOG DALI_LOG_ERROR +#define LOG(a...) + + +#ifdef __cplusplus +extern "C" { +#endif + +SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Keyboard_SetRepeatInfo(float rate, float delay) +{ + bool ret; + + LOG("CSharp_Dali_Keyboard_SetRepeatInfo() [DP1] rate=%f, delay=%f", rate, delay); + + { + try { + ret = Dali::Keyboard::SetRepeatInfo(rate, delay); + } catch (std::out_of_range& e) { + { + SWIG_CSharpException(SWIG_IndexError, const_cast(e.what())); return false; + }; + } catch (std::exception& e) { + { + SWIG_CSharpException(SWIG_RuntimeError, const_cast(e.what())); return false; + }; + } catch (Dali::DaliException e) { + { + SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0; + }; + } catch (...) { + { + SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0; + }; + } + } + + + LOG("CSharp_Dali_Keyboard_SetRepeatInfo() [DP2] ret=%d", ret); + + return ret; +} + +SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Keyboard_GetRepeatInfo(float& rate, float& delay) +{ + bool ret; + + LOG("CSharp_Dali_Keyboard_GetRepeatInfo() [DP1] rate=%f, delay=%f", rate, delay); + + { + try { + ret = Dali::Keyboard::GetRepeatInfo(rate, delay); + } catch (std::out_of_range& e) { + { + SWIG_CSharpException(SWIG_IndexError, const_cast(e.what())); return false; + }; + } catch (std::exception& e) { + { + SWIG_CSharpException(SWIG_RuntimeError, const_cast(e.what())); return false; + }; + } catch (Dali::DaliException e) { + { + SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0; + }; + } catch (...) { + { + SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0; + }; + } + } + + + LOG("CSharp_Dali_Keyboard_GetRepeatInfo() [DP2] ret=%d", ret); + + return ret; +} + + +#ifdef __cplusplus +} +#endif + -- 2.7.4