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 object direction interface</summary>
9 [DirectionNativeInherit]
10 public interface Direction :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>Control the direction of a given widget.
14 /// Use this function to change how your widget is to be disposed: vertically or horizontally or inverted vertically or inverted horizontally.
16 /// Mirroring as defined in <see cref="Efl.Ui.I18n"/> can invert the <c>horizontal</c> direction: it is <c>ltr</c> by default, but becomes <c>rtl</c> if the object is mirrored.</summary>
17 /// <returns>Direction of the widget.</returns>
18 Efl.Ui.Dir GetDirection();
19 /// <summary>Control the direction of a given widget.
20 /// Use this function to change how your widget is to be disposed: vertically or horizontally or inverted vertically or inverted horizontally.
22 /// Mirroring as defined in <see cref="Efl.Ui.I18n"/> can invert the <c>horizontal</c> direction: it is <c>ltr</c> by default, but becomes <c>rtl</c> if the object is mirrored.</summary>
23 /// <param name="dir">Direction of the widget.</param>
24 /// <returns></returns>
25 void SetDirection( Efl.Ui.Dir dir);
26 /// <summary>Control the direction of a given widget.
27 /// Use this function to change how your widget is to be disposed: vertically or horizontally or inverted vertically or inverted horizontally.
29 /// Mirroring as defined in <see cref="Efl.Ui.I18n"/> can invert the <c>horizontal</c> direction: it is <c>ltr</c> by default, but becomes <c>rtl</c> if the object is mirrored.</summary>
30 /// <value>Direction of the widget.</value>
31 Efl.Ui.Dir Direction {
36 /// <summary>EFL UI object direction interface</summary>
37 sealed public class DirectionConcrete :
42 ///<summary>Pointer to the native class description.</summary>
43 public System.IntPtr NativeClass {
45 if (((object)this).GetType() == typeof (DirectionConcrete))
46 return Efl.Ui.DirectionNativeInherit.GetEflClassStatic();
48 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
51 private System.IntPtr handle;
52 ///<summary>Pointer to the native instance.</summary>
53 public System.IntPtr NativeHandle {
54 get { return handle; }
56 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
57 efl_ui_direction_interface_get();
58 ///<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>
59 public DirectionConcrete(System.IntPtr raw)
62 register_event_proxies();
64 ///<summary>Destructor.</summary>
69 ///<summary>Releases the underlying native instance.</summary>
70 void Dispose(bool disposing)
72 if (handle != System.IntPtr.Zero) {
73 Efl.Eo.Globals.efl_unref(handle);
74 handle = System.IntPtr.Zero;
77 ///<summary>Releases the underlying native instance.</summary>
81 GC.SuppressFinalize(this);
83 ///<summary>Casts obj into an instance of this type.</summary>
84 public static DirectionConcrete static_cast(Efl.Object obj)
87 throw new System.ArgumentNullException("obj");
88 return new DirectionConcrete(obj.NativeHandle);
90 ///<summary>Verifies if the given object is equal to this one.</summary>
91 public override bool Equals(object obj)
93 var other = obj as Efl.Object;
96 return this.NativeHandle == other.NativeHandle;
98 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
99 public override int GetHashCode()
101 return this.NativeHandle.ToInt32();
103 ///<summary>Turns the native pointer into a string representation.</summary>
104 public override String ToString()
106 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
108 void register_event_proxies()
111 /// <summary>Control the direction of a given widget.
112 /// Use this function to change how your widget is to be disposed: vertically or horizontally or inverted vertically or inverted horizontally.
114 /// Mirroring as defined in <see cref="Efl.Ui.I18n"/> can invert the <c>horizontal</c> direction: it is <c>ltr</c> by default, but becomes <c>rtl</c> if the object is mirrored.</summary>
115 /// <returns>Direction of the widget.</returns>
116 public Efl.Ui.Dir GetDirection() {
117 var _ret_var = Efl.Ui.DirectionNativeInherit.efl_ui_direction_get_ptr.Value.Delegate(this.NativeHandle);
118 Eina.Error.RaiseIfUnhandledException();
121 /// <summary>Control the direction of a given widget.
122 /// Use this function to change how your widget is to be disposed: vertically or horizontally or inverted vertically or inverted horizontally.
124 /// Mirroring as defined in <see cref="Efl.Ui.I18n"/> can invert the <c>horizontal</c> direction: it is <c>ltr</c> by default, but becomes <c>rtl</c> if the object is mirrored.</summary>
125 /// <param name="dir">Direction of the widget.</param>
126 /// <returns></returns>
127 public void SetDirection( Efl.Ui.Dir dir) {
128 Efl.Ui.DirectionNativeInherit.efl_ui_direction_set_ptr.Value.Delegate(this.NativeHandle, dir);
129 Eina.Error.RaiseIfUnhandledException();
131 /// <summary>Control the direction of a given widget.
132 /// Use this function to change how your widget is to be disposed: vertically or horizontally or inverted vertically or inverted horizontally.
134 /// Mirroring as defined in <see cref="Efl.Ui.I18n"/> can invert the <c>horizontal</c> direction: it is <c>ltr</c> by default, but becomes <c>rtl</c> if the object is mirrored.</summary>
135 /// <value>Direction of the widget.</value>
136 public Efl.Ui.Dir Direction {
137 get { return GetDirection(); }
138 set { SetDirection( value); }
141 public class DirectionNativeInherit : Efl.Eo.NativeClass{
142 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
143 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
145 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
146 if (efl_ui_direction_get_static_delegate == null)
147 efl_ui_direction_get_static_delegate = new efl_ui_direction_get_delegate(direction_get);
148 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_direction_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_direction_get_static_delegate)});
149 if (efl_ui_direction_set_static_delegate == null)
150 efl_ui_direction_set_static_delegate = new efl_ui_direction_set_delegate(direction_set);
151 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_direction_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_direction_set_static_delegate)});
154 public override IntPtr GetEflClass()
156 return Efl.Ui.DirectionConcrete.efl_ui_direction_interface_get();
158 public static IntPtr GetEflClassStatic()
160 return Efl.Ui.DirectionConcrete.efl_ui_direction_interface_get();
164 private delegate Efl.Ui.Dir efl_ui_direction_get_delegate(System.IntPtr obj, System.IntPtr pd);
167 public delegate Efl.Ui.Dir efl_ui_direction_get_api_delegate(System.IntPtr obj);
168 public static Efl.Eo.FunctionWrapper<efl_ui_direction_get_api_delegate> efl_ui_direction_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_direction_get_api_delegate>(_Module, "efl_ui_direction_get");
169 private static Efl.Ui.Dir direction_get(System.IntPtr obj, System.IntPtr pd)
171 Eina.Log.Debug("function efl_ui_direction_get was called");
172 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
173 if(wrapper != null) {
174 Efl.Ui.Dir _ret_var = default(Efl.Ui.Dir);
176 _ret_var = ((Direction)wrapper).GetDirection();
177 } catch (Exception e) {
178 Eina.Log.Warning($"Callback error: {e.ToString()}");
179 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
183 return efl_ui_direction_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
186 private static efl_ui_direction_get_delegate efl_ui_direction_get_static_delegate;
189 private delegate void efl_ui_direction_set_delegate(System.IntPtr obj, System.IntPtr pd, Efl.Ui.Dir dir);
192 public delegate void efl_ui_direction_set_api_delegate(System.IntPtr obj, Efl.Ui.Dir dir);
193 public static Efl.Eo.FunctionWrapper<efl_ui_direction_set_api_delegate> efl_ui_direction_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_direction_set_api_delegate>(_Module, "efl_ui_direction_set");
194 private static void direction_set(System.IntPtr obj, System.IntPtr pd, Efl.Ui.Dir dir)
196 Eina.Log.Debug("function efl_ui_direction_set was called");
197 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
198 if(wrapper != null) {
201 ((Direction)wrapper).SetDirection( dir);
202 } catch (Exception e) {
203 Eina.Log.Warning($"Callback error: {e.ToString()}");
204 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
207 efl_ui_direction_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), dir);
210 private static efl_ui_direction_set_delegate efl_ui_direction_set_static_delegate;
213 namespace Efl { namespace Ui {
214 /// <summary>Direction for UI objects and layouts.
215 /// Not to be confused with <see cref="Efl.Orient"/> which is for images and canvases. This enum is used to define how widgets should expand and orient themselves, not to rotate images.
217 /// See also <see cref="Efl.Ui.Direction"/>.</summary>
220 /// <summary>Default direction. Each widget may have a different default.</summary>
222 /// <summary>Horizontal direction, along the X axis. Usually left-to-right, but may be inverted to right-to-left if mirroring is on.</summary>
224 /// <summary>Vertical direction, along the Y axis. Usually downwards.</summary>
226 /// <summary>Horizontal, left-to-right direction.</summary>
228 /// <summary>Horizontal, right-to-left direction.</summary>
230 /// <summary>Vertical, top-to-bottom direction.</summary>
232 /// <summary>Vertical, bottom-to-top direction.</summary>
234 /// <summary>Right is an alias for LTR.</summary>
236 /// <summary>Left is an alias for RTL.</summary>