Follow formatting NUI
[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 = "libdali2-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                 if (e == null)
197                 {
198                     e = new global::System.ApplicationException($"FATAL: Exception e is null, numExceptionsPending : {numExceptionsPending}");
199                 }
200                 return e;
201             }
202         }
203         public class SWIGStringHelper
204         {
205             /// <since_tizen> 3 </since_tizen>
206             public delegate string SWIGStringDelegate(string message);
207             static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString);
208
209             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterStringCallback_NDalic")]
210             public static extern void SWIGRegisterStringCallback_NDalic(SWIGStringDelegate stringDelegate);
211             static string CreateString(string cString)
212             {
213                 return cString;
214             }
215             static SWIGStringHelper()
216             {
217                 SWIGRegisterStringCallback_NDalic(stringDelegate);
218             }
219             public static void RegistCallback()
220             {
221                 SWIGRegisterStringCallback_NDalic(stringDelegate);
222             }
223         }
224         static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper();
225         static NDalicPINVOKE()
226         {
227             Tizen.Log.Error("NUI", "Create NDalicPINVOKE");
228         }
229
230         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_BaseHandle")]
231         public static extern void delete_BaseHandle(global::System.Runtime.InteropServices.HandleRef jarg1);
232
233         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_SWIGUpcast")]
234         public static extern global::System.IntPtr Application_SWIGUpcast(global::System.IntPtr jarg1);
235
236         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_New__MANUAL_4")]
237         public static extern global::System.IntPtr Application_New__MANUAL_4(int jarg1, string jarg2, string jarg3, int jarg4);
238
239         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_New_WithWindowSizePosition")]
240         public static extern global::System.IntPtr Application_New_WithWindowSizePosition(int jarg1, string jarg2, string jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5);
241
242         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_MainLoop__SWIG_0")]
243         public static extern void Application_MainLoop__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1);
244
245         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_InitSignal")]
246         public static extern global::System.IntPtr Application_InitSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
247
248         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_TerminateSignal")]
249         public static extern global::System.IntPtr Application_TerminateSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
250
251         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_PauseSignal")]
252         public static extern global::System.IntPtr Application_PauseSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
253
254         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_ResumeSignal")]
255         public static extern global::System.IntPtr Application_ResumeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
256
257         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_ResetSignal")]
258         public static extern global::System.IntPtr Application_ResetSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
259
260         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_AppControlSignal")]
261         public static extern global::System.IntPtr Application_AppControlSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
262
263         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_LanguageChangedSignal")]
264         public static extern global::System.IntPtr Application_LanguageChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
265
266         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_RegionChangedSignal")]
267         public static extern global::System.IntPtr Application_RegionChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
268
269         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_LowBatterySignal")]
270         public static extern global::System.IntPtr Application_LowBatterySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
271
272         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_LowMemorySignal")]
273         public static extern global::System.IntPtr Application_LowMemorySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
274     }
275 }