#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 Ui { /// An off-screen window to be displayed in a remote process. /// The window is rendered onto an image buffer to be displayed in another process' plug image object. No actual window is created for this type. The window contents can then be sent over a socket so that another process displays it inside a plug image. /// This is a BETA class. It can be modified or removed in the future. Do not use it for product development. [Efl.Ui.WinSocket.NativeMethods] [Efl.Eo.BindingEntity] public class WinSocket : Efl.Ui.Win { /// Pointer to the native class description. public override System.IntPtr NativeClass { get { if (((object)this).GetType() == typeof(WinSocket)) { 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_win_socket_class_get(); /// Initializes a new instance of the class. /// Parent instance. /// The widget style to use. See /// The window name. See /// The type of the window. See /// The hardware acceleration preference for this window. See public WinSocket(Efl.Object parent , System.String style = null, System.String winName = null, Efl.Ui.WinType? winType = null, System.String accelPreference = null) : base(efl_ui_win_socket_class_get(), parent) { if (Efl.Eo.Globals.ParamHelperCheck(style)) { SetStyle(Efl.Eo.Globals.GetParamHelper(style)); } if (Efl.Eo.Globals.ParamHelperCheck(winName)) { SetWinName(Efl.Eo.Globals.GetParamHelper(winName)); } if (Efl.Eo.Globals.ParamHelperCheck(winType)) { SetWinType(Efl.Eo.Globals.GetParamHelper(winType)); } if (Efl.Eo.Globals.ParamHelperCheck(accelPreference)) { SetAccelPreference(Efl.Eo.Globals.GetParamHelper(accelPreference)); } FinishInstantiation(); } /// 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 WinSocket(ConstructingHandle ch) : base(ch) { } /// 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 WinSocket(Efl.Eo.Globals.WrappingHandle wh) : base(wh) { } /// 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 WinSocket(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent) { } /// Create a socket to provide the service for Plug widget. /// The name of the service to be advertised. Ensure that it is unique (when combined with svcnum) otherwise creation may fail. /// A number (any value, 0 being the common default) to differentiate multiple instances of services with the same name. /// A boolean which when true specifies the creation of a system-wide service to which all users can connect, otherwise the service is private to the user id that created it. /// true on success, false otherwise virtual public bool SocketListen(System.String svcname, int svcnum, bool svcsys) { var _ret_var = Efl.Ui.WinSocket.NativeMethods.efl_ui_win_socket_listen_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),svcname, svcnum, svcsys); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } private static IntPtr GetEflClassStatic() { return Efl.Ui.WinSocket.efl_ui_win_socket_class_get(); } /// Wrapper for native methods and virtual method delegates. /// For internal use by generated code only. public new class NativeMethods : Efl.Ui.Win.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_ui_win_socket_listen_static_delegate == null) { efl_ui_win_socket_listen_static_delegate = new efl_ui_win_socket_listen_delegate(socket_listen); } if (methods.FirstOrDefault(m => m.Name == "SocketListen") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_win_socket_listen"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_win_socket_listen_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.WinSocket.efl_ui_win_socket_class_get(); } #pragma warning disable CA1707, CS1591, SA1300, SA1600 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_ui_win_socket_listen_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String svcname, int svcnum, [MarshalAs(UnmanagedType.U1)] bool svcsys); [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_ui_win_socket_listen_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String svcname, int svcnum, [MarshalAs(UnmanagedType.U1)] bool svcsys); public static Efl.Eo.FunctionWrapper efl_ui_win_socket_listen_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_win_socket_listen"); private static bool socket_listen(System.IntPtr obj, System.IntPtr pd, System.String svcname, int svcnum, bool svcsys) { Eina.Log.Debug("function efl_ui_win_socket_listen was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { bool _ret_var = default(bool); try { _ret_var = ((WinSocket)ws.Target).SocketListen(svcname, svcnum, svcsys); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } return _ret_var; } else { return efl_ui_win_socket_listen_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), svcname, svcnum, svcsys); } } private static efl_ui_win_socket_listen_delegate efl_ui_win_socket_listen_static_delegate; #pragma warning restore CA1707, CS1591, SA1300, SA1600 } } } } #if EFL_BETA #pragma warning disable CS1591 public static class Efl_UiWinSocket_ExtensionMethods { } #pragma warning restore CS1591 #endif