1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Canvas {
8 /// <summary>Low-level proxy image object.
9 /// 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>
11 public class Proxy : Efl.Canvas.ImageInternal, Efl.Eo.IWrapper
13 ///<summary>Pointer to the native class description.</summary>
14 public override System.IntPtr NativeClass {
16 if (((object)this).GetType() == typeof (Proxy))
17 return Efl.Canvas.ProxyNativeInherit.GetEflClassStatic();
19 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
22 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
23 efl_canvas_proxy_class_get();
24 ///<summary>Creates a new instance.</summary>
25 ///<param name="parent">Parent instance.</param>
26 public Proxy(Efl.Object parent= null
28 base(efl_canvas_proxy_class_get(), typeof(Proxy), parent)
30 FinishInstantiation();
32 ///<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>
33 protected Proxy(System.IntPtr raw) : base(raw)
35 RegisterEventProxies();
37 ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
38 protected Proxy(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
39 ///<summary>Verifies if the given object is equal to this one.</summary>
40 public override bool Equals(object obj)
42 var other = obj as Efl.Object;
45 return this.NativeHandle == other.NativeHandle;
47 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
48 public override int GetHashCode()
50 return this.NativeHandle.ToInt32();
52 ///<summary>Turns the native pointer into a string representation.</summary>
53 public override String ToString()
55 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
57 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
58 protected override void RegisterEventProxies()
60 base.RegisterEventProxies();
62 /// <summary>The source object for this proxy.
63 /// 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).
65 /// Any existing source object will be removed after this call.
67 /// Note: This property should be set as soon as creating a proxy object, otherwise the proxy will do nothing.
69 /// Warning: You cannot set a proxy as another proxy's source.</summary>
70 /// <returns>Source object to use for the proxy.</returns>
71 virtual public Efl.Canvas.Object GetSource() {
72 var _ret_var = Efl.Canvas.ProxyNativeInherit.efl_canvas_proxy_source_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
73 Eina.Error.RaiseIfUnhandledException();
76 /// <summary>The source object for this proxy.
77 /// 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).
79 /// Any existing source object will be removed after this call.
81 /// Note: This property should be set as soon as creating a proxy object, otherwise the proxy will do nothing.
83 /// Warning: You cannot set a proxy as another proxy's source.</summary>
84 /// <param name="src">Source object to use for the proxy.</param>
85 /// <returns>Returns <c>true</c> in case of success.</returns>
86 virtual public bool SetSource( Efl.Canvas.Object src) {
87 var _ret_var = Efl.Canvas.ProxyNativeInherit.efl_canvas_proxy_source_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), src);
88 Eina.Error.RaiseIfUnhandledException();
91 /// <summary>Clip this proxy object with the source object's clipper.
92 /// Use this if you want to overlay an existing object with its proxy, and apply some sort of transformation on it.
94 /// <c>true</c> means both objects will share the same clip.</summary>
95 /// <returns>Whether <c>obj</c> is clipped by the source clipper (<c>true</c>) or not (<c>false</c>).</returns>
96 virtual public bool GetSourceClip() {
97 var _ret_var = Efl.Canvas.ProxyNativeInherit.efl_canvas_proxy_source_clip_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
98 Eina.Error.RaiseIfUnhandledException();
101 /// <summary>Clip this proxy object with the source object's clipper.
102 /// Use this if you want to overlay an existing object with its proxy, and apply some sort of transformation on it.
104 /// <c>true</c> means both objects will share the same clip.</summary>
105 /// <param name="source_clip">Whether <c>obj</c> is clipped by the source clipper (<c>true</c>) or not (<c>false</c>).</param>
106 /// <returns></returns>
107 virtual public void SetSourceClip( bool source_clip) {
108 Efl.Canvas.ProxyNativeInherit.efl_canvas_proxy_source_clip_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), source_clip);
109 Eina.Error.RaiseIfUnhandledException();
111 /// <summary>Defines whether the events on this object are repeated to the source.
112 /// 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.
114 /// If <c>source</c> is <c>false</c>, events occurring on <c>obj</c> will be processed only on it.</summary>
115 /// <returns>Whether this object should pass events (<c>true</c>) or not (<c>false</c>) to its source.</returns>
116 virtual public bool GetSourceEvents() {
117 var _ret_var = Efl.Canvas.ProxyNativeInherit.efl_canvas_proxy_source_events_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
118 Eina.Error.RaiseIfUnhandledException();
121 /// <summary>Defines whether the events on this object are repeated to the source.
122 /// 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.
124 /// If <c>source</c> is <c>false</c>, events occurring on <c>obj</c> will be processed only on it.</summary>
125 /// <param name="repeat">Whether this object should pass events (<c>true</c>) or not (<c>false</c>) to its source.</param>
126 /// <returns></returns>
127 virtual public void SetSourceEvents( bool repeat) {
128 Efl.Canvas.ProxyNativeInherit.efl_canvas_proxy_source_events_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), repeat);
129 Eina.Error.RaiseIfUnhandledException();
131 /// <summary>The source object for this proxy.
132 /// 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).
134 /// Any existing source object will be removed after this call.
136 /// Note: This property should be set as soon as creating a proxy object, otherwise the proxy will do nothing.
138 /// Warning: You cannot set a proxy as another proxy's source.</summary>
139 /// <value>Source object to use for the proxy.</value>
140 public Efl.Canvas.Object Source {
141 get { return GetSource(); }
142 set { SetSource( value); }
144 /// <summary>Clip this proxy object with the source object's clipper.
145 /// Use this if you want to overlay an existing object with its proxy, and apply some sort of transformation on it.
147 /// <c>true</c> means both objects will share the same clip.</summary>
148 /// <value>Whether <c>obj</c> is clipped by the source clipper (<c>true</c>) or not (<c>false</c>).</value>
149 public bool SourceClip {
150 get { return GetSourceClip(); }
151 set { SetSourceClip( value); }
153 /// <summary>Defines whether the events on this object are repeated to the source.
154 /// 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.
156 /// If <c>source</c> is <c>false</c>, events occurring on <c>obj</c> will be processed only on it.</summary>
157 /// <value>Whether this object should pass events (<c>true</c>) or not (<c>false</c>) to its source.</value>
158 public bool SourceEvents {
159 get { return GetSourceEvents(); }
160 set { SetSourceEvents( value); }
162 private static IntPtr GetEflClassStatic()
164 return Efl.Canvas.Proxy.efl_canvas_proxy_class_get();
167 public class ProxyNativeInherit : Efl.Canvas.ImageInternalNativeInherit{
168 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Evas);
169 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
171 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
172 var methods = Efl.Eo.Globals.GetUserMethods(type);
173 if (efl_canvas_proxy_source_get_static_delegate == null)
174 efl_canvas_proxy_source_get_static_delegate = new efl_canvas_proxy_source_get_delegate(source_get);
175 if (methods.FirstOrDefault(m => m.Name == "GetSource") != null)
176 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)});
177 if (efl_canvas_proxy_source_set_static_delegate == null)
178 efl_canvas_proxy_source_set_static_delegate = new efl_canvas_proxy_source_set_delegate(source_set);
179 if (methods.FirstOrDefault(m => m.Name == "SetSource") != null)
180 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)});
181 if (efl_canvas_proxy_source_clip_get_static_delegate == null)
182 efl_canvas_proxy_source_clip_get_static_delegate = new efl_canvas_proxy_source_clip_get_delegate(source_clip_get);
183 if (methods.FirstOrDefault(m => m.Name == "GetSourceClip") != null)
184 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)});
185 if (efl_canvas_proxy_source_clip_set_static_delegate == null)
186 efl_canvas_proxy_source_clip_set_static_delegate = new efl_canvas_proxy_source_clip_set_delegate(source_clip_set);
187 if (methods.FirstOrDefault(m => m.Name == "SetSourceClip") != null)
188 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)});
189 if (efl_canvas_proxy_source_events_get_static_delegate == null)
190 efl_canvas_proxy_source_events_get_static_delegate = new efl_canvas_proxy_source_events_get_delegate(source_events_get);
191 if (methods.FirstOrDefault(m => m.Name == "GetSourceEvents") != null)
192 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)});
193 if (efl_canvas_proxy_source_events_set_static_delegate == null)
194 efl_canvas_proxy_source_events_set_static_delegate = new efl_canvas_proxy_source_events_set_delegate(source_events_set);
195 if (methods.FirstOrDefault(m => m.Name == "SetSourceEvents") != null)
196 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)});
197 descs.AddRange(base.GetEoOps(type));
200 public override IntPtr GetEflClass()
202 return Efl.Canvas.Proxy.efl_canvas_proxy_class_get();
204 public static new IntPtr GetEflClassStatic()
206 return Efl.Canvas.Proxy.efl_canvas_proxy_class_get();
210 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Object, Efl.Eo.NonOwnTag>))] private delegate Efl.Canvas.Object efl_canvas_proxy_source_get_delegate(System.IntPtr obj, System.IntPtr pd);
213 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Object, Efl.Eo.NonOwnTag>))] public delegate Efl.Canvas.Object efl_canvas_proxy_source_get_api_delegate(System.IntPtr obj);
214 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");
215 private static Efl.Canvas.Object source_get(System.IntPtr obj, System.IntPtr pd)
217 Eina.Log.Debug("function efl_canvas_proxy_source_get was called");
218 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
219 if(wrapper != null) {
220 Efl.Canvas.Object _ret_var = default(Efl.Canvas.Object);
222 _ret_var = ((Proxy)wrapper).GetSource();
223 } catch (Exception e) {
224 Eina.Log.Warning($"Callback error: {e.ToString()}");
225 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
229 return efl_canvas_proxy_source_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
232 private static efl_canvas_proxy_source_get_delegate efl_canvas_proxy_source_get_static_delegate;
235 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_canvas_proxy_source_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Object, Efl.Eo.NonOwnTag>))] Efl.Canvas.Object src);
238 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_canvas_proxy_source_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Object, Efl.Eo.NonOwnTag>))] Efl.Canvas.Object src);
239 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");
240 private static bool source_set(System.IntPtr obj, System.IntPtr pd, Efl.Canvas.Object src)
242 Eina.Log.Debug("function efl_canvas_proxy_source_set was called");
243 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
244 if(wrapper != null) {
245 bool _ret_var = default(bool);
247 _ret_var = ((Proxy)wrapper).SetSource( src);
248 } catch (Exception e) {
249 Eina.Log.Warning($"Callback error: {e.ToString()}");
250 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
254 return efl_canvas_proxy_source_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), src);
257 private static efl_canvas_proxy_source_set_delegate efl_canvas_proxy_source_set_static_delegate;
260 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_canvas_proxy_source_clip_get_delegate(System.IntPtr obj, System.IntPtr pd);
263 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_canvas_proxy_source_clip_get_api_delegate(System.IntPtr obj);
264 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");
265 private static bool source_clip_get(System.IntPtr obj, System.IntPtr pd)
267 Eina.Log.Debug("function efl_canvas_proxy_source_clip_get was called");
268 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
269 if(wrapper != null) {
270 bool _ret_var = default(bool);
272 _ret_var = ((Proxy)wrapper).GetSourceClip();
273 } catch (Exception e) {
274 Eina.Log.Warning($"Callback error: {e.ToString()}");
275 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
279 return efl_canvas_proxy_source_clip_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
282 private static efl_canvas_proxy_source_clip_get_delegate efl_canvas_proxy_source_clip_get_static_delegate;
285 private delegate void efl_canvas_proxy_source_clip_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool source_clip);
288 public delegate void efl_canvas_proxy_source_clip_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool source_clip);
289 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");
290 private static void source_clip_set(System.IntPtr obj, System.IntPtr pd, bool source_clip)
292 Eina.Log.Debug("function efl_canvas_proxy_source_clip_set was called");
293 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
294 if(wrapper != null) {
297 ((Proxy)wrapper).SetSourceClip( source_clip);
298 } catch (Exception e) {
299 Eina.Log.Warning($"Callback error: {e.ToString()}");
300 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
303 efl_canvas_proxy_source_clip_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), source_clip);
306 private static efl_canvas_proxy_source_clip_set_delegate efl_canvas_proxy_source_clip_set_static_delegate;
309 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_canvas_proxy_source_events_get_delegate(System.IntPtr obj, System.IntPtr pd);
312 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_canvas_proxy_source_events_get_api_delegate(System.IntPtr obj);
313 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");
314 private static bool source_events_get(System.IntPtr obj, System.IntPtr pd)
316 Eina.Log.Debug("function efl_canvas_proxy_source_events_get was called");
317 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
318 if(wrapper != null) {
319 bool _ret_var = default(bool);
321 _ret_var = ((Proxy)wrapper).GetSourceEvents();
322 } catch (Exception e) {
323 Eina.Log.Warning($"Callback error: {e.ToString()}");
324 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
328 return efl_canvas_proxy_source_events_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
331 private static efl_canvas_proxy_source_events_get_delegate efl_canvas_proxy_source_events_get_static_delegate;
334 private delegate void efl_canvas_proxy_source_events_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool repeat);
337 public delegate void efl_canvas_proxy_source_events_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool repeat);
338 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");
339 private static void source_events_set(System.IntPtr obj, System.IntPtr pd, bool repeat)
341 Eina.Log.Debug("function efl_canvas_proxy_source_events_set was called");
342 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
343 if(wrapper != null) {
346 ((Proxy)wrapper).SetSourceEvents( repeat);
347 } catch (Exception e) {
348 Eina.Log.Warning($"Callback error: {e.ToString()}");
349 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
352 efl_canvas_proxy_source_events_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), repeat);
355 private static efl_canvas_proxy_source_events_set_delegate efl_canvas_proxy_source_events_set_static_delegate;