1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
10 /// <summary>An interface for duplication of objects.
11 /// Objects implementing this interface can be duplicated with <see cref="Efl.IDuplicate.Duplicate"/>.</summary>
12 [Efl.IDuplicateConcrete.NativeMethods]
13 public interface IDuplicate :
14 Efl.Eo.IWrapper, IDisposable
16 /// <summary>Creates a carbon copy of this object and returns it.
17 /// The newly created object will have no event handlers or anything of the sort.</summary>
18 /// <returns>Returned carbon copy</returns>
19 Efl.IDuplicate Duplicate();
21 /// <summary>An interface for duplication of objects.
22 /// Objects implementing this interface can be duplicated with <see cref="Efl.IDuplicate.Duplicate"/>.</summary>
23 sealed public class IDuplicateConcrete :
28 ///<summary>Pointer to the native class description.</summary>
29 public override System.IntPtr NativeClass
33 if (((object)this).GetType() == typeof(IDuplicateConcrete))
35 return GetEflClassStatic();
39 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
44 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
45 efl_duplicate_interface_get();
46 /// <summary>Initializes a new instance of the <see cref="IDuplicate"/> class.
47 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
48 private IDuplicateConcrete(System.IntPtr raw) : base(raw)
52 /// <summary>Creates a carbon copy of this object and returns it.
53 /// The newly created object will have no event handlers or anything of the sort.</summary>
54 /// <returns>Returned carbon copy</returns>
55 public Efl.IDuplicate Duplicate() {
56 var _ret_var = Efl.IDuplicateConcrete.NativeMethods.efl_duplicate_ptr.Value.Delegate(this.NativeHandle);
57 Eina.Error.RaiseIfUnhandledException();
60 private static IntPtr GetEflClassStatic()
62 return Efl.IDuplicateConcrete.efl_duplicate_interface_get();
64 /// <summary>Wrapper for native methods and virtual method delegates.
65 /// For internal use by generated code only.</summary>
66 public class NativeMethods : Efl.Eo.NativeClass
68 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
69 /// <summary>Gets the list of Eo operations to override.</summary>
70 /// <returns>The list of Eo operations to be overload.</returns>
71 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
73 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
74 var methods = Efl.Eo.Globals.GetUserMethods(type);
76 if (efl_duplicate_static_delegate == null)
78 efl_duplicate_static_delegate = new efl_duplicate_delegate(duplicate);
81 if (methods.FirstOrDefault(m => m.Name == "Duplicate") != null)
83 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_duplicate"), func = Marshal.GetFunctionPointerForDelegate(efl_duplicate_static_delegate) });
88 /// <summary>Returns the Eo class for the native methods of this class.</summary>
89 /// <returns>The native class pointer.</returns>
90 public override IntPtr GetEflClass()
92 return Efl.IDuplicateConcrete.efl_duplicate_interface_get();
95 #pragma warning disable CA1707, CS1591, SA1300, SA1600
97 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
98 private delegate Efl.IDuplicate efl_duplicate_delegate(System.IntPtr obj, System.IntPtr pd);
100 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
101 public delegate Efl.IDuplicate efl_duplicate_api_delegate(System.IntPtr obj);
103 public static Efl.Eo.FunctionWrapper<efl_duplicate_api_delegate> efl_duplicate_ptr = new Efl.Eo.FunctionWrapper<efl_duplicate_api_delegate>(Module, "efl_duplicate");
105 private static Efl.IDuplicate duplicate(System.IntPtr obj, System.IntPtr pd)
107 Eina.Log.Debug("function efl_duplicate was called");
108 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
111 Efl.IDuplicate _ret_var = default(Efl.IDuplicate);
114 _ret_var = ((IDuplicate)ws.Target).Duplicate();
118 Eina.Log.Warning($"Callback error: {e.ToString()}");
119 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
127 return efl_duplicate_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
131 private static efl_duplicate_delegate efl_duplicate_static_delegate;
133 #pragma warning restore CA1707, CS1591, SA1300, SA1600