1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Gfx {
8 /// <summary>Efl Gfx Size Class interface</summary>
9 [ISizeClassNativeInherit]
10 public interface ISizeClass :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>Get width and height of size class.
14 /// 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>
15 /// <param name="size_class">The name of size class</param>
16 /// <param name="minw">minimum width</param>
17 /// <param name="minh">minimum height</param>
18 /// <param name="maxw">maximum width</param>
19 /// <param name="maxh">maximum height</param>
20 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
21 bool GetSizeClass( System.String size_class, out int minw, out int minh, out int maxw, out int maxh);
22 /// <summary>Set width and height of size class.
23 /// 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>
24 /// <param name="size_class">The name of size class</param>
25 /// <param name="minw">minimum width</param>
26 /// <param name="minh">minimum height</param>
27 /// <param name="maxw">maximum width</param>
28 /// <param name="maxh">maximum height</param>
29 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
30 bool SetSizeClass( System.String size_class, int minw, int minh, int maxw, int maxh);
31 /// <summary>Delete the size class.
32 /// This function deletes any values for the specified size class.
34 /// 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>
35 /// <param name="size_class">The size class to be deleted.</param>
36 /// <returns></returns>
37 void DelSizeClass( System.String size_class);
39 /// <summary>Efl Gfx Size Class interface</summary>
40 sealed public class ISizeClassConcrete :
45 ///<summary>Pointer to the native class description.</summary>
46 public System.IntPtr NativeClass {
48 if (((object)this).GetType() == typeof (ISizeClassConcrete))
49 return Efl.Gfx.ISizeClassNativeInherit.GetEflClassStatic();
51 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
54 private System.IntPtr handle;
55 ///<summary>Pointer to the native instance.</summary>
56 public System.IntPtr NativeHandle {
57 get { return handle; }
59 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
60 efl_gfx_size_class_interface_get();
61 ///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
62 private ISizeClassConcrete(System.IntPtr raw)
65 RegisterEventProxies();
67 ///<summary>Destructor.</summary>
72 ///<summary>Releases the underlying native instance.</summary>
73 void Dispose(bool disposing)
75 if (handle != System.IntPtr.Zero) {
76 Efl.Eo.Globals.efl_unref(handle);
77 handle = System.IntPtr.Zero;
80 ///<summary>Releases the underlying native instance.</summary>
84 GC.SuppressFinalize(this);
86 ///<summary>Verifies if the given object is equal to this one.</summary>
87 public override bool Equals(object obj)
89 var other = obj as Efl.Object;
92 return this.NativeHandle == other.NativeHandle;
94 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
95 public override int GetHashCode()
97 return this.NativeHandle.ToInt32();
99 ///<summary>Turns the native pointer into a string representation.</summary>
100 public override String ToString()
102 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
104 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
105 void RegisterEventProxies()
108 /// <summary>Get width and height of size class.
109 /// 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>
110 /// <param name="size_class">The name of size class</param>
111 /// <param name="minw">minimum width</param>
112 /// <param name="minh">minimum height</param>
113 /// <param name="maxw">maximum width</param>
114 /// <param name="maxh">maximum height</param>
115 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
116 public bool GetSizeClass( System.String size_class, out int minw, out int minh, out int maxw, out int maxh) {
117 var _ret_var = Efl.Gfx.ISizeClassNativeInherit.efl_gfx_size_class_get_ptr.Value.Delegate(this.NativeHandle, size_class, out minw, out minh, out maxw, out maxh);
118 Eina.Error.RaiseIfUnhandledException();
121 /// <summary>Set width and height of size class.
122 /// 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>
123 /// <param name="size_class">The name of size class</param>
124 /// <param name="minw">minimum width</param>
125 /// <param name="minh">minimum height</param>
126 /// <param name="maxw">maximum width</param>
127 /// <param name="maxh">maximum height</param>
128 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
129 public bool SetSizeClass( System.String size_class, int minw, int minh, int maxw, int maxh) {
130 var _ret_var = Efl.Gfx.ISizeClassNativeInherit.efl_gfx_size_class_set_ptr.Value.Delegate(this.NativeHandle, size_class, minw, minh, maxw, maxh);
131 Eina.Error.RaiseIfUnhandledException();
134 /// <summary>Delete the size class.
135 /// This function deletes any values for the specified size class.
137 /// 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>
138 /// <param name="size_class">The size class to be deleted.</param>
139 /// <returns></returns>
140 public void DelSizeClass( System.String size_class) {
141 Efl.Gfx.ISizeClassNativeInherit.efl_gfx_size_class_del_ptr.Value.Delegate(this.NativeHandle, size_class);
142 Eina.Error.RaiseIfUnhandledException();
144 private static IntPtr GetEflClassStatic()
146 return Efl.Gfx.ISizeClassConcrete.efl_gfx_size_class_interface_get();
149 public class ISizeClassNativeInherit : Efl.Eo.NativeClass{
150 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
151 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
153 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
154 var methods = Efl.Eo.Globals.GetUserMethods(type);
155 if (efl_gfx_size_class_get_static_delegate == null)
156 efl_gfx_size_class_get_static_delegate = new efl_gfx_size_class_get_delegate(size_class_get);
157 if (methods.FirstOrDefault(m => m.Name == "GetSizeClass") != null)
158 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)});
159 if (efl_gfx_size_class_set_static_delegate == null)
160 efl_gfx_size_class_set_static_delegate = new efl_gfx_size_class_set_delegate(size_class_set);
161 if (methods.FirstOrDefault(m => m.Name == "SetSizeClass") != null)
162 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)});
163 if (efl_gfx_size_class_del_static_delegate == null)
164 efl_gfx_size_class_del_static_delegate = new efl_gfx_size_class_del_delegate(size_class_del);
165 if (methods.FirstOrDefault(m => m.Name == "DelSizeClass") != null)
166 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)});
169 public override IntPtr GetEflClass()
171 return Efl.Gfx.ISizeClassConcrete.efl_gfx_size_class_interface_get();
173 public static IntPtr GetEflClassStatic()
175 return Efl.Gfx.ISizeClassConcrete.efl_gfx_size_class_interface_get();
179 [return: MarshalAs(UnmanagedType.U1)] 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);
182 [return: MarshalAs(UnmanagedType.U1)] 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);
183 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");
184 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)
186 Eina.Log.Debug("function efl_gfx_size_class_get was called");
187 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
188 if(wrapper != null) {
189 minw = default(int); minh = default(int); maxw = default(int); maxh = default(int); bool _ret_var = default(bool);
191 _ret_var = ((ISizeClass)wrapper).GetSizeClass( size_class, out minw, out minh, out maxw, out maxh);
192 } catch (Exception e) {
193 Eina.Log.Warning($"Callback error: {e.ToString()}");
194 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
198 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);
201 private static efl_gfx_size_class_get_delegate efl_gfx_size_class_get_static_delegate;
204 [return: MarshalAs(UnmanagedType.U1)] 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);
207 [return: MarshalAs(UnmanagedType.U1)] 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);
208 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");
209 private static bool size_class_set(System.IntPtr obj, System.IntPtr pd, System.String size_class, int minw, int minh, int maxw, int maxh)
211 Eina.Log.Debug("function efl_gfx_size_class_set was called");
212 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
213 if(wrapper != null) {
214 bool _ret_var = default(bool);
216 _ret_var = ((ISizeClass)wrapper).SetSizeClass( size_class, minw, minh, maxw, maxh);
217 } catch (Exception e) {
218 Eina.Log.Warning($"Callback error: {e.ToString()}");
219 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
223 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);
226 private static efl_gfx_size_class_set_delegate efl_gfx_size_class_set_static_delegate;
229 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);
232 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);
233 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");
234 private static void size_class_del(System.IntPtr obj, System.IntPtr pd, System.String size_class)
236 Eina.Log.Debug("function efl_gfx_size_class_del was called");
237 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
238 if(wrapper != null) {
241 ((ISizeClass)wrapper).DelSizeClass( size_class);
242 } catch (Exception e) {
243 Eina.Log.Warning($"Callback error: {e.ToString()}");
244 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
247 efl_gfx_size_class_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), size_class);
250 private static efl_gfx_size_class_del_delegate efl_gfx_size_class_del_static_delegate;