1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Gfx {
8 /// <summary>Efl graphics gradient interface</summary>
9 [IGradientNativeInherit]
10 public interface IGradient :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>Get the list of color stops.</summary>
14 /// <param name="colors">Color stops list</param>
15 /// <param name="length">Length of the list</param>
16 /// <returns></returns>
17 void GetStop( out Efl.Gfx.GradientStop colors, out uint length);
18 /// <summary>Set the list of color stops for the gradient</summary>
19 /// <param name="colors">Color stops list</param>
20 /// <param name="length">Length of the list</param>
21 /// <returns></returns>
22 void SetStop( ref Efl.Gfx.GradientStop colors, uint length);
23 /// <summary>Returns the spread method use by this gradient. The default is EFL_GFX_GRADIENT_SPREAD_PAD.</summary>
24 /// <returns>Spread type to be used</returns>
25 Efl.Gfx.GradientSpread GetSpread();
26 /// <summary>Specifies the spread method that should be used for this gradient.</summary>
27 /// <param name="s">Spread type to be used</param>
28 /// <returns></returns>
29 void SetSpread( Efl.Gfx.GradientSpread s);
30 /// <summary>Returns the spread method use by this gradient. The default is EFL_GFX_GRADIENT_SPREAD_PAD.</summary>
31 /// <value>Spread type to be used</value>
32 Efl.Gfx.GradientSpread Spread {
37 /// <summary>Efl graphics gradient interface</summary>
38 sealed public class IGradientConcrete :
43 ///<summary>Pointer to the native class description.</summary>
44 public System.IntPtr NativeClass {
46 if (((object)this).GetType() == typeof (IGradientConcrete))
47 return Efl.Gfx.IGradientNativeInherit.GetEflClassStatic();
49 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
52 private System.IntPtr handle;
53 ///<summary>Pointer to the native instance.</summary>
54 public System.IntPtr NativeHandle {
55 get { return handle; }
57 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
58 efl_gfx_gradient_interface_get();
59 ///<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>
60 private IGradientConcrete(System.IntPtr raw)
63 RegisterEventProxies();
65 ///<summary>Destructor.</summary>
70 ///<summary>Releases the underlying native instance.</summary>
71 void Dispose(bool disposing)
73 if (handle != System.IntPtr.Zero) {
74 Efl.Eo.Globals.efl_unref(handle);
75 handle = System.IntPtr.Zero;
78 ///<summary>Releases the underlying native instance.</summary>
82 GC.SuppressFinalize(this);
84 ///<summary>Verifies if the given object is equal to this one.</summary>
85 public override bool Equals(object obj)
87 var other = obj as Efl.Object;
90 return this.NativeHandle == other.NativeHandle;
92 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
93 public override int GetHashCode()
95 return this.NativeHandle.ToInt32();
97 ///<summary>Turns the native pointer into a string representation.</summary>
98 public override String ToString()
100 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
102 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
103 void RegisterEventProxies()
106 /// <summary>Get the list of color stops.</summary>
107 /// <param name="colors">Color stops list</param>
108 /// <param name="length">Length of the list</param>
109 /// <returns></returns>
110 public void GetStop( out Efl.Gfx.GradientStop colors, out uint length) {
111 var _out_colors = new System.IntPtr();
112 Efl.Gfx.IGradientNativeInherit.efl_gfx_gradient_stop_get_ptr.Value.Delegate(this.NativeHandle, out _out_colors, out length);
113 Eina.Error.RaiseIfUnhandledException();
114 colors = Eina.PrimitiveConversion.PointerToManaged<Efl.Gfx.GradientStop>(_out_colors);
116 /// <summary>Set the list of color stops for the gradient</summary>
117 /// <param name="colors">Color stops list</param>
118 /// <param name="length">Length of the list</param>
119 /// <returns></returns>
120 public void SetStop( ref Efl.Gfx.GradientStop colors, uint length) {
121 Efl.Gfx.GradientStop.NativeStruct _in_colors = colors;
122 Efl.Gfx.IGradientNativeInherit.efl_gfx_gradient_stop_set_ptr.Value.Delegate(this.NativeHandle, ref _in_colors, length);
123 Eina.Error.RaiseIfUnhandledException();
126 /// <summary>Returns the spread method use by this gradient. The default is EFL_GFX_GRADIENT_SPREAD_PAD.</summary>
127 /// <returns>Spread type to be used</returns>
128 public Efl.Gfx.GradientSpread GetSpread() {
129 var _ret_var = Efl.Gfx.IGradientNativeInherit.efl_gfx_gradient_spread_get_ptr.Value.Delegate(this.NativeHandle);
130 Eina.Error.RaiseIfUnhandledException();
133 /// <summary>Specifies the spread method that should be used for this gradient.</summary>
134 /// <param name="s">Spread type to be used</param>
135 /// <returns></returns>
136 public void SetSpread( Efl.Gfx.GradientSpread s) {
137 Efl.Gfx.IGradientNativeInherit.efl_gfx_gradient_spread_set_ptr.Value.Delegate(this.NativeHandle, s);
138 Eina.Error.RaiseIfUnhandledException();
140 /// <summary>Returns the spread method use by this gradient. The default is EFL_GFX_GRADIENT_SPREAD_PAD.</summary>
141 /// <value>Spread type to be used</value>
142 public Efl.Gfx.GradientSpread Spread {
143 get { return GetSpread(); }
144 set { SetSpread( value); }
146 private static IntPtr GetEflClassStatic()
148 return Efl.Gfx.IGradientConcrete.efl_gfx_gradient_interface_get();
151 public class IGradientNativeInherit : Efl.Eo.NativeClass{
152 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
153 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
155 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
156 var methods = Efl.Eo.Globals.GetUserMethods(type);
157 if (efl_gfx_gradient_stop_get_static_delegate == null)
158 efl_gfx_gradient_stop_get_static_delegate = new efl_gfx_gradient_stop_get_delegate(stop_get);
159 if (methods.FirstOrDefault(m => m.Name == "GetStop") != null)
160 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)});
161 if (efl_gfx_gradient_stop_set_static_delegate == null)
162 efl_gfx_gradient_stop_set_static_delegate = new efl_gfx_gradient_stop_set_delegate(stop_set);
163 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)});
165 if (efl_gfx_gradient_spread_get_static_delegate == null)
166 efl_gfx_gradient_spread_get_static_delegate = new efl_gfx_gradient_spread_get_delegate(spread_get);
167 if (methods.FirstOrDefault(m => m.Name == "GetSpread") != null)
168 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)});
169 if (efl_gfx_gradient_spread_set_static_delegate == null)
170 efl_gfx_gradient_spread_set_static_delegate = new efl_gfx_gradient_spread_set_delegate(spread_set);
171 if (methods.FirstOrDefault(m => m.Name == "SetSpread") != null)
172 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)});
175 public override IntPtr GetEflClass()
177 return Efl.Gfx.IGradientConcrete.efl_gfx_gradient_interface_get();
179 public static IntPtr GetEflClassStatic()
181 return Efl.Gfx.IGradientConcrete.efl_gfx_gradient_interface_get();
185 private delegate void efl_gfx_gradient_stop_get_delegate(System.IntPtr obj, System.IntPtr pd, out System.IntPtr colors, out uint length);
188 public delegate void efl_gfx_gradient_stop_get_api_delegate(System.IntPtr obj, out System.IntPtr colors, out uint length);
189 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");
190 private static void stop_get(System.IntPtr obj, System.IntPtr pd, out System.IntPtr colors, out uint length)
192 Eina.Log.Debug("function efl_gfx_gradient_stop_get was called");
193 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
194 if(wrapper != null) {
195 Efl.Gfx.GradientStop _out_colors = default(Efl.Gfx.GradientStop);
196 length = default(uint);
198 ((IGradient)wrapper).GetStop( out _out_colors, out length);
199 } catch (Exception e) {
200 Eina.Log.Warning($"Callback error: {e.ToString()}");
201 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
203 colors = Eina.PrimitiveConversion.ManagedToPointerAlloc(_out_colors);
205 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);
208 private static efl_gfx_gradient_stop_get_delegate efl_gfx_gradient_stop_get_static_delegate;
211 private delegate void efl_gfx_gradient_stop_set_delegate(System.IntPtr obj, System.IntPtr pd, ref Efl.Gfx.GradientStop.NativeStruct colors, uint length);
214 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");
216 private static void stop_set(System.IntPtr obj, System.IntPtr pd, ref Efl.Gfx.GradientStop.NativeStruct colors, uint length)
218 Eina.Log.Debug("function efl_gfx_gradient_stop_set was called");
219 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
220 if(wrapper != null) {
221 Efl.Gfx.GradientStop _in_colors = colors;
224 ((IGradient)wrapper).SetStop( ref _in_colors, length);
225 } catch (Exception e) {
226 Eina.Log.Warning($"Callback error: {e.ToString()}");
227 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
231 efl_gfx_gradient_stop_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), ref colors, length);
234 private static efl_gfx_gradient_stop_set_delegate efl_gfx_gradient_stop_set_static_delegate;
237 private delegate Efl.Gfx.GradientSpread efl_gfx_gradient_spread_get_delegate(System.IntPtr obj, System.IntPtr pd);
240 public delegate Efl.Gfx.GradientSpread efl_gfx_gradient_spread_get_api_delegate(System.IntPtr obj);
241 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");
242 private static Efl.Gfx.GradientSpread spread_get(System.IntPtr obj, System.IntPtr pd)
244 Eina.Log.Debug("function efl_gfx_gradient_spread_get was called");
245 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
246 if(wrapper != null) {
247 Efl.Gfx.GradientSpread _ret_var = default(Efl.Gfx.GradientSpread);
249 _ret_var = ((IGradient)wrapper).GetSpread();
250 } catch (Exception e) {
251 Eina.Log.Warning($"Callback error: {e.ToString()}");
252 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
256 return efl_gfx_gradient_spread_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
259 private static efl_gfx_gradient_spread_get_delegate efl_gfx_gradient_spread_get_static_delegate;
262 private delegate void efl_gfx_gradient_spread_set_delegate(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.GradientSpread s);
265 public delegate void efl_gfx_gradient_spread_set_api_delegate(System.IntPtr obj, Efl.Gfx.GradientSpread s);
266 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");
267 private static void spread_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.GradientSpread s)
269 Eina.Log.Debug("function efl_gfx_gradient_spread_set was called");
270 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
271 if(wrapper != null) {
274 ((IGradient)wrapper).SetSpread( s);
275 } catch (Exception e) {
276 Eina.Log.Warning($"Callback error: {e.ToString()}");
277 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
280 efl_gfx_gradient_spread_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), s);
283 private static efl_gfx_gradient_spread_set_delegate efl_gfx_gradient_spread_set_static_delegate;