[NUI] Support Device orientation and window orientation event.
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Interop / NDalicPINVOKE.cs
1 /*
2  * Copyright(c) 2021 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 using System;
19 using System.ComponentModel;
20
21 namespace Tizen.NUI
22 {
23     class NDalicPINVOKE
24     {
25         public const string Lib = "libdali2-csharp-binder.so";
26         protected class SWIGExceptionHelper
27         {
28             /// <since_tizen> 3 </since_tizen>
29             public delegate void ExceptionDelegate(string message);
30             /// <since_tizen> 3 </since_tizen>
31             public delegate void ExceptionArgumentDelegate(string message, string paramName);
32             static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException);
33             static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException);
34             static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException);
35             static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException);
36             static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException);
37             static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException);
38             static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException);
39             static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException);
40             static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException);
41             static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException);
42             static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException);
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(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterExceptionCallbacks_NDalic")]
48             public static extern void SWIGRegisterExceptionCallbacksNDalic(
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             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterExceptionArgumentCallbacks_NDalic")]
62             public static extern void SWIGRegisterExceptionArgumentCallbacksNDalic(
63                                         ExceptionArgumentDelegate argumentDelegate,
64                                         ExceptionArgumentDelegate argumentNullDelegate,
65                                         ExceptionArgumentDelegate argumentOutOfRangeDelegate);
66             static void SetPendingApplicationException(string message)
67             {
68                 SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve()));
69             }
70             static void SetPendingArithmeticException(string message)
71             {
72                 SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve()));
73             }
74             static void SetPendingDivideByZeroException(string message)
75             {
76                 SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve()));
77             }
78             static void SetPendingIndexOutOfRangeException(string message)
79             {
80                 SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve()));
81             }
82             static void SetPendingInvalidCastException(string message)
83             {
84                 SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve()));
85             }
86             static void SetPendingInvalidOperationException(string message)
87             {
88                 SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve()));
89             }
90             static void SetPendingIOException(string message)
91             {
92                 SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve()));
93             }
94             static void SetPendingNullReferenceException(string message)
95             {
96                 SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve()));
97             }
98             static void SetPendingOutOfMemoryException(string message)
99             {
100                 SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve()));
101             }
102             static void SetPendingOverflowException(string message)
103             {
104                 SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve()));
105             }
106             static void SetPendingSystemException(string message)
107             {
108                 SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve()));
109             }
110
111             static void SetPendingArgumentException(string message, string paramName)
112             {
113                 SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve()));
114             }
115             static void SetPendingArgumentNullException(string message, string paramName)
116             {
117                 global::System.Exception e = SWIGPendingException.Retrieve();
118                 if (e != null) message = message + " Inner Exception: " + e.Message;
119                 SWIGPendingException.Set(new global::System.ArgumentNullException(message, paramName));
120             }
121             static void SetPendingArgumentOutOfRangeException(string message, string paramName)
122             {
123                 global::System.Exception e = SWIGPendingException.Retrieve();
124                 if (e != null) message = message + " Inner Exception: " + e.Message;
125                 SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message));
126             }
127             static SWIGExceptionHelper()
128             {
129                 SWIGRegisterExceptionCallbacksNDalic(
130                                           applicationDelegate,
131                                           arithmeticDelegate,
132                                           divideByZeroDelegate,
133                                           indexOutOfRangeDelegate,
134                                           invalidCastDelegate,
135                                           invalidOperationDelegate,
136                                           ioDelegate,
137                                           nullReferenceDelegate,
138                                           outOfMemoryDelegate,
139                                           overflowDelegate,
140                                           systemDelegate);
141
142                 SWIGRegisterExceptionArgumentCallbacksNDalic(
143                                           argumentDelegate,
144                                           argumentNullDelegate,
145                                           argumentOutOfRangeDelegate);
146             }
147         }
148         protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper();
149
150         /// <since_tizen> 3 </since_tizen>
151         public class SWIGPendingException
152         {
153             [global::System.ThreadStatic]
154             private static global::System.Exception pendingException = null;
155             private static int numExceptionsPending = 0;
156             private static readonly object exceptionPendingLock = new object();
157
158             /// <since_tizen> 3 </since_tizen>
159             public static bool Pending
160             {
161                 get
162                 {
163                     bool pending = false;
164                     if (numExceptionsPending > 0)
165                         if (pendingException != null)
166                             pending = true;
167                     return pending;
168                 }
169             }
170
171             /// <since_tizen> 3 </since_tizen>
172             public static void Set(global::System.Exception e)
173             {
174                 if (pendingException != null)
175                     throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e);
176                 pendingException = e;
177                 lock (exceptionPendingLock)
178                 {
179                     numExceptionsPending++;
180                 }
181             }
182
183             /// <since_tizen> 3 </since_tizen>
184             public static global::System.Exception Retrieve()
185             {
186                 global::System.Exception e = null;
187                 if (numExceptionsPending > 0)
188                 {
189                     if (pendingException != null)
190                     {
191                         e = pendingException;
192                         pendingException = null;
193                         lock (exceptionPendingLock)
194                         {
195                             numExceptionsPending--;
196                         }
197                     }
198                 }
199                 if (e == null)
200                 {
201                     e = new global::System.ApplicationException($"FATAL: Exception e is null, numExceptionsPending : {numExceptionsPending}");
202                 }
203                 return e;
204             }
205         }
206         public class SWIGStringHelper
207         {
208             /// <since_tizen> 3 </since_tizen>
209             public delegate string SWIGStringDelegate(string message);
210             static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString);
211
212             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterStringCallback_NDalic")]
213             public static extern void SWIGRegisterStringCallbackNDalic(SWIGStringDelegate stringDelegate);
214             static string CreateString(string cString)
215             {
216                 return cString;
217             }
218             static SWIGStringHelper()
219             {
220                 SWIGRegisterStringCallbackNDalic(stringDelegate);
221             }
222
223             [Obsolete("Do not use this, that is deprecated in API9 and will be removed in API11. Delete this if currently used.")]
224             [EditorBrowsable(EditorBrowsableState.Never)]
225             public static void RegistCallback()
226             {
227                 //do nothing!
228             }
229         }
230         static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper();
231         static NDalicPINVOKE()
232         {
233         }
234
235         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_BaseHandle")]
236         public static extern void DeleteBaseHandle(global::System.Runtime.InteropServices.HandleRef jarg1);
237
238         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_SWIGUpcast")]
239         public static extern global::System.IntPtr ApplicationUpcast(global::System.IntPtr jarg1);
240
241         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_New__MANUAL_4")]
242         public static extern global::System.IntPtr ApplicationNewManual4(int jarg1, string jarg2, string jarg3, int jarg4);
243
244         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_New_WithWindowSizePosition")]
245         public static extern global::System.IntPtr ApplicationNewWithWindowSizePosition(int jarg1, string jarg2, string jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5);
246
247         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_MainLoop__SWIG_0")]
248         public static extern void ApplicationMainLoop(global::System.Runtime.InteropServices.HandleRef jarg1);
249
250         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_InitSignal")]
251         public static extern global::System.IntPtr ApplicationInitSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
252
253         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_TerminateSignal")]
254         public static extern global::System.IntPtr ApplicationTerminateSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
255
256         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_PauseSignal")]
257         public static extern global::System.IntPtr ApplicationPauseSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
258
259         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_ResumeSignal")]
260         public static extern global::System.IntPtr ApplicationResumeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
261
262         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_ResetSignal")]
263         public static extern global::System.IntPtr ApplicationResetSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
264
265         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_AppControlSignal")]
266         public static extern global::System.IntPtr ApplicationAppControlSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
267
268         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_LanguageChangedSignal")]
269         public static extern global::System.IntPtr ApplicationLanguageChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
270
271         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_RegionChangedSignal")]
272         public static extern global::System.IntPtr ApplicationRegionChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
273
274         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_LowBatterySignal")]
275         public static extern global::System.IntPtr ApplicationLowBatterySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
276
277         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_LowMemorySignal")]
278         public static extern global::System.IntPtr ApplicationLowMemorySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
279
280         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_DeviceOrientationChangedSignal")]
281         public static extern global::System.IntPtr ApplicationDeviceOrientationChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
282
283         //Task
284         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_TaskInitSignal")]
285         public static extern global::System.IntPtr ApplicationTaskInitSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
286
287         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_TaskTerminateSignal")]
288         public static extern global::System.IntPtr ApplicationTaskTerminateSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
289
290         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_TaskAppControlSignal")]
291         public static extern global::System.IntPtr ApplicationTaskAppControlSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
292
293         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_TaskLanguageChangedSignal")]
294         public static extern global::System.IntPtr ApplicationTaskLanguageChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
295
296         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_TaskRegionChangedSignal")]
297         public static extern global::System.IntPtr ApplicationTaskRegionChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
298
299         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_TaskLowBatterySignal")]
300         public static extern global::System.IntPtr ApplicationTaskLowBatterySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
301
302         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_TaskLowMemorySignal")]
303         public static extern global::System.IntPtr ApplicationTaskLowMemorySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
304
305         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_TaskDeviceOrientationChangedSignal")]
306         public static extern global::System.IntPtr ApplicationTaskDeviceOrientationChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
307
308         [Obsolete("This has been deprecated in API9 and will be removed in API11. Use NDalicPINVOKE.DeleteBaseHandle(...) instead.")]
309         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_BaseHandle")]
310         public static extern void delete_BaseHandle(global::System.Runtime.InteropServices.HandleRef jarg1);
311     }
312 }