1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
14 /// <summary>Efl vectopr graphics gradient abstract class</summary>
15 [Efl.Canvas.Vg.Gradient.NativeMethods]
16 public abstract class Gradient : Efl.Canvas.Vg.Node, Efl.Eo.IWrapper,Efl.Gfx.IGradient
18 ///<summary>Pointer to the native class description.</summary>
19 public override System.IntPtr NativeClass
23 if (((object)this).GetType() == typeof(Gradient))
25 return GetEflClassStatic();
29 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
34 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
35 efl_canvas_vg_gradient_class_get();
36 /// <summary>Initializes a new instance of the <see cref="Gradient"/> class.</summary>
37 /// <param name="parent">Parent instance.</param>
38 public Gradient(Efl.Object parent= null
39 ) : base(efl_canvas_vg_gradient_class_get(), typeof(Gradient), parent)
41 FinishInstantiation();
44 /// <summary>Initializes a new instance of the <see cref="Gradient"/> class.
45 /// 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 /// <param name="raw">The native pointer to be wrapped.</param>
47 protected Gradient(System.IntPtr raw) : base(raw)
51 [Efl.Eo.PrivateNativeClass]
52 private class GradientRealized : Gradient
54 private GradientRealized(IntPtr ptr) : base(ptr)
58 /// <summary>Initializes a new instance of the <see cref="Gradient"/> class.
59 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
60 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
61 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
62 /// <param name="parent">The Efl.Object parent of this instance.</param>
63 protected Gradient(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
67 /// <summary>Verifies if the given object is equal to this one.</summary>
68 /// <param name="instance">The object to compare to.</param>
69 /// <returns>True if both objects point to the same native object.</returns>
70 public override bool Equals(object instance)
72 var other = instance as Efl.Object;
77 return this.NativeHandle == other.NativeHandle;
80 /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
81 /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
82 public override int GetHashCode()
84 return this.NativeHandle.ToInt32();
87 /// <summary>Turns the native pointer into a string representation.</summary>
88 /// <returns>A string with the type and the native pointer for this object.</returns>
89 public override String ToString()
91 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
94 /// <summary>Get the list of color stops.</summary>
95 /// <param name="colors">Color stops list</param>
96 /// <param name="length">Length of the list</param>
97 virtual public void GetStop(out Efl.Gfx.GradientStop colors, out uint length) {
98 var _out_colors = new System.IntPtr();
99 Efl.Gfx.IGradientConcrete.NativeMethods.efl_gfx_gradient_stop_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),out _out_colors, out length);
100 Eina.Error.RaiseIfUnhandledException();
101 colors = Eina.PrimitiveConversion.PointerToManaged<Efl.Gfx.GradientStop>(_out_colors);
103 /// <summary>Set the list of color stops for the gradient</summary>
104 /// <param name="colors">Color stops list</param>
105 /// <param name="length">Length of the list</param>
106 virtual public void SetStop(ref Efl.Gfx.GradientStop colors, uint length) {
107 Efl.Gfx.GradientStop.NativeStruct _in_colors = colors;
108 Efl.Gfx.IGradientConcrete.NativeMethods.efl_gfx_gradient_stop_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),ref _in_colors, length);
109 Eina.Error.RaiseIfUnhandledException();
112 /// <summary>Returns the spread method use by this gradient. The default is EFL_GFX_GRADIENT_SPREAD_PAD.</summary>
113 /// <returns>Spread type to be used</returns>
114 virtual public Efl.Gfx.GradientSpread GetSpread() {
115 var _ret_var = Efl.Gfx.IGradientConcrete.NativeMethods.efl_gfx_gradient_spread_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
116 Eina.Error.RaiseIfUnhandledException();
119 /// <summary>Specifies the spread method that should be used for this gradient.</summary>
120 /// <param name="s">Spread type to be used</param>
121 virtual public void SetSpread(Efl.Gfx.GradientSpread s) {
122 Efl.Gfx.IGradientConcrete.NativeMethods.efl_gfx_gradient_spread_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),s);
123 Eina.Error.RaiseIfUnhandledException();
125 /// <summary>Returns the spread method use by this gradient. The default is EFL_GFX_GRADIENT_SPREAD_PAD.</summary>
126 /// <value>Spread type to be used</value>
127 public Efl.Gfx.GradientSpread Spread {
128 get { return GetSpread(); }
129 set { SetSpread(value); }
131 private static IntPtr GetEflClassStatic()
133 return Efl.Canvas.Vg.Gradient.efl_canvas_vg_gradient_class_get();
135 /// <summary>Wrapper for native methods and virtual method delegates.
136 /// For internal use by generated code only.</summary>
137 public new class NativeMethods : Efl.Canvas.Vg.Node.NativeMethods
139 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Evas);
140 /// <summary>Gets the list of Eo operations to override.</summary>
141 /// <returns>The list of Eo operations to be overload.</returns>
142 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
144 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
145 var methods = Efl.Eo.Globals.GetUserMethods(type);
147 if (efl_gfx_gradient_stop_get_static_delegate == null)
149 efl_gfx_gradient_stop_get_static_delegate = new efl_gfx_gradient_stop_get_delegate(stop_get);
152 if (methods.FirstOrDefault(m => m.Name == "GetStop") != null)
154 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_gradient_stop_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_gradient_stop_get_static_delegate) });
157 if (efl_gfx_gradient_stop_set_static_delegate == null)
159 efl_gfx_gradient_stop_set_static_delegate = new efl_gfx_gradient_stop_set_delegate(stop_set);
162 if (methods.FirstOrDefault(m => m.Name == "SetStop") != null)
164 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_gradient_stop_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_gradient_stop_set_static_delegate) });
167 if (efl_gfx_gradient_spread_get_static_delegate == null)
169 efl_gfx_gradient_spread_get_static_delegate = new efl_gfx_gradient_spread_get_delegate(spread_get);
172 if (methods.FirstOrDefault(m => m.Name == "GetSpread") != null)
174 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_gradient_spread_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_gradient_spread_get_static_delegate) });
177 if (efl_gfx_gradient_spread_set_static_delegate == null)
179 efl_gfx_gradient_spread_set_static_delegate = new efl_gfx_gradient_spread_set_delegate(spread_set);
182 if (methods.FirstOrDefault(m => m.Name == "SetSpread") != null)
184 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_gradient_spread_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_gradient_spread_set_static_delegate) });
187 descs.AddRange(base.GetEoOps(type));
190 /// <summary>Returns the Eo class for the native methods of this class.</summary>
191 /// <returns>The native class pointer.</returns>
192 public override IntPtr GetEflClass()
194 return Efl.Canvas.Vg.Gradient.efl_canvas_vg_gradient_class_get();
197 #pragma warning disable CA1707, SA1300, SA1600
200 private delegate void efl_gfx_gradient_stop_get_delegate(System.IntPtr obj, System.IntPtr pd, out System.IntPtr colors, out uint length);
203 public delegate void efl_gfx_gradient_stop_get_api_delegate(System.IntPtr obj, out System.IntPtr colors, out uint length);
205 public static Efl.Eo.FunctionWrapper<efl_gfx_gradient_stop_get_api_delegate> efl_gfx_gradient_stop_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_gradient_stop_get_api_delegate>(Module, "efl_gfx_gradient_stop_get");
207 private static void stop_get(System.IntPtr obj, System.IntPtr pd, out System.IntPtr colors, out uint length)
209 Eina.Log.Debug("function efl_gfx_gradient_stop_get was called");
210 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
213 Efl.Gfx.GradientStop _out_colors = default(Efl.Gfx.GradientStop);
214 length = default(uint);
217 ((Gradient)wrapper).GetStop(out _out_colors, out length);
221 Eina.Log.Warning($"Callback error: {e.ToString()}");
222 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
225 colors = Eina.PrimitiveConversion.ManagedToPointerAlloc(_out_colors);
230 efl_gfx_gradient_stop_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), out colors, out length);
234 private static efl_gfx_gradient_stop_get_delegate efl_gfx_gradient_stop_get_static_delegate;
237 private delegate void efl_gfx_gradient_stop_set_delegate(System.IntPtr obj, System.IntPtr pd, ref Efl.Gfx.GradientStop.NativeStruct colors, uint length);
240 public delegate void efl_gfx_gradient_stop_set_api_delegate(System.IntPtr obj, ref Efl.Gfx.GradientStop.NativeStruct colors, uint length);
242 public static Efl.Eo.FunctionWrapper<efl_gfx_gradient_stop_set_api_delegate> efl_gfx_gradient_stop_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_gradient_stop_set_api_delegate>(Module, "efl_gfx_gradient_stop_set");
244 private static void stop_set(System.IntPtr obj, System.IntPtr pd, ref Efl.Gfx.GradientStop.NativeStruct colors, uint length)
246 Eina.Log.Debug("function efl_gfx_gradient_stop_set was called");
247 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
250 Efl.Gfx.GradientStop _in_colors = colors;
254 ((Gradient)wrapper).SetStop(ref _in_colors, length);
258 Eina.Log.Warning($"Callback error: {e.ToString()}");
259 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
267 efl_gfx_gradient_stop_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), ref colors, length);
271 private static efl_gfx_gradient_stop_set_delegate efl_gfx_gradient_stop_set_static_delegate;
274 private delegate Efl.Gfx.GradientSpread efl_gfx_gradient_spread_get_delegate(System.IntPtr obj, System.IntPtr pd);
277 public delegate Efl.Gfx.GradientSpread efl_gfx_gradient_spread_get_api_delegate(System.IntPtr obj);
279 public static Efl.Eo.FunctionWrapper<efl_gfx_gradient_spread_get_api_delegate> efl_gfx_gradient_spread_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_gradient_spread_get_api_delegate>(Module, "efl_gfx_gradient_spread_get");
281 private static Efl.Gfx.GradientSpread spread_get(System.IntPtr obj, System.IntPtr pd)
283 Eina.Log.Debug("function efl_gfx_gradient_spread_get was called");
284 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
287 Efl.Gfx.GradientSpread _ret_var = default(Efl.Gfx.GradientSpread);
290 _ret_var = ((Gradient)wrapper).GetSpread();
294 Eina.Log.Warning($"Callback error: {e.ToString()}");
295 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
303 return efl_gfx_gradient_spread_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
307 private static efl_gfx_gradient_spread_get_delegate efl_gfx_gradient_spread_get_static_delegate;
310 private delegate void efl_gfx_gradient_spread_set_delegate(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.GradientSpread s);
313 public delegate void efl_gfx_gradient_spread_set_api_delegate(System.IntPtr obj, Efl.Gfx.GradientSpread s);
315 public static Efl.Eo.FunctionWrapper<efl_gfx_gradient_spread_set_api_delegate> efl_gfx_gradient_spread_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_gradient_spread_set_api_delegate>(Module, "efl_gfx_gradient_spread_set");
317 private static void spread_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.GradientSpread s)
319 Eina.Log.Debug("function efl_gfx_gradient_spread_set was called");
320 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
326 ((Gradient)wrapper).SetSpread(s);
330 Eina.Log.Warning($"Callback error: {e.ToString()}");
331 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
338 efl_gfx_gradient_spread_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), s);
342 private static efl_gfx_gradient_spread_set_delegate efl_gfx_gradient_spread_set_static_delegate;
344 #pragma warning restore CA1707, SA1300, SA1600