1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
10 /// <summary>Efl control interface</summary>
11 [Efl.IControlConcrete.NativeMethods]
12 [Efl.Eo.BindingEntity]
13 public interface IControl :
14 Efl.Eo.IWrapper, IDisposable
16 /// <summary>Control the priority of the object.</summary>
17 /// <returns>The priority of the object</returns>
19 /// <summary>Control the priority of the object.</summary>
20 /// <param name="priority">The priority of the object</param>
21 void SetPriority(int priority);
22 /// <summary>Controls whether the object is suspended or not.</summary>
23 /// <returns>Controls whether the object is suspended or not.</returns>
25 /// <summary>Controls whether the object is suspended or not.</summary>
26 /// <param name="suspend">Controls whether the object is suspended or not.</param>
27 void SetSuspend(bool suspend);
28 /// <summary>Control the priority of the object.</summary>
29 /// <value>The priority of the object</value>
34 /// <summary>Controls whether the object is suspended or not.</summary>
35 /// <value>Controls whether the object is suspended or not.</value>
41 /// <summary>Efl control interface</summary>
42 sealed public class IControlConcrete :
47 ///<summary>Pointer to the native class description.</summary>
48 public override System.IntPtr NativeClass
52 if (((object)this).GetType() == typeof(IControlConcrete))
54 return GetEflClassStatic();
58 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
63 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
64 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
65 private IControlConcrete(ConstructingHandle ch) : base(ch)
69 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
70 efl_control_interface_get();
71 /// <summary>Initializes a new instance of the <see cref="IControl"/> class.
72 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
73 /// <param name="wh">The native pointer to be wrapped.</param>
74 private IControlConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
78 /// <summary>Control the priority of the object.</summary>
79 /// <returns>The priority of the object</returns>
80 public int GetPriority() {
81 var _ret_var = Efl.IControlConcrete.NativeMethods.efl_control_priority_get_ptr.Value.Delegate(this.NativeHandle);
82 Eina.Error.RaiseIfUnhandledException();
85 /// <summary>Control the priority of the object.</summary>
86 /// <param name="priority">The priority of the object</param>
87 public void SetPriority(int priority) {
88 Efl.IControlConcrete.NativeMethods.efl_control_priority_set_ptr.Value.Delegate(this.NativeHandle,priority);
89 Eina.Error.RaiseIfUnhandledException();
91 /// <summary>Controls whether the object is suspended or not.</summary>
92 /// <returns>Controls whether the object is suspended or not.</returns>
93 public bool GetSuspend() {
94 var _ret_var = Efl.IControlConcrete.NativeMethods.efl_control_suspend_get_ptr.Value.Delegate(this.NativeHandle);
95 Eina.Error.RaiseIfUnhandledException();
98 /// <summary>Controls whether the object is suspended or not.</summary>
99 /// <param name="suspend">Controls whether the object is suspended or not.</param>
100 public void SetSuspend(bool suspend) {
101 Efl.IControlConcrete.NativeMethods.efl_control_suspend_set_ptr.Value.Delegate(this.NativeHandle,suspend);
102 Eina.Error.RaiseIfUnhandledException();
104 /// <summary>Control the priority of the object.</summary>
105 /// <value>The priority of the object</value>
106 public int Priority {
107 get { return GetPriority(); }
108 set { SetPriority(value); }
110 /// <summary>Controls whether the object is suspended or not.</summary>
111 /// <value>Controls whether the object is suspended or not.</value>
112 public bool Suspend {
113 get { return GetSuspend(); }
114 set { SetSuspend(value); }
116 private static IntPtr GetEflClassStatic()
118 return Efl.IControlConcrete.efl_control_interface_get();
120 /// <summary>Wrapper for native methods and virtual method delegates.
121 /// For internal use by generated code only.</summary>
122 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
124 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
125 /// <summary>Gets the list of Eo operations to override.</summary>
126 /// <returns>The list of Eo operations to be overload.</returns>
127 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
129 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
130 var methods = Efl.Eo.Globals.GetUserMethods(type);
132 if (efl_control_priority_get_static_delegate == null)
134 efl_control_priority_get_static_delegate = new efl_control_priority_get_delegate(priority_get);
137 if (methods.FirstOrDefault(m => m.Name == "GetPriority") != null)
139 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_control_priority_get"), func = Marshal.GetFunctionPointerForDelegate(efl_control_priority_get_static_delegate) });
142 if (efl_control_priority_set_static_delegate == null)
144 efl_control_priority_set_static_delegate = new efl_control_priority_set_delegate(priority_set);
147 if (methods.FirstOrDefault(m => m.Name == "SetPriority") != null)
149 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_control_priority_set"), func = Marshal.GetFunctionPointerForDelegate(efl_control_priority_set_static_delegate) });
152 if (efl_control_suspend_get_static_delegate == null)
154 efl_control_suspend_get_static_delegate = new efl_control_suspend_get_delegate(suspend_get);
157 if (methods.FirstOrDefault(m => m.Name == "GetSuspend") != null)
159 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_control_suspend_get"), func = Marshal.GetFunctionPointerForDelegate(efl_control_suspend_get_static_delegate) });
162 if (efl_control_suspend_set_static_delegate == null)
164 efl_control_suspend_set_static_delegate = new efl_control_suspend_set_delegate(suspend_set);
167 if (methods.FirstOrDefault(m => m.Name == "SetSuspend") != null)
169 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_control_suspend_set"), func = Marshal.GetFunctionPointerForDelegate(efl_control_suspend_set_static_delegate) });
174 /// <summary>Returns the Eo class for the native methods of this class.</summary>
175 /// <returns>The native class pointer.</returns>
176 public override IntPtr GetEflClass()
178 return Efl.IControlConcrete.efl_control_interface_get();
181 #pragma warning disable CA1707, CS1591, SA1300, SA1600
184 private delegate int efl_control_priority_get_delegate(System.IntPtr obj, System.IntPtr pd);
187 public delegate int efl_control_priority_get_api_delegate(System.IntPtr obj);
189 public static Efl.Eo.FunctionWrapper<efl_control_priority_get_api_delegate> efl_control_priority_get_ptr = new Efl.Eo.FunctionWrapper<efl_control_priority_get_api_delegate>(Module, "efl_control_priority_get");
191 private static int priority_get(System.IntPtr obj, System.IntPtr pd)
193 Eina.Log.Debug("function efl_control_priority_get was called");
194 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
197 int _ret_var = default(int);
200 _ret_var = ((IControl)ws.Target).GetPriority();
204 Eina.Log.Warning($"Callback error: {e.ToString()}");
205 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
213 return efl_control_priority_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
217 private static efl_control_priority_get_delegate efl_control_priority_get_static_delegate;
220 private delegate void efl_control_priority_set_delegate(System.IntPtr obj, System.IntPtr pd, int priority);
223 public delegate void efl_control_priority_set_api_delegate(System.IntPtr obj, int priority);
225 public static Efl.Eo.FunctionWrapper<efl_control_priority_set_api_delegate> efl_control_priority_set_ptr = new Efl.Eo.FunctionWrapper<efl_control_priority_set_api_delegate>(Module, "efl_control_priority_set");
227 private static void priority_set(System.IntPtr obj, System.IntPtr pd, int priority)
229 Eina.Log.Debug("function efl_control_priority_set was called");
230 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
236 ((IControl)ws.Target).SetPriority(priority);
240 Eina.Log.Warning($"Callback error: {e.ToString()}");
241 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
248 efl_control_priority_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), priority);
252 private static efl_control_priority_set_delegate efl_control_priority_set_static_delegate;
254 [return: MarshalAs(UnmanagedType.U1)]
255 private delegate bool efl_control_suspend_get_delegate(System.IntPtr obj, System.IntPtr pd);
257 [return: MarshalAs(UnmanagedType.U1)]
258 public delegate bool efl_control_suspend_get_api_delegate(System.IntPtr obj);
260 public static Efl.Eo.FunctionWrapper<efl_control_suspend_get_api_delegate> efl_control_suspend_get_ptr = new Efl.Eo.FunctionWrapper<efl_control_suspend_get_api_delegate>(Module, "efl_control_suspend_get");
262 private static bool suspend_get(System.IntPtr obj, System.IntPtr pd)
264 Eina.Log.Debug("function efl_control_suspend_get was called");
265 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
268 bool _ret_var = default(bool);
271 _ret_var = ((IControl)ws.Target).GetSuspend();
275 Eina.Log.Warning($"Callback error: {e.ToString()}");
276 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
284 return efl_control_suspend_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
288 private static efl_control_suspend_get_delegate efl_control_suspend_get_static_delegate;
291 private delegate void efl_control_suspend_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool suspend);
294 public delegate void efl_control_suspend_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool suspend);
296 public static Efl.Eo.FunctionWrapper<efl_control_suspend_set_api_delegate> efl_control_suspend_set_ptr = new Efl.Eo.FunctionWrapper<efl_control_suspend_set_api_delegate>(Module, "efl_control_suspend_set");
298 private static void suspend_set(System.IntPtr obj, System.IntPtr pd, bool suspend)
300 Eina.Log.Debug("function efl_control_suspend_set was called");
301 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
307 ((IControl)ws.Target).SetSuspend(suspend);
311 Eina.Log.Warning($"Callback error: {e.ToString()}");
312 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
319 efl_control_suspend_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), suspend);
323 private static efl_control_suspend_set_delegate efl_control_suspend_set_static_delegate;
325 #pragma warning restore CA1707, CS1591, SA1300, SA1600