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