1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
8 /// <summary>Efl control interface</summary>
10 public interface Control :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>Control the priority of the object.</summary>
14 /// <returns>The priority of the object</returns>
16 /// <summary>Control the priority of the object.</summary>
17 /// <param name="priority">The priority of the object</param>
18 /// <returns></returns>
19 void SetPriority( int priority);
20 /// <summary>Controls whether the object is suspended or not.</summary>
21 /// <returns>Controls whether the object is suspended or not.</returns>
23 /// <summary>Controls whether the object is suspended or not.</summary>
24 /// <param name="suspend">Controls whether the object is suspended or not.</param>
25 /// <returns></returns>
26 void SetSuspend( bool suspend);
27 /// <summary>Control the priority of the object.</summary>
28 /// <value>The priority of the object</value>
33 /// <summary>Controls whether the object is suspended or not.</summary>
34 /// <value>Controls whether the object is suspended or not.</value>
40 /// <summary>Efl control interface</summary>
41 sealed public class ControlConcrete :
46 ///<summary>Pointer to the native class description.</summary>
47 public System.IntPtr NativeClass {
49 if (((object)this).GetType() == typeof (ControlConcrete))
50 return Efl.ControlNativeInherit.GetEflClassStatic();
52 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
55 private System.IntPtr handle;
56 ///<summary>Pointer to the native instance.</summary>
57 public System.IntPtr NativeHandle {
58 get { return handle; }
60 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
61 efl_control_interface_get();
62 ///<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>
63 public ControlConcrete(System.IntPtr raw)
66 register_event_proxies();
68 ///<summary>Destructor.</summary>
73 ///<summary>Releases the underlying native instance.</summary>
74 void Dispose(bool disposing)
76 if (handle != System.IntPtr.Zero) {
77 Efl.Eo.Globals.efl_unref(handle);
78 handle = System.IntPtr.Zero;
81 ///<summary>Releases the underlying native instance.</summary>
85 GC.SuppressFinalize(this);
87 ///<summary>Casts obj into an instance of this type.</summary>
88 public static ControlConcrete static_cast(Efl.Object obj)
91 throw new System.ArgumentNullException("obj");
92 return new ControlConcrete(obj.NativeHandle);
94 ///<summary>Verifies if the given object is equal to this one.</summary>
95 public override bool Equals(object obj)
97 var other = obj as Efl.Object;
100 return this.NativeHandle == other.NativeHandle;
102 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
103 public override int GetHashCode()
105 return this.NativeHandle.ToInt32();
107 ///<summary>Turns the native pointer into a string representation.</summary>
108 public override String ToString()
110 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
112 void register_event_proxies()
115 /// <summary>Control the priority of the object.</summary>
116 /// <returns>The priority of the object</returns>
117 public int GetPriority() {
118 var _ret_var = Efl.ControlNativeInherit.efl_control_priority_get_ptr.Value.Delegate(this.NativeHandle);
119 Eina.Error.RaiseIfUnhandledException();
122 /// <summary>Control the priority of the object.</summary>
123 /// <param name="priority">The priority of the object</param>
124 /// <returns></returns>
125 public void SetPriority( int priority) {
126 Efl.ControlNativeInherit.efl_control_priority_set_ptr.Value.Delegate(this.NativeHandle, priority);
127 Eina.Error.RaiseIfUnhandledException();
129 /// <summary>Controls whether the object is suspended or not.</summary>
130 /// <returns>Controls whether the object is suspended or not.</returns>
131 public bool GetSuspend() {
132 var _ret_var = Efl.ControlNativeInherit.efl_control_suspend_get_ptr.Value.Delegate(this.NativeHandle);
133 Eina.Error.RaiseIfUnhandledException();
136 /// <summary>Controls whether the object is suspended or not.</summary>
137 /// <param name="suspend">Controls whether the object is suspended or not.</param>
138 /// <returns></returns>
139 public void SetSuspend( bool suspend) {
140 Efl.ControlNativeInherit.efl_control_suspend_set_ptr.Value.Delegate(this.NativeHandle, suspend);
141 Eina.Error.RaiseIfUnhandledException();
143 /// <summary>Control the priority of the object.</summary>
144 /// <value>The priority of the object</value>
145 public int Priority {
146 get { return GetPriority(); }
147 set { SetPriority( value); }
149 /// <summary>Controls whether the object is suspended or not.</summary>
150 /// <value>Controls whether the object is suspended or not.</value>
151 public bool Suspend {
152 get { return GetSuspend(); }
153 set { SetSuspend( value); }
156 public class ControlNativeInherit : Efl.Eo.NativeClass{
157 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
158 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
160 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
161 if (efl_control_priority_get_static_delegate == null)
162 efl_control_priority_get_static_delegate = new efl_control_priority_get_delegate(priority_get);
163 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)});
164 if (efl_control_priority_set_static_delegate == null)
165 efl_control_priority_set_static_delegate = new efl_control_priority_set_delegate(priority_set);
166 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)});
167 if (efl_control_suspend_get_static_delegate == null)
168 efl_control_suspend_get_static_delegate = new efl_control_suspend_get_delegate(suspend_get);
169 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)});
170 if (efl_control_suspend_set_static_delegate == null)
171 efl_control_suspend_set_static_delegate = new efl_control_suspend_set_delegate(suspend_set);
172 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)});
175 public override IntPtr GetEflClass()
177 return Efl.ControlConcrete.efl_control_interface_get();
179 public static IntPtr GetEflClassStatic()
181 return Efl.ControlConcrete.efl_control_interface_get();
185 private delegate int efl_control_priority_get_delegate(System.IntPtr obj, System.IntPtr pd);
188 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");
190 private static int priority_get(System.IntPtr obj, System.IntPtr pd)
192 Eina.Log.Debug("function efl_control_priority_get was called");
193 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
194 if(wrapper != null) {
195 int _ret_var = default( int);
197 _ret_var = ((Control)wrapper).GetPriority();
198 } catch (Exception e) {
199 Eina.Log.Warning($"Callback error: {e.ToString()}");
200 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
204 return efl_control_priority_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
207 private static efl_control_priority_get_delegate efl_control_priority_get_static_delegate;
210 private delegate void efl_control_priority_set_delegate(System.IntPtr obj, System.IntPtr pd, int priority);
213 public delegate void efl_control_priority_set_api_delegate(System.IntPtr obj, int priority);
214 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");
215 private static void priority_set(System.IntPtr obj, System.IntPtr pd, int priority)
217 Eina.Log.Debug("function efl_control_priority_set was called");
218 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
219 if(wrapper != null) {
222 ((Control)wrapper).SetPriority( priority);
223 } catch (Exception e) {
224 Eina.Log.Warning($"Callback error: {e.ToString()}");
225 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
228 efl_control_priority_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), priority);
231 private static efl_control_priority_set_delegate efl_control_priority_set_static_delegate;
234 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_control_suspend_get_delegate(System.IntPtr obj, System.IntPtr pd);
237 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_control_suspend_get_api_delegate(System.IntPtr obj);
238 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");
239 private static bool suspend_get(System.IntPtr obj, System.IntPtr pd)
241 Eina.Log.Debug("function efl_control_suspend_get was called");
242 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
243 if(wrapper != null) {
244 bool _ret_var = default(bool);
246 _ret_var = ((Control)wrapper).GetSuspend();
247 } catch (Exception e) {
248 Eina.Log.Warning($"Callback error: {e.ToString()}");
249 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
253 return efl_control_suspend_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
256 private static efl_control_suspend_get_delegate efl_control_suspend_get_static_delegate;
259 private delegate void efl_control_suspend_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool suspend);
262 public delegate void efl_control_suspend_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool suspend);
263 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");
264 private static void suspend_set(System.IntPtr obj, System.IntPtr pd, bool suspend)
266 Eina.Log.Debug("function efl_control_suspend_set was called");
267 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
268 if(wrapper != null) {
271 ((Control)wrapper).SetSuspend( suspend);
272 } catch (Exception e) {
273 Eina.Log.Warning($"Callback error: {e.ToString()}");
274 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
277 efl_control_suspend_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), suspend);
280 private static efl_control_suspend_set_delegate efl_control_suspend_set_static_delegate;