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>Efl graphics interface
13 /// (Since EFL 1.22)</summary>
14 [Efl.Gfx.IEntityConcrete.NativeMethods]
15 public interface IEntity :
16 Efl.Eo.IWrapper, IDisposable
18 /// <summary>Retrieves the position of the given canvas object.
19 /// (Since EFL 1.22)</summary>
20 /// <returns>A 2D coordinate in pixel units.</returns>
21 Eina.Position2D GetPosition();
22 /// <summary>Moves the given canvas object to the given location inside its canvas' viewport. If unchanged this call may be entirely skipped, but if changed this will trigger move events, as well as potential pointer,in or pointer,out events.
23 /// (Since EFL 1.22)</summary>
24 /// <param name="pos">A 2D coordinate in pixel units.</param>
25 void SetPosition(Eina.Position2D pos);
26 /// <summary>Retrieves the (rectangular) size of the given Evas object.
27 /// (Since EFL 1.22)</summary>
28 /// <returns>A 2D size in pixel units.</returns>
29 Eina.Size2D GetSize();
30 /// <summary>Changes the size of the given object.
31 /// Note that setting the actual size of an object might be the job of its container, so this function might have no effect. Look at <see cref="Efl.Gfx.IHint"/> instead, when manipulating widgets.
32 /// (Since EFL 1.22)</summary>
33 /// <param name="size">A 2D size in pixel units.</param>
34 void SetSize(Eina.Size2D size);
35 /// <summary>Rectangular geometry that combines both position and size.
36 /// (Since EFL 1.22)</summary>
37 /// <returns>The X,Y position and W,H size, in pixels.</returns>
38 Eina.Rect GetGeometry();
39 /// <summary>Rectangular geometry that combines both position and size.
40 /// (Since EFL 1.22)</summary>
41 /// <param name="rect">The X,Y position and W,H size, in pixels.</param>
42 void SetGeometry(Eina.Rect rect);
43 /// <summary>Retrieves whether or not the given canvas object is visible.
44 /// (Since EFL 1.22)</summary>
45 /// <returns><c>true</c> if to make the object visible, <c>false</c> otherwise</returns>
47 /// <summary>Shows or hides this object.
48 /// (Since EFL 1.22)</summary>
49 /// <param name="v"><c>true</c> if to make the object visible, <c>false</c> otherwise</param>
50 void SetVisible(bool v);
51 /// <summary>Gets an object's scaling factor.
52 /// (Since EFL 1.22)</summary>
53 /// <returns>The scaling factor (the default value is 0.0, meaning individual scaling is not set)</returns>
55 /// <summary>Sets the scaling factor of an object.
56 /// (Since EFL 1.22)</summary>
57 /// <param name="scale">The scaling factor (the default value is 0.0, meaning individual scaling is not set)</param>
58 void SetScale(double scale);
59 /// <summary>Object's visibility state changed, the event value is the new state.
60 /// (Since EFL 1.22)</summary>
61 event EventHandler<Efl.Gfx.IEntityVisibilityChangedEvt_Args> VisibilityChangedEvt;
62 /// <summary>Object was moved, its position during the event is the new one.
63 /// (Since EFL 1.22)</summary>
64 event EventHandler<Efl.Gfx.IEntityPositionChangedEvt_Args> PositionChangedEvt;
65 /// <summary>Object was resized, its size during the event is the new one.
66 /// (Since EFL 1.22)</summary>
67 event EventHandler<Efl.Gfx.IEntitySizeChangedEvt_Args> SizeChangedEvt;
68 /// <summary>The 2D position of a canvas object.
69 /// The position is absolute, in pixels, relative to the top-left corner of the window, within its border decorations (application space).
70 /// (Since EFL 1.22)</summary>
71 /// <value>A 2D coordinate in pixel units.</value>
72 Eina.Position2D Position {
76 /// <summary>The 2D size of a canvas object.
77 /// (Since EFL 1.22)</summary>
78 /// <value>A 2D size in pixel units.</value>
83 /// <summary>Rectangular geometry that combines both position and size.
84 /// (Since EFL 1.22)</summary>
85 /// <value>The X,Y position and W,H size, in pixels.</value>
90 /// <summary>The visibility of a canvas object.
91 /// All canvas objects will become visible by default just before render. This means that it is not required to call <see cref="Efl.Gfx.IEntity.SetVisible"/> after creating an object unless you want to create it without showing it. Note that this behavior is new since 1.21, and only applies to canvas objects created with the EO API (i.e. not the legacy C-only API). Other types of Gfx objects may or may not be visible by default.
93 /// Note that many other parameters can prevent a visible object from actually being "visible" on screen. For instance if its color is fully transparent, or its parent is hidden, or it is clipped out, etc...
94 /// (Since EFL 1.22)</summary>
95 /// <value><c>true</c> if to make the object visible, <c>false</c> otherwise</value>
100 /// <summary>The scaling factor of an object.
101 /// This property is an individual scaling factor on the object (Edje or UI widget). This property (or Edje's global scaling factor, when applicable), will affect this object's part sizes. If scale is not zero, than the individual scaling will override any global scaling set, for the object obj's parts. Set it back to zero to get the effects of the global scaling again.
103 /// Warning: In Edje, only parts which, at EDC level, had the "scale" property set to 1, will be affected by this function. Check the complete "syntax reference" for EDC files.
104 /// (Since EFL 1.22)</summary>
105 /// <value>The scaling factor (the default value is 0.0, meaning individual scaling is not set)</value>
111 ///<summary>Event argument wrapper for event <see cref="Efl.Gfx.IEntity.VisibilityChangedEvt"/>.</summary>
112 public class IEntityVisibilityChangedEvt_Args : EventArgs {
113 ///<summary>Actual event payload.</summary>
114 public bool arg { get; set; }
116 ///<summary>Event argument wrapper for event <see cref="Efl.Gfx.IEntity.PositionChangedEvt"/>.</summary>
117 public class IEntityPositionChangedEvt_Args : EventArgs {
118 ///<summary>Actual event payload.</summary>
119 public Eina.Position2D arg { get; set; }
121 ///<summary>Event argument wrapper for event <see cref="Efl.Gfx.IEntity.SizeChangedEvt"/>.</summary>
122 public class IEntitySizeChangedEvt_Args : EventArgs {
123 ///<summary>Actual event payload.</summary>
124 public Eina.Size2D arg { get; set; }
126 /// <summary>Efl graphics interface
127 /// (Since EFL 1.22)</summary>
128 sealed public class IEntityConcrete :
133 ///<summary>Pointer to the native class description.</summary>
134 public System.IntPtr NativeClass
138 if (((object)this).GetType() == typeof(IEntityConcrete))
140 return GetEflClassStatic();
144 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
149 private Dictionary<(IntPtr desc, object evtDelegate), (IntPtr evtCallerPtr, Efl.EventCb evtCaller)> eoEvents = new Dictionary<(IntPtr desc, object evtDelegate), (IntPtr evtCallerPtr, Efl.EventCb evtCaller)>();
150 private readonly object eventLock = new object();
151 private System.IntPtr handle;
152 ///<summary>Pointer to the native instance.</summary>
153 public System.IntPtr NativeHandle
155 get { return handle; }
158 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
159 efl_gfx_entity_interface_get();
160 /// <summary>Initializes a new instance of the <see cref="IEntity"/> class.
161 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
162 private IEntityConcrete(System.IntPtr raw)
166 ///<summary>Destructor.</summary>
172 ///<summary>Releases the underlying native instance.</summary>
173 private void Dispose(bool disposing)
175 if (handle != System.IntPtr.Zero)
178 handle = IntPtr.Zero;
180 IntPtr gcHandlePtr = IntPtr.Zero;
181 if (eoEvents.Count != 0)
183 GCHandle gcHandle = GCHandle.Alloc(eoEvents);
184 gcHandlePtr = GCHandle.ToIntPtr(gcHandle);
189 Efl.Eo.Globals.efl_mono_native_dispose(h, gcHandlePtr);
193 Monitor.Enter(Efl.All.InitLock);
194 if (Efl.All.MainLoopInitialized)
196 Efl.Eo.Globals.efl_mono_thread_safe_native_dispose(h, gcHandlePtr);
199 Monitor.Exit(Efl.All.InitLock);
205 ///<summary>Releases the underlying native instance.</summary>
206 public void Dispose()
209 GC.SuppressFinalize(this);
212 /// <summary>Verifies if the given object is equal to this one.</summary>
213 /// <param name="instance">The object to compare to.</param>
214 /// <returns>True if both objects point to the same native object.</returns>
215 public override bool Equals(object instance)
217 var other = instance as Efl.Object;
222 return this.NativeHandle == other.NativeHandle;
225 /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
226 /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
227 public override int GetHashCode()
229 return this.NativeHandle.ToInt32();
232 /// <summary>Turns the native pointer into a string representation.</summary>
233 /// <returns>A string with the type and the native pointer for this object.</returns>
234 public override String ToString()
236 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
239 ///<summary>Adds a new event handler, registering it to the native event. For internal use only.</summary>
240 ///<param name="lib">The name of the native library definining the event.</param>
241 ///<param name="key">The name of the native event.</param>
242 ///<param name="evtCaller">Delegate to be called by native code on event raising.</param>
243 ///<param name="evtDelegate">Managed delegate that will be called by evtCaller on event raising.</param>
244 private void AddNativeEventHandler(string lib, string key, Efl.EventCb evtCaller, object evtDelegate)
246 IntPtr desc = Efl.EventDescription.GetNative(lib, key);
247 if (desc == IntPtr.Zero)
249 Eina.Log.Error($"Failed to get native event {key}");
252 if (eoEvents.ContainsKey((desc, evtDelegate)))
254 Eina.Log.Warning($"Event proxy for event {key} already registered!");
258 IntPtr evtCallerPtr = Marshal.GetFunctionPointerForDelegate(evtCaller);
259 if (!Efl.Eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evtCallerPtr, IntPtr.Zero))
261 Eina.Log.Error($"Failed to add event proxy for event {key}");
265 eoEvents[(desc, evtDelegate)] = (evtCallerPtr, evtCaller);
266 Eina.Error.RaiseIfUnhandledException();
269 ///<summary>Removes the given event handler for the given event. For internal use only.</summary>
270 ///<param name="lib">The name of the native library definining the event.</param>
271 ///<param name="key">The name of the native event.</param>
272 ///<param name="evtDelegate">The delegate to be removed.</param>
273 private void RemoveNativeEventHandler(string lib, string key, object evtDelegate)
275 IntPtr desc = Efl.EventDescription.GetNative(lib, key);
276 if (desc == IntPtr.Zero)
278 Eina.Log.Error($"Failed to get native event {key}");
282 var evtPair = (desc, evtDelegate);
283 if (eoEvents.TryGetValue(evtPair, out var caller))
285 if (!Efl.Eo.Globals.efl_event_callback_del(handle, desc, caller.evtCallerPtr, IntPtr.Zero))
287 Eina.Log.Error($"Failed to remove event proxy for event {key}");
291 eoEvents.Remove(evtPair);
292 Eina.Error.RaiseIfUnhandledException();
296 Eina.Log.Error($"Trying to remove proxy for event {key} when it is nothing registered.");
300 /// <summary>Object's visibility state changed, the event value is the new state.
301 /// (Since EFL 1.22)</summary>
302 public event EventHandler<Efl.Gfx.IEntityVisibilityChangedEvt_Args> VisibilityChangedEvt
308 var wRef = new WeakReference(this);
309 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
311 var obj = wRef.Target as Efl.Eo.IWrapper;
314 Efl.Gfx.IEntityVisibilityChangedEvt_Args args = new Efl.Gfx.IEntityVisibilityChangedEvt_Args();
315 args.arg = evt.Info != IntPtr.Zero;
318 value?.Invoke(obj, args);
322 Eina.Log.Error(e.ToString());
323 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
328 string key = "_EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED";
329 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
337 string key = "_EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED";
338 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
342 ///<summary>Method to raise event VisibilityChangedEvt.</summary>
343 public void OnVisibilityChangedEvt(Efl.Gfx.IEntityVisibilityChangedEvt_Args e)
345 var key = "_EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED";
346 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
347 if (desc == IntPtr.Zero)
349 Eina.Log.Error($"Failed to get native event {key}");
353 IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(e.arg ? (byte) 1 : (byte) 0);
356 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
360 Marshal.FreeHGlobal(info);
363 /// <summary>Object was moved, its position during the event is the new one.
364 /// (Since EFL 1.22)</summary>
365 public event EventHandler<Efl.Gfx.IEntityPositionChangedEvt_Args> PositionChangedEvt
371 var wRef = new WeakReference(this);
372 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
374 var obj = wRef.Target as Efl.Eo.IWrapper;
377 Efl.Gfx.IEntityPositionChangedEvt_Args args = new Efl.Gfx.IEntityPositionChangedEvt_Args();
381 value?.Invoke(obj, args);
385 Eina.Log.Error(e.ToString());
386 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
391 string key = "_EFL_GFX_ENTITY_EVENT_POSITION_CHANGED";
392 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
400 string key = "_EFL_GFX_ENTITY_EVENT_POSITION_CHANGED";
401 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
405 ///<summary>Method to raise event PositionChangedEvt.</summary>
406 public void OnPositionChangedEvt(Efl.Gfx.IEntityPositionChangedEvt_Args e)
408 var key = "_EFL_GFX_ENTITY_EVENT_POSITION_CHANGED";
409 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
410 if (desc == IntPtr.Zero)
412 Eina.Log.Error($"Failed to get native event {key}");
416 IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));
419 Marshal.StructureToPtr(e.arg, info, false);
420 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
424 Marshal.FreeHGlobal(info);
427 /// <summary>Object was resized, its size during the event is the new one.
428 /// (Since EFL 1.22)</summary>
429 public event EventHandler<Efl.Gfx.IEntitySizeChangedEvt_Args> SizeChangedEvt
435 var wRef = new WeakReference(this);
436 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
438 var obj = wRef.Target as Efl.Eo.IWrapper;
441 Efl.Gfx.IEntitySizeChangedEvt_Args args = new Efl.Gfx.IEntitySizeChangedEvt_Args();
445 value?.Invoke(obj, args);
449 Eina.Log.Error(e.ToString());
450 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
455 string key = "_EFL_GFX_ENTITY_EVENT_SIZE_CHANGED";
456 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
464 string key = "_EFL_GFX_ENTITY_EVENT_SIZE_CHANGED";
465 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
469 ///<summary>Method to raise event SizeChangedEvt.</summary>
470 public void OnSizeChangedEvt(Efl.Gfx.IEntitySizeChangedEvt_Args e)
472 var key = "_EFL_GFX_ENTITY_EVENT_SIZE_CHANGED";
473 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
474 if (desc == IntPtr.Zero)
476 Eina.Log.Error($"Failed to get native event {key}");
480 IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));
483 Marshal.StructureToPtr(e.arg, info, false);
484 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
488 Marshal.FreeHGlobal(info);
491 /// <summary>Retrieves the position of the given canvas object.
492 /// (Since EFL 1.22)</summary>
493 /// <returns>A 2D coordinate in pixel units.</returns>
494 public Eina.Position2D GetPosition() {
495 var _ret_var = Efl.Gfx.IEntityConcrete.NativeMethods.efl_gfx_entity_position_get_ptr.Value.Delegate(this.NativeHandle);
496 Eina.Error.RaiseIfUnhandledException();
499 /// <summary>Moves the given canvas object to the given location inside its canvas' viewport. If unchanged this call may be entirely skipped, but if changed this will trigger move events, as well as potential pointer,in or pointer,out events.
500 /// (Since EFL 1.22)</summary>
501 /// <param name="pos">A 2D coordinate in pixel units.</param>
502 public void SetPosition(Eina.Position2D pos) {
503 Eina.Position2D.NativeStruct _in_pos = pos;
504 Efl.Gfx.IEntityConcrete.NativeMethods.efl_gfx_entity_position_set_ptr.Value.Delegate(this.NativeHandle,_in_pos);
505 Eina.Error.RaiseIfUnhandledException();
507 /// <summary>Retrieves the (rectangular) size of the given Evas object.
508 /// (Since EFL 1.22)</summary>
509 /// <returns>A 2D size in pixel units.</returns>
510 public Eina.Size2D GetSize() {
511 var _ret_var = Efl.Gfx.IEntityConcrete.NativeMethods.efl_gfx_entity_size_get_ptr.Value.Delegate(this.NativeHandle);
512 Eina.Error.RaiseIfUnhandledException();
515 /// <summary>Changes the size of the given object.
516 /// Note that setting the actual size of an object might be the job of its container, so this function might have no effect. Look at <see cref="Efl.Gfx.IHint"/> instead, when manipulating widgets.
517 /// (Since EFL 1.22)</summary>
518 /// <param name="size">A 2D size in pixel units.</param>
519 public void SetSize(Eina.Size2D size) {
520 Eina.Size2D.NativeStruct _in_size = size;
521 Efl.Gfx.IEntityConcrete.NativeMethods.efl_gfx_entity_size_set_ptr.Value.Delegate(this.NativeHandle,_in_size);
522 Eina.Error.RaiseIfUnhandledException();
524 /// <summary>Rectangular geometry that combines both position and size.
525 /// (Since EFL 1.22)</summary>
526 /// <returns>The X,Y position and W,H size, in pixels.</returns>
527 public Eina.Rect GetGeometry() {
528 var _ret_var = Efl.Gfx.IEntityConcrete.NativeMethods.efl_gfx_entity_geometry_get_ptr.Value.Delegate(this.NativeHandle);
529 Eina.Error.RaiseIfUnhandledException();
532 /// <summary>Rectangular geometry that combines both position and size.
533 /// (Since EFL 1.22)</summary>
534 /// <param name="rect">The X,Y position and W,H size, in pixels.</param>
535 public void SetGeometry(Eina.Rect rect) {
536 Eina.Rect.NativeStruct _in_rect = rect;
537 Efl.Gfx.IEntityConcrete.NativeMethods.efl_gfx_entity_geometry_set_ptr.Value.Delegate(this.NativeHandle,_in_rect);
538 Eina.Error.RaiseIfUnhandledException();
540 /// <summary>Retrieves whether or not the given canvas object is visible.
541 /// (Since EFL 1.22)</summary>
542 /// <returns><c>true</c> if to make the object visible, <c>false</c> otherwise</returns>
543 public bool GetVisible() {
544 var _ret_var = Efl.Gfx.IEntityConcrete.NativeMethods.efl_gfx_entity_visible_get_ptr.Value.Delegate(this.NativeHandle);
545 Eina.Error.RaiseIfUnhandledException();
548 /// <summary>Shows or hides this object.
549 /// (Since EFL 1.22)</summary>
550 /// <param name="v"><c>true</c> if to make the object visible, <c>false</c> otherwise</param>
551 public void SetVisible(bool v) {
552 Efl.Gfx.IEntityConcrete.NativeMethods.efl_gfx_entity_visible_set_ptr.Value.Delegate(this.NativeHandle,v);
553 Eina.Error.RaiseIfUnhandledException();
555 /// <summary>Gets an object's scaling factor.
556 /// (Since EFL 1.22)</summary>
557 /// <returns>The scaling factor (the default value is 0.0, meaning individual scaling is not set)</returns>
558 public double GetScale() {
559 var _ret_var = Efl.Gfx.IEntityConcrete.NativeMethods.efl_gfx_entity_scale_get_ptr.Value.Delegate(this.NativeHandle);
560 Eina.Error.RaiseIfUnhandledException();
563 /// <summary>Sets the scaling factor of an object.
564 /// (Since EFL 1.22)</summary>
565 /// <param name="scale">The scaling factor (the default value is 0.0, meaning individual scaling is not set)</param>
566 public void SetScale(double scale) {
567 Efl.Gfx.IEntityConcrete.NativeMethods.efl_gfx_entity_scale_set_ptr.Value.Delegate(this.NativeHandle,scale);
568 Eina.Error.RaiseIfUnhandledException();
570 /// <summary>The 2D position of a canvas object.
571 /// The position is absolute, in pixels, relative to the top-left corner of the window, within its border decorations (application space).
572 /// (Since EFL 1.22)</summary>
573 /// <value>A 2D coordinate in pixel units.</value>
574 public Eina.Position2D Position {
575 get { return GetPosition(); }
576 set { SetPosition(value); }
578 /// <summary>The 2D size of a canvas object.
579 /// (Since EFL 1.22)</summary>
580 /// <value>A 2D size in pixel units.</value>
581 public Eina.Size2D Size {
582 get { return GetSize(); }
583 set { SetSize(value); }
585 /// <summary>Rectangular geometry that combines both position and size.
586 /// (Since EFL 1.22)</summary>
587 /// <value>The X,Y position and W,H size, in pixels.</value>
588 public Eina.Rect Geometry {
589 get { return GetGeometry(); }
590 set { SetGeometry(value); }
592 /// <summary>The visibility of a canvas object.
593 /// All canvas objects will become visible by default just before render. This means that it is not required to call <see cref="Efl.Gfx.IEntity.SetVisible"/> after creating an object unless you want to create it without showing it. Note that this behavior is new since 1.21, and only applies to canvas objects created with the EO API (i.e. not the legacy C-only API). Other types of Gfx objects may or may not be visible by default.
595 /// Note that many other parameters can prevent a visible object from actually being "visible" on screen. For instance if its color is fully transparent, or its parent is hidden, or it is clipped out, etc...
596 /// (Since EFL 1.22)</summary>
597 /// <value><c>true</c> if to make the object visible, <c>false</c> otherwise</value>
598 public bool Visible {
599 get { return GetVisible(); }
600 set { SetVisible(value); }
602 /// <summary>The scaling factor of an object.
603 /// This property is an individual scaling factor on the object (Edje or UI widget). This property (or Edje's global scaling factor, when applicable), will affect this object's part sizes. If scale is not zero, than the individual scaling will override any global scaling set, for the object obj's parts. Set it back to zero to get the effects of the global scaling again.
605 /// Warning: In Edje, only parts which, at EDC level, had the "scale" property set to 1, will be affected by this function. Check the complete "syntax reference" for EDC files.
606 /// (Since EFL 1.22)</summary>
607 /// <value>The scaling factor (the default value is 0.0, meaning individual scaling is not set)</value>
608 public double Scale {
609 get { return GetScale(); }
610 set { SetScale(value); }
612 private static IntPtr GetEflClassStatic()
614 return Efl.Gfx.IEntityConcrete.efl_gfx_entity_interface_get();
616 /// <summary>Wrapper for native methods and virtual method delegates.
617 /// For internal use by generated code only.</summary>
618 public class NativeMethods : Efl.Eo.NativeClass
620 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
621 /// <summary>Gets the list of Eo operations to override.</summary>
622 /// <returns>The list of Eo operations to be overload.</returns>
623 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
625 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
626 var methods = Efl.Eo.Globals.GetUserMethods(type);
628 if (efl_gfx_entity_position_get_static_delegate == null)
630 efl_gfx_entity_position_get_static_delegate = new efl_gfx_entity_position_get_delegate(position_get);
633 if (methods.FirstOrDefault(m => m.Name == "GetPosition") != null)
635 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_entity_position_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_entity_position_get_static_delegate) });
638 if (efl_gfx_entity_position_set_static_delegate == null)
640 efl_gfx_entity_position_set_static_delegate = new efl_gfx_entity_position_set_delegate(position_set);
643 if (methods.FirstOrDefault(m => m.Name == "SetPosition") != null)
645 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_entity_position_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_entity_position_set_static_delegate) });
648 if (efl_gfx_entity_size_get_static_delegate == null)
650 efl_gfx_entity_size_get_static_delegate = new efl_gfx_entity_size_get_delegate(size_get);
653 if (methods.FirstOrDefault(m => m.Name == "GetSize") != null)
655 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_entity_size_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_entity_size_get_static_delegate) });
658 if (efl_gfx_entity_size_set_static_delegate == null)
660 efl_gfx_entity_size_set_static_delegate = new efl_gfx_entity_size_set_delegate(size_set);
663 if (methods.FirstOrDefault(m => m.Name == "SetSize") != null)
665 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_entity_size_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_entity_size_set_static_delegate) });
668 if (efl_gfx_entity_geometry_get_static_delegate == null)
670 efl_gfx_entity_geometry_get_static_delegate = new efl_gfx_entity_geometry_get_delegate(geometry_get);
673 if (methods.FirstOrDefault(m => m.Name == "GetGeometry") != null)
675 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_entity_geometry_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_entity_geometry_get_static_delegate) });
678 if (efl_gfx_entity_geometry_set_static_delegate == null)
680 efl_gfx_entity_geometry_set_static_delegate = new efl_gfx_entity_geometry_set_delegate(geometry_set);
683 if (methods.FirstOrDefault(m => m.Name == "SetGeometry") != null)
685 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_entity_geometry_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_entity_geometry_set_static_delegate) });
688 if (efl_gfx_entity_visible_get_static_delegate == null)
690 efl_gfx_entity_visible_get_static_delegate = new efl_gfx_entity_visible_get_delegate(visible_get);
693 if (methods.FirstOrDefault(m => m.Name == "GetVisible") != null)
695 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_entity_visible_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_entity_visible_get_static_delegate) });
698 if (efl_gfx_entity_visible_set_static_delegate == null)
700 efl_gfx_entity_visible_set_static_delegate = new efl_gfx_entity_visible_set_delegate(visible_set);
703 if (methods.FirstOrDefault(m => m.Name == "SetVisible") != null)
705 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_entity_visible_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_entity_visible_set_static_delegate) });
708 if (efl_gfx_entity_scale_get_static_delegate == null)
710 efl_gfx_entity_scale_get_static_delegate = new efl_gfx_entity_scale_get_delegate(scale_get);
713 if (methods.FirstOrDefault(m => m.Name == "GetScale") != null)
715 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_entity_scale_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_entity_scale_get_static_delegate) });
718 if (efl_gfx_entity_scale_set_static_delegate == null)
720 efl_gfx_entity_scale_set_static_delegate = new efl_gfx_entity_scale_set_delegate(scale_set);
723 if (methods.FirstOrDefault(m => m.Name == "SetScale") != null)
725 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_gfx_entity_scale_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_entity_scale_set_static_delegate) });
730 /// <summary>Returns the Eo class for the native methods of this class.</summary>
731 /// <returns>The native class pointer.</returns>
732 public override IntPtr GetEflClass()
734 return Efl.Gfx.IEntityConcrete.efl_gfx_entity_interface_get();
737 #pragma warning disable CA1707, SA1300, SA1600
740 private delegate Eina.Position2D.NativeStruct efl_gfx_entity_position_get_delegate(System.IntPtr obj, System.IntPtr pd);
743 public delegate Eina.Position2D.NativeStruct efl_gfx_entity_position_get_api_delegate(System.IntPtr obj);
745 public static Efl.Eo.FunctionWrapper<efl_gfx_entity_position_get_api_delegate> efl_gfx_entity_position_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_entity_position_get_api_delegate>(Module, "efl_gfx_entity_position_get");
747 private static Eina.Position2D.NativeStruct position_get(System.IntPtr obj, System.IntPtr pd)
749 Eina.Log.Debug("function efl_gfx_entity_position_get was called");
750 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
753 Eina.Position2D _ret_var = default(Eina.Position2D);
756 _ret_var = ((IEntity)wrapper).GetPosition();
760 Eina.Log.Warning($"Callback error: {e.ToString()}");
761 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
769 return efl_gfx_entity_position_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
773 private static efl_gfx_entity_position_get_delegate efl_gfx_entity_position_get_static_delegate;
776 private delegate void efl_gfx_entity_position_set_delegate(System.IntPtr obj, System.IntPtr pd, Eina.Position2D.NativeStruct pos);
779 public delegate void efl_gfx_entity_position_set_api_delegate(System.IntPtr obj, Eina.Position2D.NativeStruct pos);
781 public static Efl.Eo.FunctionWrapper<efl_gfx_entity_position_set_api_delegate> efl_gfx_entity_position_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_entity_position_set_api_delegate>(Module, "efl_gfx_entity_position_set");
783 private static void position_set(System.IntPtr obj, System.IntPtr pd, Eina.Position2D.NativeStruct pos)
785 Eina.Log.Debug("function efl_gfx_entity_position_set was called");
786 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
789 Eina.Position2D _in_pos = pos;
793 ((IEntity)wrapper).SetPosition(_in_pos);
797 Eina.Log.Warning($"Callback error: {e.ToString()}");
798 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
805 efl_gfx_entity_position_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), pos);
809 private static efl_gfx_entity_position_set_delegate efl_gfx_entity_position_set_static_delegate;
812 private delegate Eina.Size2D.NativeStruct efl_gfx_entity_size_get_delegate(System.IntPtr obj, System.IntPtr pd);
815 public delegate Eina.Size2D.NativeStruct efl_gfx_entity_size_get_api_delegate(System.IntPtr obj);
817 public static Efl.Eo.FunctionWrapper<efl_gfx_entity_size_get_api_delegate> efl_gfx_entity_size_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_entity_size_get_api_delegate>(Module, "efl_gfx_entity_size_get");
819 private static Eina.Size2D.NativeStruct size_get(System.IntPtr obj, System.IntPtr pd)
821 Eina.Log.Debug("function efl_gfx_entity_size_get was called");
822 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
825 Eina.Size2D _ret_var = default(Eina.Size2D);
828 _ret_var = ((IEntity)wrapper).GetSize();
832 Eina.Log.Warning($"Callback error: {e.ToString()}");
833 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
841 return efl_gfx_entity_size_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
845 private static efl_gfx_entity_size_get_delegate efl_gfx_entity_size_get_static_delegate;
848 private delegate void efl_gfx_entity_size_set_delegate(System.IntPtr obj, System.IntPtr pd, Eina.Size2D.NativeStruct size);
851 public delegate void efl_gfx_entity_size_set_api_delegate(System.IntPtr obj, Eina.Size2D.NativeStruct size);
853 public static Efl.Eo.FunctionWrapper<efl_gfx_entity_size_set_api_delegate> efl_gfx_entity_size_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_entity_size_set_api_delegate>(Module, "efl_gfx_entity_size_set");
855 private static void size_set(System.IntPtr obj, System.IntPtr pd, Eina.Size2D.NativeStruct size)
857 Eina.Log.Debug("function efl_gfx_entity_size_set was called");
858 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
861 Eina.Size2D _in_size = size;
865 ((IEntity)wrapper).SetSize(_in_size);
869 Eina.Log.Warning($"Callback error: {e.ToString()}");
870 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
877 efl_gfx_entity_size_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), size);
881 private static efl_gfx_entity_size_set_delegate efl_gfx_entity_size_set_static_delegate;
884 private delegate Eina.Rect.NativeStruct efl_gfx_entity_geometry_get_delegate(System.IntPtr obj, System.IntPtr pd);
887 public delegate Eina.Rect.NativeStruct efl_gfx_entity_geometry_get_api_delegate(System.IntPtr obj);
889 public static Efl.Eo.FunctionWrapper<efl_gfx_entity_geometry_get_api_delegate> efl_gfx_entity_geometry_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_entity_geometry_get_api_delegate>(Module, "efl_gfx_entity_geometry_get");
891 private static Eina.Rect.NativeStruct geometry_get(System.IntPtr obj, System.IntPtr pd)
893 Eina.Log.Debug("function efl_gfx_entity_geometry_get was called");
894 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
897 Eina.Rect _ret_var = default(Eina.Rect);
900 _ret_var = ((IEntity)wrapper).GetGeometry();
904 Eina.Log.Warning($"Callback error: {e.ToString()}");
905 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
913 return efl_gfx_entity_geometry_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
917 private static efl_gfx_entity_geometry_get_delegate efl_gfx_entity_geometry_get_static_delegate;
920 private delegate void efl_gfx_entity_geometry_set_delegate(System.IntPtr obj, System.IntPtr pd, Eina.Rect.NativeStruct rect);
923 public delegate void efl_gfx_entity_geometry_set_api_delegate(System.IntPtr obj, Eina.Rect.NativeStruct rect);
925 public static Efl.Eo.FunctionWrapper<efl_gfx_entity_geometry_set_api_delegate> efl_gfx_entity_geometry_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_entity_geometry_set_api_delegate>(Module, "efl_gfx_entity_geometry_set");
927 private static void geometry_set(System.IntPtr obj, System.IntPtr pd, Eina.Rect.NativeStruct rect)
929 Eina.Log.Debug("function efl_gfx_entity_geometry_set was called");
930 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
933 Eina.Rect _in_rect = rect;
937 ((IEntity)wrapper).SetGeometry(_in_rect);
941 Eina.Log.Warning($"Callback error: {e.ToString()}");
942 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
949 efl_gfx_entity_geometry_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), rect);
953 private static efl_gfx_entity_geometry_set_delegate efl_gfx_entity_geometry_set_static_delegate;
955 [return: MarshalAs(UnmanagedType.U1)]
956 private delegate bool efl_gfx_entity_visible_get_delegate(System.IntPtr obj, System.IntPtr pd);
958 [return: MarshalAs(UnmanagedType.U1)]
959 public delegate bool efl_gfx_entity_visible_get_api_delegate(System.IntPtr obj);
961 public static Efl.Eo.FunctionWrapper<efl_gfx_entity_visible_get_api_delegate> efl_gfx_entity_visible_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_entity_visible_get_api_delegate>(Module, "efl_gfx_entity_visible_get");
963 private static bool visible_get(System.IntPtr obj, System.IntPtr pd)
965 Eina.Log.Debug("function efl_gfx_entity_visible_get was called");
966 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
969 bool _ret_var = default(bool);
972 _ret_var = ((IEntity)wrapper).GetVisible();
976 Eina.Log.Warning($"Callback error: {e.ToString()}");
977 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
985 return efl_gfx_entity_visible_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
989 private static efl_gfx_entity_visible_get_delegate efl_gfx_entity_visible_get_static_delegate;
992 private delegate void efl_gfx_entity_visible_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool v);
995 public delegate void efl_gfx_entity_visible_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool v);
997 public static Efl.Eo.FunctionWrapper<efl_gfx_entity_visible_set_api_delegate> efl_gfx_entity_visible_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_entity_visible_set_api_delegate>(Module, "efl_gfx_entity_visible_set");
999 private static void visible_set(System.IntPtr obj, System.IntPtr pd, bool v)
1001 Eina.Log.Debug("function efl_gfx_entity_visible_set was called");
1002 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
1003 if (wrapper != null)
1008 ((IEntity)wrapper).SetVisible(v);
1012 Eina.Log.Warning($"Callback error: {e.ToString()}");
1013 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1020 efl_gfx_entity_visible_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), v);
1024 private static efl_gfx_entity_visible_set_delegate efl_gfx_entity_visible_set_static_delegate;
1027 private delegate double efl_gfx_entity_scale_get_delegate(System.IntPtr obj, System.IntPtr pd);
1030 public delegate double efl_gfx_entity_scale_get_api_delegate(System.IntPtr obj);
1032 public static Efl.Eo.FunctionWrapper<efl_gfx_entity_scale_get_api_delegate> efl_gfx_entity_scale_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_entity_scale_get_api_delegate>(Module, "efl_gfx_entity_scale_get");
1034 private static double scale_get(System.IntPtr obj, System.IntPtr pd)
1036 Eina.Log.Debug("function efl_gfx_entity_scale_get was called");
1037 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
1038 if (wrapper != null)
1040 double _ret_var = default(double);
1043 _ret_var = ((IEntity)wrapper).GetScale();
1047 Eina.Log.Warning($"Callback error: {e.ToString()}");
1048 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1056 return efl_gfx_entity_scale_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
1060 private static efl_gfx_entity_scale_get_delegate efl_gfx_entity_scale_get_static_delegate;
1063 private delegate void efl_gfx_entity_scale_set_delegate(System.IntPtr obj, System.IntPtr pd, double scale);
1066 public delegate void efl_gfx_entity_scale_set_api_delegate(System.IntPtr obj, double scale);
1068 public static Efl.Eo.FunctionWrapper<efl_gfx_entity_scale_set_api_delegate> efl_gfx_entity_scale_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_entity_scale_set_api_delegate>(Module, "efl_gfx_entity_scale_set");
1070 private static void scale_set(System.IntPtr obj, System.IntPtr pd, double scale)
1072 Eina.Log.Debug("function efl_gfx_entity_scale_set was called");
1073 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
1074 if (wrapper != null)
1079 ((IEntity)wrapper).SetScale(scale);
1083 Eina.Log.Warning($"Callback error: {e.ToString()}");
1084 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1091 efl_gfx_entity_scale_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), scale);
1095 private static efl_gfx_entity_scale_set_delegate efl_gfx_entity_scale_set_static_delegate;
1097 #pragma warning restore CA1707, SA1300, SA1600