[dali_2.1.18] Merge branch 'devel/master'
[platform/core/uifw/dali-csharp-binder.git] / dali-csharp-binder / src / keyboard-wrap.cpp
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // EXTERNAL INCLUDES
19 #include <dali/dali.h>
20 #include <dali/public-api/common/dali-common.h>
21 #include <dali/devel-api/adaptor-framework/keyboard.h>
22 #include <dali-toolkit/dali-toolkit.h>
23
24 // INTERNAL INCLUDES
25 #include "common.h"
26
27 #ifdef TIZEN_BUILD
28 #ifdef ECORE_WL2
29 #include <Ecore_Wl2.h>
30 #else
31 #include <Ecore_Wayland.h>
32 #endif
33 #endif
34
35 #undef LOG
36 //#define LOG DALI_LOG_ERROR
37 #define LOG(a...)
38
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Keyboard_SetRepeatInfo(float rate, float delay)
45 {
46   bool ret;
47
48   LOG("CSharp_Dali_Keyboard_SetRepeatInfo() [DP1] rate=%f, delay=%f", rate, delay);
49
50   {
51     try {
52       ret = Dali::Keyboard::SetRepeatInfo(rate, delay);
53     } CALL_CATCH_EXCEPTION(0);
54   }
55
56
57   LOG("CSharp_Dali_Keyboard_SetRepeatInfo() [DP2] ret=%d", ret);
58
59   return ret;
60 }
61
62 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Keyboard_GetRepeatInfo(float& rate, float& delay)
63 {
64   bool ret;
65
66   LOG("CSharp_Dali_Keyboard_GetRepeatInfo() [DP1] rate=%f, delay=%f", rate, delay);
67
68   {
69     try {
70       ret = Dali::Keyboard::GetRepeatInfo(rate, delay);
71     } CALL_CATCH_EXCEPTION(0);
72   }
73
74
75   LOG("CSharp_Dali_Keyboard_GetRepeatInfo() [DP2] ret=%d", ret);
76
77   return ret;
78 }
79
80
81 #ifdef __cplusplus
82 }
83 #endif
84