1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Ui {
8 /// <summary>An inlined window.
9 /// The window is rendered onto an image buffer. No actual window is created, instead the window and all of its contents will be rendered to an image buffer. This allows child windows inside a parent just like any other object. You can also do other things like apply map effects. This window must have a valid <see cref="Efl.Canvas.Object"/> parent.</summary>
10 [WinInlinedNativeInherit]
11 public class WinInlined : Efl.Ui.Win, Efl.Eo.IWrapper
13 ///<summary>Pointer to the native class description.</summary>
14 public override System.IntPtr NativeClass {
16 if (((object)this).GetType() == typeof (WinInlined))
17 return Efl.Ui.WinInlinedNativeInherit.GetEflClassStatic();
19 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
22 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
23 efl_ui_win_inlined_class_get();
24 ///<summary>Creates a new instance.</summary>
25 ///<param name="parent">Parent instance.</param>
26 ///<param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle"/></param>
27 ///<param name="winName">The window name. See <see cref="Efl.Ui.Win.SetWinName"/></param>
28 ///<param name="winType">The type of the window. See <see cref="Efl.Ui.Win.SetWinType"/></param>
29 ///<param name="accelPreference">The hardware acceleration preference for this window. See <see cref="Efl.Ui.Win.SetAccelPreference"/></param>
30 public WinInlined(Efl.Object parent
31 , System.String style = null, System.String winName = null, Efl.Ui.WinType? winType = null, System.String accelPreference = null) :
32 base(efl_ui_win_inlined_class_get(), typeof(WinInlined), parent)
34 if (Efl.Eo.Globals.ParamHelperCheck(style))
35 SetStyle(Efl.Eo.Globals.GetParamHelper(style));
36 if (Efl.Eo.Globals.ParamHelperCheck(winName))
37 SetWinName(Efl.Eo.Globals.GetParamHelper(winName));
38 if (Efl.Eo.Globals.ParamHelperCheck(winType))
39 SetWinType(Efl.Eo.Globals.GetParamHelper(winType));
40 if (Efl.Eo.Globals.ParamHelperCheck(accelPreference))
41 SetAccelPreference(Efl.Eo.Globals.GetParamHelper(accelPreference));
42 FinishInstantiation();
44 ///<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>
45 protected WinInlined(System.IntPtr raw) : base(raw)
47 RegisterEventProxies();
49 ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
50 protected WinInlined(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
51 ///<summary>Verifies if the given object is equal to this one.</summary>
52 public override bool Equals(object obj)
54 var other = obj as Efl.Object;
57 return this.NativeHandle == other.NativeHandle;
59 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
60 public override int GetHashCode()
62 return this.NativeHandle.ToInt32();
64 ///<summary>Turns the native pointer into a string representation.</summary>
65 public override String ToString()
67 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
69 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
70 protected override void RegisterEventProxies()
72 base.RegisterEventProxies();
74 /// <summary>This property holds the parent object in the parent canvas.</summary>
75 /// <returns>An object in the parent canvas.</returns>
76 virtual public Efl.Canvas.Object GetInlinedParent() {
77 var _ret_var = Efl.Ui.WinInlinedNativeInherit.efl_ui_win_inlined_parent_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
78 Eina.Error.RaiseIfUnhandledException();
81 /// <summary>This property holds the parent object in the parent canvas.</summary>
82 /// <value>An object in the parent canvas.</value>
83 public Efl.Canvas.Object InlinedParent {
84 get { return GetInlinedParent(); }
86 private static IntPtr GetEflClassStatic()
88 return Efl.Ui.WinInlined.efl_ui_win_inlined_class_get();
91 public class WinInlinedNativeInherit : Efl.Ui.WinNativeInherit{
92 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
93 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
95 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
96 var methods = Efl.Eo.Globals.GetUserMethods(type);
97 if (efl_ui_win_inlined_parent_get_static_delegate == null)
98 efl_ui_win_inlined_parent_get_static_delegate = new efl_ui_win_inlined_parent_get_delegate(inlined_parent_get);
99 if (methods.FirstOrDefault(m => m.Name == "GetInlinedParent") != null)
100 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_win_inlined_parent_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_win_inlined_parent_get_static_delegate)});
101 descs.AddRange(base.GetEoOps(type));
104 public override IntPtr GetEflClass()
106 return Efl.Ui.WinInlined.efl_ui_win_inlined_class_get();
108 public static new IntPtr GetEflClassStatic()
110 return Efl.Ui.WinInlined.efl_ui_win_inlined_class_get();
114 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Object, Efl.Eo.NonOwnTag>))] private delegate Efl.Canvas.Object efl_ui_win_inlined_parent_get_delegate(System.IntPtr obj, System.IntPtr pd);
117 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Object, Efl.Eo.NonOwnTag>))] public delegate Efl.Canvas.Object efl_ui_win_inlined_parent_get_api_delegate(System.IntPtr obj);
118 public static Efl.Eo.FunctionWrapper<efl_ui_win_inlined_parent_get_api_delegate> efl_ui_win_inlined_parent_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_win_inlined_parent_get_api_delegate>(_Module, "efl_ui_win_inlined_parent_get");
119 private static Efl.Canvas.Object inlined_parent_get(System.IntPtr obj, System.IntPtr pd)
121 Eina.Log.Debug("function efl_ui_win_inlined_parent_get was called");
122 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
123 if(wrapper != null) {
124 Efl.Canvas.Object _ret_var = default(Efl.Canvas.Object);
126 _ret_var = ((WinInlined)wrapper).GetInlinedParent();
127 } catch (Exception e) {
128 Eina.Log.Warning($"Callback error: {e.ToString()}");
129 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
133 return efl_ui_win_inlined_parent_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
136 private static efl_ui_win_inlined_parent_get_delegate efl_ui_win_inlined_parent_get_static_delegate;