1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Canvas {
8 /// <summary>Efl Canvas Pointer interface</summary>
10 public interface Pointer :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>Returns whether the mouse pointer is logically inside the canvas.
14 /// When this function is called it will return a value of either <c>false</c> or <c>true</c>, depending on whether a pointer,in or pointer,out event has been called previously.
16 /// A return value of <c>true</c> indicates the mouse is logically inside the canvas, and <c>false</c> implies it is logically outside the canvas.
18 /// A canvas begins with the mouse being assumed outside (<c>false</c>).</summary>
19 /// <param name="seat">The seat to consider, if <c>null</c> then the default seat will be used.</param>
20 /// <returns><c>true</c> if the mouse pointer is inside the canvas, <c>false</c> otherwise</returns>
21 bool GetPointerInside( Efl.Input.Device seat);
23 /// <summary>Efl Canvas Pointer interface</summary>
24 sealed public class PointerConcrete :
29 ///<summary>Pointer to the native class description.</summary>
30 public System.IntPtr NativeClass {
32 if (((object)this).GetType() == typeof (PointerConcrete))
33 return Efl.Canvas.PointerNativeInherit.GetEflClassStatic();
35 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
38 private System.IntPtr handle;
39 ///<summary>Pointer to the native instance.</summary>
40 public System.IntPtr NativeHandle {
41 get { return handle; }
43 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
44 efl_canvas_pointer_interface_get();
45 ///<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>
46 public PointerConcrete(System.IntPtr raw)
49 register_event_proxies();
51 ///<summary>Destructor.</summary>
56 ///<summary>Releases the underlying native instance.</summary>
57 void Dispose(bool disposing)
59 if (handle != System.IntPtr.Zero) {
60 Efl.Eo.Globals.efl_unref(handle);
61 handle = System.IntPtr.Zero;
64 ///<summary>Releases the underlying native instance.</summary>
68 GC.SuppressFinalize(this);
70 ///<summary>Casts obj into an instance of this type.</summary>
71 public static PointerConcrete static_cast(Efl.Object obj)
74 throw new System.ArgumentNullException("obj");
75 return new PointerConcrete(obj.NativeHandle);
77 ///<summary>Verifies if the given object is equal to this one.</summary>
78 public override bool Equals(object obj)
80 var other = obj as Efl.Object;
83 return this.NativeHandle == other.NativeHandle;
85 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
86 public override int GetHashCode()
88 return this.NativeHandle.ToInt32();
90 ///<summary>Turns the native pointer into a string representation.</summary>
91 public override String ToString()
93 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
95 void register_event_proxies()
98 /// <summary>Returns whether the mouse pointer is logically inside the canvas.
99 /// When this function is called it will return a value of either <c>false</c> or <c>true</c>, depending on whether a pointer,in or pointer,out event has been called previously.
101 /// A return value of <c>true</c> indicates the mouse is logically inside the canvas, and <c>false</c> implies it is logically outside the canvas.
103 /// A canvas begins with the mouse being assumed outside (<c>false</c>).</summary>
104 /// <param name="seat">The seat to consider, if <c>null</c> then the default seat will be used.</param>
105 /// <returns><c>true</c> if the mouse pointer is inside the canvas, <c>false</c> otherwise</returns>
106 public bool GetPointerInside( Efl.Input.Device seat) {
107 var _ret_var = Efl.Canvas.PointerNativeInherit.efl_canvas_pointer_inside_get_ptr.Value.Delegate(this.NativeHandle, seat);
108 Eina.Error.RaiseIfUnhandledException();
112 public class PointerNativeInherit : Efl.Eo.NativeClass{
113 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
114 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
116 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
117 if (efl_canvas_pointer_inside_get_static_delegate == null)
118 efl_canvas_pointer_inside_get_static_delegate = new efl_canvas_pointer_inside_get_delegate(pointer_inside_get);
119 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_canvas_pointer_inside_get"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_pointer_inside_get_static_delegate)});
122 public override IntPtr GetEflClass()
124 return Efl.Canvas.PointerConcrete.efl_canvas_pointer_interface_get();
126 public static IntPtr GetEflClassStatic()
128 return Efl.Canvas.PointerConcrete.efl_canvas_pointer_interface_get();
132 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_canvas_pointer_inside_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Input.Device, Efl.Eo.NonOwnTag>))] Efl.Input.Device seat);
135 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_canvas_pointer_inside_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Input.Device, Efl.Eo.NonOwnTag>))] Efl.Input.Device seat);
136 public static Efl.Eo.FunctionWrapper<efl_canvas_pointer_inside_get_api_delegate> efl_canvas_pointer_inside_get_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_pointer_inside_get_api_delegate>(_Module, "efl_canvas_pointer_inside_get");
137 private static bool pointer_inside_get(System.IntPtr obj, System.IntPtr pd, Efl.Input.Device seat)
139 Eina.Log.Debug("function efl_canvas_pointer_inside_get was called");
140 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
141 if(wrapper != null) {
142 bool _ret_var = default(bool);
144 _ret_var = ((Pointer)wrapper).GetPointerInside( seat);
145 } catch (Exception e) {
146 Eina.Log.Warning($"Callback error: {e.ToString()}");
147 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
151 return efl_canvas_pointer_inside_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), seat);
154 private static efl_canvas_pointer_inside_get_delegate efl_canvas_pointer_inside_get_static_delegate;