1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
10 /// <summary>Efl linear interpolator class</summary>
11 [Efl.LinearInterpolator.NativeMethods]
12 public class LinearInterpolator : Efl.Object, Efl.IInterpolator
14 ///<summary>Pointer to the native class description.</summary>
15 public override System.IntPtr NativeClass
19 if (((object)this).GetType() == typeof(LinearInterpolator))
21 return GetEflClassStatic();
25 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
30 [System.Runtime.InteropServices.DllImport(efl.Libs.Ecore)] internal static extern System.IntPtr
31 efl_linear_interpolator_class_get();
32 /// <summary>Initializes a new instance of the <see cref="LinearInterpolator"/> class.</summary>
33 /// <param name="parent">Parent instance.</param>
34 public LinearInterpolator(Efl.Object parent= null
35 ) : base(efl_linear_interpolator_class_get(), typeof(LinearInterpolator), parent)
37 FinishInstantiation();
40 /// <summary>Initializes a new instance of the <see cref="LinearInterpolator"/> class.
41 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
42 /// <param name="raw">The native pointer to be wrapped.</param>
43 protected LinearInterpolator(System.IntPtr raw) : base(raw)
47 /// <summary>Initializes a new instance of the <see cref="LinearInterpolator"/> class.
48 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
49 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
50 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
51 /// <param name="parent">The Efl.Object parent of this instance.</param>
52 protected LinearInterpolator(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
56 /// <summary>Interpolate the given value.</summary>
57 /// <param name="progress">Input value mapped from 0.0 to 1.0.</param>
58 /// <returns>Output value calculated by interpolating the input value.</returns>
59 virtual public double Interpolate(double progress) {
60 var _ret_var = Efl.IInterpolatorConcrete.NativeMethods.efl_interpolator_interpolate_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),progress);
61 Eina.Error.RaiseIfUnhandledException();
64 private static IntPtr GetEflClassStatic()
66 return Efl.LinearInterpolator.efl_linear_interpolator_class_get();
68 /// <summary>Wrapper for native methods and virtual method delegates.
69 /// For internal use by generated code only.</summary>
70 public new class NativeMethods : Efl.Object.NativeMethods
72 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Ecore);
73 /// <summary>Gets the list of Eo operations to override.</summary>
74 /// <returns>The list of Eo operations to be overload.</returns>
75 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
77 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
78 var methods = Efl.Eo.Globals.GetUserMethods(type);
80 if (efl_interpolator_interpolate_static_delegate == null)
82 efl_interpolator_interpolate_static_delegate = new efl_interpolator_interpolate_delegate(interpolate);
85 if (methods.FirstOrDefault(m => m.Name == "Interpolate") != null)
87 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_interpolator_interpolate"), func = Marshal.GetFunctionPointerForDelegate(efl_interpolator_interpolate_static_delegate) });
90 descs.AddRange(base.GetEoOps(type));
93 /// <summary>Returns the Eo class for the native methods of this class.</summary>
94 /// <returns>The native class pointer.</returns>
95 public override IntPtr GetEflClass()
97 return Efl.LinearInterpolator.efl_linear_interpolator_class_get();
100 #pragma warning disable CA1707, CS1591, SA1300, SA1600
103 private delegate double efl_interpolator_interpolate_delegate(System.IntPtr obj, System.IntPtr pd, double progress);
106 public delegate double efl_interpolator_interpolate_api_delegate(System.IntPtr obj, double progress);
108 public static Efl.Eo.FunctionWrapper<efl_interpolator_interpolate_api_delegate> efl_interpolator_interpolate_ptr = new Efl.Eo.FunctionWrapper<efl_interpolator_interpolate_api_delegate>(Module, "efl_interpolator_interpolate");
110 private static double interpolate(System.IntPtr obj, System.IntPtr pd, double progress)
112 Eina.Log.Debug("function efl_interpolator_interpolate was called");
113 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
116 double _ret_var = default(double);
119 _ret_var = ((LinearInterpolator)ws.Target).Interpolate(progress);
123 Eina.Log.Warning($"Callback error: {e.ToString()}");
124 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
132 return efl_interpolator_interpolate_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), progress);
136 private static efl_interpolator_interpolate_delegate efl_interpolator_interpolate_static_delegate;
138 #pragma warning restore CA1707, CS1591, SA1300, SA1600