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 Cached Item interface</summary>
13 [Efl.Cached.IItemConcrete.NativeMethods]
14 [Efl.Eo.BindingEntity]
15 public interface IItem :
16 Efl.Eo.IWrapper, IDisposable
18 /// <summary>Get the memory size associated with an object.</summary>
19 /// <returns>Bytes of memory consumed by this object.</returns>
21 /// <summary>Get the memory size associated with an object.</summary>
22 /// <value>Bytes of memory consumed by this object.</value>
27 /// <summary>Efl Cached Item interface</summary>
28 sealed public class IItemConcrete :
33 ///<summary>Pointer to the native class description.</summary>
34 public override System.IntPtr NativeClass
38 if (((object)this).GetType() == typeof(IItemConcrete))
40 return GetEflClassStatic();
44 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
49 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
50 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
51 private IItemConcrete(ConstructingHandle ch) : base(ch)
55 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
56 efl_cached_item_interface_get();
57 /// <summary>Initializes a new instance of the <see cref="IItem"/> class.
58 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
59 /// <param name="wh">The native pointer to be wrapped.</param>
60 private IItemConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
64 /// <summary>Get the memory size associated with an object.</summary>
65 /// <returns>Bytes of memory consumed by this object.</returns>
66 public uint GetMemorySize() {
67 var _ret_var = Efl.Cached.IItemConcrete.NativeMethods.efl_cached_item_memory_size_get_ptr.Value.Delegate(this.NativeHandle);
68 Eina.Error.RaiseIfUnhandledException();
71 /// <summary>Get the memory size associated with an object.</summary>
72 /// <value>Bytes of memory consumed by this object.</value>
73 public uint MemorySize {
74 get { return GetMemorySize(); }
76 private static IntPtr GetEflClassStatic()
78 return Efl.Cached.IItemConcrete.efl_cached_item_interface_get();
80 /// <summary>Wrapper for native methods and virtual method delegates.
81 /// For internal use by generated code only.</summary>
82 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
84 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
85 /// <summary>Gets the list of Eo operations to override.</summary>
86 /// <returns>The list of Eo operations to be overload.</returns>
87 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
89 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
90 var methods = Efl.Eo.Globals.GetUserMethods(type);
92 if (efl_cached_item_memory_size_get_static_delegate == null)
94 efl_cached_item_memory_size_get_static_delegate = new efl_cached_item_memory_size_get_delegate(memory_size_get);
97 if (methods.FirstOrDefault(m => m.Name == "GetMemorySize") != null)
99 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_cached_item_memory_size_get"), func = Marshal.GetFunctionPointerForDelegate(efl_cached_item_memory_size_get_static_delegate) });
104 /// <summary>Returns the Eo class for the native methods of this class.</summary>
105 /// <returns>The native class pointer.</returns>
106 public override IntPtr GetEflClass()
108 return Efl.Cached.IItemConcrete.efl_cached_item_interface_get();
111 #pragma warning disable CA1707, CS1591, SA1300, SA1600
114 private delegate uint efl_cached_item_memory_size_get_delegate(System.IntPtr obj, System.IntPtr pd);
117 public delegate uint efl_cached_item_memory_size_get_api_delegate(System.IntPtr obj);
119 public static Efl.Eo.FunctionWrapper<efl_cached_item_memory_size_get_api_delegate> efl_cached_item_memory_size_get_ptr = new Efl.Eo.FunctionWrapper<efl_cached_item_memory_size_get_api_delegate>(Module, "efl_cached_item_memory_size_get");
121 private static uint memory_size_get(System.IntPtr obj, System.IntPtr pd)
123 Eina.Log.Debug("function efl_cached_item_memory_size_get was called");
124 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
127 uint _ret_var = default(uint);
130 _ret_var = ((IItem)ws.Target).GetMemorySize();
134 Eina.Log.Warning($"Callback error: {e.ToString()}");
135 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
143 return efl_cached_item_memory_size_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
147 private static efl_cached_item_memory_size_get_delegate efl_cached_item_memory_size_get_static_delegate;
149 #pragma warning restore CA1707, CS1591, SA1300, SA1600