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>An interface for duplication of objects.
12 /// Objects implementing this interface can be duplicated with <see cref="Efl.IDuplicate.Duplicate"/>.</summary>
13 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
14 [Efl.IDuplicateConcrete.NativeMethods]
15 [Efl.Eo.BindingEntity]
16 public interface IDuplicate :
17 Efl.Eo.IWrapper, IDisposable
19 /// <summary>Creates a carbon copy of this object and returns it.
20 /// The newly created object will have no event handlers or anything of the sort.</summary>
21 /// <returns>Returned carbon copy</returns>
22 Efl.IDuplicate Duplicate();
24 /// <summary>An interface for duplication of objects.
25 /// Objects implementing this interface can be duplicated with <see cref="Efl.IDuplicate.Duplicate"/>.</summary>
26 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
27 sealed public class IDuplicateConcrete :
32 /// <summary>Pointer to the native class description.</summary>
33 public override System.IntPtr NativeClass
37 if (((object)this).GetType() == typeof(IDuplicateConcrete))
39 return GetEflClassStatic();
43 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
48 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
49 /// Do not call this constructor directly.</summary>
50 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
51 private IDuplicateConcrete(ConstructingHandle ch) : base(ch)
55 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
56 efl_duplicate_interface_get();
57 /// <summary>Initializes a new instance of the <see cref="IDuplicate"/> 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 IDuplicateConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
64 /// <summary>Creates a carbon copy of this object and returns it.
65 /// The newly created object will have no event handlers or anything of the sort.</summary>
66 /// <returns>Returned carbon copy</returns>
67 public Efl.IDuplicate Duplicate() {
68 var _ret_var = Efl.IDuplicateConcrete.NativeMethods.efl_duplicate_ptr.Value.Delegate(this.NativeHandle);
69 Eina.Error.RaiseIfUnhandledException();
72 private static IntPtr GetEflClassStatic()
74 return Efl.IDuplicateConcrete.efl_duplicate_interface_get();
76 /// <summary>Wrapper for native methods and virtual method delegates.
77 /// For internal use by generated code only.</summary>
78 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
80 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
81 /// <summary>Gets the list of Eo operations to override.</summary>
82 /// <returns>The list of Eo operations to be overload.</returns>
83 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
85 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
86 var methods = Efl.Eo.Globals.GetUserMethods(type);
88 if (efl_duplicate_static_delegate == null)
90 efl_duplicate_static_delegate = new efl_duplicate_delegate(duplicate);
93 if (methods.FirstOrDefault(m => m.Name == "Duplicate") != null)
95 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_duplicate"), func = Marshal.GetFunctionPointerForDelegate(efl_duplicate_static_delegate) });
100 /// <summary>Returns the Eo class for the native methods of this class.</summary>
101 /// <returns>The native class pointer.</returns>
102 public override IntPtr GetEflClass()
104 return Efl.IDuplicateConcrete.efl_duplicate_interface_get();
107 #pragma warning disable CA1707, CS1591, SA1300, SA1600
109 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
110 private delegate Efl.IDuplicate efl_duplicate_delegate(System.IntPtr obj, System.IntPtr pd);
112 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
113 public delegate Efl.IDuplicate efl_duplicate_api_delegate(System.IntPtr obj);
115 public static Efl.Eo.FunctionWrapper<efl_duplicate_api_delegate> efl_duplicate_ptr = new Efl.Eo.FunctionWrapper<efl_duplicate_api_delegate>(Module, "efl_duplicate");
117 private static Efl.IDuplicate duplicate(System.IntPtr obj, System.IntPtr pd)
119 Eina.Log.Debug("function efl_duplicate was called");
120 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
123 Efl.IDuplicate _ret_var = default(Efl.IDuplicate);
126 _ret_var = ((IDuplicate)ws.Target).Duplicate();
130 Eina.Log.Warning($"Callback error: {e.ToString()}");
131 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
139 return efl_duplicate_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
143 private static efl_duplicate_delegate efl_duplicate_static_delegate;
145 #pragma warning restore CA1707, CS1591, SA1300, SA1600
152 #pragma warning disable CS1591
153 public static class EflIDuplicateConcrete_ExtensionMethods {
155 #pragma warning restore CS1591