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>Page transition for <see cref="Efl.Ui.Pager"/>
13 /// A page transition is essential to <see cref="Efl.Ui.Pager"/> object and invoked whenever pages are rearranged or scrolled (see <see cref="Efl.Ui.Pager"/>).</summary>
14 [Efl.Page.Transition.NativeMethods]
15 public class Transition : Efl.Object, Efl.Eo.IWrapper
17 ///<summary>Pointer to the native class description.</summary>
18 public override System.IntPtr NativeClass
22 if (((object)this).GetType() == typeof(Transition))
24 return GetEflClassStatic();
28 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
33 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
34 efl_page_transition_class_get();
35 /// <summary>Initializes a new instance of the <see cref="Transition"/> class.</summary>
36 /// <param name="parent">Parent instance.</param>
37 public Transition(Efl.Object parent= null
38 ) : base(efl_page_transition_class_get(), typeof(Transition), parent)
40 FinishInstantiation();
43 /// <summary>Initializes a new instance of the <see cref="Transition"/> class.
44 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
45 /// <param name="raw">The native pointer to be wrapped.</param>
46 protected Transition(System.IntPtr raw) : base(raw)
50 /// <summary>Initializes a new instance of the <see cref="Transition"/> class.
51 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
52 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
53 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
54 /// <param name="parent">The Efl.Object parent of this instance.</param>
55 protected Transition(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
59 /// <summary>Verifies if the given object is equal to this one.</summary>
60 /// <param name="instance">The object to compare to.</param>
61 /// <returns>True if both objects point to the same native object.</returns>
62 public override bool Equals(object instance)
64 var other = instance as Efl.Object;
69 return this.NativeHandle == other.NativeHandle;
72 /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
73 /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
74 public override int GetHashCode()
76 return this.NativeHandle.ToInt32();
79 /// <summary>Turns the native pointer into a string representation.</summary>
80 /// <returns>A string with the type and the native pointer for this object.</returns>
81 public override String ToString()
83 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
86 /// <summary>set object</summary>
87 /// <param name="pager">pager object</param>
88 /// <param name="group">a dummy object for layer adjustment</param>
89 virtual public void Bind(Efl.Ui.Pager pager, Efl.Canvas.Group group) {
90 Efl.Page.Transition.NativeMethods.efl_page_transition_bind_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),pager, group);
91 Eina.Error.RaiseIfUnhandledException();
93 private static IntPtr GetEflClassStatic()
95 return Efl.Page.Transition.efl_page_transition_class_get();
97 /// <summary>Wrapper for native methods and virtual method delegates.
98 /// For internal use by generated code only.</summary>
99 public new class NativeMethods : Efl.Object.NativeMethods
101 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
102 /// <summary>Gets the list of Eo operations to override.</summary>
103 /// <returns>The list of Eo operations to be overload.</returns>
104 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
106 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
107 var methods = Efl.Eo.Globals.GetUserMethods(type);
109 if (efl_page_transition_bind_static_delegate == null)
111 efl_page_transition_bind_static_delegate = new efl_page_transition_bind_delegate(bind);
114 if (methods.FirstOrDefault(m => m.Name == "Bind") != null)
116 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_page_transition_bind"), func = Marshal.GetFunctionPointerForDelegate(efl_page_transition_bind_static_delegate) });
119 descs.AddRange(base.GetEoOps(type));
122 /// <summary>Returns the Eo class for the native methods of this class.</summary>
123 /// <returns>The native class pointer.</returns>
124 public override IntPtr GetEflClass()
126 return Efl.Page.Transition.efl_page_transition_class_get();
129 #pragma warning disable CA1707, SA1300, SA1600
132 private delegate void efl_page_transition_bind_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Ui.Pager pager, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Canvas.Group group);
135 public delegate void efl_page_transition_bind_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Ui.Pager pager, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Canvas.Group group);
137 public static Efl.Eo.FunctionWrapper<efl_page_transition_bind_api_delegate> efl_page_transition_bind_ptr = new Efl.Eo.FunctionWrapper<efl_page_transition_bind_api_delegate>(Module, "efl_page_transition_bind");
139 private static void bind(System.IntPtr obj, System.IntPtr pd, Efl.Ui.Pager pager, Efl.Canvas.Group group)
141 Eina.Log.Debug("function efl_page_transition_bind was called");
142 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
148 ((Transition)wrapper).Bind(pager, group);
152 Eina.Log.Warning($"Callback error: {e.ToString()}");
153 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
160 efl_page_transition_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), pager, group);
164 private static efl_page_transition_bind_delegate efl_page_transition_bind_static_delegate;
166 #pragma warning restore CA1707, SA1300, SA1600