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>Efl graphics gradient interface</summary>
13 [Efl.Gfx.IGradientConcrete.NativeMethods]
14 public interface IGradient :
15 Efl.Eo.IWrapper, IDisposable
17 /// <summary>Get the list of color stops.</summary>
18 /// <param name="colors">Color stops list</param>
19 /// <param name="length">Length of the list</param>
20 void GetStop(out Efl.Gfx.GradientStop colors, out uint length);
21 /// <summary>Set the list of color stops for the gradient</summary>
22 /// <param name="colors">Color stops list</param>
23 /// <param name="length">Length of the list</param>
24 void SetStop(ref Efl.Gfx.GradientStop colors, uint length);
25 /// <summary>Returns the spread method use by this gradient. The default is EFL_GFX_GRADIENT_SPREAD_PAD.</summary>
26 /// <returns>Spread type to be used</returns>
27 Efl.Gfx.GradientSpread GetSpread();
28 /// <summary>Specifies the spread method that should be used for this gradient.</summary>
29 /// <param name="s">Spread type to be used</param>
30 void SetSpread(Efl.Gfx.GradientSpread s);
31 /// <summary>Returns the spread method use by this gradient. The default is EFL_GFX_GRADIENT_SPREAD_PAD.</summary>
32 /// <value>Spread type to be used</value>
33 Efl.Gfx.GradientSpread Spread {
38 /// <summary>Efl graphics gradient interface</summary>
39 sealed public class IGradientConcrete :
44 ///<summary>Pointer to the native class description.</summary>
45 public override System.IntPtr NativeClass
49 if (((object)this).GetType() == typeof(IGradientConcrete))
51 return GetEflClassStatic();
55 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
60 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
61 efl_gfx_gradient_interface_get();
62 /// <summary>Initializes a new instance of the <see cref="IGradient"/> class.
63 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
64 private IGradientConcrete(System.IntPtr raw) : base(raw)
68 /// <summary>Get the list of color stops.</summary>
69 /// <param name="colors">Color stops list</param>
70 /// <param name="length">Length of the list</param>
71 public void GetStop(out Efl.Gfx.GradientStop colors, out uint length) {
72 var _out_colors = new System.IntPtr();
73 Efl.Gfx.IGradientConcrete.NativeMethods.efl_gfx_gradient_stop_get_ptr.Value.Delegate(this.NativeHandle,out _out_colors, out length);
74 Eina.Error.RaiseIfUnhandledException();
75 colors = Eina.PrimitiveConversion.PointerToManaged<Efl.Gfx.GradientStop>(_out_colors);
77 /// <summary>Set the list of color stops for the gradient</summary>
78 /// <param name="colors">Color stops list</param>
79 /// <param name="length">Length of the list</param>
80 public void SetStop(ref Efl.Gfx.GradientStop colors, uint length) {
81 Efl.Gfx.GradientStop.NativeStruct _in_colors = colors;
82 Efl.Gfx.IGradientConcrete.NativeMethods.efl_gfx_gradient_stop_set_ptr.Value.Delegate(this.NativeHandle,ref _in_colors, length);
83 Eina.Error.RaiseIfUnhandledException();
86 /// <summary>Returns the spread method use by this gradient. The default is EFL_GFX_GRADIENT_SPREAD_PAD.</summary>
87 /// <returns>Spread type to be used</returns>
88 public Efl.Gfx.GradientSpread GetSpread() {
89 var _ret_var = Efl.Gfx.IGradientConcrete.NativeMethods.efl_gfx_gradient_spread_get_ptr.Value.Delegate(this.NativeHandle);
90 Eina.Error.RaiseIfUnhandledException();
93 /// <summary>Specifies the spread method that should be used for this gradient.</summary>
94 /// <param name="s">Spread type to be used</param>
95 public void SetSpread(Efl.Gfx.GradientSpread s) {
96 Efl.Gfx.IGradientConcrete.NativeMethods.efl_gfx_gradient_spread_set_ptr.Value.Delegate(this.NativeHandle,s);
97 Eina.Error.RaiseIfUnhandledException();
99 /// <summary>Returns the spread method use by this gradient. The default is EFL_GFX_GRADIENT_SPREAD_PAD.</summary>
100 /// <value>Spread type to be used</value>
101 public Efl.Gfx.GradientSpread Spread {
102 get { return GetSpread(); }
103 set { SetSpread(value); }
105 private static IntPtr GetEflClassStatic()
107 return Efl.Gfx.IGradientConcrete.efl_gfx_gradient_interface_get();
109 /// <summary>Wrapper for native methods and virtual method delegates.
110 /// For internal use by generated code only.</summary>
111 public class NativeMethods : Efl.Eo.NativeClass
113 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
114 /// <summary>Gets the list of Eo operations to override.</summary>
115 /// <returns>The list of Eo operations to be overload.</returns>
116 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
118 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
119 var methods = Efl.Eo.Globals.GetUserMethods(type);
121 if (efl_gfx_gradient_stop_get_static_delegate == null)
123 efl_gfx_gradient_stop_get_static_delegate = new efl_gfx_gradient_stop_get_delegate(stop_get);
126 if (methods.FirstOrDefault(m => m.Name == "GetStop") != null)
128 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) });
131 if (efl_gfx_gradient_stop_set_static_delegate == null)
133 efl_gfx_gradient_stop_set_static_delegate = new efl_gfx_gradient_stop_set_delegate(stop_set);
136 if (methods.FirstOrDefault(m => m.Name == "SetStop") != null)
138 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) });
141 if (efl_gfx_gradient_spread_get_static_delegate == null)
143 efl_gfx_gradient_spread_get_static_delegate = new efl_gfx_gradient_spread_get_delegate(spread_get);
146 if (methods.FirstOrDefault(m => m.Name == "GetSpread") != null)
148 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) });
151 if (efl_gfx_gradient_spread_set_static_delegate == null)
153 efl_gfx_gradient_spread_set_static_delegate = new efl_gfx_gradient_spread_set_delegate(spread_set);
156 if (methods.FirstOrDefault(m => m.Name == "SetSpread") != null)
158 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) });
163 /// <summary>Returns the Eo class for the native methods of this class.</summary>
164 /// <returns>The native class pointer.</returns>
165 public override IntPtr GetEflClass()
167 return Efl.Gfx.IGradientConcrete.efl_gfx_gradient_interface_get();
170 #pragma warning disable CA1707, CS1591, SA1300, SA1600
173 private delegate void efl_gfx_gradient_stop_get_delegate(System.IntPtr obj, System.IntPtr pd, out System.IntPtr colors, out uint length);
176 public delegate void efl_gfx_gradient_stop_get_api_delegate(System.IntPtr obj, out System.IntPtr colors, out uint length);
178 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");
180 private static void stop_get(System.IntPtr obj, System.IntPtr pd, out System.IntPtr colors, out uint length)
182 Eina.Log.Debug("function efl_gfx_gradient_stop_get was called");
183 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
186 Efl.Gfx.GradientStop _out_colors = default(Efl.Gfx.GradientStop);
187 length = default(uint);
190 ((IGradient)ws.Target).GetStop(out _out_colors, out length);
194 Eina.Log.Warning($"Callback error: {e.ToString()}");
195 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
198 colors = Eina.PrimitiveConversion.ManagedToPointerAlloc(_out_colors);
203 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);
207 private static efl_gfx_gradient_stop_get_delegate efl_gfx_gradient_stop_get_static_delegate;
210 private delegate void efl_gfx_gradient_stop_set_delegate(System.IntPtr obj, System.IntPtr pd, ref Efl.Gfx.GradientStop.NativeStruct colors, uint length);
213 public delegate void efl_gfx_gradient_stop_set_api_delegate(System.IntPtr obj, ref Efl.Gfx.GradientStop.NativeStruct colors, uint length);
215 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");
217 private static void stop_set(System.IntPtr obj, System.IntPtr pd, ref Efl.Gfx.GradientStop.NativeStruct colors, uint length)
219 Eina.Log.Debug("function efl_gfx_gradient_stop_set was called");
220 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
223 Efl.Gfx.GradientStop _in_colors = colors;
227 ((IGradient)ws.Target).SetStop(ref _in_colors, length);
231 Eina.Log.Warning($"Callback error: {e.ToString()}");
232 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
240 efl_gfx_gradient_stop_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), ref colors, length);
244 private static efl_gfx_gradient_stop_set_delegate efl_gfx_gradient_stop_set_static_delegate;
247 private delegate Efl.Gfx.GradientSpread efl_gfx_gradient_spread_get_delegate(System.IntPtr obj, System.IntPtr pd);
250 public delegate Efl.Gfx.GradientSpread efl_gfx_gradient_spread_get_api_delegate(System.IntPtr obj);
252 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");
254 private static Efl.Gfx.GradientSpread spread_get(System.IntPtr obj, System.IntPtr pd)
256 Eina.Log.Debug("function efl_gfx_gradient_spread_get was called");
257 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
260 Efl.Gfx.GradientSpread _ret_var = default(Efl.Gfx.GradientSpread);
263 _ret_var = ((IGradient)ws.Target).GetSpread();
267 Eina.Log.Warning($"Callback error: {e.ToString()}");
268 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
276 return efl_gfx_gradient_spread_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
280 private static efl_gfx_gradient_spread_get_delegate efl_gfx_gradient_spread_get_static_delegate;
283 private delegate void efl_gfx_gradient_spread_set_delegate(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.GradientSpread s);
286 public delegate void efl_gfx_gradient_spread_set_api_delegate(System.IntPtr obj, Efl.Gfx.GradientSpread s);
288 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");
290 private static void spread_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.GradientSpread s)
292 Eina.Log.Debug("function efl_gfx_gradient_spread_set was called");
293 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
299 ((IGradient)ws.Target).SetSpread(s);
303 Eina.Log.Warning($"Callback error: {e.ToString()}");
304 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
311 efl_gfx_gradient_spread_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), s);
315 private static efl_gfx_gradient_spread_set_delegate efl_gfx_gradient_spread_set_static_delegate;
317 #pragma warning restore CA1707, CS1591, SA1300, SA1600