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 proxy image object.
13 /// A proxy is a special kind of image containing the pixels from a source object attached to it. It can be used to apply some sort of image transformation to any object (eg. filters, map or zoom).</summary>
14 [Efl.Canvas.Proxy.NativeMethods]
15 public class Proxy : 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(Proxy))
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_proxy_class_get();
35 /// <summary>Initializes a new instance of the <see cref="Proxy"/> class.</summary>
36 /// <param name="parent">Parent instance.</param>
37 public Proxy(Efl.Object parent= null
38 ) : base(efl_canvas_proxy_class_get(), typeof(Proxy), parent)
40 FinishInstantiation();
43 /// <summary>Initializes a new instance of the <see cref="Proxy"/> 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 Proxy(System.IntPtr raw) : base(raw)
50 /// <summary>Initializes a new instance of the <see cref="Proxy"/> 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 Proxy(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 /// <summary>The source object for this proxy.
87 /// The proxy object will mirror the rendering contents of a given source object in its drawing region, without affecting that source in any way. The source must be another valid <see cref="Efl.Canvas.Object"/>. Other effects may be applied to the proxy, such as a map (see <see cref="Efl.Gfx.IMapping"/>) to create a reflection of the original object (for example).
89 /// Any existing source object will be removed after this call.
91 /// Note: This property should be set as soon as creating a proxy object, otherwise the proxy will do nothing.
93 /// Warning: You cannot set a proxy as another proxy's source.</summary>
94 /// <returns>Source object to use for the proxy.</returns>
95 virtual public Efl.Canvas.Object GetSource() {
96 var _ret_var = Efl.Canvas.Proxy.NativeMethods.efl_canvas_proxy_source_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
97 Eina.Error.RaiseIfUnhandledException();
100 /// <summary>The source object for this proxy.
101 /// The proxy object will mirror the rendering contents of a given source object in its drawing region, without affecting that source in any way. The source must be another valid <see cref="Efl.Canvas.Object"/>. Other effects may be applied to the proxy, such as a map (see <see cref="Efl.Gfx.IMapping"/>) to create a reflection of the original object (for example).
103 /// Any existing source object will be removed after this call.
105 /// Note: This property should be set as soon as creating a proxy object, otherwise the proxy will do nothing.
107 /// Warning: You cannot set a proxy as another proxy's source.</summary>
108 /// <param name="src">Source object to use for the proxy.</param>
109 /// <returns>Returns <c>true</c> in case of success.</returns>
110 virtual public bool SetSource(Efl.Canvas.Object src) {
111 var _ret_var = Efl.Canvas.Proxy.NativeMethods.efl_canvas_proxy_source_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),src);
112 Eina.Error.RaiseIfUnhandledException();
115 /// <summary>Clip this proxy object with the source object's clipper.
116 /// Use this if you want to overlay an existing object with its proxy, and apply some sort of transformation on it.
118 /// <c>true</c> means both objects will share the same clip.</summary>
119 /// <returns>Whether <c>obj</c> is clipped by the source clipper (<c>true</c>) or not (<c>false</c>).</returns>
120 virtual public bool GetSourceClip() {
121 var _ret_var = Efl.Canvas.Proxy.NativeMethods.efl_canvas_proxy_source_clip_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
122 Eina.Error.RaiseIfUnhandledException();
125 /// <summary>Clip this proxy object with the source object's clipper.
126 /// Use this if you want to overlay an existing object with its proxy, and apply some sort of transformation on it.
128 /// <c>true</c> means both objects will share the same clip.</summary>
129 /// <param name="source_clip">Whether <c>obj</c> is clipped by the source clipper (<c>true</c>) or not (<c>false</c>).</param>
130 virtual public void SetSourceClip(bool source_clip) {
131 Efl.Canvas.Proxy.NativeMethods.efl_canvas_proxy_source_clip_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),source_clip);
132 Eina.Error.RaiseIfUnhandledException();
134 /// <summary>Defines whether the events on this object are repeated to the source.
135 /// If <c>source</c> is <c>true</c>, it will make events on <c>obj</c> to also be repeated for the source object (see <see cref="Efl.Canvas.Proxy.SetSource"/>). Even the <c>obj</c> and source geometries are different, the event position will be transformed to the source object's space.
137 /// If <c>source</c> is <c>false</c>, events occurring on <c>obj</c> will be processed only on it.</summary>
138 /// <returns>Whether this object should pass events (<c>true</c>) or not (<c>false</c>) to its source.</returns>
139 virtual public bool GetSourceEvents() {
140 var _ret_var = Efl.Canvas.Proxy.NativeMethods.efl_canvas_proxy_source_events_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
141 Eina.Error.RaiseIfUnhandledException();
144 /// <summary>Defines whether the events on this object are repeated to the source.
145 /// If <c>source</c> is <c>true</c>, it will make events on <c>obj</c> to also be repeated for the source object (see <see cref="Efl.Canvas.Proxy.SetSource"/>). Even the <c>obj</c> and source geometries are different, the event position will be transformed to the source object's space.
147 /// If <c>source</c> is <c>false</c>, events occurring on <c>obj</c> will be processed only on it.</summary>
148 /// <param name="repeat">Whether this object should pass events (<c>true</c>) or not (<c>false</c>) to its source.</param>
149 virtual public void SetSourceEvents(bool repeat) {
150 Efl.Canvas.Proxy.NativeMethods.efl_canvas_proxy_source_events_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),repeat);
151 Eina.Error.RaiseIfUnhandledException();
153 /// <summary>The source object for this proxy.
154 /// The proxy object will mirror the rendering contents of a given source object in its drawing region, without affecting that source in any way. The source must be another valid <see cref="Efl.Canvas.Object"/>. Other effects may be applied to the proxy, such as a map (see <see cref="Efl.Gfx.IMapping"/>) to create a reflection of the original object (for example).
156 /// Any existing source object will be removed after this call.
158 /// Note: This property should be set as soon as creating a proxy object, otherwise the proxy will do nothing.
160 /// Warning: You cannot set a proxy as another proxy's source.</summary>
161 /// <value>Source object to use for the proxy.</value>
162 public Efl.Canvas.Object Source {
163 get { return GetSource(); }
164 set { SetSource(value); }
166 /// <summary>Clip this proxy object with the source object's clipper.
167 /// Use this if you want to overlay an existing object with its proxy, and apply some sort of transformation on it.
169 /// <c>true</c> means both objects will share the same clip.</summary>
170 /// <value>Whether <c>obj</c> is clipped by the source clipper (<c>true</c>) or not (<c>false</c>).</value>
171 public bool SourceClip {
172 get { return GetSourceClip(); }
173 set { SetSourceClip(value); }
175 /// <summary>Defines whether the events on this object are repeated to the source.
176 /// If <c>source</c> is <c>true</c>, it will make events on <c>obj</c> to also be repeated for the source object (see <see cref="Efl.Canvas.Proxy.SetSource"/>). Even the <c>obj</c> and source geometries are different, the event position will be transformed to the source object's space.
178 /// If <c>source</c> is <c>false</c>, events occurring on <c>obj</c> will be processed only on it.</summary>
179 /// <value>Whether this object should pass events (<c>true</c>) or not (<c>false</c>) to its source.</value>
180 public bool SourceEvents {
181 get { return GetSourceEvents(); }
182 set { SetSourceEvents(value); }
184 private static IntPtr GetEflClassStatic()
186 return Efl.Canvas.Proxy.efl_canvas_proxy_class_get();
188 /// <summary>Wrapper for native methods and virtual method delegates.
189 /// For internal use by generated code only.</summary>
190 public new class NativeMethods : Efl.Canvas.ImageInternal.NativeMethods
192 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Evas);
193 /// <summary>Gets the list of Eo operations to override.</summary>
194 /// <returns>The list of Eo operations to be overload.</returns>
195 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
197 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
198 var methods = Efl.Eo.Globals.GetUserMethods(type);
200 if (efl_canvas_proxy_source_get_static_delegate == null)
202 efl_canvas_proxy_source_get_static_delegate = new efl_canvas_proxy_source_get_delegate(source_get);
205 if (methods.FirstOrDefault(m => m.Name == "GetSource") != null)
207 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_proxy_source_get"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_proxy_source_get_static_delegate) });
210 if (efl_canvas_proxy_source_set_static_delegate == null)
212 efl_canvas_proxy_source_set_static_delegate = new efl_canvas_proxy_source_set_delegate(source_set);
215 if (methods.FirstOrDefault(m => m.Name == "SetSource") != null)
217 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_proxy_source_set"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_proxy_source_set_static_delegate) });
220 if (efl_canvas_proxy_source_clip_get_static_delegate == null)
222 efl_canvas_proxy_source_clip_get_static_delegate = new efl_canvas_proxy_source_clip_get_delegate(source_clip_get);
225 if (methods.FirstOrDefault(m => m.Name == "GetSourceClip") != null)
227 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_proxy_source_clip_get"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_proxy_source_clip_get_static_delegate) });
230 if (efl_canvas_proxy_source_clip_set_static_delegate == null)
232 efl_canvas_proxy_source_clip_set_static_delegate = new efl_canvas_proxy_source_clip_set_delegate(source_clip_set);
235 if (methods.FirstOrDefault(m => m.Name == "SetSourceClip") != null)
237 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_proxy_source_clip_set"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_proxy_source_clip_set_static_delegate) });
240 if (efl_canvas_proxy_source_events_get_static_delegate == null)
242 efl_canvas_proxy_source_events_get_static_delegate = new efl_canvas_proxy_source_events_get_delegate(source_events_get);
245 if (methods.FirstOrDefault(m => m.Name == "GetSourceEvents") != null)
247 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_proxy_source_events_get"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_proxy_source_events_get_static_delegate) });
250 if (efl_canvas_proxy_source_events_set_static_delegate == null)
252 efl_canvas_proxy_source_events_set_static_delegate = new efl_canvas_proxy_source_events_set_delegate(source_events_set);
255 if (methods.FirstOrDefault(m => m.Name == "SetSourceEvents") != null)
257 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_proxy_source_events_set"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_proxy_source_events_set_static_delegate) });
260 descs.AddRange(base.GetEoOps(type));
263 /// <summary>Returns the Eo class for the native methods of this class.</summary>
264 /// <returns>The native class pointer.</returns>
265 public override IntPtr GetEflClass()
267 return Efl.Canvas.Proxy.efl_canvas_proxy_class_get();
270 #pragma warning disable CA1707, SA1300, SA1600
272 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
273 private delegate Efl.Canvas.Object efl_canvas_proxy_source_get_delegate(System.IntPtr obj, System.IntPtr pd);
275 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
276 public delegate Efl.Canvas.Object efl_canvas_proxy_source_get_api_delegate(System.IntPtr obj);
278 public static Efl.Eo.FunctionWrapper<efl_canvas_proxy_source_get_api_delegate> efl_canvas_proxy_source_get_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_proxy_source_get_api_delegate>(Module, "efl_canvas_proxy_source_get");
280 private static Efl.Canvas.Object source_get(System.IntPtr obj, System.IntPtr pd)
282 Eina.Log.Debug("function efl_canvas_proxy_source_get was called");
283 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
286 Efl.Canvas.Object _ret_var = default(Efl.Canvas.Object);
289 _ret_var = ((Proxy)wrapper).GetSource();
293 Eina.Log.Warning($"Callback error: {e.ToString()}");
294 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
302 return efl_canvas_proxy_source_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
306 private static efl_canvas_proxy_source_get_delegate efl_canvas_proxy_source_get_static_delegate;
308 [return: MarshalAs(UnmanagedType.U1)]
309 private delegate bool efl_canvas_proxy_source_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Canvas.Object src);
311 [return: MarshalAs(UnmanagedType.U1)]
312 public delegate bool efl_canvas_proxy_source_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Canvas.Object src);
314 public static Efl.Eo.FunctionWrapper<efl_canvas_proxy_source_set_api_delegate> efl_canvas_proxy_source_set_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_proxy_source_set_api_delegate>(Module, "efl_canvas_proxy_source_set");
316 private static bool source_set(System.IntPtr obj, System.IntPtr pd, Efl.Canvas.Object src)
318 Eina.Log.Debug("function efl_canvas_proxy_source_set was called");
319 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
322 bool _ret_var = default(bool);
325 _ret_var = ((Proxy)wrapper).SetSource(src);
329 Eina.Log.Warning($"Callback error: {e.ToString()}");
330 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
338 return efl_canvas_proxy_source_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), src);
342 private static efl_canvas_proxy_source_set_delegate efl_canvas_proxy_source_set_static_delegate;
344 [return: MarshalAs(UnmanagedType.U1)]
345 private delegate bool efl_canvas_proxy_source_clip_get_delegate(System.IntPtr obj, System.IntPtr pd);
347 [return: MarshalAs(UnmanagedType.U1)]
348 public delegate bool efl_canvas_proxy_source_clip_get_api_delegate(System.IntPtr obj);
350 public static Efl.Eo.FunctionWrapper<efl_canvas_proxy_source_clip_get_api_delegate> efl_canvas_proxy_source_clip_get_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_proxy_source_clip_get_api_delegate>(Module, "efl_canvas_proxy_source_clip_get");
352 private static bool source_clip_get(System.IntPtr obj, System.IntPtr pd)
354 Eina.Log.Debug("function efl_canvas_proxy_source_clip_get was called");
355 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
358 bool _ret_var = default(bool);
361 _ret_var = ((Proxy)wrapper).GetSourceClip();
365 Eina.Log.Warning($"Callback error: {e.ToString()}");
366 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
374 return efl_canvas_proxy_source_clip_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
378 private static efl_canvas_proxy_source_clip_get_delegate efl_canvas_proxy_source_clip_get_static_delegate;
381 private delegate void efl_canvas_proxy_source_clip_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool source_clip);
384 public delegate void efl_canvas_proxy_source_clip_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool source_clip);
386 public static Efl.Eo.FunctionWrapper<efl_canvas_proxy_source_clip_set_api_delegate> efl_canvas_proxy_source_clip_set_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_proxy_source_clip_set_api_delegate>(Module, "efl_canvas_proxy_source_clip_set");
388 private static void source_clip_set(System.IntPtr obj, System.IntPtr pd, bool source_clip)
390 Eina.Log.Debug("function efl_canvas_proxy_source_clip_set was called");
391 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
397 ((Proxy)wrapper).SetSourceClip(source_clip);
401 Eina.Log.Warning($"Callback error: {e.ToString()}");
402 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
409 efl_canvas_proxy_source_clip_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), source_clip);
413 private static efl_canvas_proxy_source_clip_set_delegate efl_canvas_proxy_source_clip_set_static_delegate;
415 [return: MarshalAs(UnmanagedType.U1)]
416 private delegate bool efl_canvas_proxy_source_events_get_delegate(System.IntPtr obj, System.IntPtr pd);
418 [return: MarshalAs(UnmanagedType.U1)]
419 public delegate bool efl_canvas_proxy_source_events_get_api_delegate(System.IntPtr obj);
421 public static Efl.Eo.FunctionWrapper<efl_canvas_proxy_source_events_get_api_delegate> efl_canvas_proxy_source_events_get_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_proxy_source_events_get_api_delegate>(Module, "efl_canvas_proxy_source_events_get");
423 private static bool source_events_get(System.IntPtr obj, System.IntPtr pd)
425 Eina.Log.Debug("function efl_canvas_proxy_source_events_get was called");
426 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
429 bool _ret_var = default(bool);
432 _ret_var = ((Proxy)wrapper).GetSourceEvents();
436 Eina.Log.Warning($"Callback error: {e.ToString()}");
437 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
445 return efl_canvas_proxy_source_events_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
449 private static efl_canvas_proxy_source_events_get_delegate efl_canvas_proxy_source_events_get_static_delegate;
452 private delegate void efl_canvas_proxy_source_events_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool repeat);
455 public delegate void efl_canvas_proxy_source_events_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool repeat);
457 public static Efl.Eo.FunctionWrapper<efl_canvas_proxy_source_events_set_api_delegate> efl_canvas_proxy_source_events_set_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_proxy_source_events_set_api_delegate>(Module, "efl_canvas_proxy_source_events_set");
459 private static void source_events_set(System.IntPtr obj, System.IntPtr pd, bool repeat)
461 Eina.Log.Debug("function efl_canvas_proxy_source_events_set was called");
462 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
468 ((Proxy)wrapper).SetSourceEvents(repeat);
472 Eina.Log.Warning($"Callback error: {e.ToString()}");
473 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
480 efl_canvas_proxy_source_events_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), repeat);
484 private static efl_canvas_proxy_source_events_set_delegate efl_canvas_proxy_source_events_set_static_delegate;
486 #pragma warning restore CA1707, SA1300, SA1600