1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
12 /// <summary>Efl Gfx Size Class interface</summary>
13 [Efl.Gfx.ISizeClassConcrete.NativeMethods]
14 public interface ISizeClass :
15 Efl.Eo.IWrapper, IDisposable
17 /// <summary>Get width and height of size class.
18 /// This function gets width and height for a size class. These values will only be valid until the size class is changed or the edje object is deleted.</summary>
19 /// <param name="size_class">The name of size class</param>
20 /// <param name="minw">minimum width</param>
21 /// <param name="minh">minimum height</param>
22 /// <param name="maxw">maximum width</param>
23 /// <param name="maxh">maximum height</param>
24 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
25 bool GetSizeClass(System.String size_class, out int minw, out int minh, out int maxw, out int maxh);
26 /// <summary>Set width and height of size class.
27 /// This function sets width and height for a size class. This will make all edje parts in the specified object that have the specified size class update their size with given values.</summary>
28 /// <param name="size_class">The name of size class</param>
29 /// <param name="minw">minimum width</param>
30 /// <param name="minh">minimum height</param>
31 /// <param name="maxw">maximum width</param>
32 /// <param name="maxh">maximum height</param>
33 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
34 bool SetSizeClass(System.String size_class, int minw, int minh, int maxw, int maxh);
35 /// <summary>Delete the size class.
36 /// This function deletes any values for the specified size class.
38 /// Deleting the size class will revert it to the values defined by <see cref="Efl.Gfx.ISizeClass.GetSizeClass"/> or the size class defined in the theme file.</summary>
39 /// <param name="size_class">The size class to be deleted.</param>
40 void DelSizeClass(System.String size_class);
42 /// <summary>Efl Gfx Size Class interface</summary>
43 sealed public class ISizeClassConcrete :
48 ///<summary>Pointer to the native class description.</summary>
49 public System.IntPtr NativeClass
53 if (((object)this).GetType() == typeof(ISizeClassConcrete))
55 return GetEflClassStatic();
59 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
64 private System.IntPtr handle;
65 ///<summary>Pointer to the native instance.</summary>
66 public System.IntPtr NativeHandle
68 get { return handle; }
71 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
72 efl_gfx_size_class_interface_get();
73 /// <summary>Initializes a new instance of the <see cref="ISizeClass"/> class.
74 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
75 private ISizeClassConcrete(System.IntPtr raw)
79 ///<summary>Destructor.</summary>
85 ///<summary>Releases the underlying native instance.</summary>
86 private void Dispose(bool disposing)
88 if (handle != System.IntPtr.Zero)
93 IntPtr gcHandlePtr = IntPtr.Zero;
96 Efl.Eo.Globals.efl_mono_native_dispose(h, gcHandlePtr);
100 Monitor.Enter(Efl.All.InitLock);
101 if (Efl.All.MainLoopInitialized)
103 Efl.Eo.Globals.efl_mono_thread_safe_native_dispose(h, gcHandlePtr);
106 Monitor.Exit(Efl.All.InitLock);
112 ///<summary>Releases the underlying native instance.</summary>
113 public void Dispose()
116 GC.SuppressFinalize(this);
119 /// <summary>Verifies if the given object is equal to this one.</summary>
120 /// <param name="instance">The object to compare to.</param>
121 /// <returns>True if both objects point to the same native object.</returns>
122 public override bool Equals(object instance)
124 var other = instance as Efl.Object;
129 return this.NativeHandle == other.NativeHandle;
132 /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
133 /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
134 public override int GetHashCode()
136 return this.NativeHandle.ToInt32();
139 /// <summary>Turns the native pointer into a string representation.</summary>
140 /// <returns>A string with the type and the native pointer for this object.</returns>
141 public override String ToString()
143 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
146 /// <summary>Get width and height of size class.
147 /// This function gets width and height for a size class. These values will only be valid until the size class is changed or the edje object is deleted.</summary>
148 /// <param name="size_class">The name of size class</param>
149 /// <param name="minw">minimum width</param>
150 /// <param name="minh">minimum height</param>
151 /// <param name="maxw">maximum width</param>
152 /// <param name="maxh">maximum height</param>
153 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
154 public bool GetSizeClass(System.String size_class, out int minw, out int minh, out int maxw, out int maxh) {
155 var _ret_var = Efl.Gfx.ISizeClassConcrete.NativeMethods.efl_gfx_size_class_get_ptr.Value.Delegate(this.NativeHandle,size_class, out minw, out minh, out maxw, out maxh);
156 Eina.Error.RaiseIfUnhandledException();
159 /// <summary>Set width and height of size class.
160 /// This function sets width and height for a size class. This will make all edje parts in the specified object that have the specified size class update their size with given values.</summary>
161 /// <param name="size_class">The name of size class</param>
162 /// <param name="minw">minimum width</param>
163 /// <param name="minh">minimum height</param>
164 /// <param name="maxw">maximum width</param>
165 /// <param name="maxh">maximum height</param>
166 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
167 public bool SetSizeClass(System.String size_class, int minw, int minh, int maxw, int maxh) {
168 var _ret_var = Efl.Gfx.ISizeClassConcrete.NativeMethods.efl_gfx_size_class_set_ptr.Value.Delegate(this.NativeHandle,size_class, minw, minh, maxw, maxh);
169 Eina.Error.RaiseIfUnhandledException();
172 /// <summary>Delete the size class.
173 /// This function deletes any values for the specified size class.
175 /// Deleting the size class will revert it to the values defined by <see cref="Efl.Gfx.ISizeClass.GetSizeClass"/> or the size class defined in the theme file.</summary>
176 /// <param name="size_class">The size class to be deleted.</param>
177 public void DelSizeClass(System.String size_class) {
178 Efl.Gfx.ISizeClassConcrete.NativeMethods.efl_gfx_size_class_del_ptr.Value.Delegate(this.NativeHandle,size_class);
179 Eina.Error.RaiseIfUnhandledException();
181 private static IntPtr GetEflClassStatic()
183 return Efl.Gfx.ISizeClassConcrete.efl_gfx_size_class_interface_get();
185 /// <summary>Wrapper for native methods and virtual method delegates.
186 /// For internal use by generated code only.</summary>
187 public class NativeMethods : Efl.Eo.NativeClass
189 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
190 /// <summary>Gets the list of Eo operations to override.</summary>
191 /// <returns>The list of Eo operations to be overload.</returns>
192 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
194 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
195 var methods = Efl.Eo.Globals.GetUserMethods(type);
197 if (efl_gfx_size_class_get_static_delegate == null)
199 efl_gfx_size_class_get_static_delegate = new efl_gfx_size_class_get_delegate(size_class_get);
202 if (methods.FirstOrDefault(m => m.Name == "GetSizeClass") != null)
204 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_size_class_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_size_class_get_static_delegate) });
207 if (efl_gfx_size_class_set_static_delegate == null)
209 efl_gfx_size_class_set_static_delegate = new efl_gfx_size_class_set_delegate(size_class_set);
212 if (methods.FirstOrDefault(m => m.Name == "SetSizeClass") != null)
214 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_size_class_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_size_class_set_static_delegate) });
217 if (efl_gfx_size_class_del_static_delegate == null)
219 efl_gfx_size_class_del_static_delegate = new efl_gfx_size_class_del_delegate(size_class_del);
222 if (methods.FirstOrDefault(m => m.Name == "DelSizeClass") != null)
224 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_size_class_del"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_size_class_del_static_delegate) });
229 /// <summary>Returns the Eo class for the native methods of this class.</summary>
230 /// <returns>The native class pointer.</returns>
231 public override IntPtr GetEflClass()
233 return Efl.Gfx.ISizeClassConcrete.efl_gfx_size_class_interface_get();
236 #pragma warning disable CA1707, SA1300, SA1600
238 [return: MarshalAs(UnmanagedType.U1)]
239 private delegate bool efl_gfx_size_class_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String size_class, out int minw, out int minh, out int maxw, out int maxh);
241 [return: MarshalAs(UnmanagedType.U1)]
242 public delegate bool efl_gfx_size_class_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String size_class, out int minw, out int minh, out int maxw, out int maxh);
244 public static Efl.Eo.FunctionWrapper<efl_gfx_size_class_get_api_delegate> efl_gfx_size_class_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_size_class_get_api_delegate>(Module, "efl_gfx_size_class_get");
246 private static bool size_class_get(System.IntPtr obj, System.IntPtr pd, System.String size_class, out int minw, out int minh, out int maxw, out int maxh)
248 Eina.Log.Debug("function efl_gfx_size_class_get was called");
249 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
252 minw = default(int); minh = default(int); maxw = default(int); maxh = default(int); bool _ret_var = default(bool);
255 _ret_var = ((ISizeClass)wrapper).GetSizeClass(size_class, out minw, out minh, out maxw, out maxh);
259 Eina.Log.Warning($"Callback error: {e.ToString()}");
260 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
268 return efl_gfx_size_class_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), size_class, out minw, out minh, out maxw, out maxh);
272 private static efl_gfx_size_class_get_delegate efl_gfx_size_class_get_static_delegate;
274 [return: MarshalAs(UnmanagedType.U1)]
275 private delegate bool efl_gfx_size_class_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String size_class, int minw, int minh, int maxw, int maxh);
277 [return: MarshalAs(UnmanagedType.U1)]
278 public delegate bool efl_gfx_size_class_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String size_class, int minw, int minh, int maxw, int maxh);
280 public static Efl.Eo.FunctionWrapper<efl_gfx_size_class_set_api_delegate> efl_gfx_size_class_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_size_class_set_api_delegate>(Module, "efl_gfx_size_class_set");
282 private static bool size_class_set(System.IntPtr obj, System.IntPtr pd, System.String size_class, int minw, int minh, int maxw, int maxh)
284 Eina.Log.Debug("function efl_gfx_size_class_set was called");
285 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
288 bool _ret_var = default(bool);
291 _ret_var = ((ISizeClass)wrapper).SetSizeClass(size_class, minw, minh, maxw, maxh);
295 Eina.Log.Warning($"Callback error: {e.ToString()}");
296 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
304 return efl_gfx_size_class_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), size_class, minw, minh, maxw, maxh);
308 private static efl_gfx_size_class_set_delegate efl_gfx_size_class_set_static_delegate;
311 private delegate void efl_gfx_size_class_del_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String size_class);
314 public delegate void efl_gfx_size_class_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String size_class);
316 public static Efl.Eo.FunctionWrapper<efl_gfx_size_class_del_api_delegate> efl_gfx_size_class_del_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_size_class_del_api_delegate>(Module, "efl_gfx_size_class_del");
318 private static void size_class_del(System.IntPtr obj, System.IntPtr pd, System.String size_class)
320 Eina.Log.Debug("function efl_gfx_size_class_del was called");
321 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
327 ((ISizeClass)wrapper).DelSizeClass(size_class);
331 Eina.Log.Warning($"Callback error: {e.ToString()}");
332 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
339 efl_gfx_size_class_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), size_class);
343 private static efl_gfx_size_class_del_delegate efl_gfx_size_class_del_static_delegate;
345 #pragma warning restore CA1707, SA1300, SA1600