2 #pragma warning disable CS1591
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
7 using System.Threading;
8 using System.ComponentModel;
13 /// <summary>Low-level polygon object</summary>
14 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
15 [Efl.Canvas.Polygon.NativeMethods]
16 [Efl.Eo.BindingEntity]
17 public class Polygon : Efl.Canvas.Object
19 /// <summary>Pointer to the native class description.</summary>
20 public override System.IntPtr NativeClass
24 if (((object)this).GetType() == typeof(Polygon))
26 return GetEflClassStatic();
30 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
35 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
36 efl_canvas_polygon_class_get();
37 /// <summary>Initializes a new instance of the <see cref="Polygon"/> class.</summary>
38 /// <param name="parent">Parent instance.</param>
39 public Polygon(Efl.Object parent= null
40 ) : base(efl_canvas_polygon_class_get(), parent)
42 FinishInstantiation();
45 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
46 /// Do not call this constructor directly.</summary>
47 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
48 protected Polygon(ConstructingHandle ch) : base(ch)
52 /// <summary>Initializes a new instance of the <see cref="Polygon"/> class.
53 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
54 /// <param name="wh">The native pointer to be wrapped.</param>
55 protected Polygon(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
59 /// <summary>Initializes a new instance of the <see cref="Polygon"/> class.
60 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
61 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
62 /// <param name="parent">The Efl.Object parent of this instance.</param>
63 protected Polygon(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
67 /// <summary>Adds the given point to the given evas polygon object.</summary>
68 /// <param name="pos">A point coordinate.</param>
69 virtual public void AddPoint(Eina.Position2D pos) {
70 Eina.Position2D.NativeStruct _in_pos = pos;
71 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);
72 Eina.Error.RaiseIfUnhandledException();
74 /// <summary>Removes all of the points from the given evas polygon object.</summary>
75 virtual public void ClearPoints() {
76 Efl.Canvas.Polygon.NativeMethods.efl_canvas_polygon_points_clear_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
77 Eina.Error.RaiseIfUnhandledException();
79 private static IntPtr GetEflClassStatic()
81 return Efl.Canvas.Polygon.efl_canvas_polygon_class_get();
83 /// <summary>Wrapper for native methods and virtual method delegates.
84 /// For internal use by generated code only.</summary>
85 public new class NativeMethods : Efl.Canvas.Object.NativeMethods
87 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Evas);
88 /// <summary>Gets the list of Eo operations to override.</summary>
89 /// <returns>The list of Eo operations to be overload.</returns>
90 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
92 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
93 var methods = Efl.Eo.Globals.GetUserMethods(type);
95 if (efl_canvas_polygon_point_add_static_delegate == null)
97 efl_canvas_polygon_point_add_static_delegate = new efl_canvas_polygon_point_add_delegate(point_add);
100 if (methods.FirstOrDefault(m => m.Name == "AddPoint") != null)
102 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) });
105 if (efl_canvas_polygon_points_clear_static_delegate == null)
107 efl_canvas_polygon_points_clear_static_delegate = new efl_canvas_polygon_points_clear_delegate(points_clear);
110 if (methods.FirstOrDefault(m => m.Name == "ClearPoints") != null)
112 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) });
115 descs.AddRange(base.GetEoOps(type));
118 /// <summary>Returns the Eo class for the native methods of this class.</summary>
119 /// <returns>The native class pointer.</returns>
120 public override IntPtr GetEflClass()
122 return Efl.Canvas.Polygon.efl_canvas_polygon_class_get();
125 #pragma warning disable CA1707, CS1591, SA1300, SA1600
128 private delegate void efl_canvas_polygon_point_add_delegate(System.IntPtr obj, System.IntPtr pd, Eina.Position2D.NativeStruct pos);
131 public delegate void efl_canvas_polygon_point_add_api_delegate(System.IntPtr obj, Eina.Position2D.NativeStruct pos);
133 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");
135 private static void point_add(System.IntPtr obj, System.IntPtr pd, Eina.Position2D.NativeStruct pos)
137 Eina.Log.Debug("function efl_canvas_polygon_point_add was called");
138 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
141 Eina.Position2D _in_pos = pos;
145 ((Polygon)ws.Target).AddPoint(_in_pos);
149 Eina.Log.Warning($"Callback error: {e.ToString()}");
150 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
157 efl_canvas_polygon_point_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), pos);
161 private static efl_canvas_polygon_point_add_delegate efl_canvas_polygon_point_add_static_delegate;
164 private delegate void efl_canvas_polygon_points_clear_delegate(System.IntPtr obj, System.IntPtr pd);
167 public delegate void efl_canvas_polygon_points_clear_api_delegate(System.IntPtr obj);
169 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");
171 private static void points_clear(System.IntPtr obj, System.IntPtr pd)
173 Eina.Log.Debug("function efl_canvas_polygon_points_clear was called");
174 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
180 ((Polygon)ws.Target).ClearPoints();
184 Eina.Log.Warning($"Callback error: {e.ToString()}");
185 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
192 efl_canvas_polygon_points_clear_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
196 private static efl_canvas_polygon_points_clear_delegate efl_canvas_polygon_points_clear_static_delegate;
198 #pragma warning restore CA1707, CS1591, SA1300, SA1600
207 #pragma warning disable CS1591
208 public static class Efl_CanvasPolygon_ExtensionMethods {
210 #pragma warning restore CS1591