1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
8 /// <summary>Efl model interface</summary>
10 public interface Model :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>Get properties from model.
14 /// properties_get is due to provide callers a way the fetch the current properties implemented/used by the model. The event <see cref="Efl.Model.PropertiesChangedEvt"/> will be raised to notify listeners of any modifications in the properties.
16 /// See also <see cref="Efl.Model.PropertiesChangedEvt"/>.
18 /// <returns>Array of current properties</returns>
19 Eina.Iterator< System.String> GetProperties();
20 /// <summary>Retrieve the value of a given property name.
21 /// At this point the caller is free to get values from properties. The event <see cref="Efl.Model.PropertiesChangedEvt"/> may be raised to notify listeners of the property/value.
23 /// See <see cref="Efl.Model.GetProperties"/>, <see cref="Efl.Model.PropertiesChangedEvt"/>
25 /// <param name="property">Property name</param>
26 /// <returns>Property value</returns>
27 Eina.Value GetProperty( System.String property);
28 /// <summary>Set a property value of a given property name.
29 /// The caller must ensure to call at least efl_model_prop_list before being able to see/set properties. This function sets a new property value into given property name. Once the operation is completed the concrete implementation should raise <see cref="Efl.Model.PropertiesChangedEvt"/> event in order to notify listeners of the new value of the property.
31 /// If the model doesn't have the property then there are two possibilities, either raise an error or create the new property in model
33 /// See <see cref="Efl.Model.GetProperty"/>, <see cref="Efl.Model.PropertiesChangedEvt"/>
35 /// <param name="property">Property name</param>
36 /// <param name="value">Property value</param>
37 /// <returns>Return an error in case the property could not be set, the value that was set otherwise.</returns>
38 Eina.Future SetProperty( System.String property, Eina.Value value);
39 /// <summary>Get children count.
40 /// When efl_model_load is completed <see cref="Efl.Model.GetChildrenCount"/> can be used to get the number of children. <see cref="Efl.Model.GetChildrenCount"/> can also be used before calling <see cref="Efl.Model.GetChildrenSlice"/> so a valid range is known. Event <see cref="Efl.Model.ChildrenCountChangedEvt"/> is emitted when count is finished.
42 /// See also <see cref="Efl.Model.GetChildrenSlice"/>.
44 /// <returns>Current known children count</returns>
45 uint GetChildrenCount();
46 /// <summary>Get a future value when it changes to something that is not error:EAGAIN
47 /// <see cref="Efl.Model.GetProperty"/> can return an error with code EAGAIN when it doesn't have any meaningful value. To make life easier, this future will resolve when the error:EAGAIN disapears. Either into a failed future in case the error code changed to something else or a success with the value of the property whenever the property finally changes.
49 /// The future can also be canceled if the model itself gets destroyed.</summary>
50 /// <param name="property"></param>
51 /// <returns></returns>
52 Eina.Future GetPropertyReady( System.String property);
53 /// <summary>Get children slice OR full range.
54 /// <see cref="Efl.Model.GetChildrenSlice"/> behaves in two different ways, it may provide the slice if <c>count</c> is non-zero OR full range otherwise.
56 /// Since 'slice' is a range, for example if we have 20 children a slice could be the range from 3(start) with 4(count), see:
58 /// child 0 [no] child 1 [no] child 2 [no] child 3 [yes] child 4 [yes] child 5 [yes] child 6 [yes] child 7 [no]
60 /// Optionally the user can call <see cref="Efl.Model.GetChildrenCount"/> to know the number of children so a valid range can be known in advance.
62 /// See <see cref="Efl.Model.GetChildrenCount"/>
64 /// Note: The returned children will live only as long as the future itself. Once the future is done, if you want to keep the object alive, you need to take a reference for yourself.
66 /// <param name="start">Range begin - start from here.</param>
67 /// <param name="count">Range size. If count is 0, start is ignored.</param>
68 /// <returns>Array of children</returns>
69 Eina.Future GetChildrenSlice( uint start, uint count);
70 /// <summary>Add a new child.
71 /// Add a new child, possibly dummy, depending on the implementation, of a internal keeping. When the child is effectively added the event <see cref="Efl.Model.ChildAddedEvt"/> is then raised and the new child is kept along with other children.
73 /// <returns>Child object</returns>
74 Efl.Object AddChild();
75 /// <summary>Remove a child.
76 /// Remove a child of a internal keeping. When the child is effectively removed the event <see cref="Efl.Model.ChildRemovedEvt"/> is then raised to give a chance for listeners to perform any cleanup and/or update references.
78 /// <param name="child">Child to be removed</param>
79 /// <returns></returns>
80 void DelChild( Efl.Object child);
81 System.Threading.Tasks.Task<Eina.Value> SetPropertyAsync( System.String property, Eina.Value value, System.Threading.CancellationToken token=default(System.Threading.CancellationToken));
82 System.Threading.Tasks.Task<Eina.Value> GetPropertyReadyAsync( System.String property, System.Threading.CancellationToken token=default(System.Threading.CancellationToken));
83 System.Threading.Tasks.Task<Eina.Value> GetChildrenSliceAsync( uint start, uint count, System.Threading.CancellationToken token=default(System.Threading.CancellationToken));
84 /// <summary>Event dispatched when properties list is available.</summary>
85 event EventHandler<Efl.ModelPropertiesChangedEvt_Args> PropertiesChangedEvt;
86 /// <summary>Event dispatched when new child is added.</summary>
87 event EventHandler<Efl.ModelChildAddedEvt_Args> ChildAddedEvt;
88 /// <summary>Event dispatched when child is removed.</summary>
89 event EventHandler<Efl.ModelChildRemovedEvt_Args> ChildRemovedEvt;
90 /// <summary>Event dispatched when children count is finished.</summary>
91 event EventHandler ChildrenCountChangedEvt;
92 /// <summary>Get properties from model.
93 /// properties_get is due to provide callers a way the fetch the current properties implemented/used by the model. The event <see cref="Efl.Model.PropertiesChangedEvt"/> will be raised to notify listeners of any modifications in the properties.
95 /// See also <see cref="Efl.Model.PropertiesChangedEvt"/>.
97 /// <value>Array of current properties</value>
98 Eina.Iterator< System.String> Properties {
101 /// <summary>Get children count.
102 /// When efl_model_load is completed <see cref="Efl.Model.GetChildrenCount"/> can be used to get the number of children. <see cref="Efl.Model.GetChildrenCount"/> can also be used before calling <see cref="Efl.Model.GetChildrenSlice"/> so a valid range is known. Event <see cref="Efl.Model.ChildrenCountChangedEvt"/> is emitted when count is finished.
104 /// See also <see cref="Efl.Model.GetChildrenSlice"/>.
106 /// <value>Current known children count</value>
111 ///<summary>Event argument wrapper for event <see cref="Efl.Model.PropertiesChangedEvt"/>.</summary>
112 public class ModelPropertiesChangedEvt_Args : EventArgs {
113 ///<summary>Actual event payload.</summary>
114 public Efl.ModelPropertyEvent arg { get; set; }
116 ///<summary>Event argument wrapper for event <see cref="Efl.Model.ChildAddedEvt"/>.</summary>
117 public class ModelChildAddedEvt_Args : EventArgs {
118 ///<summary>Actual event payload.</summary>
119 public Efl.ModelChildrenEvent arg { get; set; }
121 ///<summary>Event argument wrapper for event <see cref="Efl.Model.ChildRemovedEvt"/>.</summary>
122 public class ModelChildRemovedEvt_Args : EventArgs {
123 ///<summary>Actual event payload.</summary>
124 public Efl.ModelChildrenEvent arg { get; set; }
126 /// <summary>Efl model interface</summary>
127 sealed public class ModelConcrete :
132 ///<summary>Pointer to the native class description.</summary>
133 public System.IntPtr NativeClass {
135 if (((object)this).GetType() == typeof (ModelConcrete))
136 return Efl.ModelNativeInherit.GetEflClassStatic();
138 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
141 private EventHandlerList eventHandlers = new EventHandlerList();
142 private System.IntPtr handle;
143 ///<summary>Pointer to the native instance.</summary>
144 public System.IntPtr NativeHandle {
145 get { return handle; }
147 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
148 efl_model_interface_get();
149 ///<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>
150 public ModelConcrete(System.IntPtr raw)
153 register_event_proxies();
155 ///<summary>Destructor.</summary>
160 ///<summary>Releases the underlying native instance.</summary>
161 void Dispose(bool disposing)
163 if (handle != System.IntPtr.Zero) {
164 Efl.Eo.Globals.efl_unref(handle);
165 handle = System.IntPtr.Zero;
168 ///<summary>Releases the underlying native instance.</summary>
169 public void Dispose()
172 GC.SuppressFinalize(this);
174 ///<summary>Casts obj into an instance of this type.</summary>
175 public static ModelConcrete static_cast(Efl.Object obj)
178 throw new System.ArgumentNullException("obj");
179 return new ModelConcrete(obj.NativeHandle);
181 ///<summary>Verifies if the given object is equal to this one.</summary>
182 public override bool Equals(object obj)
184 var other = obj as Efl.Object;
187 return this.NativeHandle == other.NativeHandle;
189 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
190 public override int GetHashCode()
192 return this.NativeHandle.ToInt32();
194 ///<summary>Turns the native pointer into a string representation.</summary>
195 public override String ToString()
197 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
199 private readonly object eventLock = new object();
200 private Dictionary<string, int> event_cb_count = new Dictionary<string, int>();
201 private bool add_cpp_event_handler(string lib, string key, Efl.EventCb evt_delegate) {
203 if (!event_cb_count.TryGetValue(key, out event_count))
204 event_cb_count[key] = event_count;
205 if (event_count == 0) {
206 IntPtr desc = Efl.EventDescription.GetNative(lib, key);
207 if (desc == IntPtr.Zero) {
208 Eina.Log.Error($"Failed to get native event {key}");
211 bool result = Efl.Eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evt_delegate, System.IntPtr.Zero);
213 Eina.Log.Error($"Failed to add event proxy for event {key}");
216 Eina.Error.RaiseIfUnhandledException();
218 event_cb_count[key]++;
221 private bool remove_cpp_event_handler(string key, Efl.EventCb evt_delegate) {
223 if (!event_cb_count.TryGetValue(key, out event_count))
224 event_cb_count[key] = event_count;
225 if (event_count == 1) {
226 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
227 if (desc == IntPtr.Zero) {
228 Eina.Log.Error($"Failed to get native event {key}");
231 bool result = Efl.Eo.Globals.efl_event_callback_del(handle, desc, evt_delegate, System.IntPtr.Zero);
233 Eina.Log.Error($"Failed to remove event proxy for event {key}");
236 Eina.Error.RaiseIfUnhandledException();
237 } else if (event_count == 0) {
238 Eina.Log.Error($"Trying to remove proxy for event {key} when there is nothing registered.");
241 event_cb_count[key]--;
244 private static object PropertiesChangedEvtKey = new object();
245 /// <summary>Event dispatched when properties list is available.</summary>
246 public event EventHandler<Efl.ModelPropertiesChangedEvt_Args> PropertiesChangedEvt
250 string key = "_EFL_MODEL_EVENT_PROPERTIES_CHANGED";
251 if (add_cpp_event_handler(efl.Libs.Efl, key, this.evt_PropertiesChangedEvt_delegate)) {
252 eventHandlers.AddHandler(PropertiesChangedEvtKey , value);
254 Eina.Log.Error($"Error adding proxy for event {key}");
259 string key = "_EFL_MODEL_EVENT_PROPERTIES_CHANGED";
260 if (remove_cpp_event_handler(key, this.evt_PropertiesChangedEvt_delegate)) {
261 eventHandlers.RemoveHandler(PropertiesChangedEvtKey , value);
263 Eina.Log.Error($"Error removing proxy for event {key}");
267 ///<summary>Method to raise event PropertiesChangedEvt.</summary>
268 public void On_PropertiesChangedEvt(Efl.ModelPropertiesChangedEvt_Args e)
270 EventHandler<Efl.ModelPropertiesChangedEvt_Args> evt;
272 evt = (EventHandler<Efl.ModelPropertiesChangedEvt_Args>)eventHandlers[PropertiesChangedEvtKey];
274 evt?.Invoke(this, e);
276 Efl.EventCb evt_PropertiesChangedEvt_delegate;
277 private void on_PropertiesChangedEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
279 Efl.ModelPropertiesChangedEvt_Args args = new Efl.ModelPropertiesChangedEvt_Args();
280 args.arg = evt.Info;;
282 On_PropertiesChangedEvt(args);
283 } catch (Exception e) {
284 Eina.Log.Error(e.ToString());
285 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
289 private static object ChildAddedEvtKey = new object();
290 /// <summary>Event dispatched when new child is added.</summary>
291 public event EventHandler<Efl.ModelChildAddedEvt_Args> ChildAddedEvt
295 string key = "_EFL_MODEL_EVENT_CHILD_ADDED";
296 if (add_cpp_event_handler(efl.Libs.Efl, key, this.evt_ChildAddedEvt_delegate)) {
297 eventHandlers.AddHandler(ChildAddedEvtKey , value);
299 Eina.Log.Error($"Error adding proxy for event {key}");
304 string key = "_EFL_MODEL_EVENT_CHILD_ADDED";
305 if (remove_cpp_event_handler(key, this.evt_ChildAddedEvt_delegate)) {
306 eventHandlers.RemoveHandler(ChildAddedEvtKey , value);
308 Eina.Log.Error($"Error removing proxy for event {key}");
312 ///<summary>Method to raise event ChildAddedEvt.</summary>
313 public void On_ChildAddedEvt(Efl.ModelChildAddedEvt_Args e)
315 EventHandler<Efl.ModelChildAddedEvt_Args> evt;
317 evt = (EventHandler<Efl.ModelChildAddedEvt_Args>)eventHandlers[ChildAddedEvtKey];
319 evt?.Invoke(this, e);
321 Efl.EventCb evt_ChildAddedEvt_delegate;
322 private void on_ChildAddedEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
324 Efl.ModelChildAddedEvt_Args args = new Efl.ModelChildAddedEvt_Args();
325 args.arg = evt.Info;;
327 On_ChildAddedEvt(args);
328 } catch (Exception e) {
329 Eina.Log.Error(e.ToString());
330 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
334 private static object ChildRemovedEvtKey = new object();
335 /// <summary>Event dispatched when child is removed.</summary>
336 public event EventHandler<Efl.ModelChildRemovedEvt_Args> ChildRemovedEvt
340 string key = "_EFL_MODEL_EVENT_CHILD_REMOVED";
341 if (add_cpp_event_handler(efl.Libs.Efl, key, this.evt_ChildRemovedEvt_delegate)) {
342 eventHandlers.AddHandler(ChildRemovedEvtKey , value);
344 Eina.Log.Error($"Error adding proxy for event {key}");
349 string key = "_EFL_MODEL_EVENT_CHILD_REMOVED";
350 if (remove_cpp_event_handler(key, this.evt_ChildRemovedEvt_delegate)) {
351 eventHandlers.RemoveHandler(ChildRemovedEvtKey , value);
353 Eina.Log.Error($"Error removing proxy for event {key}");
357 ///<summary>Method to raise event ChildRemovedEvt.</summary>
358 public void On_ChildRemovedEvt(Efl.ModelChildRemovedEvt_Args e)
360 EventHandler<Efl.ModelChildRemovedEvt_Args> evt;
362 evt = (EventHandler<Efl.ModelChildRemovedEvt_Args>)eventHandlers[ChildRemovedEvtKey];
364 evt?.Invoke(this, e);
366 Efl.EventCb evt_ChildRemovedEvt_delegate;
367 private void on_ChildRemovedEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
369 Efl.ModelChildRemovedEvt_Args args = new Efl.ModelChildRemovedEvt_Args();
370 args.arg = evt.Info;;
372 On_ChildRemovedEvt(args);
373 } catch (Exception e) {
374 Eina.Log.Error(e.ToString());
375 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
379 private static object ChildrenCountChangedEvtKey = new object();
380 /// <summary>Event dispatched when children count is finished.</summary>
381 public event EventHandler ChildrenCountChangedEvt
385 string key = "_EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED";
386 if (add_cpp_event_handler(efl.Libs.Efl, key, this.evt_ChildrenCountChangedEvt_delegate)) {
387 eventHandlers.AddHandler(ChildrenCountChangedEvtKey , value);
389 Eina.Log.Error($"Error adding proxy for event {key}");
394 string key = "_EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED";
395 if (remove_cpp_event_handler(key, this.evt_ChildrenCountChangedEvt_delegate)) {
396 eventHandlers.RemoveHandler(ChildrenCountChangedEvtKey , value);
398 Eina.Log.Error($"Error removing proxy for event {key}");
402 ///<summary>Method to raise event ChildrenCountChangedEvt.</summary>
403 public void On_ChildrenCountChangedEvt(EventArgs e)
407 evt = (EventHandler)eventHandlers[ChildrenCountChangedEvtKey];
409 evt?.Invoke(this, e);
411 Efl.EventCb evt_ChildrenCountChangedEvt_delegate;
412 private void on_ChildrenCountChangedEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
414 EventArgs args = EventArgs.Empty;
416 On_ChildrenCountChangedEvt(args);
417 } catch (Exception e) {
418 Eina.Log.Error(e.ToString());
419 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
423 void register_event_proxies()
425 evt_PropertiesChangedEvt_delegate = new Efl.EventCb(on_PropertiesChangedEvt_NativeCallback);
426 evt_ChildAddedEvt_delegate = new Efl.EventCb(on_ChildAddedEvt_NativeCallback);
427 evt_ChildRemovedEvt_delegate = new Efl.EventCb(on_ChildRemovedEvt_NativeCallback);
428 evt_ChildrenCountChangedEvt_delegate = new Efl.EventCb(on_ChildrenCountChangedEvt_NativeCallback);
430 /// <summary>Get properties from model.
431 /// properties_get is due to provide callers a way the fetch the current properties implemented/used by the model. The event <see cref="Efl.Model.PropertiesChangedEvt"/> will be raised to notify listeners of any modifications in the properties.
433 /// See also <see cref="Efl.Model.PropertiesChangedEvt"/>.
435 /// <returns>Array of current properties</returns>
436 public Eina.Iterator< System.String> GetProperties() {
437 var _ret_var = Efl.ModelNativeInherit.efl_model_properties_get_ptr.Value.Delegate(this.NativeHandle);
438 Eina.Error.RaiseIfUnhandledException();
439 return new Eina.Iterator< System.String>(_ret_var, true, false);
441 /// <summary>Retrieve the value of a given property name.
442 /// At this point the caller is free to get values from properties. The event <see cref="Efl.Model.PropertiesChangedEvt"/> may be raised to notify listeners of the property/value.
444 /// See <see cref="Efl.Model.GetProperties"/>, <see cref="Efl.Model.PropertiesChangedEvt"/>
446 /// <param name="property">Property name</param>
447 /// <returns>Property value</returns>
448 public Eina.Value GetProperty( System.String property) {
449 var _ret_var = Efl.ModelNativeInherit.efl_model_property_get_ptr.Value.Delegate(this.NativeHandle, property);
450 Eina.Error.RaiseIfUnhandledException();
453 /// <summary>Set a property value of a given property name.
454 /// The caller must ensure to call at least efl_model_prop_list before being able to see/set properties. This function sets a new property value into given property name. Once the operation is completed the concrete implementation should raise <see cref="Efl.Model.PropertiesChangedEvt"/> event in order to notify listeners of the new value of the property.
456 /// If the model doesn't have the property then there are two possibilities, either raise an error or create the new property in model
458 /// See <see cref="Efl.Model.GetProperty"/>, <see cref="Efl.Model.PropertiesChangedEvt"/>
460 /// <param name="property">Property name</param>
461 /// <param name="value">Property value</param>
462 /// <returns>Return an error in case the property could not be set, the value that was set otherwise.</returns>
463 public Eina.Future SetProperty( System.String property, Eina.Value value) {
464 var _ret_var = Efl.ModelNativeInherit.efl_model_property_set_ptr.Value.Delegate(this.NativeHandle, property, value);
465 Eina.Error.RaiseIfUnhandledException();
468 /// <summary>Get children count.
469 /// When efl_model_load is completed <see cref="Efl.Model.GetChildrenCount"/> can be used to get the number of children. <see cref="Efl.Model.GetChildrenCount"/> can also be used before calling <see cref="Efl.Model.GetChildrenSlice"/> so a valid range is known. Event <see cref="Efl.Model.ChildrenCountChangedEvt"/> is emitted when count is finished.
471 /// See also <see cref="Efl.Model.GetChildrenSlice"/>.
473 /// <returns>Current known children count</returns>
474 public uint GetChildrenCount() {
475 var _ret_var = Efl.ModelNativeInherit.efl_model_children_count_get_ptr.Value.Delegate(this.NativeHandle);
476 Eina.Error.RaiseIfUnhandledException();
479 /// <summary>Get a future value when it changes to something that is not error:EAGAIN
480 /// <see cref="Efl.Model.GetProperty"/> can return an error with code EAGAIN when it doesn't have any meaningful value. To make life easier, this future will resolve when the error:EAGAIN disapears. Either into a failed future in case the error code changed to something else or a success with the value of the property whenever the property finally changes.
482 /// The future can also be canceled if the model itself gets destroyed.</summary>
483 /// <param name="property"></param>
484 /// <returns></returns>
485 public Eina.Future GetPropertyReady( System.String property) {
486 var _ret_var = Efl.ModelNativeInherit.efl_model_property_ready_get_ptr.Value.Delegate(this.NativeHandle, property);
487 Eina.Error.RaiseIfUnhandledException();
490 /// <summary>Get children slice OR full range.
491 /// <see cref="Efl.Model.GetChildrenSlice"/> behaves in two different ways, it may provide the slice if <c>count</c> is non-zero OR full range otherwise.
493 /// Since 'slice' is a range, for example if we have 20 children a slice could be the range from 3(start) with 4(count), see:
495 /// child 0 [no] child 1 [no] child 2 [no] child 3 [yes] child 4 [yes] child 5 [yes] child 6 [yes] child 7 [no]
497 /// Optionally the user can call <see cref="Efl.Model.GetChildrenCount"/> to know the number of children so a valid range can be known in advance.
499 /// See <see cref="Efl.Model.GetChildrenCount"/>
501 /// Note: The returned children will live only as long as the future itself. Once the future is done, if you want to keep the object alive, you need to take a reference for yourself.
503 /// <param name="start">Range begin - start from here.</param>
504 /// <param name="count">Range size. If count is 0, start is ignored.</param>
505 /// <returns>Array of children</returns>
506 public Eina.Future GetChildrenSlice( uint start, uint count) {
507 var _ret_var = Efl.ModelNativeInherit.efl_model_children_slice_get_ptr.Value.Delegate(this.NativeHandle, start, count);
508 Eina.Error.RaiseIfUnhandledException();
511 /// <summary>Add a new child.
512 /// Add a new child, possibly dummy, depending on the implementation, of a internal keeping. When the child is effectively added the event <see cref="Efl.Model.ChildAddedEvt"/> is then raised and the new child is kept along with other children.
514 /// <returns>Child object</returns>
515 public Efl.Object AddChild() {
516 var _ret_var = Efl.ModelNativeInherit.efl_model_child_add_ptr.Value.Delegate(this.NativeHandle);
517 Eina.Error.RaiseIfUnhandledException();
520 /// <summary>Remove a child.
521 /// Remove a child of a internal keeping. When the child is effectively removed the event <see cref="Efl.Model.ChildRemovedEvt"/> is then raised to give a chance for listeners to perform any cleanup and/or update references.
523 /// <param name="child">Child to be removed</param>
524 /// <returns></returns>
525 public void DelChild( Efl.Object child) {
526 Efl.ModelNativeInherit.efl_model_child_del_ptr.Value.Delegate(this.NativeHandle, child);
527 Eina.Error.RaiseIfUnhandledException();
529 public System.Threading.Tasks.Task<Eina.Value> SetPropertyAsync( System.String property, Eina.Value value, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
531 Eina.Future future = SetProperty( property, value);
532 return Efl.Eo.Globals.WrapAsync(future, token);
534 public System.Threading.Tasks.Task<Eina.Value> GetPropertyReadyAsync( System.String property, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
536 Eina.Future future = GetPropertyReady( property);
537 return Efl.Eo.Globals.WrapAsync(future, token);
539 public System.Threading.Tasks.Task<Eina.Value> GetChildrenSliceAsync( uint start, uint count, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
541 Eina.Future future = GetChildrenSlice( start, count);
542 return Efl.Eo.Globals.WrapAsync(future, token);
544 /// <summary>Get properties from model.
545 /// properties_get is due to provide callers a way the fetch the current properties implemented/used by the model. The event <see cref="Efl.Model.PropertiesChangedEvt"/> will be raised to notify listeners of any modifications in the properties.
547 /// See also <see cref="Efl.Model.PropertiesChangedEvt"/>.
549 /// <value>Array of current properties</value>
550 public Eina.Iterator< System.String> Properties {
551 get { return GetProperties(); }
553 /// <summary>Get children count.
554 /// When efl_model_load is completed <see cref="Efl.Model.GetChildrenCount"/> can be used to get the number of children. <see cref="Efl.Model.GetChildrenCount"/> can also be used before calling <see cref="Efl.Model.GetChildrenSlice"/> so a valid range is known. Event <see cref="Efl.Model.ChildrenCountChangedEvt"/> is emitted when count is finished.
556 /// See also <see cref="Efl.Model.GetChildrenSlice"/>.
558 /// <value>Current known children count</value>
559 public uint ChildrenCount {
560 get { return GetChildrenCount(); }
563 public class ModelNativeInherit : Efl.Eo.NativeClass{
564 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
565 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
567 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
568 if (efl_model_properties_get_static_delegate == null)
569 efl_model_properties_get_static_delegate = new efl_model_properties_get_delegate(properties_get);
570 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_model_properties_get"), func = Marshal.GetFunctionPointerForDelegate(efl_model_properties_get_static_delegate)});
571 if (efl_model_property_get_static_delegate == null)
572 efl_model_property_get_static_delegate = new efl_model_property_get_delegate(property_get);
573 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_model_property_get"), func = Marshal.GetFunctionPointerForDelegate(efl_model_property_get_static_delegate)});
574 if (efl_model_property_set_static_delegate == null)
575 efl_model_property_set_static_delegate = new efl_model_property_set_delegate(property_set);
576 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_model_property_set"), func = Marshal.GetFunctionPointerForDelegate(efl_model_property_set_static_delegate)});
577 if (efl_model_children_count_get_static_delegate == null)
578 efl_model_children_count_get_static_delegate = new efl_model_children_count_get_delegate(children_count_get);
579 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_model_children_count_get"), func = Marshal.GetFunctionPointerForDelegate(efl_model_children_count_get_static_delegate)});
580 if (efl_model_property_ready_get_static_delegate == null)
581 efl_model_property_ready_get_static_delegate = new efl_model_property_ready_get_delegate(property_ready_get);
582 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_model_property_ready_get"), func = Marshal.GetFunctionPointerForDelegate(efl_model_property_ready_get_static_delegate)});
583 if (efl_model_children_slice_get_static_delegate == null)
584 efl_model_children_slice_get_static_delegate = new efl_model_children_slice_get_delegate(children_slice_get);
585 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_model_children_slice_get"), func = Marshal.GetFunctionPointerForDelegate(efl_model_children_slice_get_static_delegate)});
586 if (efl_model_child_add_static_delegate == null)
587 efl_model_child_add_static_delegate = new efl_model_child_add_delegate(child_add);
588 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_model_child_add"), func = Marshal.GetFunctionPointerForDelegate(efl_model_child_add_static_delegate)});
589 if (efl_model_child_del_static_delegate == null)
590 efl_model_child_del_static_delegate = new efl_model_child_del_delegate(child_del);
591 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_model_child_del"), func = Marshal.GetFunctionPointerForDelegate(efl_model_child_del_static_delegate)});
594 public override IntPtr GetEflClass()
596 return Efl.ModelConcrete.efl_model_interface_get();
598 public static IntPtr GetEflClassStatic()
600 return Efl.ModelConcrete.efl_model_interface_get();
604 private delegate System.IntPtr efl_model_properties_get_delegate(System.IntPtr obj, System.IntPtr pd);
607 public delegate System.IntPtr efl_model_properties_get_api_delegate(System.IntPtr obj);
608 public static Efl.Eo.FunctionWrapper<efl_model_properties_get_api_delegate> efl_model_properties_get_ptr = new Efl.Eo.FunctionWrapper<efl_model_properties_get_api_delegate>(_Module, "efl_model_properties_get");
609 private static System.IntPtr properties_get(System.IntPtr obj, System.IntPtr pd)
611 Eina.Log.Debug("function efl_model_properties_get was called");
612 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
613 if(wrapper != null) {
614 Eina.Iterator< System.String> _ret_var = default(Eina.Iterator< System.String>);
616 _ret_var = ((Model)wrapper).GetProperties();
617 } catch (Exception e) {
618 Eina.Log.Warning($"Callback error: {e.ToString()}");
619 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
621 _ret_var.Own = false; return _ret_var.Handle;
623 return efl_model_properties_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
626 private static efl_model_properties_get_delegate efl_model_properties_get_static_delegate;
629 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))] private delegate Eina.Value efl_model_property_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String property);
632 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))] public delegate Eina.Value efl_model_property_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String property);
633 public static Efl.Eo.FunctionWrapper<efl_model_property_get_api_delegate> efl_model_property_get_ptr = new Efl.Eo.FunctionWrapper<efl_model_property_get_api_delegate>(_Module, "efl_model_property_get");
634 private static Eina.Value property_get(System.IntPtr obj, System.IntPtr pd, System.String property)
636 Eina.Log.Debug("function efl_model_property_get was called");
637 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
638 if(wrapper != null) {
639 Eina.Value _ret_var = default( Eina.Value);
641 _ret_var = ((Model)wrapper).GetProperty( property);
642 } catch (Exception e) {
643 Eina.Log.Warning($"Callback error: {e.ToString()}");
644 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
648 return efl_model_property_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), property);
651 private static efl_model_property_get_delegate efl_model_property_get_static_delegate;
654 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] private delegate Eina.Future efl_model_property_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String property, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))] Eina.Value value);
657 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] public delegate Eina.Future efl_model_property_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String property, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))] Eina.Value value);
658 public static Efl.Eo.FunctionWrapper<efl_model_property_set_api_delegate> efl_model_property_set_ptr = new Efl.Eo.FunctionWrapper<efl_model_property_set_api_delegate>(_Module, "efl_model_property_set");
659 private static Eina.Future property_set(System.IntPtr obj, System.IntPtr pd, System.String property, Eina.Value value)
661 Eina.Log.Debug("function efl_model_property_set was called");
662 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
663 if(wrapper != null) {
664 Eina.Future _ret_var = default( Eina.Future);
666 _ret_var = ((Model)wrapper).SetProperty( property, value);
667 } catch (Exception e) {
668 Eina.Log.Warning($"Callback error: {e.ToString()}");
669 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
673 return efl_model_property_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), property, value);
676 private static efl_model_property_set_delegate efl_model_property_set_static_delegate;
679 private delegate uint efl_model_children_count_get_delegate(System.IntPtr obj, System.IntPtr pd);
682 public delegate uint efl_model_children_count_get_api_delegate(System.IntPtr obj);
683 public static Efl.Eo.FunctionWrapper<efl_model_children_count_get_api_delegate> efl_model_children_count_get_ptr = new Efl.Eo.FunctionWrapper<efl_model_children_count_get_api_delegate>(_Module, "efl_model_children_count_get");
684 private static uint children_count_get(System.IntPtr obj, System.IntPtr pd)
686 Eina.Log.Debug("function efl_model_children_count_get was called");
687 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
688 if(wrapper != null) {
689 uint _ret_var = default( uint);
691 _ret_var = ((Model)wrapper).GetChildrenCount();
692 } catch (Exception e) {
693 Eina.Log.Warning($"Callback error: {e.ToString()}");
694 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
698 return efl_model_children_count_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
701 private static efl_model_children_count_get_delegate efl_model_children_count_get_static_delegate;
704 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] private delegate Eina.Future efl_model_property_ready_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String property);
707 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] public delegate Eina.Future efl_model_property_ready_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String property);
708 public static Efl.Eo.FunctionWrapper<efl_model_property_ready_get_api_delegate> efl_model_property_ready_get_ptr = new Efl.Eo.FunctionWrapper<efl_model_property_ready_get_api_delegate>(_Module, "efl_model_property_ready_get");
709 private static Eina.Future property_ready_get(System.IntPtr obj, System.IntPtr pd, System.String property)
711 Eina.Log.Debug("function efl_model_property_ready_get was called");
712 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
713 if(wrapper != null) {
714 Eina.Future _ret_var = default( Eina.Future);
716 _ret_var = ((Model)wrapper).GetPropertyReady( property);
717 } catch (Exception e) {
718 Eina.Log.Warning($"Callback error: {e.ToString()}");
719 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
723 return efl_model_property_ready_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), property);
726 private static efl_model_property_ready_get_delegate efl_model_property_ready_get_static_delegate;
729 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] private delegate Eina.Future efl_model_children_slice_get_delegate(System.IntPtr obj, System.IntPtr pd, uint start, uint count);
732 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] public delegate Eina.Future efl_model_children_slice_get_api_delegate(System.IntPtr obj, uint start, uint count);
733 public static Efl.Eo.FunctionWrapper<efl_model_children_slice_get_api_delegate> efl_model_children_slice_get_ptr = new Efl.Eo.FunctionWrapper<efl_model_children_slice_get_api_delegate>(_Module, "efl_model_children_slice_get");
734 private static Eina.Future children_slice_get(System.IntPtr obj, System.IntPtr pd, uint start, uint count)
736 Eina.Log.Debug("function efl_model_children_slice_get was called");
737 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
738 if(wrapper != null) {
739 Eina.Future _ret_var = default( Eina.Future);
741 _ret_var = ((Model)wrapper).GetChildrenSlice( start, count);
742 } catch (Exception e) {
743 Eina.Log.Warning($"Callback error: {e.ToString()}");
744 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
748 return efl_model_children_slice_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), start, count);
751 private static efl_model_children_slice_get_delegate efl_model_children_slice_get_static_delegate;
754 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Object, Efl.Eo.NonOwnTag>))] private delegate Efl.Object efl_model_child_add_delegate(System.IntPtr obj, System.IntPtr pd);
757 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Object, Efl.Eo.NonOwnTag>))] public delegate Efl.Object efl_model_child_add_api_delegate(System.IntPtr obj);
758 public static Efl.Eo.FunctionWrapper<efl_model_child_add_api_delegate> efl_model_child_add_ptr = new Efl.Eo.FunctionWrapper<efl_model_child_add_api_delegate>(_Module, "efl_model_child_add");
759 private static Efl.Object child_add(System.IntPtr obj, System.IntPtr pd)
761 Eina.Log.Debug("function efl_model_child_add was called");
762 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
763 if(wrapper != null) {
764 Efl.Object _ret_var = default(Efl.Object);
766 _ret_var = ((Model)wrapper).AddChild();
767 } catch (Exception e) {
768 Eina.Log.Warning($"Callback error: {e.ToString()}");
769 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
773 return efl_model_child_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
776 private static efl_model_child_add_delegate efl_model_child_add_static_delegate;
779 private delegate void efl_model_child_del_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Object, Efl.Eo.NonOwnTag>))] Efl.Object child);
782 public delegate void efl_model_child_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Object, Efl.Eo.NonOwnTag>))] Efl.Object child);
783 public static Efl.Eo.FunctionWrapper<efl_model_child_del_api_delegate> efl_model_child_del_ptr = new Efl.Eo.FunctionWrapper<efl_model_child_del_api_delegate>(_Module, "efl_model_child_del");
784 private static void child_del(System.IntPtr obj, System.IntPtr pd, Efl.Object child)
786 Eina.Log.Debug("function efl_model_child_del was called");
787 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
788 if(wrapper != null) {
791 ((Model)wrapper).DelChild( child);
792 } catch (Exception e) {
793 Eina.Log.Warning($"Callback error: {e.ToString()}");
794 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
797 efl_model_child_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), child);
800 private static efl_model_child_del_delegate efl_model_child_del_static_delegate;
804 /// <summary>EFL model property event data structure</summary>
805 [StructLayout(LayoutKind.Sequential)]
806 public struct ModelPropertyEvent
808 /// <summary>List of changed properties</summary>
809 public Eina.Array< System.String> Changed_properties;
810 /// <summary>Removed properties identified by name</summary>
811 public Eina.Array< System.String> Invalidated_properties;
812 ///<summary>Constructor for ModelPropertyEvent.</summary>
813 public ModelPropertyEvent(
814 Eina.Array< System.String> Changed_properties=default(Eina.Array< System.String>),
815 Eina.Array< System.String> Invalidated_properties=default(Eina.Array< System.String>) )
817 this.Changed_properties = Changed_properties;
818 this.Invalidated_properties = Invalidated_properties;
820 public static implicit operator ModelPropertyEvent(IntPtr ptr)
822 var tmp = (ModelPropertyEvent_StructInternal)Marshal.PtrToStructure(ptr, typeof(ModelPropertyEvent_StructInternal));
823 return ModelPropertyEvent_StructConversion.ToManaged(tmp);
826 ///<summary>Internal wrapper for struct ModelPropertyEvent.</summary>
827 [StructLayout(LayoutKind.Sequential)]
828 public struct ModelPropertyEvent_StructInternal
831 public System.IntPtr Changed_properties;
833 public System.IntPtr Invalidated_properties;
834 ///<summary>Implicit conversion to the internal/marshalling representation.</summary>
835 public static implicit operator ModelPropertyEvent(ModelPropertyEvent_StructInternal struct_)
837 return ModelPropertyEvent_StructConversion.ToManaged(struct_);
839 ///<summary>Implicit conversion to the managed representation.</summary>
840 public static implicit operator ModelPropertyEvent_StructInternal(ModelPropertyEvent struct_)
842 return ModelPropertyEvent_StructConversion.ToInternal(struct_);
845 /// <summary>Conversion class for struct ModelPropertyEvent</summary>
846 public static class ModelPropertyEvent_StructConversion
848 internal static ModelPropertyEvent_StructInternal ToInternal(ModelPropertyEvent _external_struct)
850 var _internal_struct = new ModelPropertyEvent_StructInternal();
852 _internal_struct.Changed_properties = _external_struct.Changed_properties.Handle;
853 _internal_struct.Invalidated_properties = _external_struct.Invalidated_properties.Handle;
855 return _internal_struct;
858 internal static ModelPropertyEvent ToManaged(ModelPropertyEvent_StructInternal _internal_struct)
860 var _external_struct = new ModelPropertyEvent();
862 _external_struct.Changed_properties = new Eina.Array< System.String>(_internal_struct.Changed_properties, false, false);
863 _external_struct.Invalidated_properties = new Eina.Array< System.String>(_internal_struct.Invalidated_properties, false, false);
865 return _external_struct;
871 /// <summary>Every time a child is added the event <see cref="Efl.Model.ChildAddedEvt"/> is dispatched passing along this structure.</summary>
872 [StructLayout(LayoutKind.Sequential)]
873 public struct ModelChildrenEvent
875 /// <summary>index is a hint and is intended to provide a way for applications to control/know children relative positions through listings.</summary>
877 /// <summary>If an object has been built for this index and it is currently tracked by the parent, it will be available here.</summary>
878 public Efl.Object Child;
879 ///<summary>Constructor for ModelChildrenEvent.</summary>
880 public ModelChildrenEvent(
881 uint Index=default( uint),
882 Efl.Object Child=default(Efl.Object) )
887 public static implicit operator ModelChildrenEvent(IntPtr ptr)
889 var tmp = (ModelChildrenEvent_StructInternal)Marshal.PtrToStructure(ptr, typeof(ModelChildrenEvent_StructInternal));
890 return ModelChildrenEvent_StructConversion.ToManaged(tmp);
893 ///<summary>Internal wrapper for struct ModelChildrenEvent.</summary>
894 [StructLayout(LayoutKind.Sequential)]
895 public struct ModelChildrenEvent_StructInternal
899 ///<summary>Internal wrapper for field Child</summary>
900 public System.IntPtr Child;
901 ///<summary>Implicit conversion to the internal/marshalling representation.</summary>
902 public static implicit operator ModelChildrenEvent(ModelChildrenEvent_StructInternal struct_)
904 return ModelChildrenEvent_StructConversion.ToManaged(struct_);
906 ///<summary>Implicit conversion to the managed representation.</summary>
907 public static implicit operator ModelChildrenEvent_StructInternal(ModelChildrenEvent struct_)
909 return ModelChildrenEvent_StructConversion.ToInternal(struct_);
912 /// <summary>Conversion class for struct ModelChildrenEvent</summary>
913 public static class ModelChildrenEvent_StructConversion
915 internal static ModelChildrenEvent_StructInternal ToInternal(ModelChildrenEvent _external_struct)
917 var _internal_struct = new ModelChildrenEvent_StructInternal();
919 _internal_struct.Index = _external_struct.Index;
920 _internal_struct.Child = _external_struct.Child.NativeHandle;
922 return _internal_struct;
925 internal static ModelChildrenEvent ToManaged(ModelChildrenEvent_StructInternal _internal_struct)
927 var _external_struct = new ModelChildrenEvent();
929 _external_struct.Index = _internal_struct.Index;
931 _external_struct.Child = (Efl.Object) System.Activator.CreateInstance(typeof(Efl.Object), new System.Object[] {_internal_struct.Child});
932 Efl.Eo.Globals.efl_ref(_internal_struct.Child);
935 return _external_struct;