1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Ui {
8 /// <summary>Efl UI factory interface</summary>
9 [IFactoryNativeInherit]
10 public interface IFactory :
12 Efl.Ui.IPropertyBind ,
13 Efl.Eo.IWrapper, IDisposable
15 /// <summary>Create a UI object from the necessary properties in the specified model.</summary>
16 /// <param name="model">Efl model</param>
17 /// <param name="parent">Efl canvas</param>
18 /// <returns>Created UI object</returns>
19 Eina.Future Create( Efl.IModel model, Efl.Gfx.IEntity parent);
20 /// <summary>Release a UI object and disconnect from models.</summary>
21 /// <param name="ui_view">Efl canvas</param>
22 /// <returns></returns>
23 void Release( Efl.Gfx.IEntity ui_view);
24 System.Threading.Tasks.Task<Eina.Value> CreateAsync( Efl.IModel model, Efl.Gfx.IEntity parent, System.Threading.CancellationToken token=default(System.Threading.CancellationToken));
25 /// <summary>Event triggered when an item has been successfully created.</summary>
26 event EventHandler<Efl.Ui.IFactoryCreatedEvt_Args> CreatedEvt;
28 ///<summary>Event argument wrapper for event <see cref="Efl.Ui.IFactory.CreatedEvt"/>.</summary>
29 public class IFactoryCreatedEvt_Args : EventArgs {
30 ///<summary>Actual event payload.</summary>
31 public Efl.Ui.FactoryItemCreatedEvent arg { get; set; }
33 /// <summary>Efl UI factory interface</summary>
34 sealed public class IFactoryConcrete :
37 , Efl.Ui.IFactoryBind, Efl.Ui.IPropertyBind
39 ///<summary>Pointer to the native class description.</summary>
40 public System.IntPtr NativeClass {
42 if (((object)this).GetType() == typeof (IFactoryConcrete))
43 return Efl.Ui.IFactoryNativeInherit.GetEflClassStatic();
45 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
48 private EventHandlerList eventHandlers = new EventHandlerList();
49 private System.IntPtr handle;
50 ///<summary>Pointer to the native instance.</summary>
51 public System.IntPtr NativeHandle {
52 get { return handle; }
54 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
55 efl_ui_factory_interface_get();
56 ///<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>
57 private IFactoryConcrete(System.IntPtr raw)
60 RegisterEventProxies();
62 ///<summary>Destructor.</summary>
67 ///<summary>Releases the underlying native instance.</summary>
68 void Dispose(bool disposing)
70 if (handle != System.IntPtr.Zero) {
71 Efl.Eo.Globals.efl_unref(handle);
72 handle = System.IntPtr.Zero;
75 ///<summary>Releases the underlying native instance.</summary>
79 GC.SuppressFinalize(this);
81 ///<summary>Verifies if the given object is equal to this one.</summary>
82 public override bool Equals(object obj)
84 var other = obj as Efl.Object;
87 return this.NativeHandle == other.NativeHandle;
89 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
90 public override int GetHashCode()
92 return this.NativeHandle.ToInt32();
94 ///<summary>Turns the native pointer into a string representation.</summary>
95 public override String ToString()
97 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
99 private readonly object eventLock = new object();
100 private Dictionary<string, int> event_cb_count = new Dictionary<string, int>();
101 ///<summary>Adds a new event handler, registering it to the native event. For internal use only.</summary>
102 ///<param name="lib">The name of the native library definining the event.</param>
103 ///<param name="key">The name of the native event.</param>
104 ///<param name="evt_delegate">The delegate to be called on event raising.</param>
105 ///<returns>True if the delegate was successfully registered.</returns>
106 private bool AddNativeEventHandler(string lib, string key, Efl.EventCb evt_delegate) {
108 if (!event_cb_count.TryGetValue(key, out event_count))
109 event_cb_count[key] = event_count;
110 if (event_count == 0) {
111 IntPtr desc = Efl.EventDescription.GetNative(lib, key);
112 if (desc == IntPtr.Zero) {
113 Eina.Log.Error($"Failed to get native event {key}");
116 bool result = Efl.Eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evt_delegate, System.IntPtr.Zero);
118 Eina.Log.Error($"Failed to add event proxy for event {key}");
121 Eina.Error.RaiseIfUnhandledException();
123 event_cb_count[key]++;
126 ///<summary>Removes the given event handler for the given event. For internal use only.</summary>
127 ///<param name="key">The name of the native event.</param>
128 ///<param name="evt_delegate">The delegate to be removed.</param>
129 ///<returns>True if the delegate was successfully registered.</returns>
130 private bool RemoveNativeEventHandler(string key, Efl.EventCb evt_delegate) {
132 if (!event_cb_count.TryGetValue(key, out event_count))
133 event_cb_count[key] = event_count;
134 if (event_count == 1) {
135 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
136 if (desc == IntPtr.Zero) {
137 Eina.Log.Error($"Failed to get native event {key}");
140 bool result = Efl.Eo.Globals.efl_event_callback_del(handle, desc, evt_delegate, System.IntPtr.Zero);
142 Eina.Log.Error($"Failed to remove event proxy for event {key}");
145 Eina.Error.RaiseIfUnhandledException();
146 } else if (event_count == 0) {
147 Eina.Log.Error($"Trying to remove proxy for event {key} when there is nothing registered.");
150 event_cb_count[key]--;
153 private static object CreatedEvtKey = new object();
154 /// <summary>Event triggered when an item has been successfully created.</summary>
155 public event EventHandler<Efl.Ui.IFactoryCreatedEvt_Args> CreatedEvt
159 string key = "_EFL_UI_FACTORY_EVENT_CREATED";
160 if (AddNativeEventHandler(efl.Libs.Efl, key, this.evt_CreatedEvt_delegate)) {
161 eventHandlers.AddHandler(CreatedEvtKey , value);
163 Eina.Log.Error($"Error adding proxy for event {key}");
168 string key = "_EFL_UI_FACTORY_EVENT_CREATED";
169 if (RemoveNativeEventHandler(key, this.evt_CreatedEvt_delegate)) {
170 eventHandlers.RemoveHandler(CreatedEvtKey , value);
172 Eina.Log.Error($"Error removing proxy for event {key}");
176 ///<summary>Method to raise event CreatedEvt.</summary>
177 public void On_CreatedEvt(Efl.Ui.IFactoryCreatedEvt_Args e)
179 EventHandler<Efl.Ui.IFactoryCreatedEvt_Args> evt;
181 evt = (EventHandler<Efl.Ui.IFactoryCreatedEvt_Args>)eventHandlers[CreatedEvtKey];
183 evt?.Invoke(this, e);
185 Efl.EventCb evt_CreatedEvt_delegate;
186 private void on_CreatedEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt)
188 Efl.Ui.IFactoryCreatedEvt_Args args = new Efl.Ui.IFactoryCreatedEvt_Args();
189 args.arg = evt.Info;;
192 } catch (Exception e) {
193 Eina.Log.Error(e.ToString());
194 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
198 private static object PropertiesChangedEvtKey = new object();
199 /// <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>
200 public event EventHandler<Efl.Ui.IPropertyBindPropertiesChangedEvt_Args> PropertiesChangedEvt
204 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED";
205 if (AddNativeEventHandler(efl.Libs.Efl, key, this.evt_PropertiesChangedEvt_delegate)) {
206 eventHandlers.AddHandler(PropertiesChangedEvtKey , value);
208 Eina.Log.Error($"Error adding proxy for event {key}");
213 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED";
214 if (RemoveNativeEventHandler(key, this.evt_PropertiesChangedEvt_delegate)) {
215 eventHandlers.RemoveHandler(PropertiesChangedEvtKey , value);
217 Eina.Log.Error($"Error removing proxy for event {key}");
221 ///<summary>Method to raise event PropertiesChangedEvt.</summary>
222 public void On_PropertiesChangedEvt(Efl.Ui.IPropertyBindPropertiesChangedEvt_Args e)
224 EventHandler<Efl.Ui.IPropertyBindPropertiesChangedEvt_Args> evt;
226 evt = (EventHandler<Efl.Ui.IPropertyBindPropertiesChangedEvt_Args>)eventHandlers[PropertiesChangedEvtKey];
228 evt?.Invoke(this, e);
230 Efl.EventCb evt_PropertiesChangedEvt_delegate;
231 private void on_PropertiesChangedEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt)
233 Efl.Ui.IPropertyBindPropertiesChangedEvt_Args args = new Efl.Ui.IPropertyBindPropertiesChangedEvt_Args();
234 args.arg = evt.Info;;
236 On_PropertiesChangedEvt(args);
237 } catch (Exception e) {
238 Eina.Log.Error(e.ToString());
239 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
243 private static object PropertyBoundEvtKey = new object();
244 /// <summary>Event dispatched when a property on the object is bound to a model. This is useful to not overgenerate event.</summary>
245 public event EventHandler<Efl.Ui.IPropertyBindPropertyBoundEvt_Args> PropertyBoundEvt
249 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND";
250 if (AddNativeEventHandler(efl.Libs.Efl, key, this.evt_PropertyBoundEvt_delegate)) {
251 eventHandlers.AddHandler(PropertyBoundEvtKey , value);
253 Eina.Log.Error($"Error adding proxy for event {key}");
258 string key = "_EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND";
259 if (RemoveNativeEventHandler(key, this.evt_PropertyBoundEvt_delegate)) {
260 eventHandlers.RemoveHandler(PropertyBoundEvtKey , value);
262 Eina.Log.Error($"Error removing proxy for event {key}");
266 ///<summary>Method to raise event PropertyBoundEvt.</summary>
267 public void On_PropertyBoundEvt(Efl.Ui.IPropertyBindPropertyBoundEvt_Args e)
269 EventHandler<Efl.Ui.IPropertyBindPropertyBoundEvt_Args> evt;
271 evt = (EventHandler<Efl.Ui.IPropertyBindPropertyBoundEvt_Args>)eventHandlers[PropertyBoundEvtKey];
273 evt?.Invoke(this, e);
275 Efl.EventCb evt_PropertyBoundEvt_delegate;
276 private void on_PropertyBoundEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt)
278 Efl.Ui.IPropertyBindPropertyBoundEvt_Args args = new Efl.Ui.IPropertyBindPropertyBoundEvt_Args();
279 args.arg = Eina.StringConversion.NativeUtf8ToManagedString(evt.Info);
281 On_PropertyBoundEvt(args);
282 } catch (Exception e) {
283 Eina.Log.Error(e.ToString());
284 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
288 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
289 void RegisterEventProxies()
291 evt_CreatedEvt_delegate = new Efl.EventCb(on_CreatedEvt_NativeCallback);
292 evt_PropertiesChangedEvt_delegate = new Efl.EventCb(on_PropertiesChangedEvt_NativeCallback);
293 evt_PropertyBoundEvt_delegate = new Efl.EventCb(on_PropertyBoundEvt_NativeCallback);
295 /// <summary>Create a UI object from the necessary properties in the specified model.</summary>
296 /// <param name="model">Efl model</param>
297 /// <param name="parent">Efl canvas</param>
298 /// <returns>Created UI object</returns>
299 public Eina.Future Create( Efl.IModel model, Efl.Gfx.IEntity parent) {
300 var _ret_var = Efl.Ui.IFactoryNativeInherit.efl_ui_factory_create_ptr.Value.Delegate(this.NativeHandle, model, parent);
301 Eina.Error.RaiseIfUnhandledException();
304 /// <summary>Release a UI object and disconnect from models.</summary>
305 /// <param name="ui_view">Efl canvas</param>
306 /// <returns></returns>
307 public void Release( Efl.Gfx.IEntity ui_view) {
308 Efl.Ui.IFactoryNativeInherit.efl_ui_factory_release_ptr.Value.Delegate(this.NativeHandle, ui_view);
309 Eina.Error.RaiseIfUnhandledException();
311 /// <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>
312 /// <param name="key">Key string for bind model property data</param>
313 /// <param name="factory"><see cref="Efl.Ui.IFactory"/> for create and bind model property data</param>
314 /// <returns></returns>
315 public void FactoryBind( System.String key, Efl.Ui.IFactory factory) {
316 Efl.Ui.IFactoryBindNativeInherit.efl_ui_factory_bind_ptr.Value.Delegate(this.NativeHandle, key, factory);
317 Eina.Error.RaiseIfUnhandledException();
319 /// <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>
320 /// <param name="key">key string for bind model property data</param>
321 /// <param name="property">Model property name</param>
322 /// <returns>0 when it succeed, an error code otherwise.</returns>
323 public Eina.Error PropertyBind( System.String key, System.String property) {
324 var _ret_var = Efl.Ui.IPropertyBindNativeInherit.efl_ui_property_bind_ptr.Value.Delegate(this.NativeHandle, key, property);
325 Eina.Error.RaiseIfUnhandledException();
328 public System.Threading.Tasks.Task<Eina.Value> CreateAsync( Efl.IModel model, Efl.Gfx.IEntity parent, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
330 Eina.Future future = Create( model, parent);
331 return Efl.Eo.Globals.WrapAsync(future, token);
333 private static IntPtr GetEflClassStatic()
335 return Efl.Ui.IFactoryConcrete.efl_ui_factory_interface_get();
338 public class IFactoryNativeInherit : Efl.Eo.NativeClass{
339 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
340 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
342 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
343 var methods = Efl.Eo.Globals.GetUserMethods(type);
344 if (efl_ui_factory_create_static_delegate == null)
345 efl_ui_factory_create_static_delegate = new efl_ui_factory_create_delegate(create);
346 if (methods.FirstOrDefault(m => m.Name == "Create") != null)
347 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)});
348 if (efl_ui_factory_release_static_delegate == null)
349 efl_ui_factory_release_static_delegate = new efl_ui_factory_release_delegate(release);
350 if (methods.FirstOrDefault(m => m.Name == "Release") != null)
351 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)});
352 if (efl_ui_factory_bind_static_delegate == null)
353 efl_ui_factory_bind_static_delegate = new efl_ui_factory_bind_delegate(factory_bind);
354 if (methods.FirstOrDefault(m => m.Name == "FactoryBind") != null)
355 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)});
356 if (efl_ui_property_bind_static_delegate == null)
357 efl_ui_property_bind_static_delegate = new efl_ui_property_bind_delegate(property_bind);
358 if (methods.FirstOrDefault(m => m.Name == "PropertyBind") != null)
359 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)});
362 public override IntPtr GetEflClass()
364 return Efl.Ui.IFactoryConcrete.efl_ui_factory_interface_get();
366 public static IntPtr GetEflClassStatic()
368 return Efl.Ui.IFactoryConcrete.efl_ui_factory_interface_get();
372 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] private delegate Eina.Future efl_ui_factory_create_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.IModelConcrete, Efl.Eo.NonOwnTag>))] Efl.IModel model, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.IEntityConcrete, Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity parent);
375 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] public delegate Eina.Future efl_ui_factory_create_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.IModelConcrete, Efl.Eo.NonOwnTag>))] Efl.IModel model, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.IEntityConcrete, Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity parent);
376 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");
377 private static Eina.Future create(System.IntPtr obj, System.IntPtr pd, Efl.IModel model, Efl.Gfx.IEntity parent)
379 Eina.Log.Debug("function efl_ui_factory_create was called");
380 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
381 if(wrapper != null) {
382 Eina.Future _ret_var = default( Eina.Future);
384 _ret_var = ((IFactory)wrapper).Create( model, parent);
385 } catch (Exception e) {
386 Eina.Log.Warning($"Callback error: {e.ToString()}");
387 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
391 return efl_ui_factory_create_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), model, parent);
394 private static efl_ui_factory_create_delegate efl_ui_factory_create_static_delegate;
397 private delegate void efl_ui_factory_release_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.IEntityConcrete, Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity ui_view);
400 public delegate void efl_ui_factory_release_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.IEntityConcrete, Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity ui_view);
401 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");
402 private static void release(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity ui_view)
404 Eina.Log.Debug("function efl_ui_factory_release was called");
405 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
406 if(wrapper != null) {
409 ((IFactory)wrapper).Release( ui_view);
410 } catch (Exception e) {
411 Eina.Log.Warning($"Callback error: {e.ToString()}");
412 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
415 efl_ui_factory_release_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), ui_view);
418 private static efl_ui_factory_release_delegate efl_ui_factory_release_static_delegate;
421 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.MarshalTest<Efl.Ui.IFactoryConcrete, Efl.Eo.NonOwnTag>))] Efl.Ui.IFactory factory);
424 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.MarshalTest<Efl.Ui.IFactoryConcrete, Efl.Eo.NonOwnTag>))] Efl.Ui.IFactory factory);
425 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");
426 private static void factory_bind(System.IntPtr obj, System.IntPtr pd, System.String key, Efl.Ui.IFactory factory)
428 Eina.Log.Debug("function efl_ui_factory_bind was called");
429 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
430 if(wrapper != null) {
433 ((IFactory)wrapper).FactoryBind( key, factory);
434 } catch (Exception e) {
435 Eina.Log.Warning($"Callback error: {e.ToString()}");
436 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
439 efl_ui_factory_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key, factory);
442 private static efl_ui_factory_bind_delegate efl_ui_factory_bind_static_delegate;
445 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);
448 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);
449 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");
450 private static Eina.Error property_bind(System.IntPtr obj, System.IntPtr pd, System.String key, System.String property)
452 Eina.Log.Debug("function efl_ui_property_bind was called");
453 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
454 if(wrapper != null) {
455 Eina.Error _ret_var = default(Eina.Error);
457 _ret_var = ((IFactory)wrapper).PropertyBind( key, property);
458 } catch (Exception e) {
459 Eina.Log.Warning($"Callback error: {e.ToString()}");
460 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
464 return efl_ui_property_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key, property);
467 private static efl_ui_property_bind_delegate efl_ui_property_bind_static_delegate;
470 namespace Efl { namespace Ui {
471 /// <summary>EFL Ui Factory event structure provided when an item was just created.</summary>
472 [StructLayout(LayoutKind.Sequential)]
473 public struct FactoryItemCreatedEvent
475 /// <summary>The model already set on the new item.</summary>
476 public Efl.IModel Model;
477 /// <summary>The item that was just created.</summary>
478 public Efl.Gfx.IEntity Item;
479 ///<summary>Constructor for FactoryItemCreatedEvent.</summary>
480 public FactoryItemCreatedEvent(
481 Efl.IModel Model=default(Efl.IModel),
482 Efl.Gfx.IEntity Item=default(Efl.Gfx.IEntity) )
488 public static implicit operator FactoryItemCreatedEvent(IntPtr ptr)
490 var tmp = (FactoryItemCreatedEvent.NativeStruct)Marshal.PtrToStructure(ptr, typeof(FactoryItemCreatedEvent.NativeStruct));
494 ///<summary>Internal wrapper for struct FactoryItemCreatedEvent.</summary>
495 [StructLayout(LayoutKind.Sequential)]
496 public struct NativeStruct
498 ///<summary>Internal wrapper for field Model</summary>
499 public System.IntPtr Model;
500 ///<summary>Internal wrapper for field Item</summary>
501 public System.IntPtr Item;
502 ///<summary>Implicit conversion to the internal/marshalling representation.</summary>
503 public static implicit operator FactoryItemCreatedEvent.NativeStruct(FactoryItemCreatedEvent _external_struct)
505 var _internal_struct = new FactoryItemCreatedEvent.NativeStruct();
506 _internal_struct.Model = _external_struct.Model?.NativeHandle ?? System.IntPtr.Zero;
507 _internal_struct.Item = _external_struct.Item?.NativeHandle ?? System.IntPtr.Zero;
508 return _internal_struct;
511 ///<summary>Implicit conversion to the managed representation.</summary>
512 public static implicit operator FactoryItemCreatedEvent(FactoryItemCreatedEvent.NativeStruct _internal_struct)
514 var _external_struct = new FactoryItemCreatedEvent();
516 _external_struct.Model = (Efl.IModelConcrete) Efl.Eo.Globals.CreateWrapperFor(_internal_struct.Model);
518 _external_struct.Item = (Efl.Gfx.IEntityConcrete) Efl.Eo.Globals.CreateWrapperFor(_internal_struct.Item);
519 return _external_struct;