1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
12 /// <summary>Low-level snapshot image object.
13 /// A snapshot is a special kind of image containing the pixels from all the objects below it. This allows applications to save screenshots of all or part of their UI, or apply filters to parts of the UI.</summary>
14 [Efl.Canvas.Snapshot.NativeMethods]
15 public class Snapshot : Efl.Canvas.ImageInternal, Efl.Eo.IWrapper
17 ///<summary>Pointer to the native class description.</summary>
18 public override System.IntPtr NativeClass
22 if (((object)this).GetType() == typeof(Snapshot))
24 return GetEflClassStatic();
28 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
33 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
34 efl_canvas_snapshot_class_get();
35 /// <summary>Initializes a new instance of the <see cref="Snapshot"/> class.</summary>
36 /// <param name="parent">Parent instance.</param>
37 public Snapshot(Efl.Object parent= null
38 ) : base(efl_canvas_snapshot_class_get(), typeof(Snapshot), parent)
40 FinishInstantiation();
43 /// <summary>Initializes a new instance of the <see cref="Snapshot"/> class.
44 /// 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 /// <param name="raw">The native pointer to be wrapped.</param>
46 protected Snapshot(System.IntPtr raw) : base(raw)
50 /// <summary>Initializes a new instance of the <see cref="Snapshot"/> class.
51 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
52 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
53 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
54 /// <param name="parent">The Efl.Object parent of this instance.</param>
55 protected Snapshot(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
59 /// <summary>Verifies if the given object is equal to this one.</summary>
60 /// <param name="instance">The object to compare to.</param>
61 /// <returns>True if both objects point to the same native object.</returns>
62 public override bool Equals(object instance)
64 var other = instance as Efl.Object;
69 return this.NativeHandle == other.NativeHandle;
72 /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
73 /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
74 public override int GetHashCode()
76 return this.NativeHandle.ToInt32();
79 /// <summary>Turns the native pointer into a string representation.</summary>
80 /// <returns>A string with the type and the native pointer for this object.</returns>
81 public override String ToString()
83 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
86 private static IntPtr GetEflClassStatic()
88 return Efl.Canvas.Snapshot.efl_canvas_snapshot_class_get();
90 /// <summary>Wrapper for native methods and virtual method delegates.
91 /// For internal use by generated code only.</summary>
92 public new class NativeMethods : Efl.Canvas.ImageInternal.NativeMethods
94 /// <summary>Gets the list of Eo operations to override.</summary>
95 /// <returns>The list of Eo operations to be overload.</returns>
96 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
98 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
99 descs.AddRange(base.GetEoOps(type));
102 /// <summary>Returns the Eo class for the native methods of this class.</summary>
103 /// <returns>The native class pointer.</returns>
104 public override IntPtr GetEflClass()
106 return Efl.Canvas.Snapshot.efl_canvas_snapshot_class_get();
109 #pragma warning disable CA1707, SA1300, SA1600
111 #pragma warning restore CA1707, SA1300, SA1600