#pragma warning disable CS1591 using System; using System.Runtime.InteropServices; using System.Collections.Generic; using System.Linq; using System.Threading; using System.ComponentModel; namespace Efl { namespace Ui { namespace TextFactory { /// Internal factory for fallback cases. /// This wraps some internal functionality: - Contains 2 factories: image and emoticon - Strips off "file://" prefix for image items, to be used with the image factory. [Efl.Ui.TextFactory.Fallback.NativeMethods] public class Fallback : Efl.Object, Efl.Canvas.ITextFactory { ///Pointer to the native class description. public override System.IntPtr NativeClass { get { if (((object)this).GetType() == typeof(Fallback)) { return GetEflClassStatic(); } else { return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()]; } } } [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr efl_ui_text_factory_fallback_class_get(); /// Initializes a new instance of the class. /// Parent instance. public Fallback(Efl.Object parent= null ) : base(efl_ui_text_factory_fallback_class_get(), typeof(Fallback), parent) { FinishInstantiation(); } /// Initializes a new instance of the class. /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly. /// The native pointer to be wrapped. protected Fallback(System.IntPtr raw) : base(raw) { } /// Initializes a new instance of the class. /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly. /// The pointer to the base native Eo class. /// The managed type of the public constructor that originated this call. /// The Efl.Object parent of this instance. protected Fallback(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent) { } /// Translates a given key to an item object, and returns the object. The returned object should be owned by the passed object. /// The parent of the created object /// Key that is associated to an item object virtual public Efl.Canvas.Object Create(Efl.Canvas.Object kw_object, System.String key) { var _ret_var = Efl.Canvas.ITextFactoryConcrete.NativeMethods.efl_canvas_text_factory_create_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),kw_object, key); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } private static IntPtr GetEflClassStatic() { return Efl.Ui.TextFactory.Fallback.efl_ui_text_factory_fallback_class_get(); } /// Wrapper for native methods and virtual method delegates. /// For internal use by generated code only. public new class NativeMethods : Efl.Object.NativeMethods { private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary); /// Gets the list of Eo operations to override. /// The list of Eo operations to be overload. public override System.Collections.Generic.List GetEoOps(System.Type type) { var descs = new System.Collections.Generic.List(); var methods = Efl.Eo.Globals.GetUserMethods(type); if (efl_canvas_text_factory_create_static_delegate == null) { efl_canvas_text_factory_create_static_delegate = new efl_canvas_text_factory_create_delegate(create); } if (methods.FirstOrDefault(m => m.Name == "Create") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_text_factory_create"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_text_factory_create_static_delegate) }); } descs.AddRange(base.GetEoOps(type)); return descs; } /// Returns the Eo class for the native methods of this class. /// The native class pointer. public override IntPtr GetEflClass() { return Efl.Ui.TextFactory.Fallback.efl_ui_text_factory_fallback_class_get(); } #pragma warning disable CA1707, CS1591, SA1300, SA1600 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo))] private delegate Efl.Canvas.Object efl_canvas_text_factory_create_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo))] Efl.Canvas.Object kw_object, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key); [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo))] public delegate Efl.Canvas.Object efl_canvas_text_factory_create_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo))] Efl.Canvas.Object kw_object, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key); public static Efl.Eo.FunctionWrapper efl_canvas_text_factory_create_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_canvas_text_factory_create"); private static Efl.Canvas.Object create(System.IntPtr obj, System.IntPtr pd, Efl.Canvas.Object kw_object, System.String key) { Eina.Log.Debug("function efl_canvas_text_factory_create was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { Efl.Canvas.Object _ret_var = default(Efl.Canvas.Object); try { _ret_var = ((Fallback)ws.Target).Create(kw_object, key); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } return _ret_var; } else { return efl_canvas_text_factory_create_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), kw_object, key); } } private static efl_canvas_text_factory_create_delegate efl_canvas_text_factory_create_static_delegate; #pragma warning restore CA1707, CS1591, SA1300, SA1600 } } } } }