X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=internals%2Fsrc%2FEflSharp%2FEflSharp%2Fefl%2Fefl_loop_fd.eo.cs;h=6faea97c3d0a38acdc7018da66f747d434da8fbc;hb=5418695f94c5065494f5f7d74d1506e7a5267c06;hp=84f3719c3ebcf39cb3a2f100206cbdc6c7e3e16b;hpb=1b49f5436f8fe9b85446ae63a3383d1527fbc28a;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/internals/src/EflSharp/EflSharp/efl/efl_loop_fd.eo.cs b/internals/src/EflSharp/EflSharp/efl/efl_loop_fd.eo.cs old mode 100644 new mode 100755 index 84f3719..6faea97 --- a/internals/src/EflSharp/EflSharp/efl/efl_loop_fd.eo.cs +++ b/internals/src/EflSharp/EflSharp/efl/efl_loop_fd.eo.cs @@ -1,374 +1,489 @@ +#define EFL_BETA #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 Efl { + /// Fds are objects that watch the activity on a given file descriptor. This file descriptor can be a network, a file, provided by a library. /// The object will trigger relevant events depending on what's happening. -[LoopFdNativeInherit] -public class LoopFd : Efl.LoopConsumer, Efl.Eo.IWrapper +/// This is a BETA class. It can be modified or removed in the future. Do not use it for product development. +[Efl.LoopFd.NativeMethods] +[Efl.Eo.BindingEntity] +public class LoopFd : Efl.LoopConsumer { - ///Pointer to the native class description. - public override System.IntPtr NativeClass { - get { - if (((object)this).GetType() == typeof (LoopFd)) - return Efl.LoopFdNativeInherit.GetEflClassStatic(); + /// Pointer to the native class description. + public override System.IntPtr NativeClass + { + get + { + if (((object)this).GetType() == typeof(LoopFd)) + { + return GetEflClassStatic(); + } else + { return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()]; + } } } + [System.Runtime.InteropServices.DllImport(efl.Libs.Ecore)] internal static extern System.IntPtr efl_loop_fd_class_get(); - ///Creates a new instance. - ///Parent instance. + /// Initializes a new instance of the class. + /// Parent instance. public LoopFd(Efl.Object parent= null - ) : - base(efl_loop_fd_class_get(), typeof(LoopFd), parent) + ) : base(efl_loop_fd_class_get(), parent) { FinishInstantiation(); } - ///Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly. - protected LoopFd(System.IntPtr raw) : base(raw) - { - RegisterEventProxies(); - } - ///Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly. - protected LoopFd(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {} - ///Verifies if the given object is equal to this one. - public override bool Equals(object obj) + + /// Subclasses should override this constructor if they are expected to be instantiated from native code. + /// Do not call this constructor directly. + /// Tag struct storing the native handle of the object being constructed. + protected LoopFd(ConstructingHandle ch) : base(ch) { - var other = obj as Efl.Object; - if (other == null) - return false; - return this.NativeHandle == other.NativeHandle; } - ///Gets the hash code for this object based on the native pointer it points to. - public override int GetHashCode() + + /// 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 LoopFd(Efl.Eo.Globals.WrappingHandle wh) : base(wh) { - return this.NativeHandle.ToInt32(); } - ///Turns the native pointer into a string representation. - public override String ToString() + + /// 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 Efl.Object parent of this instance. + protected LoopFd(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent) { - return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]"; } -private static object ReadEvtKey = new object(); + /// Called when a read happened on the file descriptor public event EventHandler ReadEvt { - add { - lock (eventLock) { + add + { + lock (eflBindingEventLock) + { + Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) => + { + var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target; + if (obj != null) + { + EventArgs args = EventArgs.Empty; + try + { + value?.Invoke(obj, args); + } + catch (Exception e) + { + Eina.Log.Error(e.ToString()); + Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + } + } + }; + string key = "_EFL_LOOP_FD_EVENT_READ"; - if (AddNativeEventHandler(efl.Libs.Ecore, key, this.evt_ReadEvt_delegate)) { - eventHandlers.AddHandler(ReadEvtKey , value); - } else - Eina.Log.Error($"Error adding proxy for event {key}"); + AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value); } } - remove { - lock (eventLock) { + + remove + { + lock (eflBindingEventLock) + { string key = "_EFL_LOOP_FD_EVENT_READ"; - if (RemoveNativeEventHandler(key, this.evt_ReadEvt_delegate)) { - eventHandlers.RemoveHandler(ReadEvtKey , value); - } else - Eina.Log.Error($"Error removing proxy for event {key}"); + RemoveNativeEventHandler(efl.Libs.Ecore, key, value); } } } - ///Method to raise event ReadEvt. - public void On_ReadEvt(EventArgs e) + /// Method to raise event ReadEvt. + public void OnReadEvt(EventArgs e) { - EventHandler evt; - lock (eventLock) { - evt = (EventHandler)eventHandlers[ReadEvtKey]; + var key = "_EFL_LOOP_FD_EVENT_READ"; + IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key); + if (desc == IntPtr.Zero) + { + Eina.Log.Error($"Failed to get native event {key}"); + return; } - evt?.Invoke(this, e); - } - Efl.EventCb evt_ReadEvt_delegate; - private void on_ReadEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt) - { - EventArgs args = EventArgs.Empty; - try { - On_ReadEvt(args); - } catch (Exception e) { - Eina.Log.Error(e.ToString()); - Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); - } - } -private static object WriteEvtKey = new object(); + Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero); + } /// Called when a write happened on the file descriptor public event EventHandler WriteEvt { - add { - lock (eventLock) { + add + { + lock (eflBindingEventLock) + { + Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) => + { + var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target; + if (obj != null) + { + EventArgs args = EventArgs.Empty; + try + { + value?.Invoke(obj, args); + } + catch (Exception e) + { + Eina.Log.Error(e.ToString()); + Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + } + } + }; + string key = "_EFL_LOOP_FD_EVENT_WRITE"; - if (AddNativeEventHandler(efl.Libs.Ecore, key, this.evt_WriteEvt_delegate)) { - eventHandlers.AddHandler(WriteEvtKey , value); - } else - Eina.Log.Error($"Error adding proxy for event {key}"); + AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value); } } - remove { - lock (eventLock) { + + remove + { + lock (eflBindingEventLock) + { string key = "_EFL_LOOP_FD_EVENT_WRITE"; - if (RemoveNativeEventHandler(key, this.evt_WriteEvt_delegate)) { - eventHandlers.RemoveHandler(WriteEvtKey , value); - } else - Eina.Log.Error($"Error removing proxy for event {key}"); + RemoveNativeEventHandler(efl.Libs.Ecore, key, value); } } } - ///Method to raise event WriteEvt. - public void On_WriteEvt(EventArgs e) - { - EventHandler evt; - lock (eventLock) { - evt = (EventHandler)eventHandlers[WriteEvtKey]; - } - evt?.Invoke(this, e); - } - Efl.EventCb evt_WriteEvt_delegate; - private void on_WriteEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt) + /// Method to raise event WriteEvt. + public void OnWriteEvt(EventArgs e) { - EventArgs args = EventArgs.Empty; - try { - On_WriteEvt(args); - } catch (Exception e) { - Eina.Log.Error(e.ToString()); - Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + var key = "_EFL_LOOP_FD_EVENT_WRITE"; + IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key); + if (desc == IntPtr.Zero) + { + Eina.Log.Error($"Failed to get native event {key}"); + return; } - } -private static object ErrorEvtKey = new object(); + Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero); + } /// Called when a error occurred on the file descriptor public event EventHandler ErrorEvt { - add { - lock (eventLock) { + add + { + lock (eflBindingEventLock) + { + Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) => + { + var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target; + if (obj != null) + { + EventArgs args = EventArgs.Empty; + try + { + value?.Invoke(obj, args); + } + catch (Exception e) + { + Eina.Log.Error(e.ToString()); + Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + } + } + }; + string key = "_EFL_LOOP_FD_EVENT_ERROR"; - if (AddNativeEventHandler(efl.Libs.Ecore, key, this.evt_ErrorEvt_delegate)) { - eventHandlers.AddHandler(ErrorEvtKey , value); - } else - Eina.Log.Error($"Error adding proxy for event {key}"); + AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value); } } - remove { - lock (eventLock) { + + remove + { + lock (eflBindingEventLock) + { string key = "_EFL_LOOP_FD_EVENT_ERROR"; - if (RemoveNativeEventHandler(key, this.evt_ErrorEvt_delegate)) { - eventHandlers.RemoveHandler(ErrorEvtKey , value); - } else - Eina.Log.Error($"Error removing proxy for event {key}"); + RemoveNativeEventHandler(efl.Libs.Ecore, key, value); } } } - ///Method to raise event ErrorEvt. - public void On_ErrorEvt(EventArgs e) - { - EventHandler evt; - lock (eventLock) { - evt = (EventHandler)eventHandlers[ErrorEvtKey]; - } - evt?.Invoke(this, e); - } - Efl.EventCb evt_ErrorEvt_delegate; - private void on_ErrorEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt) + /// Method to raise event ErrorEvt. + public void OnErrorEvt(EventArgs e) { - EventArgs args = EventArgs.Empty; - try { - On_ErrorEvt(args); - } catch (Exception e) { - Eina.Log.Error(e.ToString()); - Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + var key = "_EFL_LOOP_FD_EVENT_ERROR"; + IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key); + if (desc == IntPtr.Zero) + { + Eina.Log.Error($"Failed to get native event {key}"); + return; } - } - ///Register the Eo event wrappers making the bridge to C# events. Internal usage only. - protected override void RegisterEventProxies() - { - base.RegisterEventProxies(); - evt_ReadEvt_delegate = new Efl.EventCb(on_ReadEvt_NativeCallback); - evt_WriteEvt_delegate = new Efl.EventCb(on_WriteEvt_NativeCallback); - evt_ErrorEvt_delegate = new Efl.EventCb(on_ErrorEvt_NativeCallback); + Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero); } /// Defines which file descriptor to watch. If it is a file, use file_fd variant. /// The file descriptor. virtual public int GetFd() { - var _ret_var = Efl.LoopFdNativeInherit.efl_loop_fd_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle)); + var _ret_var = Efl.LoopFd.NativeMethods.efl_loop_fd_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass))); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } /// Defines the fd to watch. /// The file descriptor. - /// - virtual public void SetFd( int fd) { - Efl.LoopFdNativeInherit.efl_loop_fd_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), fd); + virtual public void SetFd(int fd) { + Efl.LoopFd.NativeMethods.efl_loop_fd_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),fd); Eina.Error.RaiseIfUnhandledException(); } /// Defines which file descriptor to watch when watching a file. /// The file descriptor. virtual public int GetFdFile() { - var _ret_var = Efl.LoopFdNativeInherit.efl_loop_fd_file_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle)); + var _ret_var = Efl.LoopFd.NativeMethods.efl_loop_fd_file_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass))); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } /// Defines the fd to watch on. /// The file descriptor. - /// - virtual public void SetFdFile( int fd) { - Efl.LoopFdNativeInherit.efl_loop_fd_file_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), fd); + virtual public void SetFdFile(int fd) { + Efl.LoopFd.NativeMethods.efl_loop_fd_file_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),fd); Eina.Error.RaiseIfUnhandledException(); } /// Defines which file descriptor to watch. If it is a file, use file_fd variant. -/// The file descriptor. + /// The file descriptor. public int Fd { get { return GetFd(); } - set { SetFd( value); } + set { SetFd(value); } } /// Defines which file descriptor to watch when watching a file. -/// The file descriptor. + /// The file descriptor. public int FdFile { get { return GetFdFile(); } - set { SetFdFile( value); } + set { SetFdFile(value); } } private static IntPtr GetEflClassStatic() { return Efl.LoopFd.efl_loop_fd_class_get(); } -} -public class LoopFdNativeInherit : Efl.LoopConsumerNativeInherit{ - public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Ecore); - 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_loop_fd_get_static_delegate == null) - efl_loop_fd_get_static_delegate = new efl_loop_fd_get_delegate(fd_get); - if (methods.FirstOrDefault(m => m.Name == "GetFd") != null) - descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_fd_get"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_fd_get_static_delegate)}); - if (efl_loop_fd_set_static_delegate == null) - efl_loop_fd_set_static_delegate = new efl_loop_fd_set_delegate(fd_set); - if (methods.FirstOrDefault(m => m.Name == "SetFd") != null) - descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_fd_set"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_fd_set_static_delegate)}); - if (efl_loop_fd_file_get_static_delegate == null) - efl_loop_fd_file_get_static_delegate = new efl_loop_fd_file_get_delegate(fd_file_get); - if (methods.FirstOrDefault(m => m.Name == "GetFdFile") != null) - descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_fd_file_get"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_fd_file_get_static_delegate)}); - if (efl_loop_fd_file_set_static_delegate == null) - efl_loop_fd_file_set_static_delegate = new efl_loop_fd_file_set_delegate(fd_file_set); - if (methods.FirstOrDefault(m => m.Name == "SetFdFile") != null) - descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_fd_file_set"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_fd_file_set_static_delegate)}); - descs.AddRange(base.GetEoOps(type)); - return descs; - } - public override IntPtr GetEflClass() - { - return Efl.LoopFd.efl_loop_fd_class_get(); - } - public static new IntPtr GetEflClassStatic() + /// Wrapper for native methods and virtual method delegates. + /// For internal use by generated code only. + public new class NativeMethods : Efl.LoopConsumer.NativeMethods { - return Efl.LoopFd.efl_loop_fd_class_get(); - } + private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Ecore); + /// 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_loop_fd_get_static_delegate == null) + { + efl_loop_fd_get_static_delegate = new efl_loop_fd_get_delegate(fd_get); + } + + if (methods.FirstOrDefault(m => m.Name == "GetFd") != null) + { + descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_fd_get"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_fd_get_static_delegate) }); + } + if (efl_loop_fd_set_static_delegate == null) + { + efl_loop_fd_set_static_delegate = new efl_loop_fd_set_delegate(fd_set); + } - private delegate int efl_loop_fd_get_delegate(System.IntPtr obj, System.IntPtr pd); + if (methods.FirstOrDefault(m => m.Name == "SetFd") != null) + { + descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_fd_set"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_fd_set_static_delegate) }); + } + if (efl_loop_fd_file_get_static_delegate == null) + { + efl_loop_fd_file_get_static_delegate = new efl_loop_fd_file_get_delegate(fd_file_get); + } - public delegate int efl_loop_fd_get_api_delegate(System.IntPtr obj); - public static Efl.Eo.FunctionWrapper efl_loop_fd_get_ptr = new Efl.Eo.FunctionWrapper(_Module, "efl_loop_fd_get"); - private static int fd_get(System.IntPtr obj, System.IntPtr pd) - { - Eina.Log.Debug("function efl_loop_fd_get was called"); - Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd); - if(wrapper != null) { - int _ret_var = default(int); - try { - _ret_var = ((LoopFd)wrapper).GetFd(); - } catch (Exception e) { - Eina.Log.Warning($"Callback error: {e.ToString()}"); - Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + if (methods.FirstOrDefault(m => m.Name == "GetFdFile") != null) + { + descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_fd_file_get"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_fd_file_get_static_delegate) }); } - return _ret_var; - } else { - return efl_loop_fd_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); + + if (efl_loop_fd_file_set_static_delegate == null) + { + efl_loop_fd_file_set_static_delegate = new efl_loop_fd_file_set_delegate(fd_file_set); + } + + if (methods.FirstOrDefault(m => m.Name == "SetFdFile") != null) + { + descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_fd_file_set"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_fd_file_set_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.LoopFd.efl_loop_fd_class_get(); } - } - private static efl_loop_fd_get_delegate efl_loop_fd_get_static_delegate; + #pragma warning disable CA1707, CS1591, SA1300, SA1600 - private delegate void efl_loop_fd_set_delegate(System.IntPtr obj, System.IntPtr pd, int fd); + + private delegate int efl_loop_fd_get_delegate(System.IntPtr obj, System.IntPtr pd); + + public delegate int efl_loop_fd_get_api_delegate(System.IntPtr obj); + + public static Efl.Eo.FunctionWrapper efl_loop_fd_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_loop_fd_get"); + + private static int fd_get(System.IntPtr obj, System.IntPtr pd) + { + Eina.Log.Debug("function efl_loop_fd_get was called"); + var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); + if (ws != null) + { + int _ret_var = default(int); + try + { + _ret_var = ((LoopFd)ws.Target).GetFd(); + } + catch (Exception e) + { + Eina.Log.Warning($"Callback error: {e.ToString()}"); + Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + } + + return _ret_var; - public delegate void efl_loop_fd_set_api_delegate(System.IntPtr obj, int fd); - public static Efl.Eo.FunctionWrapper efl_loop_fd_set_ptr = new Efl.Eo.FunctionWrapper(_Module, "efl_loop_fd_set"); - private static void fd_set(System.IntPtr obj, System.IntPtr pd, int fd) - { - Eina.Log.Debug("function efl_loop_fd_set was called"); - Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd); - if(wrapper != null) { - - try { - ((LoopFd)wrapper).SetFd( fd); - } catch (Exception e) { - Eina.Log.Warning($"Callback error: {e.ToString()}"); - Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } - } else { - efl_loop_fd_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), fd); + else + { + return efl_loop_fd_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); + } } - } - private static efl_loop_fd_set_delegate efl_loop_fd_set_static_delegate; + private static efl_loop_fd_get_delegate efl_loop_fd_get_static_delegate; - private delegate int efl_loop_fd_file_get_delegate(System.IntPtr obj, System.IntPtr pd); + + private delegate void efl_loop_fd_set_delegate(System.IntPtr obj, System.IntPtr pd, int fd); + + public delegate void efl_loop_fd_set_api_delegate(System.IntPtr obj, int fd); - public delegate int efl_loop_fd_file_get_api_delegate(System.IntPtr obj); - public static Efl.Eo.FunctionWrapper efl_loop_fd_file_get_ptr = new Efl.Eo.FunctionWrapper(_Module, "efl_loop_fd_file_get"); - private static int fd_file_get(System.IntPtr obj, System.IntPtr pd) - { - Eina.Log.Debug("function efl_loop_fd_file_get was called"); - Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd); - if(wrapper != null) { - int _ret_var = default(int); - try { - _ret_var = ((LoopFd)wrapper).GetFdFile(); - } catch (Exception e) { - Eina.Log.Warning($"Callback error: {e.ToString()}"); - Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + public static Efl.Eo.FunctionWrapper efl_loop_fd_set_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_loop_fd_set"); + + private static void fd_set(System.IntPtr obj, System.IntPtr pd, int fd) + { + Eina.Log.Debug("function efl_loop_fd_set was called"); + var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); + if (ws != null) + { + + try + { + ((LoopFd)ws.Target).SetFd(fd); + } + catch (Exception e) + { + Eina.Log.Warning($"Callback error: {e.ToString()}"); + Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + } + + } + else + { + efl_loop_fd_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), fd); + } + } + + private static efl_loop_fd_set_delegate efl_loop_fd_set_static_delegate; + + + private delegate int efl_loop_fd_file_get_delegate(System.IntPtr obj, System.IntPtr pd); + + + public delegate int efl_loop_fd_file_get_api_delegate(System.IntPtr obj); + + public static Efl.Eo.FunctionWrapper efl_loop_fd_file_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_loop_fd_file_get"); + + private static int fd_file_get(System.IntPtr obj, System.IntPtr pd) + { + Eina.Log.Debug("function efl_loop_fd_file_get was called"); + var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); + if (ws != null) + { + int _ret_var = default(int); + try + { + _ret_var = ((LoopFd)ws.Target).GetFdFile(); + } + catch (Exception e) + { + Eina.Log.Warning($"Callback error: {e.ToString()}"); + Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + } + return _ret_var; - } else { - return efl_loop_fd_file_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); + + } + else + { + return efl_loop_fd_file_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); + } } - } - private static efl_loop_fd_file_get_delegate efl_loop_fd_file_get_static_delegate; + private static efl_loop_fd_file_get_delegate efl_loop_fd_file_get_static_delegate; - private delegate void efl_loop_fd_file_set_delegate(System.IntPtr obj, System.IntPtr pd, int fd); + + private delegate void efl_loop_fd_file_set_delegate(System.IntPtr obj, System.IntPtr pd, int fd); + + public delegate void efl_loop_fd_file_set_api_delegate(System.IntPtr obj, int fd); - public delegate void efl_loop_fd_file_set_api_delegate(System.IntPtr obj, int fd); - public static Efl.Eo.FunctionWrapper efl_loop_fd_file_set_ptr = new Efl.Eo.FunctionWrapper(_Module, "efl_loop_fd_file_set"); - private static void fd_file_set(System.IntPtr obj, System.IntPtr pd, int fd) - { - Eina.Log.Debug("function efl_loop_fd_file_set was called"); - Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd); - if(wrapper != null) { - - try { - ((LoopFd)wrapper).SetFdFile( fd); - } catch (Exception e) { - Eina.Log.Warning($"Callback error: {e.ToString()}"); - Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + public static Efl.Eo.FunctionWrapper efl_loop_fd_file_set_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_loop_fd_file_set"); + + private static void fd_file_set(System.IntPtr obj, System.IntPtr pd, int fd) + { + Eina.Log.Debug("function efl_loop_fd_file_set was called"); + var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); + if (ws != null) + { + + try + { + ((LoopFd)ws.Target).SetFdFile(fd); + } + catch (Exception e) + { + Eina.Log.Warning($"Callback error: {e.ToString()}"); + Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + } + + + } + else + { + efl_loop_fd_file_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), fd); } - } else { - efl_loop_fd_file_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), fd); } + + private static efl_loop_fd_file_set_delegate efl_loop_fd_file_set_static_delegate; + + #pragma warning restore CA1707, CS1591, SA1300, SA1600 + +} +} +} + +#if EFL_BETA +#pragma warning disable CS1591 +public static class EflLoopFd_ExtensionMethods { + public static Efl.BindableProperty Fd(this Efl.Ui.ItemFactory fac, Efl.Csharp.ExtensionTagmagic = null) where T : Efl.LoopFd { + return new Efl.BindableProperty("fd", fac); } - private static efl_loop_fd_file_set_delegate efl_loop_fd_file_set_static_delegate; + + public static Efl.BindableProperty FdFile(this Efl.Ui.ItemFactory fac, Efl.Csharp.ExtensionTagmagic = null) where T : Efl.LoopFd { + return new Efl.BindableProperty("fd_file", fac); + } + } -} +#pragma warning restore CS1591 +#endif