Merge "Change Set and Get InputPanelData() name" into devel/master
[platform/core/uifw/dali-csharp-binder.git] / dali-csharp-binder / src / event-thread-callback-wrap.cpp
1 /*
2  * Copyright (c) 2017 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 #ifndef CSHARP_EVENT_THREAD_CALLBACK
19 #define CSHARP_EVENT_THREAD_CALLBACK
20 #endif
21
22 #include "common.h"
23 #include <dali/devel-api/adaptor-framework/event-thread-callback.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 typedef void (SWIGSTDCALL* SWIG_CallbackMakeCallback)(void);
30
31 SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_EventThreadCallback(SWIG_CallbackMakeCallback callbackOnMakeCallback) {
32   void * jresult ;
33   void (*arg1)(void) = (void (*)(void)) 0 ;
34   Dali::EventThreadCallback *result = 0 ;
35   Dali::CallbackBase * callbackBase = 0 ;
36
37   arg1 = (void (*)(void))callbackOnMakeCallback;
38   callbackBase = (Dali::CallbackBase *)Dali::MakeCallback(arg1);
39
40   {
41     try {
42       result = (Dali::EventThreadCallback *)new Dali::EventThreadCallback(callbackBase);
43     } catch (std::out_of_range& e) {
44       {
45         delete result;
46         delete callbackBase;
47         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0;
48       };
49     } catch (std::exception& e) {
50       {
51         delete result;
52         delete callbackBase;
53         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0;
54       };
55     } catch (...) {
56       {
57         delete result;
58         delete callbackBase;
59         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
60       };
61     }
62   }
63   jresult = (void *)result;
64   return jresult;
65 }
66
67 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_EventThreadCallback(void * jarg1) {
68   Dali::EventThreadCallback *arg1 = (Dali::EventThreadCallback *) 0 ;
69
70   arg1 = (Dali::EventThreadCallback *)jarg1;
71   {
72     try {
73       delete arg1;
74     } catch (std::out_of_range& e) {
75       {
76         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return ;
77       };
78     } catch (std::exception& e) {
79       {
80         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return ;
81       };
82     } catch (...) {
83       {
84         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ;
85       };
86     }
87   }
88 }
89
90
91 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_EventThreadCallback_Trigger(void * jarg1) {
92   Dali::EventThreadCallback *arg1 = (Dali::EventThreadCallback *) 0 ;
93
94   arg1 = (Dali::EventThreadCallback *)jarg1;
95   {
96     try {
97       (arg1)->Trigger();
98     } catch (std::out_of_range& e) {
99       {
100         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return ;
101       };
102     } catch (std::exception& e) {
103       {
104         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return ;
105       };
106     } catch (...) {
107       {
108         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ;
109       };
110     }
111   }
112 }
113
114 #ifdef __cplusplus
115 }
116 #endif //CSHARP_EVENT_THREAD_CALLBACK
117