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>Low-level polygon object</summary>
13 [Efl.Canvas.Polygon.NativeMethods]
14 [Efl.Eo.BindingEntity]
15 public class Polygon : Efl.Canvas.Object
17 ///<summary>Pointer to the native class description.</summary>
18 public override System.IntPtr NativeClass
22 if (((object)this).GetType() == typeof(Polygon))
24 return GetEflClassStatic();
28 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
33 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
34 efl_canvas_polygon_class_get();
35 /// <summary>Initializes a new instance of the <see cref="Polygon"/> class.</summary>
36 /// <param name="parent">Parent instance.</param>
37 public Polygon(Efl.Object parent= null
38 ) : base(efl_canvas_polygon_class_get(), parent)
40 FinishInstantiation();
43 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
44 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
45 protected Polygon(ConstructingHandle ch) : base(ch)
49 /// <summary>Initializes a new instance of the <see cref="Polygon"/> class.
50 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
51 /// <param name="wh">The native pointer to be wrapped.</param>
52 protected Polygon(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
56 /// <summary>Initializes a new instance of the <see cref="Polygon"/> class.
57 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
58 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
59 /// <param name="parent">The Efl.Object parent of this instance.</param>
60 protected Polygon(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
64 /// <summary>Adds the given point to the given evas polygon object.</summary>
65 /// <param name="pos">A point coordinate.</param>
66 virtual public void AddPoint(Eina.Position2D pos) {
67 Eina.Position2D.NativeStruct _in_pos = pos;
68 Efl.Canvas.Polygon.NativeMethods.efl_canvas_polygon_point_add_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),_in_pos);
69 Eina.Error.RaiseIfUnhandledException();
71 /// <summary>Removes all of the points from the given evas polygon object.</summary>
72 virtual public void ClearPoints() {
73 Efl.Canvas.Polygon.NativeMethods.efl_canvas_polygon_points_clear_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
74 Eina.Error.RaiseIfUnhandledException();
76 private static IntPtr GetEflClassStatic()
78 return Efl.Canvas.Polygon.efl_canvas_polygon_class_get();
80 /// <summary>Wrapper for native methods and virtual method delegates.
81 /// For internal use by generated code only.</summary>
82 public new class NativeMethods : Efl.Canvas.Object.NativeMethods
84 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Evas);
85 /// <summary>Gets the list of Eo operations to override.</summary>
86 /// <returns>The list of Eo operations to be overload.</returns>
87 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
89 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
90 var methods = Efl.Eo.Globals.GetUserMethods(type);
92 if (efl_canvas_polygon_point_add_static_delegate == null)
94 efl_canvas_polygon_point_add_static_delegate = new efl_canvas_polygon_point_add_delegate(point_add);
97 if (methods.FirstOrDefault(m => m.Name == "AddPoint") != null)
99 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_polygon_point_add"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_polygon_point_add_static_delegate) });
102 if (efl_canvas_polygon_points_clear_static_delegate == null)
104 efl_canvas_polygon_points_clear_static_delegate = new efl_canvas_polygon_points_clear_delegate(points_clear);
107 if (methods.FirstOrDefault(m => m.Name == "ClearPoints") != null)
109 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_polygon_points_clear"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_polygon_points_clear_static_delegate) });
112 descs.AddRange(base.GetEoOps(type));
115 /// <summary>Returns the Eo class for the native methods of this class.</summary>
116 /// <returns>The native class pointer.</returns>
117 public override IntPtr GetEflClass()
119 return Efl.Canvas.Polygon.efl_canvas_polygon_class_get();
122 #pragma warning disable CA1707, CS1591, SA1300, SA1600
125 private delegate void efl_canvas_polygon_point_add_delegate(System.IntPtr obj, System.IntPtr pd, Eina.Position2D.NativeStruct pos);
128 public delegate void efl_canvas_polygon_point_add_api_delegate(System.IntPtr obj, Eina.Position2D.NativeStruct pos);
130 public static Efl.Eo.FunctionWrapper<efl_canvas_polygon_point_add_api_delegate> efl_canvas_polygon_point_add_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_polygon_point_add_api_delegate>(Module, "efl_canvas_polygon_point_add");
132 private static void point_add(System.IntPtr obj, System.IntPtr pd, Eina.Position2D.NativeStruct pos)
134 Eina.Log.Debug("function efl_canvas_polygon_point_add was called");
135 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
138 Eina.Position2D _in_pos = pos;
142 ((Polygon)ws.Target).AddPoint(_in_pos);
146 Eina.Log.Warning($"Callback error: {e.ToString()}");
147 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
154 efl_canvas_polygon_point_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), pos);
158 private static efl_canvas_polygon_point_add_delegate efl_canvas_polygon_point_add_static_delegate;
161 private delegate void efl_canvas_polygon_points_clear_delegate(System.IntPtr obj, System.IntPtr pd);
164 public delegate void efl_canvas_polygon_points_clear_api_delegate(System.IntPtr obj);
166 public static Efl.Eo.FunctionWrapper<efl_canvas_polygon_points_clear_api_delegate> efl_canvas_polygon_points_clear_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_polygon_points_clear_api_delegate>(Module, "efl_canvas_polygon_points_clear");
168 private static void points_clear(System.IntPtr obj, System.IntPtr pd)
170 Eina.Log.Debug("function efl_canvas_polygon_points_clear was called");
171 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
177 ((Polygon)ws.Target).ClearPoints();
181 Eina.Log.Warning($"Callback error: {e.ToString()}");
182 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
189 efl_canvas_polygon_points_clear_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
193 private static efl_canvas_polygon_points_clear_delegate efl_canvas_polygon_points_clear_static_delegate;
195 #pragma warning restore CA1707, CS1591, SA1300, SA1600