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 indicator
9 /// Page indicator is used with <see cref="Efl.Ui.Pager"/>. It is located on the top layer of pager widget and helps users to know the number of pages and the current page's index without scrolling.</summary>
10 [IndicatorNativeInherit]
11 public class Indicator : Efl.Object, Efl.Eo.IWrapper
13 public new static System.IntPtr klass = System.IntPtr.Zero;
14 public new static Efl.Page.IndicatorNativeInherit nativeInherit = new Efl.Page.IndicatorNativeInherit();
15 ///<summary>Pointer to the native class description.</summary>
16 public override System.IntPtr NativeClass {
18 if (((object)this).GetType() == typeof (Indicator))
19 return Efl.Page.IndicatorNativeInherit.GetEflClassStatic();
21 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
24 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
25 efl_page_indicator_class_get();
26 ///<summary>Creates a new instance.</summary>
27 ///<param name="parent">Parent instance.</param>
28 public Indicator(Efl.Object parent= null
30 base(efl_page_indicator_class_get(), typeof(Indicator), parent)
32 FinishInstantiation();
34 ///<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>
35 public Indicator(System.IntPtr raw) : base(raw)
37 register_event_proxies();
39 ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
40 protected Indicator(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
41 ///<summary>Casts obj into an instance of this type.</summary>
42 public new static Indicator static_cast(Efl.Object obj)
45 throw new System.ArgumentNullException("obj");
46 return new Indicator(obj.NativeHandle);
48 ///<summary>Verifies if the given object is equal to this one.</summary>
49 public override bool Equals(object obj)
51 var other = obj as Efl.Object;
54 return this.NativeHandle == other.NativeHandle;
56 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
57 public override int GetHashCode()
59 return this.NativeHandle.ToInt32();
61 ///<summary>Turns the native pointer into a string representation.</summary>
62 public override String ToString()
64 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
66 protected override void register_event_proxies()
68 base.register_event_proxies();
70 /// <summary>set object</summary>
71 /// <param name="pager">pager object</param>
72 /// <param name="group">a dummy object for layer adjustment</param>
73 /// <returns></returns>
74 virtual public void Bind( Efl.Ui.Pager pager, Efl.Canvas.Group group) {
75 Efl.Page.IndicatorNativeInherit.efl_page_indicator_bind_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), pager, group);
76 Eina.Error.RaiseIfUnhandledException();
78 private static new IntPtr GetEflClassStatic()
80 return Efl.Page.Indicator.efl_page_indicator_class_get();
83 public class IndicatorNativeInherit : Efl.ObjectNativeInherit{
84 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
85 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
87 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
88 if (efl_page_indicator_bind_static_delegate == null)
89 efl_page_indicator_bind_static_delegate = new efl_page_indicator_bind_delegate(bind);
90 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_page_indicator_bind"), func = Marshal.GetFunctionPointerForDelegate(efl_page_indicator_bind_static_delegate)});
91 descs.AddRange(base.GetEoOps(type));
94 public override IntPtr GetEflClass()
96 return Efl.Page.Indicator.efl_page_indicator_class_get();
98 public static new IntPtr GetEflClassStatic()
100 return Efl.Page.Indicator.efl_page_indicator_class_get();
104 private delegate void efl_page_indicator_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);
107 public delegate void efl_page_indicator_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);
108 public static Efl.Eo.FunctionWrapper<efl_page_indicator_bind_api_delegate> efl_page_indicator_bind_ptr = new Efl.Eo.FunctionWrapper<efl_page_indicator_bind_api_delegate>(_Module, "efl_page_indicator_bind");
109 private static void bind(System.IntPtr obj, System.IntPtr pd, Efl.Ui.Pager pager, Efl.Canvas.Group group)
111 Eina.Log.Debug("function efl_page_indicator_bind was called");
112 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
113 if(wrapper != null) {
116 ((Indicator)wrapper).Bind( pager, group);
117 } catch (Exception e) {
118 Eina.Log.Warning($"Callback error: {e.ToString()}");
119 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
122 efl_page_indicator_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), pager, group);
125 private static efl_page_indicator_bind_delegate efl_page_indicator_bind_static_delegate;