2 #pragma warning disable CS1591
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
7 using System.Threading;
8 using System.ComponentModel;
11 /// <summary>Interface for objects supporting named parts.
12 /// An object implementing this interface will be able to provide access to some of its sub-objects by name. This gives access to parts as defined in a widget's theme.
14 /// Part proxy objects have a special lifetime that is limited to one and only one function call. This behavior is implemented in efl_part() which call Efl.Part.part_get(). Calling Efl.Part.part_get() directly should be avoided.
16 /// In other words, the caller does not hold a reference to this proxy object. It may be possible, in languages that allow it, to get an extra reference to this part object and extend its lifetime to more than a single function call.
18 /// In pseudo-code, this means only the following two use cases are supported:
20 /// obj.func(part(obj, "part"), args)
24 /// part = ref(part(obj, "part")) func1(part, args) func2(part, args) func3(part, args) unref(part)
25 /// (Since EFL 1.22)</summary>
26 [Efl.IPartConcrete.NativeMethods]
27 [Efl.Eo.BindingEntity]
28 public interface IPart :
29 Efl.Eo.IWrapper, IDisposable
31 /// <summary>Get a proxy object referring to a part of an object.
32 /// (Since EFL 1.22)</summary>
33 /// <param name="name">The part name.</param>
34 /// <returns>A (proxy) object, valid for a single call.</returns>
35 Efl.Object GetPart(System.String name);
37 /// <summary>Interface for objects supporting named parts.
38 /// An object implementing this interface will be able to provide access to some of its sub-objects by name. This gives access to parts as defined in a widget's theme.
40 /// Part proxy objects have a special lifetime that is limited to one and only one function call. This behavior is implemented in efl_part() which call Efl.Part.part_get(). Calling Efl.Part.part_get() directly should be avoided.
42 /// In other words, the caller does not hold a reference to this proxy object. It may be possible, in languages that allow it, to get an extra reference to this part object and extend its lifetime to more than a single function call.
44 /// In pseudo-code, this means only the following two use cases are supported:
46 /// obj.func(part(obj, "part"), args)
50 /// part = ref(part(obj, "part")) func1(part, args) func2(part, args) func3(part, args) unref(part)
51 /// (Since EFL 1.22)</summary>
52 sealed public class IPartConcrete :
57 /// <summary>Pointer to the native class description.</summary>
58 public override System.IntPtr NativeClass
62 if (((object)this).GetType() == typeof(IPartConcrete))
64 return GetEflClassStatic();
68 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
73 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
74 /// Do not call this constructor directly.</summary>
75 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
76 private IPartConcrete(ConstructingHandle ch) : base(ch)
80 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
81 efl_part_interface_get();
82 /// <summary>Initializes a new instance of the <see cref="IPart"/> class.
83 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
84 /// <param name="wh">The native pointer to be wrapped.</param>
85 private IPartConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
89 /// <summary>Get a proxy object referring to a part of an object.
90 /// (Since EFL 1.22)</summary>
91 /// <param name="name">The part name.</param>
92 /// <returns>A (proxy) object, valid for a single call.</returns>
93 public Efl.Object GetPart(System.String name) {
94 var _ret_var = Efl.IPartConcrete.NativeMethods.efl_part_get_ptr.Value.Delegate(this.NativeHandle,name);
95 Eina.Error.RaiseIfUnhandledException();
98 private static IntPtr GetEflClassStatic()
100 return Efl.IPartConcrete.efl_part_interface_get();
102 /// <summary>Wrapper for native methods and virtual method delegates.
103 /// For internal use by generated code only.</summary>
104 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
106 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
107 /// <summary>Gets the list of Eo operations to override.</summary>
108 /// <returns>The list of Eo operations to be overload.</returns>
109 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
111 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
112 var methods = Efl.Eo.Globals.GetUserMethods(type);
114 if (efl_part_get_static_delegate == null)
116 efl_part_get_static_delegate = new efl_part_get_delegate(part_get);
119 if (methods.FirstOrDefault(m => m.Name == "GetPart") != null)
121 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_part_get"), func = Marshal.GetFunctionPointerForDelegate(efl_part_get_static_delegate) });
126 /// <summary>Returns the Eo class for the native methods of this class.</summary>
127 /// <returns>The native class pointer.</returns>
128 public override IntPtr GetEflClass()
130 return Efl.IPartConcrete.efl_part_interface_get();
133 #pragma warning disable CA1707, CS1591, SA1300, SA1600
135 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
136 private delegate Efl.Object efl_part_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name);
138 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
139 public delegate Efl.Object efl_part_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name);
141 public static Efl.Eo.FunctionWrapper<efl_part_get_api_delegate> efl_part_get_ptr = new Efl.Eo.FunctionWrapper<efl_part_get_api_delegate>(Module, "efl_part_get");
143 private static Efl.Object part_get(System.IntPtr obj, System.IntPtr pd, System.String name)
145 Eina.Log.Debug("function efl_part_get was called");
146 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
149 Efl.Object _ret_var = default(Efl.Object);
152 _ret_var = ((IPart)ws.Target).GetPart(name);
156 Eina.Log.Warning($"Callback error: {e.ToString()}");
157 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
165 return efl_part_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), name);
169 private static efl_part_get_delegate efl_part_get_static_delegate;
171 #pragma warning restore CA1707, CS1591, SA1300, SA1600
178 #pragma warning disable CS1591
179 public static class EflIPartConcrete_ExtensionMethods {
181 #pragma warning restore CS1591