2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 using System.ComponentModel;
25 public const string Lib = "libdali2-csharp-binder.so";
26 protected class SWIGExceptionHelper
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);
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);
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)
68 SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve()));
70 static void SetPendingArithmeticException(string message)
72 SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve()));
74 static void SetPendingDivideByZeroException(string message)
76 SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve()));
78 static void SetPendingIndexOutOfRangeException(string message)
80 SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve()));
82 static void SetPendingInvalidCastException(string message)
84 SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve()));
86 static void SetPendingInvalidOperationException(string message)
88 SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve()));
90 static void SetPendingIOException(string message)
92 SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve()));
94 static void SetPendingNullReferenceException(string message)
96 SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve()));
98 static void SetPendingOutOfMemoryException(string message)
100 SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve()));
102 static void SetPendingOverflowException(string message)
104 SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve()));
106 static void SetPendingSystemException(string message)
108 SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve()));
111 static void SetPendingArgumentException(string message, string paramName)
113 SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve()));
115 static void SetPendingArgumentNullException(string message, string paramName)
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));
121 static void SetPendingArgumentOutOfRangeException(string message, string paramName)
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));
127 static SWIGExceptionHelper()
129 SWIGRegisterExceptionCallbacksNDalic(
132 divideByZeroDelegate,
133 indexOutOfRangeDelegate,
135 invalidOperationDelegate,
137 nullReferenceDelegate,
142 SWIGRegisterExceptionArgumentCallbacksNDalic(
144 argumentNullDelegate,
145 argumentOutOfRangeDelegate);
148 protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper();
150 /// <since_tizen> 3 </since_tizen>
151 public class SWIGPendingException
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();
158 /// <since_tizen> 3 </since_tizen>
159 public static bool Pending
163 bool pending = false;
164 if (numExceptionsPending > 0)
165 if (pendingException != null)
171 /// <since_tizen> 3 </since_tizen>
172 public static void Set(global::System.Exception e)
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)
179 numExceptionsPending++;
183 /// <since_tizen> 3 </since_tizen>
184 public static global::System.Exception Retrieve()
186 global::System.Exception e = null;
187 if (numExceptionsPending > 0)
189 if (pendingException != null)
191 e = pendingException;
192 pendingException = null;
193 lock (exceptionPendingLock)
195 numExceptionsPending--;
201 e = new global::System.ApplicationException($"FATAL: Exception e is null, numExceptionsPending : {numExceptionsPending}");
206 public class SWIGStringHelper
208 /// <since_tizen> 3 </since_tizen>
209 public delegate string SWIGStringDelegate(string message);
210 static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString);
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)
218 static SWIGStringHelper()
220 SWIGRegisterStringCallbackNDalic(stringDelegate);
223 [Obsolete("Please do not use! Deprecated in API9, will be removed in API11! Please delete this if currently used!")]
224 [EditorBrowsable(EditorBrowsableState.Never)]
225 public static void RegistCallback()
230 static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper();
231 static NDalicPINVOKE()
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
281 [Obsolete("Please do not use this! Deprecated in API9, will be removed in API11! Please use NDalicPINVOKE.DeleteBaseHandle(...) instead!")]
282 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_BaseHandle")]
283 public static extern void delete_BaseHandle(global::System.Runtime.InteropServices.HandleRef jarg1);