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 public interface IItem :
15 Efl.Eo.IWrapper, IDisposable
17 /// <summary>Get the memory size associated with an object.</summary>
18 /// <returns>Bytes of memory consumed by this object.</returns>
20 /// <summary>Get the memory size associated with an object.</summary>
21 /// <value>Bytes of memory consumed by this object.</value>
26 /// <summary>Efl Cached Item interface</summary>
27 sealed public class IItemConcrete :
32 ///<summary>Pointer to the native class description.</summary>
33 public override System.IntPtr NativeClass
37 if (((object)this).GetType() == typeof(IItemConcrete))
39 return GetEflClassStatic();
43 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
48 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
49 efl_cached_item_interface_get();
50 /// <summary>Initializes a new instance of the <see cref="IItem"/> class.
51 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
52 private IItemConcrete(System.IntPtr raw) : base(raw)
56 /// <summary>Get the memory size associated with an object.</summary>
57 /// <returns>Bytes of memory consumed by this object.</returns>
58 public uint GetMemorySize() {
59 var _ret_var = Efl.Cached.IItemConcrete.NativeMethods.efl_cached_item_memory_size_get_ptr.Value.Delegate(this.NativeHandle);
60 Eina.Error.RaiseIfUnhandledException();
63 /// <summary>Get the memory size associated with an object.</summary>
64 /// <value>Bytes of memory consumed by this object.</value>
65 public uint MemorySize {
66 get { return GetMemorySize(); }
68 private static IntPtr GetEflClassStatic()
70 return Efl.Cached.IItemConcrete.efl_cached_item_interface_get();
72 /// <summary>Wrapper for native methods and virtual method delegates.
73 /// For internal use by generated code only.</summary>
74 public class NativeMethods : Efl.Eo.NativeClass
76 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
77 /// <summary>Gets the list of Eo operations to override.</summary>
78 /// <returns>The list of Eo operations to be overload.</returns>
79 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
81 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
82 var methods = Efl.Eo.Globals.GetUserMethods(type);
84 if (efl_cached_item_memory_size_get_static_delegate == null)
86 efl_cached_item_memory_size_get_static_delegate = new efl_cached_item_memory_size_get_delegate(memory_size_get);
89 if (methods.FirstOrDefault(m => m.Name == "GetMemorySize") != null)
91 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) });
96 /// <summary>Returns the Eo class for the native methods of this class.</summary>
97 /// <returns>The native class pointer.</returns>
98 public override IntPtr GetEflClass()
100 return Efl.Cached.IItemConcrete.efl_cached_item_interface_get();
103 #pragma warning disable CA1707, CS1591, SA1300, SA1600
106 private delegate uint efl_cached_item_memory_size_get_delegate(System.IntPtr obj, System.IntPtr pd);
109 public delegate uint efl_cached_item_memory_size_get_api_delegate(System.IntPtr obj);
111 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");
113 private static uint memory_size_get(System.IntPtr obj, System.IntPtr pd)
115 Eina.Log.Debug("function efl_cached_item_memory_size_get was called");
116 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
119 uint _ret_var = default(uint);
122 _ret_var = ((IItem)ws.Target).GetMemorySize();
126 Eina.Log.Warning($"Callback error: {e.ToString()}");
127 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
135 return efl_cached_item_memory_size_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
139 private static efl_cached_item_memory_size_get_delegate efl_cached_item_memory_size_get_static_delegate;
141 #pragma warning restore CA1707, CS1591, SA1300, SA1600