1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Page {
8 /// <summary>Page transition for <see cref="Efl.Ui.Pager"/>
9 /// 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>
10 [TransitionNativeInherit]
11 public class Transition : Efl.Object, Efl.Eo.IWrapper
13 ///<summary>Pointer to the native class description.</summary>
14 public override System.IntPtr NativeClass {
16 if (((object)this).GetType() == typeof (Transition))
17 return Efl.Page.TransitionNativeInherit.GetEflClassStatic();
19 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
22 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
23 efl_page_transition_class_get();
24 ///<summary>Creates a new instance.</summary>
25 ///<param name="parent">Parent instance.</param>
26 public Transition(Efl.Object parent= null
28 base(efl_page_transition_class_get(), typeof(Transition), parent)
30 FinishInstantiation();
32 ///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
33 protected Transition(System.IntPtr raw) : base(raw)
35 RegisterEventProxies();
37 ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
38 protected Transition(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
39 ///<summary>Verifies if the given object is equal to this one.</summary>
40 public override bool Equals(object obj)
42 var other = obj as Efl.Object;
45 return this.NativeHandle == other.NativeHandle;
47 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
48 public override int GetHashCode()
50 return this.NativeHandle.ToInt32();
52 ///<summary>Turns the native pointer into a string representation.</summary>
53 public override String ToString()
55 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
57 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
58 protected override void RegisterEventProxies()
60 base.RegisterEventProxies();
62 /// <summary>set object</summary>
63 /// <param name="pager">pager object</param>
64 /// <param name="group">a dummy object for layer adjustment</param>
65 /// <returns></returns>
66 virtual public void Bind( Efl.Ui.Pager pager, Efl.Canvas.Group group) {
67 Efl.Page.TransitionNativeInherit.efl_page_transition_bind_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), pager, group);
68 Eina.Error.RaiseIfUnhandledException();
70 private static IntPtr GetEflClassStatic()
72 return Efl.Page.Transition.efl_page_transition_class_get();
75 public class TransitionNativeInherit : Efl.ObjectNativeInherit{
76 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
77 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
79 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
80 var methods = Efl.Eo.Globals.GetUserMethods(type);
81 if (efl_page_transition_bind_static_delegate == null)
82 efl_page_transition_bind_static_delegate = new efl_page_transition_bind_delegate(bind);
83 if (methods.FirstOrDefault(m => m.Name == "Bind") != null)
84 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)});
85 descs.AddRange(base.GetEoOps(type));
88 public override IntPtr GetEflClass()
90 return Efl.Page.Transition.efl_page_transition_class_get();
92 public static new IntPtr GetEflClassStatic()
94 return Efl.Page.Transition.efl_page_transition_class_get();
98 private delegate void efl_page_transition_bind_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Ui.Pager, Efl.Eo.NonOwnTag>))] Efl.Ui.Pager pager, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Group, Efl.Eo.NonOwnTag>))] Efl.Canvas.Group group);
101 public delegate void efl_page_transition_bind_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Ui.Pager, Efl.Eo.NonOwnTag>))] Efl.Ui.Pager pager, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Group, Efl.Eo.NonOwnTag>))] Efl.Canvas.Group group);
102 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");
103 private static void bind(System.IntPtr obj, System.IntPtr pd, Efl.Ui.Pager pager, Efl.Canvas.Group group)
105 Eina.Log.Debug("function efl_page_transition_bind was called");
106 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
107 if(wrapper != null) {
110 ((Transition)wrapper).Bind( pager, group);
111 } catch (Exception e) {
112 Eina.Log.Warning($"Callback error: {e.ToString()}");
113 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
116 efl_page_transition_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), pager, group);
119 private static efl_page_transition_bind_delegate efl_page_transition_bind_static_delegate;