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