265de21efff41d92a886b1d588e960971f5dd913
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Interop / NDalicPINVOKE.cs
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 namespace Tizen.NUI
19 {
20
21     class NDalicPINVOKE
22     {
23         public const string Lib = "libdali-csharp-binder.so";
24         protected class SWIGExceptionHelper
25                 {
26                         /// <since_tizen> 3 </since_tizen>
27                         public delegate void ExceptionDelegate(string message);
28                         /// <since_tizen> 3 </since_tizen>
29                         public delegate void ExceptionArgumentDelegate(string message, string paramName);
30                         static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException);
31                         static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException);
32                         static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException);
33                         static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException);
34                         static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException);
35                         static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException);
36                         static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException);
37                         static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException);
38                         static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException);
39                         static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException);
40                         static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException);
41                         static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException);
42                         static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException);
43                         static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException);
44         
45                         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterExceptionCallbacks_NDalic")]
46                         public static extern void SWIGRegisterExceptionCallbacks_NDalic(
47                                                                                 ExceptionDelegate applicationDelegate,
48                                                                                 ExceptionDelegate arithmeticDelegate,
49                                                                                 ExceptionDelegate divideByZeroDelegate,
50                                                                                 ExceptionDelegate indexOutOfRangeDelegate,
51                                                                                 ExceptionDelegate invalidCastDelegate,
52                                                                                 ExceptionDelegate invalidOperationDelegate,
53                                                                                 ExceptionDelegate ioDelegate,
54                                                                                 ExceptionDelegate nullReferenceDelegate,
55                                                                                 ExceptionDelegate outOfMemoryDelegate,
56                                                                                 ExceptionDelegate overflowDelegate,
57                                                                                 ExceptionDelegate systemExceptionDelegate);
58         
59                         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterExceptionArgumentCallbacks_NDalic")]
60                         public static extern void SWIGRegisterExceptionCallbacksArgument_NDalic(
61                                                                                 ExceptionArgumentDelegate argumentDelegate,
62                                                                                 ExceptionArgumentDelegate argumentNullDelegate,
63                                                                                 ExceptionArgumentDelegate argumentOutOfRangeDelegate);
64                         static void SetPendingApplicationException(string message)
65                         {
66                                 SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve()));
67                         }
68                         static void SetPendingArithmeticException(string message)
69                         {
70                                 SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve()));
71                         }
72                         static void SetPendingDivideByZeroException(string message)
73                         {
74                                 SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve()));
75                         }
76                         static void SetPendingIndexOutOfRangeException(string message)
77                         {
78                                 SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve()));
79                         }
80                         static void SetPendingInvalidCastException(string message)
81                         {
82                                 SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve()));
83                         }
84                         static void SetPendingInvalidOperationException(string message)
85                         {
86                                 SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve()));
87                         }
88                         static void SetPendingIOException(string message)
89                         {
90                                 SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve()));
91                         }
92                         static void SetPendingNullReferenceException(string message)
93                         {
94                                 SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve()));
95                         }
96                         static void SetPendingOutOfMemoryException(string message)
97                         {
98                                 SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve()));
99                         }
100                         static void SetPendingOverflowException(string message)
101                         {
102                                 SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve()));
103                         }
104                         static void SetPendingSystemException(string message)
105                         {
106                                 SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve()));
107                         }
108         
109                         static void SetPendingArgumentException(string message, string paramName)
110                         {
111                                 SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve()));
112                         }
113                         static void SetPendingArgumentNullException(string message, string paramName)
114                         {
115                                 global::System.Exception e = SWIGPendingException.Retrieve();
116                                 if (e != null) message = message + " Inner Exception: " + e.Message;
117                                 SWIGPendingException.Set(new global::System.ArgumentNullException(message, paramName));
118                         }
119                         static void SetPendingArgumentOutOfRangeException(string message, string paramName)
120                         {
121                                 global::System.Exception e = SWIGPendingException.Retrieve();
122                                 if (e != null) message = message + " Inner Exception: " + e.Message;
123                                 SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message));
124                         }
125                         static SWIGExceptionHelper()
126                         {
127                                 SWIGRegisterExceptionCallbacks_NDalic(
128                                                                                   applicationDelegate,
129                                                                                   arithmeticDelegate,
130                                                                                   divideByZeroDelegate,
131                                                                                   indexOutOfRangeDelegate,
132                                                                                   invalidCastDelegate,
133                                                                                   invalidOperationDelegate,
134                                                                                   ioDelegate,
135                                                                                   nullReferenceDelegate,
136                                                                                   outOfMemoryDelegate,
137                                                                                   overflowDelegate,
138                                                                                   systemDelegate);
139         
140                                 SWIGRegisterExceptionCallbacksArgument_NDalic(
141                                                                                   argumentDelegate,
142                                                                                   argumentNullDelegate,
143                                                                                   argumentOutOfRangeDelegate);
144                         }
145                 }
146                 protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper();
147
148         /// <since_tizen> 3 </since_tizen>
149         public class SWIGPendingException
150         {
151             [global::System.ThreadStatic]
152             private static global::System.Exception pendingException = null;
153             private static int numExceptionsPending = 0;
154
155             /// <since_tizen> 3 </since_tizen>
156             public static bool Pending
157             {
158                 get
159                 {
160                     bool pending = false;
161                     if (numExceptionsPending > 0)
162                         if (pendingException != null)
163                             pending = true;
164                     return pending;
165                 }
166             }
167
168             /// <since_tizen> 3 </since_tizen>
169             public static void Set(global::System.Exception e)
170             {
171                 if (pendingException != null)
172                     throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e);
173                 pendingException = e;
174                 lock (typeof(NDalicPINVOKE))
175                 {
176                     numExceptionsPending++;
177                 }
178             }
179
180             /// <since_tizen> 3 </since_tizen>
181             public static global::System.Exception Retrieve()
182             {
183                 global::System.Exception e = null;
184                 if (numExceptionsPending > 0)
185                 {
186                     if (pendingException != null)
187                     {
188                         e = pendingException;
189                         pendingException = null;
190                         lock (typeof(NDalicPINVOKE))
191                         {
192                             numExceptionsPending--;
193                         }
194                     }
195                 }
196                 return e;
197             }
198         }
199         public class SWIGStringHelper
200         {
201             /// <since_tizen> 3 </since_tizen>
202             public delegate string SWIGStringDelegate(string message);
203             static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString);
204
205             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterStringCallback_NDalic")]
206             public static extern void SWIGRegisterStringCallback_NDalic(SWIGStringDelegate stringDelegate);
207             static string CreateString(string cString)
208             {
209                 return cString;
210             }
211             static SWIGStringHelper()
212             {
213                 SWIGRegisterStringCallback_NDalic(stringDelegate);
214             }
215             public static void RegistCallback()
216             {
217                 SWIGRegisterStringCallback_NDalic(stringDelegate);
218             }
219         }
220         static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper();
221         static NDalicPINVOKE()
222         {
223             Tizen.Log.Error("NUI", "Create NDalicPINVOKE");
224         }
225
226                 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_BaseHandle")]
227                 public static extern void delete_BaseHandle(global::System.Runtime.InteropServices.HandleRef jarg1);
228
229         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_SWIGUpcast")]
230         public static extern global::System.IntPtr Application_SWIGUpcast(global::System.IntPtr jarg1);
231
232         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_New__MANUAL_4")]
233         public static extern global::System.IntPtr Application_New__MANUAL_4(int jarg1, string jarg2, string jarg3, int jarg4);
234
235         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_New_WithWindowSizePosition")]
236         public static extern global::System.IntPtr Application_New_WithWindowSizePosition(int jarg1, string jarg2, string jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5);
237
238         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_MainLoop__SWIG_0")]
239         public static extern void Application_MainLoop__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1);
240
241         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_InitSignal")]
242         public static extern global::System.IntPtr Application_InitSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
243
244         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_TerminateSignal")]
245         public static extern global::System.IntPtr Application_TerminateSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
246
247         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_PauseSignal")]
248         public static extern global::System.IntPtr Application_PauseSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
249
250         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_ResumeSignal")]
251         public static extern global::System.IntPtr Application_ResumeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
252
253         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_ResetSignal")]
254         public static extern global::System.IntPtr Application_ResetSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
255
256         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_ResizeSignal")]
257         public static extern global::System.IntPtr Application_ResizeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
258
259         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_AppControlSignal")]
260         public static extern global::System.IntPtr Application_AppControlSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
261
262         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_LanguageChangedSignal")]
263         public static extern global::System.IntPtr Application_LanguageChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
264
265         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_RegionChangedSignal")]
266         public static extern global::System.IntPtr Application_RegionChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
267
268         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_LowBatterySignal")]
269         public static extern global::System.IntPtr Application_LowBatterySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
270
271         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_LowMemorySignal")]
272         public static extern global::System.IntPtr Application_LowMemorySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
273     }
274 }