merging dali-sharp bindings with nui
[platform/core/uifw/dali-csharp-binder.git] / dali-bindings / 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     try {
41       result = (Dali::EventThreadCallback *)new Dali::EventThreadCallback(callbackBase);
42     } catch (std::out_of_range& e) {
43       {
44         delete result;
45         delete callbackBase;
46         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0;
47       };
48     } catch (std::exception& e) {
49       {
50         delete result;
51         delete callbackBase;
52         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0;
53       };
54     } catch (...) {
55       {
56         delete result;
57         delete callbackBase;
58         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
59       };
60     }
61   }
62   jresult = (void *)result;
63   return jresult;
64 }
65
66 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_EventThreadCallback(void * jarg1) {
67   Dali::EventThreadCallback *arg1 = (Dali::EventThreadCallback *) 0 ;
68
69   arg1 = (Dali::EventThreadCallback *)jarg1;
70   {
71     try {
72       delete arg1;
73     } catch (std::out_of_range& e) {
74       {
75         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return ;
76       };
77     } catch (std::exception& e) {
78       {
79         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return ;
80       };
81     } catch (...) {
82       {
83         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ;
84       };
85     }
86   }
87 }
88
89
90 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_EventThreadCallback_Trigger(void * jarg1) {
91   Dali::EventThreadCallback *arg1 = (Dali::EventThreadCallback *) 0 ;
92
93   arg1 = (Dali::EventThreadCallback *)jarg1;
94   {
95     try {
96       (arg1)->Trigger();
97     } catch (std::out_of_range& e) {
98       {
99         SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return ;
100       };
101     } catch (std::exception& e) {
102       {
103         SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return ;
104       };
105     } catch (...) {
106       {
107         SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ;
108       };
109     }
110   }
111 }
112
113 #ifdef __cplusplus
114 }
115 #endif //CSHARP_EVENT_THREAD_CALLBACK
116