1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
10 /// <summary>Efl screen interface
11 /// (Since EFL 1.22)</summary>
12 [Efl.IScreenConcrete.NativeMethods]
13 public interface IScreen :
14 Efl.Eo.IWrapper, IDisposable
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.
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 {
45 /// <summary>Get screen scaling factor.
46 /// This is the factor by which window contents will be scaled on the screen.
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 {
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>
62 /// <summary>Efl screen interface
63 /// (Since EFL 1.22)</summary>
64 sealed public class IScreenConcrete :
69 ///<summary>Pointer to the native class description.</summary>
70 public override System.IntPtr NativeClass
74 if (((object)this).GetType() == typeof(IScreenConcrete))
76 return GetEflClassStatic();
80 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
85 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
86 efl_screen_interface_get();
87 /// <summary>Initializes a new instance of the <see cref="IScreen"/> class.
88 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
89 private IScreenConcrete(System.IntPtr raw) : base(raw)
93 /// <summary>Get screen size (in pixels) for the screen.
94 /// Note that on some display systems this information is not available and a value of 0x0 will be returned.
95 /// (Since EFL 1.22)</summary>
96 /// <returns>The screen size in pixels.</returns>
97 public Eina.Size2D GetScreenSizeInPixels() {
98 var _ret_var = Efl.IScreenConcrete.NativeMethods.efl_screen_size_in_pixels_get_ptr.Value.Delegate(this.NativeHandle);
99 Eina.Error.RaiseIfUnhandledException();
102 /// <summary>Get screen scaling factor.
103 /// This is the factor by which window contents will be scaled on the screen.
105 /// Note that on some display systems this information is not available and a value of 1.0 will be returned.
106 /// (Since EFL 1.22)</summary>
107 /// <returns>The screen scaling factor.</returns>
108 public float GetScreenScaleFactor() {
109 var _ret_var = Efl.IScreenConcrete.NativeMethods.efl_screen_scale_factor_get_ptr.Value.Delegate(this.NativeHandle);
110 Eina.Error.RaiseIfUnhandledException();
113 /// <summary>Get the rotation of the screen.
114 /// Most engines only return multiples of 90.
115 /// (Since EFL 1.22)</summary>
116 /// <returns>Screen rotation in degrees.</returns>
117 public int GetScreenRotation() {
118 var _ret_var = Efl.IScreenConcrete.NativeMethods.efl_screen_rotation_get_ptr.Value.Delegate(this.NativeHandle);
119 Eina.Error.RaiseIfUnhandledException();
122 /// <summary>Get the pixel density in DPI (Dots Per Inch) for the screen that a window is on.
123 /// (Since EFL 1.22)</summary>
124 /// <param name="xdpi">Horizontal DPI.</param>
125 /// <param name="ydpi">Vertical DPI.</param>
126 public void GetScreenDpi(out int xdpi, out int ydpi) {
127 Efl.IScreenConcrete.NativeMethods.efl_screen_dpi_get_ptr.Value.Delegate(this.NativeHandle,out xdpi, out ydpi);
128 Eina.Error.RaiseIfUnhandledException();
130 /// <summary>Get screen size (in pixels) for the screen.
131 /// Note that on some display systems this information is not available and a value of 0x0 will be returned.
132 /// (Since EFL 1.22)</summary>
133 /// <value>The screen size in pixels.</value>
134 public Eina.Size2D ScreenSizeInPixels {
135 get { return GetScreenSizeInPixels(); }
137 /// <summary>Get screen scaling factor.
138 /// This is the factor by which window contents will be scaled on the screen.
140 /// Note that on some display systems this information is not available and a value of 1.0 will be returned.
141 /// (Since EFL 1.22)</summary>
142 /// <value>The screen scaling factor.</value>
143 public float ScreenScaleFactor {
144 get { return GetScreenScaleFactor(); }
146 /// <summary>Get the rotation of the screen.
147 /// Most engines only return multiples of 90.
148 /// (Since EFL 1.22)</summary>
149 /// <value>Screen rotation in degrees.</value>
150 public int ScreenRotation {
151 get { return GetScreenRotation(); }
153 private static IntPtr GetEflClassStatic()
155 return Efl.IScreenConcrete.efl_screen_interface_get();
157 /// <summary>Wrapper for native methods and virtual method delegates.
158 /// For internal use by generated code only.</summary>
159 public class NativeMethods : Efl.Eo.NativeClass
161 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
162 /// <summary>Gets the list of Eo operations to override.</summary>
163 /// <returns>The list of Eo operations to be overload.</returns>
164 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
166 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
167 var methods = Efl.Eo.Globals.GetUserMethods(type);
169 if (efl_screen_size_in_pixels_get_static_delegate == null)
171 efl_screen_size_in_pixels_get_static_delegate = new efl_screen_size_in_pixels_get_delegate(screen_size_in_pixels_get);
174 if (methods.FirstOrDefault(m => m.Name == "GetScreenSizeInPixels") != null)
176 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) });
179 if (efl_screen_scale_factor_get_static_delegate == null)
181 efl_screen_scale_factor_get_static_delegate = new efl_screen_scale_factor_get_delegate(screen_scale_factor_get);
184 if (methods.FirstOrDefault(m => m.Name == "GetScreenScaleFactor") != null)
186 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) });
189 if (efl_screen_rotation_get_static_delegate == null)
191 efl_screen_rotation_get_static_delegate = new efl_screen_rotation_get_delegate(screen_rotation_get);
194 if (methods.FirstOrDefault(m => m.Name == "GetScreenRotation") != null)
196 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) });
199 if (efl_screen_dpi_get_static_delegate == null)
201 efl_screen_dpi_get_static_delegate = new efl_screen_dpi_get_delegate(screen_dpi_get);
204 if (methods.FirstOrDefault(m => m.Name == "GetScreenDpi") != null)
206 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) });
211 /// <summary>Returns the Eo class for the native methods of this class.</summary>
212 /// <returns>The native class pointer.</returns>
213 public override IntPtr GetEflClass()
215 return Efl.IScreenConcrete.efl_screen_interface_get();
218 #pragma warning disable CA1707, CS1591, SA1300, SA1600
221 private delegate Eina.Size2D.NativeStruct efl_screen_size_in_pixels_get_delegate(System.IntPtr obj, System.IntPtr pd);
224 public delegate Eina.Size2D.NativeStruct efl_screen_size_in_pixels_get_api_delegate(System.IntPtr obj);
226 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");
228 private static Eina.Size2D.NativeStruct screen_size_in_pixels_get(System.IntPtr obj, System.IntPtr pd)
230 Eina.Log.Debug("function efl_screen_size_in_pixels_get was called");
231 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
234 Eina.Size2D _ret_var = default(Eina.Size2D);
237 _ret_var = ((IScreen)ws.Target).GetScreenSizeInPixels();
241 Eina.Log.Warning($"Callback error: {e.ToString()}");
242 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
250 return efl_screen_size_in_pixels_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
254 private static efl_screen_size_in_pixels_get_delegate efl_screen_size_in_pixels_get_static_delegate;
257 private delegate float efl_screen_scale_factor_get_delegate(System.IntPtr obj, System.IntPtr pd);
260 public delegate float efl_screen_scale_factor_get_api_delegate(System.IntPtr obj);
262 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");
264 private static float screen_scale_factor_get(System.IntPtr obj, System.IntPtr pd)
266 Eina.Log.Debug("function efl_screen_scale_factor_get was called");
267 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
270 float _ret_var = default(float);
273 _ret_var = ((IScreen)ws.Target).GetScreenScaleFactor();
277 Eina.Log.Warning($"Callback error: {e.ToString()}");
278 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
286 return efl_screen_scale_factor_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
290 private static efl_screen_scale_factor_get_delegate efl_screen_scale_factor_get_static_delegate;
293 private delegate int efl_screen_rotation_get_delegate(System.IntPtr obj, System.IntPtr pd);
296 public delegate int efl_screen_rotation_get_api_delegate(System.IntPtr obj);
298 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");
300 private static int screen_rotation_get(System.IntPtr obj, System.IntPtr pd)
302 Eina.Log.Debug("function efl_screen_rotation_get was called");
303 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
306 int _ret_var = default(int);
309 _ret_var = ((IScreen)ws.Target).GetScreenRotation();
313 Eina.Log.Warning($"Callback error: {e.ToString()}");
314 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
322 return efl_screen_rotation_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
326 private static efl_screen_rotation_get_delegate efl_screen_rotation_get_static_delegate;
329 private delegate void efl_screen_dpi_get_delegate(System.IntPtr obj, System.IntPtr pd, out int xdpi, out int ydpi);
332 public delegate void efl_screen_dpi_get_api_delegate(System.IntPtr obj, out int xdpi, out int ydpi);
334 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");
336 private static void screen_dpi_get(System.IntPtr obj, System.IntPtr pd, out int xdpi, out int ydpi)
338 Eina.Log.Debug("function efl_screen_dpi_get was called");
339 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
342 xdpi = default(int); ydpi = default(int);
345 ((IScreen)ws.Target).GetScreenDpi(out xdpi, out ydpi);
349 Eina.Log.Warning($"Callback error: {e.ToString()}");
350 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
357 efl_screen_dpi_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), out xdpi, out ydpi);
361 private static efl_screen_dpi_get_delegate efl_screen_dpi_get_static_delegate;
363 #pragma warning restore CA1707, CS1591, SA1300, SA1600