1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Input {
8 /// <summary>Efl input state interface</summary>
10 public interface State :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>Indicates whether a key modifier is on, such as Ctrl, Shift, ...</summary>
14 /// <param name="mod">The modifier key to test.</param>
15 /// <param name="seat">The seat device, may be <c>null</c></param>
16 /// <returns><c>true</c> if the key modifier is pressed.</returns>
17 bool GetModifierEnabled( Efl.Input.Modifier mod, Efl.Input.Device seat);
18 /// <summary>Indicates whether a key lock is on, such as NumLock, CapsLock, ...</summary>
19 /// <param name="kw_lock">The lock key to test.</param>
20 /// <param name="seat">The seat device, may be <c>null</c></param>
21 /// <returns><c>true</c> if the key lock is on.</returns>
22 bool GetLockEnabled( Efl.Input.Lock kw_lock, Efl.Input.Device seat);
24 /// <summary>Efl input state interface</summary>
25 sealed public class StateConcrete :
30 ///<summary>Pointer to the native class description.</summary>
31 public System.IntPtr NativeClass {
33 if (((object)this).GetType() == typeof (StateConcrete))
34 return Efl.Input.StateNativeInherit.GetEflClassStatic();
36 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
39 private System.IntPtr handle;
40 ///<summary>Pointer to the native instance.</summary>
41 public System.IntPtr NativeHandle {
42 get { return handle; }
44 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
45 efl_input_state_interface_get();
46 ///<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>
47 public StateConcrete(System.IntPtr raw)
50 register_event_proxies();
52 ///<summary>Destructor.</summary>
57 ///<summary>Releases the underlying native instance.</summary>
58 void Dispose(bool disposing)
60 if (handle != System.IntPtr.Zero) {
61 Efl.Eo.Globals.efl_unref(handle);
62 handle = System.IntPtr.Zero;
65 ///<summary>Releases the underlying native instance.</summary>
69 GC.SuppressFinalize(this);
71 ///<summary>Casts obj into an instance of this type.</summary>
72 public static StateConcrete static_cast(Efl.Object obj)
75 throw new System.ArgumentNullException("obj");
76 return new StateConcrete(obj.NativeHandle);
78 ///<summary>Verifies if the given object is equal to this one.</summary>
79 public override bool Equals(object obj)
81 var other = obj as Efl.Object;
84 return this.NativeHandle == other.NativeHandle;
86 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
87 public override int GetHashCode()
89 return this.NativeHandle.ToInt32();
91 ///<summary>Turns the native pointer into a string representation.</summary>
92 public override String ToString()
94 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
96 void register_event_proxies()
99 /// <summary>Indicates whether a key modifier is on, such as Ctrl, Shift, ...</summary>
100 /// <param name="mod">The modifier key to test.</param>
101 /// <param name="seat">The seat device, may be <c>null</c></param>
102 /// <returns><c>true</c> if the key modifier is pressed.</returns>
103 public bool GetModifierEnabled( Efl.Input.Modifier mod, Efl.Input.Device seat) {
104 var _ret_var = Efl.Input.StateNativeInherit.efl_input_modifier_enabled_get_ptr.Value.Delegate(this.NativeHandle, mod, seat);
105 Eina.Error.RaiseIfUnhandledException();
108 /// <summary>Indicates whether a key lock is on, such as NumLock, CapsLock, ...</summary>
109 /// <param name="kw_lock">The lock key to test.</param>
110 /// <param name="seat">The seat device, may be <c>null</c></param>
111 /// <returns><c>true</c> if the key lock is on.</returns>
112 public bool GetLockEnabled( Efl.Input.Lock kw_lock, Efl.Input.Device seat) {
113 var _ret_var = Efl.Input.StateNativeInherit.efl_input_lock_enabled_get_ptr.Value.Delegate(this.NativeHandle, kw_lock, seat);
114 Eina.Error.RaiseIfUnhandledException();
118 public class StateNativeInherit : Efl.Eo.NativeClass{
119 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Evas);
120 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
122 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
123 if (efl_input_modifier_enabled_get_static_delegate == null)
124 efl_input_modifier_enabled_get_static_delegate = new efl_input_modifier_enabled_get_delegate(modifier_enabled_get);
125 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_input_modifier_enabled_get"), func = Marshal.GetFunctionPointerForDelegate(efl_input_modifier_enabled_get_static_delegate)});
126 if (efl_input_lock_enabled_get_static_delegate == null)
127 efl_input_lock_enabled_get_static_delegate = new efl_input_lock_enabled_get_delegate(lock_enabled_get);
128 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_input_lock_enabled_get"), func = Marshal.GetFunctionPointerForDelegate(efl_input_lock_enabled_get_static_delegate)});
131 public override IntPtr GetEflClass()
133 return Efl.Input.StateConcrete.efl_input_state_interface_get();
135 public static IntPtr GetEflClassStatic()
137 return Efl.Input.StateConcrete.efl_input_state_interface_get();
141 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_input_modifier_enabled_get_delegate(System.IntPtr obj, System.IntPtr pd, Efl.Input.Modifier mod, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Input.Device, Efl.Eo.NonOwnTag>))] Efl.Input.Device seat);
144 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_input_modifier_enabled_get_api_delegate(System.IntPtr obj, Efl.Input.Modifier mod, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Input.Device, Efl.Eo.NonOwnTag>))] Efl.Input.Device seat);
145 public static Efl.Eo.FunctionWrapper<efl_input_modifier_enabled_get_api_delegate> efl_input_modifier_enabled_get_ptr = new Efl.Eo.FunctionWrapper<efl_input_modifier_enabled_get_api_delegate>(_Module, "efl_input_modifier_enabled_get");
146 private static bool modifier_enabled_get(System.IntPtr obj, System.IntPtr pd, Efl.Input.Modifier mod, Efl.Input.Device seat)
148 Eina.Log.Debug("function efl_input_modifier_enabled_get was called");
149 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
150 if(wrapper != null) {
151 bool _ret_var = default(bool);
153 _ret_var = ((State)wrapper).GetModifierEnabled( mod, seat);
154 } catch (Exception e) {
155 Eina.Log.Warning($"Callback error: {e.ToString()}");
156 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
160 return efl_input_modifier_enabled_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), mod, seat);
163 private static efl_input_modifier_enabled_get_delegate efl_input_modifier_enabled_get_static_delegate;
166 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_input_lock_enabled_get_delegate(System.IntPtr obj, System.IntPtr pd, Efl.Input.Lock kw_lock, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Input.Device, Efl.Eo.NonOwnTag>))] Efl.Input.Device seat);
169 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_input_lock_enabled_get_api_delegate(System.IntPtr obj, Efl.Input.Lock kw_lock, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Input.Device, Efl.Eo.NonOwnTag>))] Efl.Input.Device seat);
170 public static Efl.Eo.FunctionWrapper<efl_input_lock_enabled_get_api_delegate> efl_input_lock_enabled_get_ptr = new Efl.Eo.FunctionWrapper<efl_input_lock_enabled_get_api_delegate>(_Module, "efl_input_lock_enabled_get");
171 private static bool lock_enabled_get(System.IntPtr obj, System.IntPtr pd, Efl.Input.Lock kw_lock, Efl.Input.Device seat)
173 Eina.Log.Debug("function efl_input_lock_enabled_get was called");
174 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
175 if(wrapper != null) {
176 bool _ret_var = default(bool);
178 _ret_var = ((State)wrapper).GetLockEnabled( kw_lock, seat);
179 } catch (Exception e) {
180 Eina.Log.Warning($"Callback error: {e.ToString()}");
181 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
185 return efl_input_lock_enabled_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), kw_lock, seat);
188 private static efl_input_lock_enabled_get_delegate efl_input_lock_enabled_get_static_delegate;