[EflSharp] Update Circle and efl cs files (#819)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_screen.eo.cs
1 #pragma warning disable CS1591
2 using System;
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Threading;
7 using System.ComponentModel;
8 namespace Efl {
9
10 /// <summary>Efl screen interface
11 /// (Since EFL 1.22)</summary>
12 [Efl.IScreenConcrete.NativeMethods]
13 public interface IScreen : 
14     Efl.Eo.IWrapper, IDisposable
15 {
16     /// <summary>Get screen size (in pixels) for the screen.
17 /// Note that on some display systems this information is not available and a value of 0x0 will be returned.
18 /// (Since EFL 1.22)</summary>
19 /// <returns>The screen size in pixels.</returns>
20 Eina.Size2D GetScreenSizeInPixels();
21     /// <summary>Get screen scaling factor.
22 /// This is the factor by which window contents will be scaled on the screen.
23 /// 
24 /// Note that on some display systems this information is not available and a value of 1.0 will be returned.
25 /// (Since EFL 1.22)</summary>
26 /// <returns>The screen scaling factor.</returns>
27 float GetScreenScaleFactor();
28     /// <summary>Get the rotation of the screen.
29 /// Most engines only return multiples of 90.
30 /// (Since EFL 1.22)</summary>
31 /// <returns>Screen rotation in degrees.</returns>
32 int GetScreenRotation();
33     /// <summary>Get the pixel density in DPI (Dots Per Inch) for the screen that a window is on.
34 /// (Since EFL 1.22)</summary>
35 /// <param name="xdpi">Horizontal DPI.</param>
36 /// <param name="ydpi">Vertical DPI.</param>
37 void GetScreenDpi(out int xdpi, out int ydpi);
38                     /// <summary>Get screen size (in pixels) for the screen.
39 /// Note that on some display systems this information is not available and a value of 0x0 will be returned.
40 /// (Since EFL 1.22)</summary>
41 /// <value>The screen size in pixels.</value>
42     Eina.Size2D ScreenSizeInPixels {
43         get ;
44     }
45     /// <summary>Get screen scaling factor.
46 /// This is the factor by which window contents will be scaled on the screen.
47 /// 
48 /// Note that on some display systems this information is not available and a value of 1.0 will be returned.
49 /// (Since EFL 1.22)</summary>
50 /// <value>The screen scaling factor.</value>
51     float ScreenScaleFactor {
52         get ;
53     }
54     /// <summary>Get the rotation of the screen.
55 /// Most engines only return multiples of 90.
56 /// (Since EFL 1.22)</summary>
57 /// <value>Screen rotation in degrees.</value>
58     int ScreenRotation {
59         get ;
60     }
61 }
62 /// <summary>Efl screen interface
63 /// (Since EFL 1.22)</summary>
64 sealed public class IScreenConcrete : 
65
66 IScreen
67     
68 {
69     ///<summary>Pointer to the native class description.</summary>
70     public System.IntPtr NativeClass
71     {
72         get
73         {
74             if (((object)this).GetType() == typeof(IScreenConcrete))
75             {
76                 return GetEflClassStatic();
77             }
78             else
79             {
80                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
81             }
82         }
83     }
84
85     private  System.IntPtr handle;
86     ///<summary>Pointer to the native instance.</summary>
87     public System.IntPtr NativeHandle
88     {
89         get { return handle; }
90     }
91
92     [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
93         efl_screen_interface_get();
94     /// <summary>Initializes a new instance of the <see cref="IScreen"/> class.
95     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
96     private IScreenConcrete(System.IntPtr raw)
97     {
98         handle = raw;
99     }
100     ///<summary>Destructor.</summary>
101     ~IScreenConcrete()
102     {
103         Dispose(false);
104     }
105
106     ///<summary>Releases the underlying native instance.</summary>
107     private void Dispose(bool disposing)
108     {
109         if (handle != System.IntPtr.Zero)
110         {
111             IntPtr h = handle;
112             handle = IntPtr.Zero;
113
114             IntPtr gcHandlePtr = IntPtr.Zero;
115             if (disposing)
116             {
117                 Efl.Eo.Globals.efl_mono_native_dispose(h, gcHandlePtr);
118             }
119             else
120             {
121                 Monitor.Enter(Efl.All.InitLock);
122                 if (Efl.All.MainLoopInitialized)
123                 {
124                     Efl.Eo.Globals.efl_mono_thread_safe_native_dispose(h, gcHandlePtr);
125                 }
126
127                 Monitor.Exit(Efl.All.InitLock);
128             }
129         }
130
131     }
132
133     ///<summary>Releases the underlying native instance.</summary>
134     public void Dispose()
135     {
136         Dispose(true);
137         GC.SuppressFinalize(this);
138     }
139
140     /// <summary>Verifies if the given object is equal to this one.</summary>
141     /// <param name="instance">The object to compare to.</param>
142     /// <returns>True if both objects point to the same native object.</returns>
143     public override bool Equals(object instance)
144     {
145         var other = instance as Efl.Object;
146         if (other == null)
147         {
148             return false;
149         }
150         return this.NativeHandle == other.NativeHandle;
151     }
152
153     /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
154     /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
155     public override int GetHashCode()
156     {
157         return this.NativeHandle.ToInt32();
158     }
159
160     /// <summary>Turns the native pointer into a string representation.</summary>
161     /// <returns>A string with the type and the native pointer for this object.</returns>
162     public override String ToString()
163     {
164         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
165     }
166
167     /// <summary>Get screen size (in pixels) for the screen.
168     /// Note that on some display systems this information is not available and a value of 0x0 will be returned.
169     /// (Since EFL 1.22)</summary>
170     /// <returns>The screen size in pixels.</returns>
171     public Eina.Size2D GetScreenSizeInPixels() {
172          var _ret_var = Efl.IScreenConcrete.NativeMethods.efl_screen_size_in_pixels_get_ptr.Value.Delegate(this.NativeHandle);
173         Eina.Error.RaiseIfUnhandledException();
174         return _ret_var;
175  }
176     /// <summary>Get screen scaling factor.
177     /// This is the factor by which window contents will be scaled on the screen.
178     /// 
179     /// Note that on some display systems this information is not available and a value of 1.0 will be returned.
180     /// (Since EFL 1.22)</summary>
181     /// <returns>The screen scaling factor.</returns>
182     public float GetScreenScaleFactor() {
183          var _ret_var = Efl.IScreenConcrete.NativeMethods.efl_screen_scale_factor_get_ptr.Value.Delegate(this.NativeHandle);
184         Eina.Error.RaiseIfUnhandledException();
185         return _ret_var;
186  }
187     /// <summary>Get the rotation of the screen.
188     /// Most engines only return multiples of 90.
189     /// (Since EFL 1.22)</summary>
190     /// <returns>Screen rotation in degrees.</returns>
191     public int GetScreenRotation() {
192          var _ret_var = Efl.IScreenConcrete.NativeMethods.efl_screen_rotation_get_ptr.Value.Delegate(this.NativeHandle);
193         Eina.Error.RaiseIfUnhandledException();
194         return _ret_var;
195  }
196     /// <summary>Get the pixel density in DPI (Dots Per Inch) for the screen that a window is on.
197     /// (Since EFL 1.22)</summary>
198     /// <param name="xdpi">Horizontal DPI.</param>
199     /// <param name="ydpi">Vertical DPI.</param>
200     public void GetScreenDpi(out int xdpi, out int ydpi) {
201                                                          Efl.IScreenConcrete.NativeMethods.efl_screen_dpi_get_ptr.Value.Delegate(this.NativeHandle,out xdpi, out ydpi);
202         Eina.Error.RaiseIfUnhandledException();
203                                          }
204     /// <summary>Get screen size (in pixels) for the screen.
205 /// Note that on some display systems this information is not available and a value of 0x0 will be returned.
206 /// (Since EFL 1.22)</summary>
207 /// <value>The screen size in pixels.</value>
208     public Eina.Size2D ScreenSizeInPixels {
209         get { return GetScreenSizeInPixels(); }
210     }
211     /// <summary>Get screen scaling factor.
212 /// This is the factor by which window contents will be scaled on the screen.
213 /// 
214 /// Note that on some display systems this information is not available and a value of 1.0 will be returned.
215 /// (Since EFL 1.22)</summary>
216 /// <value>The screen scaling factor.</value>
217     public float ScreenScaleFactor {
218         get { return GetScreenScaleFactor(); }
219     }
220     /// <summary>Get the rotation of the screen.
221 /// Most engines only return multiples of 90.
222 /// (Since EFL 1.22)</summary>
223 /// <value>Screen rotation in degrees.</value>
224     public int ScreenRotation {
225         get { return GetScreenRotation(); }
226     }
227     private static IntPtr GetEflClassStatic()
228     {
229         return Efl.IScreenConcrete.efl_screen_interface_get();
230     }
231     /// <summary>Wrapper for native methods and virtual method delegates.
232     /// For internal use by generated code only.</summary>
233     public class NativeMethods  : Efl.Eo.NativeClass
234     {
235         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Efl);
236         /// <summary>Gets the list of Eo operations to override.</summary>
237         /// <returns>The list of Eo operations to be overload.</returns>
238         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
239         {
240             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
241             var methods = Efl.Eo.Globals.GetUserMethods(type);
242
243             if (efl_screen_size_in_pixels_get_static_delegate == null)
244             {
245                 efl_screen_size_in_pixels_get_static_delegate = new efl_screen_size_in_pixels_get_delegate(screen_size_in_pixels_get);
246             }
247
248             if (methods.FirstOrDefault(m => m.Name == "GetScreenSizeInPixels") != null)
249             {
250                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_screen_size_in_pixels_get"), func = Marshal.GetFunctionPointerForDelegate(efl_screen_size_in_pixels_get_static_delegate) });
251             }
252
253             if (efl_screen_scale_factor_get_static_delegate == null)
254             {
255                 efl_screen_scale_factor_get_static_delegate = new efl_screen_scale_factor_get_delegate(screen_scale_factor_get);
256             }
257
258             if (methods.FirstOrDefault(m => m.Name == "GetScreenScaleFactor") != null)
259             {
260                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_screen_scale_factor_get"), func = Marshal.GetFunctionPointerForDelegate(efl_screen_scale_factor_get_static_delegate) });
261             }
262
263             if (efl_screen_rotation_get_static_delegate == null)
264             {
265                 efl_screen_rotation_get_static_delegate = new efl_screen_rotation_get_delegate(screen_rotation_get);
266             }
267
268             if (methods.FirstOrDefault(m => m.Name == "GetScreenRotation") != null)
269             {
270                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_screen_rotation_get"), func = Marshal.GetFunctionPointerForDelegate(efl_screen_rotation_get_static_delegate) });
271             }
272
273             if (efl_screen_dpi_get_static_delegate == null)
274             {
275                 efl_screen_dpi_get_static_delegate = new efl_screen_dpi_get_delegate(screen_dpi_get);
276             }
277
278             if (methods.FirstOrDefault(m => m.Name == "GetScreenDpi") != null)
279             {
280                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_screen_dpi_get"), func = Marshal.GetFunctionPointerForDelegate(efl_screen_dpi_get_static_delegate) });
281             }
282
283             return descs;
284         }
285         /// <summary>Returns the Eo class for the native methods of this class.</summary>
286         /// <returns>The native class pointer.</returns>
287         public override IntPtr GetEflClass()
288         {
289             return Efl.IScreenConcrete.efl_screen_interface_get();
290         }
291
292         #pragma warning disable CA1707, SA1300, SA1600
293
294         
295         private delegate Eina.Size2D.NativeStruct efl_screen_size_in_pixels_get_delegate(System.IntPtr obj, System.IntPtr pd);
296
297         
298         public delegate Eina.Size2D.NativeStruct efl_screen_size_in_pixels_get_api_delegate(System.IntPtr obj);
299
300         public static Efl.Eo.FunctionWrapper<efl_screen_size_in_pixels_get_api_delegate> efl_screen_size_in_pixels_get_ptr = new Efl.Eo.FunctionWrapper<efl_screen_size_in_pixels_get_api_delegate>(Module, "efl_screen_size_in_pixels_get");
301
302         private static Eina.Size2D.NativeStruct screen_size_in_pixels_get(System.IntPtr obj, System.IntPtr pd)
303         {
304             Eina.Log.Debug("function efl_screen_size_in_pixels_get was called");
305             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
306             if (wrapper != null)
307             {
308             Eina.Size2D _ret_var = default(Eina.Size2D);
309                 try
310                 {
311                     _ret_var = ((IScreen)wrapper).GetScreenSizeInPixels();
312                 }
313                 catch (Exception e)
314                 {
315                     Eina.Log.Warning($"Callback error: {e.ToString()}");
316                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
317                 }
318
319         return _ret_var;
320
321             }
322             else
323             {
324                 return efl_screen_size_in_pixels_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
325             }
326         }
327
328         private static efl_screen_size_in_pixels_get_delegate efl_screen_size_in_pixels_get_static_delegate;
329
330         
331         private delegate float efl_screen_scale_factor_get_delegate(System.IntPtr obj, System.IntPtr pd);
332
333         
334         public delegate float efl_screen_scale_factor_get_api_delegate(System.IntPtr obj);
335
336         public static Efl.Eo.FunctionWrapper<efl_screen_scale_factor_get_api_delegate> efl_screen_scale_factor_get_ptr = new Efl.Eo.FunctionWrapper<efl_screen_scale_factor_get_api_delegate>(Module, "efl_screen_scale_factor_get");
337
338         private static float screen_scale_factor_get(System.IntPtr obj, System.IntPtr pd)
339         {
340             Eina.Log.Debug("function efl_screen_scale_factor_get was called");
341             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
342             if (wrapper != null)
343             {
344             float _ret_var = default(float);
345                 try
346                 {
347                     _ret_var = ((IScreen)wrapper).GetScreenScaleFactor();
348                 }
349                 catch (Exception e)
350                 {
351                     Eina.Log.Warning($"Callback error: {e.ToString()}");
352                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
353                 }
354
355         return _ret_var;
356
357             }
358             else
359             {
360                 return efl_screen_scale_factor_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
361             }
362         }
363
364         private static efl_screen_scale_factor_get_delegate efl_screen_scale_factor_get_static_delegate;
365
366         
367         private delegate int efl_screen_rotation_get_delegate(System.IntPtr obj, System.IntPtr pd);
368
369         
370         public delegate int efl_screen_rotation_get_api_delegate(System.IntPtr obj);
371
372         public static Efl.Eo.FunctionWrapper<efl_screen_rotation_get_api_delegate> efl_screen_rotation_get_ptr = new Efl.Eo.FunctionWrapper<efl_screen_rotation_get_api_delegate>(Module, "efl_screen_rotation_get");
373
374         private static int screen_rotation_get(System.IntPtr obj, System.IntPtr pd)
375         {
376             Eina.Log.Debug("function efl_screen_rotation_get was called");
377             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
378             if (wrapper != null)
379             {
380             int _ret_var = default(int);
381                 try
382                 {
383                     _ret_var = ((IScreen)wrapper).GetScreenRotation();
384                 }
385                 catch (Exception e)
386                 {
387                     Eina.Log.Warning($"Callback error: {e.ToString()}");
388                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
389                 }
390
391         return _ret_var;
392
393             }
394             else
395             {
396                 return efl_screen_rotation_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
397             }
398         }
399
400         private static efl_screen_rotation_get_delegate efl_screen_rotation_get_static_delegate;
401
402         
403         private delegate void efl_screen_dpi_get_delegate(System.IntPtr obj, System.IntPtr pd,  out int xdpi,  out int ydpi);
404
405         
406         public delegate void efl_screen_dpi_get_api_delegate(System.IntPtr obj,  out int xdpi,  out int ydpi);
407
408         public static Efl.Eo.FunctionWrapper<efl_screen_dpi_get_api_delegate> efl_screen_dpi_get_ptr = new Efl.Eo.FunctionWrapper<efl_screen_dpi_get_api_delegate>(Module, "efl_screen_dpi_get");
409
410         private static void screen_dpi_get(System.IntPtr obj, System.IntPtr pd, out int xdpi, out int ydpi)
411         {
412             Eina.Log.Debug("function efl_screen_dpi_get was called");
413             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
414             if (wrapper != null)
415             {
416                         xdpi = default(int);        ydpi = default(int);                            
417                 try
418                 {
419                     ((IScreen)wrapper).GetScreenDpi(out xdpi, out ydpi);
420                 }
421                 catch (Exception e)
422                 {
423                     Eina.Log.Warning($"Callback error: {e.ToString()}");
424                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
425                 }
426
427                                         
428             }
429             else
430             {
431                 efl_screen_dpi_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), out xdpi, out ydpi);
432             }
433         }
434
435         private static efl_screen_dpi_get_delegate efl_screen_dpi_get_static_delegate;
436
437         #pragma warning restore CA1707, SA1300, SA1600
438
439 }
440 }
441 }
442