2 #pragma warning disable CS1591
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
7 using System.Threading;
8 using System.ComponentModel;
13 /// <summary>Native X11 surface for Efl canvas</summary>
14 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
15 [Efl.Canvas.SurfaceX11.NativeMethods]
16 [Efl.Eo.BindingEntity]
17 public class SurfaceX11 : Efl.Canvas.Surface
19 /// <summary>Pointer to the native class description.</summary>
20 public override System.IntPtr NativeClass
24 if (((object)this).GetType() == typeof(SurfaceX11))
26 return GetEflClassStatic();
30 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
35 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
36 efl_canvas_surface_x11_class_get();
37 /// <summary>Initializes a new instance of the <see cref="SurfaceX11"/> class.</summary>
38 /// <param name="parent">Parent instance.</param>
39 public SurfaceX11(Efl.Object parent= null
40 ) : base(efl_canvas_surface_x11_class_get(), parent)
42 FinishInstantiation();
45 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
46 /// Do not call this constructor directly.</summary>
47 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
48 protected SurfaceX11(ConstructingHandle ch) : base(ch)
52 /// <summary>Initializes a new instance of the <see cref="SurfaceX11"/> class.
53 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
54 /// <param name="wh">The native pointer to be wrapped.</param>
55 protected SurfaceX11(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
59 /// <summary>Initializes a new instance of the <see cref="SurfaceX11"/> class.
60 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
61 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
62 /// <param name="parent">The Efl.Object parent of this instance.</param>
63 protected SurfaceX11(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
67 /// <summary>This is a helper for <see cref="Efl.Canvas.Surface.NativeBuffer"/>.</summary>
68 /// <param name="visual">X11 Visual for this Pixmap.</param>
69 /// <param name="pixmap">X11 Pixmap ID.</param>
70 virtual public void GetPixmap(out System.IntPtr visual, out uint pixmap) {
71 Efl.Canvas.SurfaceX11.NativeMethods.efl_canvas_surface_x11_pixmap_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),out visual, out pixmap);
72 Eina.Error.RaiseIfUnhandledException();
74 /// <summary>This is a helper for <see cref="Efl.Canvas.Surface.NativeBuffer"/>.</summary>
75 /// <param name="visual">X11 Visual for this Pixmap.</param>
76 /// <param name="pixmap">X11 Pixmap ID.</param>
77 /// <returns><c>true</c> on success, <c>false</c> otherwise</returns>
78 virtual public bool SetPixmap(System.IntPtr visual, uint pixmap) {
79 var _ret_var = Efl.Canvas.SurfaceX11.NativeMethods.efl_canvas_surface_x11_pixmap_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),visual, pixmap);
80 Eina.Error.RaiseIfUnhandledException();
83 /// <summary>This is a helper for <see cref="Efl.Canvas.Surface.NativeBuffer"/>.</summary>
84 /// <value>X11 Visual for this Pixmap.</value>
85 public (System.IntPtr, uint) Pixmap {
87 System.IntPtr _out_visual = default(System.IntPtr);
88 uint _out_pixmap = default(uint);
89 GetPixmap(out _out_visual,out _out_pixmap);
90 return (_out_visual,_out_pixmap);
92 set { SetPixmap( value.Item1, value.Item2); }
94 private static IntPtr GetEflClassStatic()
96 return Efl.Canvas.SurfaceX11.efl_canvas_surface_x11_class_get();
98 /// <summary>Wrapper for native methods and virtual method delegates.
99 /// For internal use by generated code only.</summary>
100 public new class NativeMethods : Efl.Canvas.Surface.NativeMethods
102 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Evas);
103 /// <summary>Gets the list of Eo operations to override.</summary>
104 /// <returns>The list of Eo operations to be overload.</returns>
105 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
107 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
108 var methods = Efl.Eo.Globals.GetUserMethods(type);
110 if (efl_canvas_surface_x11_pixmap_get_static_delegate == null)
112 efl_canvas_surface_x11_pixmap_get_static_delegate = new efl_canvas_surface_x11_pixmap_get_delegate(pixmap_get);
115 if (methods.FirstOrDefault(m => m.Name == "GetPixmap") != null)
117 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_surface_x11_pixmap_get"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_surface_x11_pixmap_get_static_delegate) });
120 if (efl_canvas_surface_x11_pixmap_set_static_delegate == null)
122 efl_canvas_surface_x11_pixmap_set_static_delegate = new efl_canvas_surface_x11_pixmap_set_delegate(pixmap_set);
125 if (methods.FirstOrDefault(m => m.Name == "SetPixmap") != null)
127 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_surface_x11_pixmap_set"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_surface_x11_pixmap_set_static_delegate) });
130 descs.AddRange(base.GetEoOps(type));
133 /// <summary>Returns the Eo class for the native methods of this class.</summary>
134 /// <returns>The native class pointer.</returns>
135 public override IntPtr GetEflClass()
137 return Efl.Canvas.SurfaceX11.efl_canvas_surface_x11_class_get();
140 #pragma warning disable CA1707, CS1591, SA1300, SA1600
143 private delegate void efl_canvas_surface_x11_pixmap_get_delegate(System.IntPtr obj, System.IntPtr pd, out System.IntPtr visual, out uint pixmap);
146 public delegate void efl_canvas_surface_x11_pixmap_get_api_delegate(System.IntPtr obj, out System.IntPtr visual, out uint pixmap);
148 public static Efl.Eo.FunctionWrapper<efl_canvas_surface_x11_pixmap_get_api_delegate> efl_canvas_surface_x11_pixmap_get_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_surface_x11_pixmap_get_api_delegate>(Module, "efl_canvas_surface_x11_pixmap_get");
150 private static void pixmap_get(System.IntPtr obj, System.IntPtr pd, out System.IntPtr visual, out uint pixmap)
152 Eina.Log.Debug("function efl_canvas_surface_x11_pixmap_get was called");
153 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
156 visual = default(System.IntPtr); pixmap = default(uint);
159 ((SurfaceX11)ws.Target).GetPixmap(out visual, out pixmap);
163 Eina.Log.Warning($"Callback error: {e.ToString()}");
164 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
171 efl_canvas_surface_x11_pixmap_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), out visual, out pixmap);
175 private static efl_canvas_surface_x11_pixmap_get_delegate efl_canvas_surface_x11_pixmap_get_static_delegate;
177 [return: MarshalAs(UnmanagedType.U1)]
178 private delegate bool efl_canvas_surface_x11_pixmap_set_delegate(System.IntPtr obj, System.IntPtr pd, System.IntPtr visual, uint pixmap);
180 [return: MarshalAs(UnmanagedType.U1)]
181 public delegate bool efl_canvas_surface_x11_pixmap_set_api_delegate(System.IntPtr obj, System.IntPtr visual, uint pixmap);
183 public static Efl.Eo.FunctionWrapper<efl_canvas_surface_x11_pixmap_set_api_delegate> efl_canvas_surface_x11_pixmap_set_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_surface_x11_pixmap_set_api_delegate>(Module, "efl_canvas_surface_x11_pixmap_set");
185 private static bool pixmap_set(System.IntPtr obj, System.IntPtr pd, System.IntPtr visual, uint pixmap)
187 Eina.Log.Debug("function efl_canvas_surface_x11_pixmap_set was called");
188 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
191 bool _ret_var = default(bool);
194 _ret_var = ((SurfaceX11)ws.Target).SetPixmap(visual, pixmap);
198 Eina.Log.Warning($"Callback error: {e.ToString()}");
199 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
207 return efl_canvas_surface_x11_pixmap_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), visual, pixmap);
211 private static efl_canvas_surface_x11_pixmap_set_delegate efl_canvas_surface_x11_pixmap_set_static_delegate;
213 #pragma warning restore CA1707, CS1591, SA1300, SA1600
222 #pragma warning disable CS1591
223 public static class Efl_CanvasSurfaceX11_ExtensionMethods {
226 #pragma warning restore CS1591
232 /// <summary>The type used by <see cref="Efl.Canvas.Surface.NativeBuffer"/>.</summary>
233 [StructLayout(LayoutKind.Sequential)]
234 [Efl.Eo.BindingEntity]
235 public struct SurfaceX11Pixmap
237 /// <summary>X11 Visual for this Pixmap.</summary>
238 public System.IntPtr Visual;
239 /// <summary>X11 Pixmap ID.</summary>
241 /// <summary>Constructor for SurfaceX11Pixmap.</summary>
242 /// <param name="Visual">X11 Visual for this Pixmap.</param>;
243 /// <param name="Pixmap">X11 Pixmap ID.</param>;
244 public SurfaceX11Pixmap(
245 System.IntPtr Visual = default(System.IntPtr),
246 uint Pixmap = default(uint) )
248 this.Visual = Visual;
249 this.Pixmap = Pixmap;
252 /// <summary>Implicit conversion to the managed representation from a native pointer.</summary>
253 /// <param name="ptr">Native pointer to be converted.</param>
254 public static implicit operator SurfaceX11Pixmap(IntPtr ptr)
256 var tmp = (SurfaceX11Pixmap.NativeStruct)Marshal.PtrToStructure(ptr, typeof(SurfaceX11Pixmap.NativeStruct));
260 #pragma warning disable CS1591
262 /// <summary>Internal wrapper for struct SurfaceX11Pixmap.</summary>
263 [StructLayout(LayoutKind.Sequential)]
264 public struct NativeStruct
267 public System.IntPtr Visual;
270 /// <summary>Implicit conversion to the internal/marshalling representation.</summary>
271 public static implicit operator SurfaceX11Pixmap.NativeStruct(SurfaceX11Pixmap _external_struct)
273 var _internal_struct = new SurfaceX11Pixmap.NativeStruct();
274 _internal_struct.Visual = _external_struct.Visual;
275 _internal_struct.Pixmap = _external_struct.Pixmap;
276 return _internal_struct;
279 /// <summary>Implicit conversion to the managed representation.</summary>
280 public static implicit operator SurfaceX11Pixmap(SurfaceX11Pixmap.NativeStruct _internal_struct)
282 var _external_struct = new SurfaceX11Pixmap();
283 _external_struct.Visual = _internal_struct.Visual;
284 _external_struct.Pixmap = _internal_struct.Pixmap;
285 return _external_struct;
290 #pragma warning restore CS1591