#define EFL_BETA #pragma warning disable CS1591 using System; using System.Runtime.InteropServices; using System.Collections.Generic; using System.Linq; using System.Threading; using System.ComponentModel; namespace Efl { namespace Ui { /// Output formatted string. Its contents will be overwritten by this method. /// The to convert to text. [Efl.Eo.BindingEntity] public delegate bool FormatFunc(Eina.Strbuf str, Eina.Value value); [return: MarshalAs(UnmanagedType.U1)]public delegate bool FormatFuncInternal(IntPtr data, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))] Eina.Strbuf str, Eina.ValueNative value); internal class FormatFuncWrapper : IDisposable { private FormatFuncInternal _cb; private IntPtr _cb_data; private EinaFreeCb _cb_free_cb; internal FormatFuncWrapper (FormatFuncInternal _cb, IntPtr _cb_data, EinaFreeCb _cb_free_cb) { this._cb = _cb; this._cb_data = _cb_data; this._cb_free_cb = _cb_free_cb; } ~FormatFuncWrapper() { Dispose(false); } protected virtual void Dispose(bool disposing) { if (this._cb_free_cb != null) { if (disposing) { this._cb_free_cb(this._cb_data); } else { Efl.Eo.Globals.ThreadSafeFreeCbExec(this._cb_free_cb, this._cb_data); } this._cb_free_cb = null; this._cb_data = IntPtr.Zero; this._cb = null; } } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } internal bool ManagedCb(Eina.Strbuf str,Eina.Value value) { var _ret_var = _cb(_cb_data, str, value); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } [return: MarshalAs(UnmanagedType.U1)] internal static bool Cb(IntPtr cb_data, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))] Eina.Strbuf str, Eina.ValueNative value) { GCHandle handle = GCHandle.FromIntPtr(cb_data); FormatFunc cb = (FormatFunc)handle.Target; bool _ret_var = default(bool); try { _ret_var = cb(str, value); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } return _ret_var; } } } } namespace Efl { namespace Ui { /// Helper mixin that simplifies converting numerical values to text. /// A number of widgets represent a numerical value but display a text representation. For example, an can hold the number 0.75 but display the string "75%", or an can hold numbers 1 to 7, but display the strings "Monday" thru "Sunday". /// /// This conversion can be controlled through the , and properties. Only one of them needs to be set. When more than one is set has the highest priority, followed by and then . If one mechanism fails to produce a valid string the others will be tried (if provided) in descending order of priority. If no user-provided mechanism works, a fallback is used that just displays the value. /// /// Widgets including this mixin offer their users different properties to control how 's are converted to text. /// This is a BETA class. It can be modified or removed in the future. Do not use it for product development. [Efl.Ui.IFormatConcrete.NativeMethods] [Efl.Eo.BindingEntity] public interface IFormat : Efl.Eo.IWrapper, IDisposable { /// User-provided function which takes care of converting an into a text string. The user is then completely in control of how the string is generated, but it is the most cumbersome method to use. If the conversion fails the other mechanisms will be tried, according to their priorities. /// User-provided formatting function. Efl.Ui.FormatFunc GetFormatFunc(); /// User-provided function which takes care of converting an into a text string. The user is then completely in control of how the string is generated, but it is the most cumbersome method to use. If the conversion fails the other mechanisms will be tried, according to their priorities. /// User-provided formatting function. void SetFormatFunc(Efl.Ui.FormatFunc func); /// User-provided list of values which are to be rendered using specific text strings. This is more convenient to use than and is perfectly suited for cases where the strings make more sense than the numerical values. For example, weekday names ("Monday", "Tuesday", ...) are friendlier than numbers 1 to 7. If a value is not found in the list, the other mechanisms will be tried according to their priorities. List members do not need to be in any particular order. They are sorted internally for performance reasons. /// Accessor over a list of value-text pairs. The method will dispose of the accessor, but not of its contents. For convenience, Eina offers a range of helper methods to obtain accessors from Eina.Array, Eina.List or even plain C arrays. Eina.Accessor GetFormatValues(); /// User-provided list of values which are to be rendered using specific text strings. This is more convenient to use than and is perfectly suited for cases where the strings make more sense than the numerical values. For example, weekday names ("Monday", "Tuesday", ...) are friendlier than numbers 1 to 7. If a value is not found in the list, the other mechanisms will be tried according to their priorities. List members do not need to be in any particular order. They are sorted internally for performance reasons. /// Accessor over a list of value-text pairs. The method will dispose of the accessor, but not of its contents. For convenience, Eina offers a range of helper methods to obtain accessors from Eina.Array, Eina.List or even plain C arrays. void SetFormatValues(Eina.Accessor values); /// A user-provided, string used to format the numerical value. /// For example, "%1.2f meters", "%.0%%" or "%d items". /// /// This is the simplest formatting mechanism, working pretty much like printf. /// /// Different format specifiers (the character after the %) are available, depending on the type used. Use for simple numerical values and for time and date values. For instance, %d means "integer" when the first type is used, but it means "day of the month as a decimal number" in the second. /// /// Pass NULL to disable this mechanism. /// Formatting string containing regular characters and format specifiers. /// Type of formatting string, which controls how the different format specifiers are to be traslated. void GetFormatString(out System.String kw_string, out Efl.Ui.FormatStringType type); /// A user-provided, string used to format the numerical value. /// For example, "%1.2f meters", "%.0%%" or "%d items". /// /// This is the simplest formatting mechanism, working pretty much like printf. /// /// Different format specifiers (the character after the %) are available, depending on the type used. Use for simple numerical values and for time and date values. For instance, %d means "integer" when the first type is used, but it means "day of the month as a decimal number" in the second. /// /// Pass NULL to disable this mechanism. /// Formatting string containing regular characters and format specifiers. /// Type of formatting string, which controls how the different format specifiers are to be traslated. void SetFormatString(System.String kw_string, Efl.Ui.FormatStringType type); /// Internal method to be used by widgets including this mixin to perform the conversion from the internal numerical value into the text representation (Users of these widgets do not need to call this method). /// uses any user-provided mechanism to perform the conversion, according to their priorities, and implements a simple fallback if all mechanisms fail. /// Output formatted string. Its contents will be overwritten by this method. /// The to convert to text. void GetFormattedValue(Eina.Strbuf str, Eina.Value value); /// Internal method to be used by widgets including this mixin. It can only be used when a has been supplied, and it returns the number of decimal places that the format string will produce for floating point values. /// For example, "%.2f" returns 2, and "%d" returns 0; /// Number of decimal places, or 0 for non-floating point types. int GetDecimalPlaces(); /// Internal method to be implemented by widgets including this mixin. /// The mixin will call this method to signal the widget that the formatting has changed and therefore the current value should be converted and rendered again. Widgets must typically call and display the returned string. This is something they are already doing (whenever the value changes, for example) so there should be no extra code written to implement this method. void ApplyFormattedValue(); /// User-provided function which takes care of converting an into a text string. The user is then completely in control of how the string is generated, but it is the most cumbersome method to use. If the conversion fails the other mechanisms will be tried, according to their priorities. /// User-provided formatting function. Efl.Ui.FormatFunc FormatFunc { get; set; } /// User-provided list of values which are to be rendered using specific text strings. This is more convenient to use than and is perfectly suited for cases where the strings make more sense than the numerical values. For example, weekday names ("Monday", "Tuesday", ...) are friendlier than numbers 1 to 7. If a value is not found in the list, the other mechanisms will be tried according to their priorities. List members do not need to be in any particular order. They are sorted internally for performance reasons. /// Accessor over a list of value-text pairs. The method will dispose of the accessor, but not of its contents. For convenience, Eina offers a range of helper methods to obtain accessors from Eina.Array, Eina.List or even plain C arrays. Eina.Accessor FormatValues { get; set; } /// A user-provided, string used to format the numerical value. /// For example, "%1.2f meters", "%.0%%" or "%d items". /// /// This is the simplest formatting mechanism, working pretty much like printf. /// /// Different format specifiers (the character after the %) are available, depending on the type used. Use for simple numerical values and for time and date values. For instance, %d means "integer" when the first type is used, but it means "day of the month as a decimal number" in the second. /// /// Pass NULL to disable this mechanism. /// Formatting string containing regular characters and format specifiers. (System.String, Efl.Ui.FormatStringType) FormatString { get; set; } } /// Helper mixin that simplifies converting numerical values to text. /// A number of widgets represent a numerical value but display a text representation. For example, an can hold the number 0.75 but display the string "75%", or an can hold numbers 1 to 7, but display the strings "Monday" thru "Sunday". /// /// This conversion can be controlled through the , and properties. Only one of them needs to be set. When more than one is set has the highest priority, followed by and then . If one mechanism fails to produce a valid string the others will be tried (if provided) in descending order of priority. If no user-provided mechanism works, a fallback is used that just displays the value. /// /// Widgets including this mixin offer their users different properties to control how 's are converted to text. /// This is a BETA class. It can be modified or removed in the future. Do not use it for product development. sealed public class IFormatConcrete : Efl.Eo.EoWrapper , IFormat { /// Pointer to the native class description. public override System.IntPtr NativeClass { get { if (((object)this).GetType() == typeof(IFormatConcrete)) { return GetEflClassStatic(); } else { return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()]; } } } /// Subclasses should override this constructor if they are expected to be instantiated from native code. /// Do not call this constructor directly. /// Tag struct storing the native handle of the object being constructed. private IFormatConcrete(ConstructingHandle ch) : base(ch) { } [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr efl_ui_format_mixin_get(); /// Initializes a new instance of the class. /// Internal usage: This is used when interacting with C code and should not be used directly. /// The native pointer to be wrapped. private IFormatConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh) { } /// User-provided function which takes care of converting an into a text string. The user is then completely in control of how the string is generated, but it is the most cumbersome method to use. If the conversion fails the other mechanisms will be tried, according to their priorities. /// User-provided formatting function. public Efl.Ui.FormatFunc GetFormatFunc() { var _ret_var = Efl.Ui.IFormatConcrete.NativeMethods.efl_ui_format_func_get_ptr.Value.Delegate(this.NativeHandle); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } /// User-provided function which takes care of converting an into a text string. The user is then completely in control of how the string is generated, but it is the most cumbersome method to use. If the conversion fails the other mechanisms will be tried, according to their priorities. /// User-provided formatting function. public void SetFormatFunc(Efl.Ui.FormatFunc func) { GCHandle func_handle = GCHandle.Alloc(func); Efl.Ui.IFormatConcrete.NativeMethods.efl_ui_format_func_set_ptr.Value.Delegate(this.NativeHandle,GCHandle.ToIntPtr(func_handle), Efl.Ui.FormatFuncWrapper.Cb, Efl.Eo.Globals.free_gchandle); Eina.Error.RaiseIfUnhandledException(); } /// User-provided list of values which are to be rendered using specific text strings. This is more convenient to use than and is perfectly suited for cases where the strings make more sense than the numerical values. For example, weekday names ("Monday", "Tuesday", ...) are friendlier than numbers 1 to 7. If a value is not found in the list, the other mechanisms will be tried according to their priorities. List members do not need to be in any particular order. They are sorted internally for performance reasons. /// Accessor over a list of value-text pairs. The method will dispose of the accessor, but not of its contents. For convenience, Eina offers a range of helper methods to obtain accessors from Eina.Array, Eina.List or even plain C arrays. public Eina.Accessor GetFormatValues() { var _ret_var = Efl.Ui.IFormatConcrete.NativeMethods.efl_ui_format_values_get_ptr.Value.Delegate(this.NativeHandle); Eina.Error.RaiseIfUnhandledException(); return new Eina.Accessor(_ret_var, false); } /// User-provided list of values which are to be rendered using specific text strings. This is more convenient to use than and is perfectly suited for cases where the strings make more sense than the numerical values. For example, weekday names ("Monday", "Tuesday", ...) are friendlier than numbers 1 to 7. If a value is not found in the list, the other mechanisms will be tried according to their priorities. List members do not need to be in any particular order. They are sorted internally for performance reasons. /// Accessor over a list of value-text pairs. The method will dispose of the accessor, but not of its contents. For convenience, Eina offers a range of helper methods to obtain accessors from Eina.Array, Eina.List or even plain C arrays. public void SetFormatValues(Eina.Accessor values) { var _in_values = values.Handle; Efl.Ui.IFormatConcrete.NativeMethods.efl_ui_format_values_set_ptr.Value.Delegate(this.NativeHandle,_in_values); Eina.Error.RaiseIfUnhandledException(); } /// A user-provided, string used to format the numerical value. /// For example, "%1.2f meters", "%.0%%" or "%d items". /// /// This is the simplest formatting mechanism, working pretty much like printf. /// /// Different format specifiers (the character after the %) are available, depending on the type used. Use for simple numerical values and for time and date values. For instance, %d means "integer" when the first type is used, but it means "day of the month as a decimal number" in the second. /// /// Pass NULL to disable this mechanism. /// Formatting string containing regular characters and format specifiers. /// Type of formatting string, which controls how the different format specifiers are to be traslated. public void GetFormatString(out System.String kw_string, out Efl.Ui.FormatStringType type) { Efl.Ui.IFormatConcrete.NativeMethods.efl_ui_format_string_get_ptr.Value.Delegate(this.NativeHandle,out kw_string, out type); Eina.Error.RaiseIfUnhandledException(); } /// A user-provided, string used to format the numerical value. /// For example, "%1.2f meters", "%.0%%" or "%d items". /// /// This is the simplest formatting mechanism, working pretty much like printf. /// /// Different format specifiers (the character after the %) are available, depending on the type used. Use for simple numerical values and for time and date values. For instance, %d means "integer" when the first type is used, but it means "day of the month as a decimal number" in the second. /// /// Pass NULL to disable this mechanism. /// Formatting string containing regular characters and format specifiers. /// Type of formatting string, which controls how the different format specifiers are to be traslated. public void SetFormatString(System.String kw_string, Efl.Ui.FormatStringType type) { Efl.Ui.IFormatConcrete.NativeMethods.efl_ui_format_string_set_ptr.Value.Delegate(this.NativeHandle,kw_string, type); Eina.Error.RaiseIfUnhandledException(); } /// Internal method to be used by widgets including this mixin to perform the conversion from the internal numerical value into the text representation (Users of these widgets do not need to call this method). /// uses any user-provided mechanism to perform the conversion, according to their priorities, and implements a simple fallback if all mechanisms fail. /// Output formatted string. Its contents will be overwritten by this method. /// The to convert to text. public void GetFormattedValue(Eina.Strbuf str, Eina.Value value) { Efl.Ui.IFormatConcrete.NativeMethods.efl_ui_format_formatted_value_get_ptr.Value.Delegate(this.NativeHandle,str, value); Eina.Error.RaiseIfUnhandledException(); } /// Internal method to be used by widgets including this mixin. It can only be used when a has been supplied, and it returns the number of decimal places that the format string will produce for floating point values. /// For example, "%.2f" returns 2, and "%d" returns 0; /// Number of decimal places, or 0 for non-floating point types. public int GetDecimalPlaces() { var _ret_var = Efl.Ui.IFormatConcrete.NativeMethods.efl_ui_format_decimal_places_get_ptr.Value.Delegate(this.NativeHandle); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } /// Internal method to be implemented by widgets including this mixin. /// The mixin will call this method to signal the widget that the formatting has changed and therefore the current value should be converted and rendered again. Widgets must typically call and display the returned string. This is something they are already doing (whenever the value changes, for example) so there should be no extra code written to implement this method. public void ApplyFormattedValue() { Efl.Ui.IFormatConcrete.NativeMethods.efl_ui_format_apply_formatted_value_ptr.Value.Delegate(this.NativeHandle); Eina.Error.RaiseIfUnhandledException(); } /// User-provided function which takes care of converting an into a text string. The user is then completely in control of how the string is generated, but it is the most cumbersome method to use. If the conversion fails the other mechanisms will be tried, according to their priorities. /// User-provided formatting function. public Efl.Ui.FormatFunc FormatFunc { get { return GetFormatFunc(); } set { SetFormatFunc(value); } } /// User-provided list of values which are to be rendered using specific text strings. This is more convenient to use than and is perfectly suited for cases where the strings make more sense than the numerical values. For example, weekday names ("Monday", "Tuesday", ...) are friendlier than numbers 1 to 7. If a value is not found in the list, the other mechanisms will be tried according to their priorities. List members do not need to be in any particular order. They are sorted internally for performance reasons. /// Accessor over a list of value-text pairs. The method will dispose of the accessor, but not of its contents. For convenience, Eina offers a range of helper methods to obtain accessors from Eina.Array, Eina.List or even plain C arrays. public Eina.Accessor FormatValues { get { return GetFormatValues(); } set { SetFormatValues(value); } } /// A user-provided, string used to format the numerical value. /// For example, "%1.2f meters", "%.0%%" or "%d items". /// /// This is the simplest formatting mechanism, working pretty much like printf. /// /// Different format specifiers (the character after the %) are available, depending on the type used. Use for simple numerical values and for time and date values. For instance, %d means "integer" when the first type is used, but it means "day of the month as a decimal number" in the second. /// /// Pass NULL to disable this mechanism. /// Formatting string containing regular characters and format specifiers. public (System.String, Efl.Ui.FormatStringType) FormatString { get { System.String _out_kw_string = default(System.String); Efl.Ui.FormatStringType _out_type = default(Efl.Ui.FormatStringType); GetFormatString(out _out_kw_string,out _out_type); return (_out_kw_string,_out_type); } set { SetFormatString( value.Item1, value.Item2); } } private static IntPtr GetEflClassStatic() { return Efl.Ui.IFormatConcrete.efl_ui_format_mixin_get(); } /// Wrapper for native methods and virtual method delegates. /// For internal use by generated code only. public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods { private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary); /// Gets the list of Eo operations to override. /// The list of Eo operations to be overload. public override System.Collections.Generic.List GetEoOps(System.Type type) { var descs = new System.Collections.Generic.List(); var methods = Efl.Eo.Globals.GetUserMethods(type); if (efl_ui_format_func_get_static_delegate == null) { efl_ui_format_func_get_static_delegate = new efl_ui_format_func_get_delegate(format_func_get); } if (methods.FirstOrDefault(m => m.Name == "GetFormatFunc") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_format_func_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_format_func_get_static_delegate) }); } if (efl_ui_format_func_set_static_delegate == null) { efl_ui_format_func_set_static_delegate = new efl_ui_format_func_set_delegate(format_func_set); } if (methods.FirstOrDefault(m => m.Name == "SetFormatFunc") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_format_func_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_format_func_set_static_delegate) }); } if (efl_ui_format_values_get_static_delegate == null) { efl_ui_format_values_get_static_delegate = new efl_ui_format_values_get_delegate(format_values_get); } if (methods.FirstOrDefault(m => m.Name == "GetFormatValues") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_format_values_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_format_values_get_static_delegate) }); } if (efl_ui_format_values_set_static_delegate == null) { efl_ui_format_values_set_static_delegate = new efl_ui_format_values_set_delegate(format_values_set); } if (methods.FirstOrDefault(m => m.Name == "SetFormatValues") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_format_values_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_format_values_set_static_delegate) }); } if (efl_ui_format_string_get_static_delegate == null) { efl_ui_format_string_get_static_delegate = new efl_ui_format_string_get_delegate(format_string_get); } if (methods.FirstOrDefault(m => m.Name == "GetFormatString") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_format_string_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_format_string_get_static_delegate) }); } if (efl_ui_format_string_set_static_delegate == null) { efl_ui_format_string_set_static_delegate = new efl_ui_format_string_set_delegate(format_string_set); } if (methods.FirstOrDefault(m => m.Name == "SetFormatString") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_format_string_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_format_string_set_static_delegate) }); } if (efl_ui_format_formatted_value_get_static_delegate == null) { efl_ui_format_formatted_value_get_static_delegate = new efl_ui_format_formatted_value_get_delegate(formatted_value_get); } if (methods.FirstOrDefault(m => m.Name == "GetFormattedValue") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_format_formatted_value_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_format_formatted_value_get_static_delegate) }); } if (efl_ui_format_decimal_places_get_static_delegate == null) { efl_ui_format_decimal_places_get_static_delegate = new efl_ui_format_decimal_places_get_delegate(decimal_places_get); } if (methods.FirstOrDefault(m => m.Name == "GetDecimalPlaces") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_format_decimal_places_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_format_decimal_places_get_static_delegate) }); } if (efl_ui_format_apply_formatted_value_static_delegate == null) { efl_ui_format_apply_formatted_value_static_delegate = new efl_ui_format_apply_formatted_value_delegate(apply_formatted_value); } if (methods.FirstOrDefault(m => m.Name == "ApplyFormattedValue") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_format_apply_formatted_value"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_format_apply_formatted_value_static_delegate) }); } return descs; } /// Returns the Eo class for the native methods of this class. /// The native class pointer. public override IntPtr GetEflClass() { return Efl.Ui.IFormatConcrete.efl_ui_format_mixin_get(); } #pragma warning disable CA1707, CS1591, SA1300, SA1600 private delegate Efl.Ui.FormatFunc efl_ui_format_func_get_delegate(System.IntPtr obj, System.IntPtr pd); public delegate Efl.Ui.FormatFunc efl_ui_format_func_get_api_delegate(System.IntPtr obj); public static Efl.Eo.FunctionWrapper efl_ui_format_func_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_format_func_get"); private static Efl.Ui.FormatFunc format_func_get(System.IntPtr obj, System.IntPtr pd) { Eina.Log.Debug("function efl_ui_format_func_get was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { Efl.Ui.FormatFunc _ret_var = default(Efl.Ui.FormatFunc); try { _ret_var = ((IFormat)ws.Target).GetFormatFunc(); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } return _ret_var; } else { return efl_ui_format_func_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); } } private static efl_ui_format_func_get_delegate efl_ui_format_func_get_static_delegate; private delegate void efl_ui_format_func_set_delegate(System.IntPtr obj, System.IntPtr pd, IntPtr func_data, Efl.Ui.FormatFuncInternal func, EinaFreeCb func_free_cb); public delegate void efl_ui_format_func_set_api_delegate(System.IntPtr obj, IntPtr func_data, Efl.Ui.FormatFuncInternal func, EinaFreeCb func_free_cb); public static Efl.Eo.FunctionWrapper efl_ui_format_func_set_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_format_func_set"); private static void format_func_set(System.IntPtr obj, System.IntPtr pd, IntPtr func_data, Efl.Ui.FormatFuncInternal func, EinaFreeCb func_free_cb) { Eina.Log.Debug("function efl_ui_format_func_set was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { Efl.Ui.FormatFuncWrapper func_wrapper = new Efl.Ui.FormatFuncWrapper(func, func_data, func_free_cb); try { ((IFormat)ws.Target).SetFormatFunc(func_wrapper.ManagedCb); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } else { efl_ui_format_func_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), func_data, func, func_free_cb); } } private static efl_ui_format_func_set_delegate efl_ui_format_func_set_static_delegate; private delegate System.IntPtr efl_ui_format_values_get_delegate(System.IntPtr obj, System.IntPtr pd); public delegate System.IntPtr efl_ui_format_values_get_api_delegate(System.IntPtr obj); public static Efl.Eo.FunctionWrapper efl_ui_format_values_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_format_values_get"); private static System.IntPtr format_values_get(System.IntPtr obj, System.IntPtr pd) { Eina.Log.Debug("function efl_ui_format_values_get was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { Eina.Accessor _ret_var = default(Eina.Accessor); try { _ret_var = ((IFormat)ws.Target).GetFormatValues(); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } return _ret_var.Handle; } else { return efl_ui_format_values_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); } } private static efl_ui_format_values_get_delegate efl_ui_format_values_get_static_delegate; private delegate void efl_ui_format_values_set_delegate(System.IntPtr obj, System.IntPtr pd, System.IntPtr values); public delegate void efl_ui_format_values_set_api_delegate(System.IntPtr obj, System.IntPtr values); public static Efl.Eo.FunctionWrapper efl_ui_format_values_set_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_format_values_set"); private static void format_values_set(System.IntPtr obj, System.IntPtr pd, System.IntPtr values) { Eina.Log.Debug("function efl_ui_format_values_set was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { var _in_values = new Eina.Accessor(values, false); try { ((IFormat)ws.Target).SetFormatValues(_in_values); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } else { efl_ui_format_values_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), values); } } private static efl_ui_format_values_set_delegate efl_ui_format_values_set_static_delegate; private delegate void efl_ui_format_string_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] out System.String kw_string, out Efl.Ui.FormatStringType type); public delegate void efl_ui_format_string_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] out System.String kw_string, out Efl.Ui.FormatStringType type); public static Efl.Eo.FunctionWrapper efl_ui_format_string_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_format_string_get"); private static void format_string_get(System.IntPtr obj, System.IntPtr pd, out System.String kw_string, out Efl.Ui.FormatStringType type) { Eina.Log.Debug("function efl_ui_format_string_get was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { System.String _out_kw_string = default(System.String); type = default(Efl.Ui.FormatStringType); try { ((IFormat)ws.Target).GetFormatString(out _out_kw_string, out type); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } kw_string = _out_kw_string; } else { efl_ui_format_string_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), out kw_string, out type); } } private static efl_ui_format_string_get_delegate efl_ui_format_string_get_static_delegate; private delegate void efl_ui_format_string_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String kw_string, Efl.Ui.FormatStringType type); public delegate void efl_ui_format_string_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String kw_string, Efl.Ui.FormatStringType type); public static Efl.Eo.FunctionWrapper efl_ui_format_string_set_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_format_string_set"); private static void format_string_set(System.IntPtr obj, System.IntPtr pd, System.String kw_string, Efl.Ui.FormatStringType type) { Eina.Log.Debug("function efl_ui_format_string_set was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { try { ((IFormat)ws.Target).SetFormatString(kw_string, type); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } else { efl_ui_format_string_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), kw_string, type); } } private static efl_ui_format_string_set_delegate efl_ui_format_string_set_static_delegate; private delegate void efl_ui_format_formatted_value_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))] Eina.Strbuf str, Eina.ValueNative value); public delegate void efl_ui_format_formatted_value_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))] Eina.Strbuf str, Eina.ValueNative value); public static Efl.Eo.FunctionWrapper efl_ui_format_formatted_value_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_format_formatted_value_get"); private static void formatted_value_get(System.IntPtr obj, System.IntPtr pd, Eina.Strbuf str, Eina.ValueNative value) { Eina.Log.Debug("function efl_ui_format_formatted_value_get was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { try { ((IFormat)ws.Target).GetFormattedValue(str, value); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } else { efl_ui_format_formatted_value_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), str, value); } } private static efl_ui_format_formatted_value_get_delegate efl_ui_format_formatted_value_get_static_delegate; private delegate int efl_ui_format_decimal_places_get_delegate(System.IntPtr obj, System.IntPtr pd); public delegate int efl_ui_format_decimal_places_get_api_delegate(System.IntPtr obj); public static Efl.Eo.FunctionWrapper efl_ui_format_decimal_places_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_format_decimal_places_get"); private static int decimal_places_get(System.IntPtr obj, System.IntPtr pd) { Eina.Log.Debug("function efl_ui_format_decimal_places_get was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { int _ret_var = default(int); try { _ret_var = ((IFormat)ws.Target).GetDecimalPlaces(); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } return _ret_var; } else { return efl_ui_format_decimal_places_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); } } private static efl_ui_format_decimal_places_get_delegate efl_ui_format_decimal_places_get_static_delegate; private delegate void efl_ui_format_apply_formatted_value_delegate(System.IntPtr obj, System.IntPtr pd); public delegate void efl_ui_format_apply_formatted_value_api_delegate(System.IntPtr obj); public static Efl.Eo.FunctionWrapper efl_ui_format_apply_formatted_value_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_format_apply_formatted_value"); private static void apply_formatted_value(System.IntPtr obj, System.IntPtr pd) { Eina.Log.Debug("function efl_ui_format_apply_formatted_value was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { try { ((IFormat)ws.Target).ApplyFormattedValue(); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } else { efl_ui_format_apply_formatted_value_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); } } private static efl_ui_format_apply_formatted_value_delegate efl_ui_format_apply_formatted_value_static_delegate; #pragma warning restore CA1707, CS1591, SA1300, SA1600 } } } } #if EFL_BETA #pragma warning disable CS1591 public static class Efl_UiIFormatConcrete_ExtensionMethods { public static Efl.BindableProperty FormatFunc(this Efl.Ui.ItemFactory fac, Efl.Csharp.ExtensionTagmagic = null) where T : Efl.Ui.IFormat { return new Efl.BindableProperty("format_func", fac); } public static Efl.BindableProperty> FormatValues(this Efl.Ui.ItemFactory fac, Efl.Csharp.ExtensionTagmagic = null) where T : Efl.Ui.IFormat { return new Efl.BindableProperty>("format_values", fac); } } #pragma warning restore CS1591 #endif namespace Efl { namespace Ui { /// Type of formatting string. [Efl.Eo.BindingEntity] public enum FormatStringType { /// This is the simplest formatting mechanism, working pretty much like printf. Accepted formats are s, f, F, d, u, i, o, x and X. For example, "%1.2f meters", "%.0%%" or "%d items". Simple = 0, /// A strftime-style string used to format date and time values. For example, "%A" for the full name of the day or "%y" for the year as a decimal number without a century (range 00 to 99). Note that these are not the printf formats. See the man page for the strftime function for the complete list. Time = 1, } } } namespace Efl { namespace Ui { /// A value which should always be displayed as a specific text string. See . [StructLayout(LayoutKind.Sequential)] [Efl.Eo.BindingEntity] public struct FormatValue { /// Input value. public int Value; /// Text string to replace it. public System.String Text; /// Constructor for FormatValue. /// Input value.; /// Text string to replace it.; public FormatValue( int Value = default(int), System.String Text = default(System.String) ) { this.Value = Value; this.Text = Text; } /// Implicit conversion to the managed representation from a native pointer. /// Native pointer to be converted. public static implicit operator FormatValue(IntPtr ptr) { var tmp = (FormatValue.NativeStruct)Marshal.PtrToStructure(ptr, typeof(FormatValue.NativeStruct)); return tmp; } #pragma warning disable CS1591 /// Internal wrapper for struct FormatValue. [StructLayout(LayoutKind.Sequential)] public struct NativeStruct { public int Value; /// Internal wrapper for field Text public System.IntPtr Text; /// Implicit conversion to the internal/marshalling representation. public static implicit operator FormatValue.NativeStruct(FormatValue _external_struct) { var _internal_struct = new FormatValue.NativeStruct(); _internal_struct.Value = _external_struct.Value; _internal_struct.Text = Eina.MemoryNative.StrDup(_external_struct.Text); return _internal_struct; } /// Implicit conversion to the managed representation. public static implicit operator FormatValue(FormatValue.NativeStruct _internal_struct) { var _external_struct = new FormatValue(); _external_struct.Value = _internal_struct.Value; _external_struct.Text = Eina.StringConversion.NativeUtf8ToManagedString(_internal_struct.Text); return _external_struct; } } #pragma warning restore CS1591 } } }