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 UI factory interface</summary>
13 [Efl.Ui.IFactoryConcrete.NativeMethods]
14 public interface IFactory :
16 Efl.Ui.IPropertyBind ,
17 Efl.Eo.IWrapper, IDisposable
19 /// <summary>Create a UI object from the necessary properties in the specified model.</summary>
20 /// <param name="model">Efl model</param>
21 /// <param name="parent">Efl canvas</param>
22 /// <returns>Created UI object</returns>
23 Eina.Future Create(Efl.IModel model, Efl.Gfx.IEntity parent);
24 /// <summary>Release a UI object and disconnect from models.</summary>
25 /// <param name="ui_view">Efl canvas</param>
26 void Release(Efl.Gfx.IEntity ui_view);
27 System.Threading.Tasks.Task<Eina.Value> CreateAsync(Efl.IModel model,Efl.Gfx.IEntity parent, System.Threading.CancellationToken token = default(System.Threading.CancellationToken));
28 /// <summary>Event triggered when an item has been successfully created.</summary>
29 event EventHandler<Efl.Ui.IFactoryCreatedEvt_Args> CreatedEvt;
31 ///<summary>Event argument wrapper for event <see cref="Efl.Ui.IFactory.CreatedEvt"/>.</summary>
32 public class IFactoryCreatedEvt_Args : EventArgs {
33 ///<summary>Actual event payload.</summary>
34 public Efl.Ui.FactoryItemCreatedEvent arg { get; set; }
36 /// <summary>Efl UI factory interface</summary>
37 sealed public class IFactoryConcrete :
40 , Efl.Ui.IFactoryBind, Efl.Ui.IPropertyBind
42 ///<summary>Pointer to the native class description.</summary>
43 public System.IntPtr NativeClass
47 if (((object)this).GetType() == typeof(IFactoryConcrete))
49 return GetEflClassStatic();
53 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
58 private Dictionary<(IntPtr desc, object evtDelegate), (IntPtr evtCallerPtr, Efl.EventCb evtCaller)> eoEvents = new Dictionary<(IntPtr desc, object evtDelegate), (IntPtr evtCallerPtr, Efl.EventCb evtCaller)>();
59 private readonly object eventLock = new object();
60 private System.IntPtr handle;
61 ///<summary>Pointer to the native instance.</summary>
62 public System.IntPtr NativeHandle
64 get { return handle; }
67 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
68 efl_ui_factory_interface_get();
69 /// <summary>Initializes a new instance of the <see cref="IFactory"/> class.
70 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
71 private IFactoryConcrete(System.IntPtr raw)
75 ///<summary>Destructor.</summary>
81 ///<summary>Releases the underlying native instance.</summary>
82 private void Dispose(bool disposing)
84 if (handle != System.IntPtr.Zero)
89 IntPtr gcHandlePtr = IntPtr.Zero;
90 if (eoEvents.Count != 0)
92 GCHandle gcHandle = GCHandle.Alloc(eoEvents);
93 gcHandlePtr = GCHandle.ToIntPtr(gcHandle);
98 Efl.Eo.Globals.efl_mono_native_dispose(h, gcHandlePtr);
102 Monitor.Enter(Efl.All.InitLock);
103 if (Efl.All.MainLoopInitialized)
105 Efl.Eo.Globals.efl_mono_thread_safe_native_dispose(h, gcHandlePtr);
108 Monitor.Exit(Efl.All.InitLock);
114 ///<summary>Releases the underlying native instance.</summary>
115 public void Dispose()
118 GC.SuppressFinalize(this);
121 /// <summary>Verifies if the given object is equal to this one.</summary>
122 /// <param name="instance">The object to compare to.</param>
123 /// <returns>True if both objects point to the same native object.</returns>
124 public override bool Equals(object instance)
126 var other = instance as Efl.Object;
131 return this.NativeHandle == other.NativeHandle;
134 /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
135 /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
136 public override int GetHashCode()
138 return this.NativeHandle.ToInt32();
141 /// <summary>Turns the native pointer into a string representation.</summary>
142 /// <returns>A string with the type and the native pointer for this object.</returns>
143 public override String ToString()
145 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
148 ///<summary>Adds a new event handler, registering it to the native event. For internal use only.</summary>
149 ///<param name="lib">The name of the native library definining the event.</param>
150 ///<param name="key">The name of the native event.</param>
151 ///<param name="evtCaller">Delegate to be called by native code on event raising.</param>
152 ///<param name="evtDelegate">Managed delegate that will be called by evtCaller on event raising.</param>
153 private void AddNativeEventHandler(string lib, string key, Efl.EventCb evtCaller, object evtDelegate)
155 IntPtr desc = Efl.EventDescription.GetNative(lib, key);
156 if (desc == IntPtr.Zero)
158 Eina.Log.Error($"Failed to get native event {key}");
161 if (eoEvents.ContainsKey((desc, evtDelegate)))
163 Eina.Log.Warning($"Event proxy for event {key} already registered!");
167 IntPtr evtCallerPtr = Marshal.GetFunctionPointerForDelegate(evtCaller);
168 if (!Efl.Eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evtCallerPtr, IntPtr.Zero))
170 Eina.Log.Error($"Failed to add event proxy for event {key}");
174 eoEvents[(desc, evtDelegate)] = (evtCallerPtr, evtCaller);
175 Eina.Error.RaiseIfUnhandledException();
178 ///<summary>Removes the given event handler for the given event. For internal use only.</summary>
179 ///<param name="lib">The name of the native library definining the event.</param>
180 ///<param name="key">The name of the native event.</param>
181 ///<param name="evtDelegate">The delegate to be removed.</param>
182 private void RemoveNativeEventHandler(string lib, string key, object evtDelegate)
184 IntPtr desc = Efl.EventDescription.GetNative(lib, key);
185 if (desc == IntPtr.Zero)
187 Eina.Log.Error($"Failed to get native event {key}");
191 var evtPair = (desc, evtDelegate);
192 if (eoEvents.TryGetValue(evtPair, out var caller))
194 if (!Efl.Eo.Globals.efl_event_callback_del(handle, desc, caller.evtCallerPtr, IntPtr.Zero))
196 Eina.Log.Error($"Failed to remove event proxy for event {key}");
200 eoEvents.Remove(evtPair);
201 Eina.Error.RaiseIfUnhandledException();
205 Eina.Log.Error($"Trying to remove proxy for event {key} when it is nothing registered.");
209 /// <summary>Event triggered when an item has been successfully created.</summary>
210 public event EventHandler<Efl.Ui.IFactoryCreatedEvt_Args> CreatedEvt
216 var wRef = new WeakReference(this);
217 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
219 var obj = wRef.Target as Efl.Eo.IWrapper;
222 Efl.Ui.IFactoryCreatedEvt_Args args = new Efl.Ui.IFactoryCreatedEvt_Args();
226 value?.Invoke(obj, args);
230 Eina.Log.Error(e.ToString());
231 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
236 string key = "_EFL_UI_FACTORY_EVENT_CREATED";
237 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
245 string key = "_EFL_UI_FACTORY_EVENT_CREATED";
246 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
250 ///<summary>Method to raise event CreatedEvt.</summary>
251 public void OnCreatedEvt(Efl.Ui.IFactoryCreatedEvt_Args e)
253 var key = "_EFL_UI_FACTORY_EVENT_CREATED";
254 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
255 if (desc == IntPtr.Zero)
257 Eina.Log.Error($"Failed to get native event {key}");
261 IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));
264 Marshal.StructureToPtr(e.arg, info, false);
265 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
269 Marshal.FreeHGlobal(info);
272 /// <summary>Event dispatched when a property on the object has changed due to an user interaction on the object that a model could be interested in.</summary>
273 public event EventHandler<Efl.Ui.IPropertyBindPropertiesChangedEvt_Args> PropertiesChangedEvt
279 var wRef = new WeakReference(this);
280 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
282 var obj = wRef.Target as Efl.Eo.IWrapper;
285 Efl.Ui.IPropertyBindPropertiesChangedEvt_Args args = new Efl.Ui.IPropertyBindPropertiesChangedEvt_Args();
289 value?.Invoke(obj, args);
293 Eina.Log.Error(e.ToString());
294 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
299 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED";
300 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
308 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED";
309 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
313 ///<summary>Method to raise event PropertiesChangedEvt.</summary>
314 public void OnPropertiesChangedEvt(Efl.Ui.IPropertyBindPropertiesChangedEvt_Args e)
316 var key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED";
317 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
318 if (desc == IntPtr.Zero)
320 Eina.Log.Error($"Failed to get native event {key}");
324 IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));
327 Marshal.StructureToPtr(e.arg, info, false);
328 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
332 Marshal.FreeHGlobal(info);
335 /// <summary>Event dispatched when a property on the object is bound to a model. This is useful to not overgenerate event.</summary>
336 public event EventHandler<Efl.Ui.IPropertyBindPropertyBoundEvt_Args> PropertyBoundEvt
342 var wRef = new WeakReference(this);
343 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
345 var obj = wRef.Target as Efl.Eo.IWrapper;
348 Efl.Ui.IPropertyBindPropertyBoundEvt_Args args = new Efl.Ui.IPropertyBindPropertyBoundEvt_Args();
349 args.arg = Eina.StringConversion.NativeUtf8ToManagedString(evt.Info);
352 value?.Invoke(obj, args);
356 Eina.Log.Error(e.ToString());
357 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
362 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND";
363 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
371 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND";
372 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
376 ///<summary>Method to raise event PropertyBoundEvt.</summary>
377 public void OnPropertyBoundEvt(Efl.Ui.IPropertyBindPropertyBoundEvt_Args e)
379 var key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND";
380 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
381 if (desc == IntPtr.Zero)
383 Eina.Log.Error($"Failed to get native event {key}");
387 IntPtr info = Eina.StringConversion.ManagedStringToNativeUtf8Alloc(e.arg);
390 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
394 Eina.MemoryNative.Free(info);
397 /// <summary>Create a UI object from the necessary properties in the specified model.</summary>
398 /// <param name="model">Efl model</param>
399 /// <param name="parent">Efl canvas</param>
400 /// <returns>Created UI object</returns>
401 public Eina.Future Create(Efl.IModel model, Efl.Gfx.IEntity parent) {
402 var _ret_var = Efl.Ui.IFactoryConcrete.NativeMethods.efl_ui_factory_create_ptr.Value.Delegate(this.NativeHandle,model, parent);
403 Eina.Error.RaiseIfUnhandledException();
406 /// <summary>Release a UI object and disconnect from models.</summary>
407 /// <param name="ui_view">Efl canvas</param>
408 public void Release(Efl.Gfx.IEntity ui_view) {
409 Efl.Ui.IFactoryConcrete.NativeMethods.efl_ui_factory_release_ptr.Value.Delegate(this.NativeHandle,ui_view);
410 Eina.Error.RaiseIfUnhandledException();
412 /// <summary>bind the factory with the given key string. when the data is ready or changed, factory create the object and bind the data to the key action and process promised work. Note: the input <see cref="Efl.Ui.IFactory"/> need to be <see cref="Efl.Ui.IPropertyBind.PropertyBind"/> at least once.</summary>
413 /// <param name="key">Key string for bind model property data</param>
414 /// <param name="factory"><see cref="Efl.Ui.IFactory"/> for create and bind model property data</param>
415 public void FactoryBind(System.String key, Efl.Ui.IFactory factory) {
416 Efl.Ui.IFactoryBindConcrete.NativeMethods.efl_ui_factory_bind_ptr.Value.Delegate(this.NativeHandle,key, factory);
417 Eina.Error.RaiseIfUnhandledException();
419 /// <summary>bind property data with the given key string. when the data is ready or changed, bind the data to the key action and process promised work.</summary>
420 /// <param name="key">key string for bind model property data</param>
421 /// <param name="property">Model property name</param>
422 /// <returns>0 when it succeed, an error code otherwise.</returns>
423 public Eina.Error PropertyBind(System.String key, System.String property) {
424 var _ret_var = Efl.Ui.IPropertyBindConcrete.NativeMethods.efl_ui_property_bind_ptr.Value.Delegate(this.NativeHandle,key, property);
425 Eina.Error.RaiseIfUnhandledException();
428 public System.Threading.Tasks.Task<Eina.Value> CreateAsync(Efl.IModel model,Efl.Gfx.IEntity parent, System.Threading.CancellationToken token = default(System.Threading.CancellationToken))
430 Eina.Future future = Create( model, parent);
431 return Efl.Eo.Globals.WrapAsync(future, token);
433 private static IntPtr GetEflClassStatic()
435 return Efl.Ui.IFactoryConcrete.efl_ui_factory_interface_get();
437 /// <summary>Wrapper for native methods and virtual method delegates.
438 /// For internal use by generated code only.</summary>
439 public class NativeMethods : Efl.Eo.NativeClass
441 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
442 /// <summary>Gets the list of Eo operations to override.</summary>
443 /// <returns>The list of Eo operations to be overload.</returns>
444 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
446 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
447 var methods = Efl.Eo.Globals.GetUserMethods(type);
449 if (efl_ui_factory_create_static_delegate == null)
451 efl_ui_factory_create_static_delegate = new efl_ui_factory_create_delegate(create);
454 if (methods.FirstOrDefault(m => m.Name == "Create") != null)
456 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_factory_create"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_factory_create_static_delegate) });
459 if (efl_ui_factory_release_static_delegate == null)
461 efl_ui_factory_release_static_delegate = new efl_ui_factory_release_delegate(release);
464 if (methods.FirstOrDefault(m => m.Name == "Release") != null)
466 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_factory_release"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_factory_release_static_delegate) });
469 if (efl_ui_factory_bind_static_delegate == null)
471 efl_ui_factory_bind_static_delegate = new efl_ui_factory_bind_delegate(factory_bind);
474 if (methods.FirstOrDefault(m => m.Name == "FactoryBind") != null)
476 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_factory_bind"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_factory_bind_static_delegate) });
479 if (efl_ui_property_bind_static_delegate == null)
481 efl_ui_property_bind_static_delegate = new efl_ui_property_bind_delegate(property_bind);
484 if (methods.FirstOrDefault(m => m.Name == "PropertyBind") != null)
486 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_property_bind"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_property_bind_static_delegate) });
491 /// <summary>Returns the Eo class for the native methods of this class.</summary>
492 /// <returns>The native class pointer.</returns>
493 public override IntPtr GetEflClass()
495 return Efl.Ui.IFactoryConcrete.efl_ui_factory_interface_get();
498 #pragma warning disable CA1707, SA1300, SA1600
500 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))]
501 private delegate Eina.Future efl_ui_factory_create_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.IModel model, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity parent);
503 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))]
504 public delegate Eina.Future efl_ui_factory_create_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.IModel model, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity parent);
506 public static Efl.Eo.FunctionWrapper<efl_ui_factory_create_api_delegate> efl_ui_factory_create_ptr = new Efl.Eo.FunctionWrapper<efl_ui_factory_create_api_delegate>(Module, "efl_ui_factory_create");
508 private static Eina.Future create(System.IntPtr obj, System.IntPtr pd, Efl.IModel model, Efl.Gfx.IEntity parent)
510 Eina.Log.Debug("function efl_ui_factory_create was called");
511 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
514 Eina.Future _ret_var = default( Eina.Future);
517 _ret_var = ((IFactory)wrapper).Create(model, parent);
521 Eina.Log.Warning($"Callback error: {e.ToString()}");
522 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
530 return efl_ui_factory_create_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), model, parent);
534 private static efl_ui_factory_create_delegate efl_ui_factory_create_static_delegate;
537 private delegate void efl_ui_factory_release_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity ui_view);
540 public delegate void efl_ui_factory_release_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity ui_view);
542 public static Efl.Eo.FunctionWrapper<efl_ui_factory_release_api_delegate> efl_ui_factory_release_ptr = new Efl.Eo.FunctionWrapper<efl_ui_factory_release_api_delegate>(Module, "efl_ui_factory_release");
544 private static void release(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity ui_view)
546 Eina.Log.Debug("function efl_ui_factory_release was called");
547 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
553 ((IFactory)wrapper).Release(ui_view);
557 Eina.Log.Warning($"Callback error: {e.ToString()}");
558 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
565 efl_ui_factory_release_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), ui_view);
569 private static efl_ui_factory_release_delegate efl_ui_factory_release_static_delegate;
572 private delegate void efl_ui_factory_bind_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Ui.IFactory factory);
575 public delegate void efl_ui_factory_bind_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Ui.IFactory factory);
577 public static Efl.Eo.FunctionWrapper<efl_ui_factory_bind_api_delegate> efl_ui_factory_bind_ptr = new Efl.Eo.FunctionWrapper<efl_ui_factory_bind_api_delegate>(Module, "efl_ui_factory_bind");
579 private static void factory_bind(System.IntPtr obj, System.IntPtr pd, System.String key, Efl.Ui.IFactory factory)
581 Eina.Log.Debug("function efl_ui_factory_bind was called");
582 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
588 ((IFactory)wrapper).FactoryBind(key, factory);
592 Eina.Log.Warning($"Callback error: {e.ToString()}");
593 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
600 efl_ui_factory_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key, factory);
604 private static efl_ui_factory_bind_delegate efl_ui_factory_bind_static_delegate;
607 private delegate Eina.Error efl_ui_property_bind_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String property);
610 public delegate Eina.Error efl_ui_property_bind_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String property);
612 public static Efl.Eo.FunctionWrapper<efl_ui_property_bind_api_delegate> efl_ui_property_bind_ptr = new Efl.Eo.FunctionWrapper<efl_ui_property_bind_api_delegate>(Module, "efl_ui_property_bind");
614 private static Eina.Error property_bind(System.IntPtr obj, System.IntPtr pd, System.String key, System.String property)
616 Eina.Log.Debug("function efl_ui_property_bind was called");
617 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
620 Eina.Error _ret_var = default(Eina.Error);
623 _ret_var = ((IFactory)wrapper).PropertyBind(key, property);
627 Eina.Log.Warning($"Callback error: {e.ToString()}");
628 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
636 return efl_ui_property_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key, property);
640 private static efl_ui_property_bind_delegate efl_ui_property_bind_static_delegate;
642 #pragma warning restore CA1707, SA1300, SA1600
654 /// <summary>EFL Ui Factory event structure provided when an item was just created.</summary>
655 [StructLayout(LayoutKind.Sequential)]
656 public struct FactoryItemCreatedEvent
658 /// <summary>The model already set on the new item.</summary>
659 public Efl.IModel Model;
660 /// <summary>The item that was just created.</summary>
661 public Efl.Gfx.IEntity Item;
662 ///<summary>Constructor for FactoryItemCreatedEvent.</summary>
663 public FactoryItemCreatedEvent(
664 Efl.IModel Model = default(Efl.IModel),
665 Efl.Gfx.IEntity Item = default(Efl.Gfx.IEntity) )
671 public static implicit operator FactoryItemCreatedEvent(IntPtr ptr)
673 var tmp = (FactoryItemCreatedEvent.NativeStruct)Marshal.PtrToStructure(ptr, typeof(FactoryItemCreatedEvent.NativeStruct));
677 ///<summary>Internal wrapper for struct FactoryItemCreatedEvent.</summary>
678 [StructLayout(LayoutKind.Sequential)]
679 public struct NativeStruct
681 ///<summary>Internal wrapper for field Model</summary>
682 public System.IntPtr Model;
683 ///<summary>Internal wrapper for field Item</summary>
684 public System.IntPtr Item;
685 ///<summary>Implicit conversion to the internal/marshalling representation.</summary>
686 public static implicit operator FactoryItemCreatedEvent.NativeStruct(FactoryItemCreatedEvent _external_struct)
688 var _internal_struct = new FactoryItemCreatedEvent.NativeStruct();
689 _internal_struct.Model = _external_struct.Model?.NativeHandle ?? System.IntPtr.Zero;
690 _internal_struct.Item = _external_struct.Item?.NativeHandle ?? System.IntPtr.Zero;
691 return _internal_struct;
694 ///<summary>Implicit conversion to the managed representation.</summary>
695 public static implicit operator FactoryItemCreatedEvent(FactoryItemCreatedEvent.NativeStruct _internal_struct)
697 var _external_struct = new FactoryItemCreatedEvent();
699 _external_struct.Model = (Efl.IModelConcrete) Efl.Eo.Globals.CreateWrapperFor(_internal_struct.Model);
701 _external_struct.Item = (Efl.Gfx.IEntityConcrete) Efl.Eo.Globals.CreateWrapperFor(_internal_struct.Item);
702 return _external_struct;