2 * Copyright(c) 2018 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.
23 public const string Lib = "libdali2-csharp-binder.so";
24 protected class SWIGExceptionHelper
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);
45 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterExceptionCallbacks_NDalic")]
46 public static extern void SWIGRegisterExceptionCallbacksNDalic(
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);
59 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterExceptionArgumentCallbacks_NDalic")]
60 public static extern void SWIGRegisterExceptionArgumentCallbacksNDalic(
61 ExceptionArgumentDelegate argumentDelegate,
62 ExceptionArgumentDelegate argumentNullDelegate,
63 ExceptionArgumentDelegate argumentOutOfRangeDelegate);
64 static void SetPendingApplicationException(string message)
66 SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve()));
68 static void SetPendingArithmeticException(string message)
70 SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve()));
72 static void SetPendingDivideByZeroException(string message)
74 SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve()));
76 static void SetPendingIndexOutOfRangeException(string message)
78 SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve()));
80 static void SetPendingInvalidCastException(string message)
82 SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve()));
84 static void SetPendingInvalidOperationException(string message)
86 SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve()));
88 static void SetPendingIOException(string message)
90 SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve()));
92 static void SetPendingNullReferenceException(string message)
94 SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve()));
96 static void SetPendingOutOfMemoryException(string message)
98 SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve()));
100 static void SetPendingOverflowException(string message)
102 SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve()));
104 static void SetPendingSystemException(string message)
106 SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve()));
109 static void SetPendingArgumentException(string message, string paramName)
111 SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve()));
113 static void SetPendingArgumentNullException(string message, string paramName)
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));
119 static void SetPendingArgumentOutOfRangeException(string message, string paramName)
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));
125 static SWIGExceptionHelper()
127 SWIGRegisterExceptionCallbacksNDalic(
130 divideByZeroDelegate,
131 indexOutOfRangeDelegate,
133 invalidOperationDelegate,
135 nullReferenceDelegate,
140 SWIGRegisterExceptionArgumentCallbacksNDalic(
142 argumentNullDelegate,
143 argumentOutOfRangeDelegate);
146 protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper();
148 /// <since_tizen> 3 </since_tizen>
149 public class SWIGPendingException
151 [global::System.ThreadStatic]
152 private static global::System.Exception pendingException = null;
153 private static int numExceptionsPending = 0;
154 private static readonly object exceptionPendingLock = new object();
156 /// <since_tizen> 3 </since_tizen>
157 public static bool Pending
161 bool pending = false;
162 if (numExceptionsPending > 0)
163 if (pendingException != null)
169 /// <since_tizen> 3 </since_tizen>
170 public static void Set(global::System.Exception e)
172 if (pendingException != null)
173 throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e);
174 pendingException = e;
175 lock (exceptionPendingLock)
177 numExceptionsPending++;
181 /// <since_tizen> 3 </since_tizen>
182 public static global::System.Exception Retrieve()
184 global::System.Exception e = null;
185 if (numExceptionsPending > 0)
187 if (pendingException != null)
189 e = pendingException;
190 pendingException = null;
191 lock (exceptionPendingLock)
193 numExceptionsPending--;
199 e = new global::System.ApplicationException($"FATAL: Exception e is null, numExceptionsPending : {numExceptionsPending}");
204 public class SWIGStringHelper
206 /// <since_tizen> 3 </since_tizen>
207 public delegate string SWIGStringDelegate(string message);
208 static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString);
210 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterStringCallback_NDalic")]
211 public static extern void SWIGRegisterStringCallbackNDalic(SWIGStringDelegate stringDelegate);
212 static string CreateString(string cString)
216 static SWIGStringHelper()
218 SWIGRegisterStringCallbackNDalic(stringDelegate);
221 static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper();
222 static NDalicPINVOKE()
226 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_BaseHandle")]
227 public static extern void DeleteBaseHandle(global::System.Runtime.InteropServices.HandleRef jarg1);
229 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_SWIGUpcast")]
230 public static extern global::System.IntPtr ApplicationUpcast(global::System.IntPtr jarg1);
232 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_New__MANUAL_4")]
233 public static extern global::System.IntPtr ApplicationNewManual4(int jarg1, string jarg2, string jarg3, int jarg4);
235 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_New_WithWindowSizePosition")]
236 public static extern global::System.IntPtr ApplicationNewWithWindowSizePosition(int jarg1, string jarg2, string jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5);
238 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_MainLoop__SWIG_0")]
239 public static extern void ApplicationMainLoop(global::System.Runtime.InteropServices.HandleRef jarg1);
241 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_InitSignal")]
242 public static extern global::System.IntPtr ApplicationInitSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
244 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_TerminateSignal")]
245 public static extern global::System.IntPtr ApplicationTerminateSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
247 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_PauseSignal")]
248 public static extern global::System.IntPtr ApplicationPauseSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
250 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_ResumeSignal")]
251 public static extern global::System.IntPtr ApplicationResumeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
253 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_ResetSignal")]
254 public static extern global::System.IntPtr ApplicationResetSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
256 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_AppControlSignal")]
257 public static extern global::System.IntPtr ApplicationAppControlSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
259 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_LanguageChangedSignal")]
260 public static extern global::System.IntPtr ApplicationLanguageChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
262 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_RegionChangedSignal")]
263 public static extern global::System.IntPtr ApplicationRegionChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
265 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_LowBatterySignal")]
266 public static extern global::System.IntPtr ApplicationLowBatterySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
268 [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_LowMemorySignal")]
269 public static extern global::System.IntPtr ApplicationLowMemorySignal(global::System.Runtime.InteropServices.HandleRef jarg1);