#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 { /// Efl Ui Theme class /// This is a BETA class. It can be modified or removed in the future. Do not use it for product development. [Efl.Ui.Theme.NativeMethods] [Efl.Eo.BindingEntity] public class Theme : Efl.Object { /// Pointer to the native class description. public override System.IntPtr NativeClass { get { if (((object)this).GetType() == typeof(Theme)) { return GetEflClassStatic(); } else { return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()]; } } } [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr efl_ui_theme_class_get(); /// Initializes a new instance of the class. /// Parent instance. public Theme(Efl.Object parent= null ) : base(efl_ui_theme_class_get(), parent) { FinishInstantiation(); } /// 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. protected Theme(ConstructingHandle ch) : base(ch) { } /// Initializes a new instance of the class. /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly. /// The native pointer to be wrapped. protected Theme(Efl.Eo.Globals.WrappingHandle wh) : base(wh) { } /// Initializes a new instance of the class. /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly. /// The pointer to the base native Eo class. /// The Efl.Object parent of this instance. protected Theme(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent) { } /// Gets the default theme handle. /// The default theme handle public static Efl.Ui.Theme GetDefault() { var _ret_var = Efl.Ui.Theme.NativeMethods.efl_ui_theme_default_get_ptr.Value.Delegate(); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } /// Appends a theme extension to the list of extensions. This is intended when an application needs more styles of widgets or new widget themes that the default does not provide (or may not provide). The application has "extended" usage by coming up with new custom style names for widgets for specific uses, but as these are not "standard", they are not guaranteed to be provided by a default theme. This means the application is required to provide these extra elements itself in specific Edje files. This call adds one of those Edje files to the theme search path to be searched after the default theme. The use of this call is encouraged when default styles do not meet the needs of the application. Use this call instead of for almost all cases. /// The Edje file path to be used virtual public void AddExtension(System.String item) { Efl.Ui.Theme.NativeMethods.efl_ui_theme_extension_add_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),item); Eina.Error.RaiseIfUnhandledException(); } /// Deletes a theme extension from the list of extensions. /// The Edje file path not to be used virtual public void DelExtension(System.String item) { Efl.Ui.Theme.NativeMethods.efl_ui_theme_extension_del_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),item); Eina.Error.RaiseIfUnhandledException(); } /// Prepends a theme overlay to the list of overlays. Use this if your application needs to provide some custom overlay theme (An Edje file that replaces some default styles of widgets) where adding new styles, or changing system theme configuration is not possible. Do NOT use this instead of a proper system theme configuration. Use proper configuration files, profiles, environment variables etc. to set a theme so that the theme can be altered by simple configuration by a user. Using this call to achieve that effect is abusing the API and will create lots of trouble. /// The Edje file path to be used virtual public void AddOverlay(System.String item) { Efl.Ui.Theme.NativeMethods.efl_ui_theme_overlay_add_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),item); Eina.Error.RaiseIfUnhandledException(); } /// Delete a theme overlay from the list of overlays. /// The Edje file path not to be used virtual public void DelOverlay(System.String item) { Efl.Ui.Theme.NativeMethods.efl_ui_theme_overlay_del_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),item); Eina.Error.RaiseIfUnhandledException(); } /// This is the default theme. /// All widgets use the default theme implicitly unless a specific theme is set. /// The default theme handle public static Efl.Ui.Theme Default { get { return GetDefault(); } } private static IntPtr GetEflClassStatic() { return Efl.Ui.Theme.efl_ui_theme_class_get(); } /// Wrapper for native methods and virtual method delegates. /// For internal use by generated code only. public new class NativeMethods : Efl.Object.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_theme_extension_add_static_delegate == null) { efl_ui_theme_extension_add_static_delegate = new efl_ui_theme_extension_add_delegate(extension_add); } if (methods.FirstOrDefault(m => m.Name == "AddExtension") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_theme_extension_add"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_theme_extension_add_static_delegate) }); } if (efl_ui_theme_extension_del_static_delegate == null) { efl_ui_theme_extension_del_static_delegate = new efl_ui_theme_extension_del_delegate(extension_del); } if (methods.FirstOrDefault(m => m.Name == "DelExtension") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_theme_extension_del"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_theme_extension_del_static_delegate) }); } if (efl_ui_theme_overlay_add_static_delegate == null) { efl_ui_theme_overlay_add_static_delegate = new efl_ui_theme_overlay_add_delegate(overlay_add); } if (methods.FirstOrDefault(m => m.Name == "AddOverlay") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_theme_overlay_add"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_theme_overlay_add_static_delegate) }); } if (efl_ui_theme_overlay_del_static_delegate == null) { efl_ui_theme_overlay_del_static_delegate = new efl_ui_theme_overlay_del_delegate(overlay_del); } if (methods.FirstOrDefault(m => m.Name == "DelOverlay") != null) { descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_theme_overlay_del"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_theme_overlay_del_static_delegate) }); } descs.AddRange(base.GetEoOps(type)); return descs; } /// Returns the Eo class for the native methods of this class. /// The native class pointer. public override IntPtr GetEflClass() { return Efl.Ui.Theme.efl_ui_theme_class_get(); } #pragma warning disable CA1707, CS1591, SA1300, SA1600 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo))] private delegate Efl.Ui.Theme efl_ui_theme_default_get_delegate(); [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo))] public delegate Efl.Ui.Theme efl_ui_theme_default_get_api_delegate(); public static Efl.Eo.FunctionWrapper efl_ui_theme_default_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_theme_default_get"); private static Efl.Ui.Theme default_get(System.IntPtr obj, System.IntPtr pd) { Eina.Log.Debug("function efl_ui_theme_default_get was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { Efl.Ui.Theme _ret_var = default(Efl.Ui.Theme); try { _ret_var = Theme.GetDefault(); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } return _ret_var; } else { return efl_ui_theme_default_get_ptr.Value.Delegate(); } } private delegate void efl_ui_theme_extension_add_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item); public delegate void efl_ui_theme_extension_add_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item); public static Efl.Eo.FunctionWrapper efl_ui_theme_extension_add_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_theme_extension_add"); private static void extension_add(System.IntPtr obj, System.IntPtr pd, System.String item) { Eina.Log.Debug("function efl_ui_theme_extension_add was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { try { ((Theme)ws.Target).AddExtension(item); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } else { efl_ui_theme_extension_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), item); } } private static efl_ui_theme_extension_add_delegate efl_ui_theme_extension_add_static_delegate; private delegate void efl_ui_theme_extension_del_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item); public delegate void efl_ui_theme_extension_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item); public static Efl.Eo.FunctionWrapper efl_ui_theme_extension_del_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_theme_extension_del"); private static void extension_del(System.IntPtr obj, System.IntPtr pd, System.String item) { Eina.Log.Debug("function efl_ui_theme_extension_del was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { try { ((Theme)ws.Target).DelExtension(item); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } else { efl_ui_theme_extension_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), item); } } private static efl_ui_theme_extension_del_delegate efl_ui_theme_extension_del_static_delegate; private delegate void efl_ui_theme_overlay_add_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item); public delegate void efl_ui_theme_overlay_add_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item); public static Efl.Eo.FunctionWrapper efl_ui_theme_overlay_add_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_theme_overlay_add"); private static void overlay_add(System.IntPtr obj, System.IntPtr pd, System.String item) { Eina.Log.Debug("function efl_ui_theme_overlay_add was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { try { ((Theme)ws.Target).AddOverlay(item); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } else { efl_ui_theme_overlay_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), item); } } private static efl_ui_theme_overlay_add_delegate efl_ui_theme_overlay_add_static_delegate; private delegate void efl_ui_theme_overlay_del_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item); public delegate void efl_ui_theme_overlay_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item); public static Efl.Eo.FunctionWrapper efl_ui_theme_overlay_del_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_ui_theme_overlay_del"); private static void overlay_del(System.IntPtr obj, System.IntPtr pd, System.String item) { Eina.Log.Debug("function efl_ui_theme_overlay_del was called"); var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); if (ws != null) { try { ((Theme)ws.Target).DelOverlay(item); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } else { efl_ui_theme_overlay_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), item); } } private static efl_ui_theme_overlay_del_delegate efl_ui_theme_overlay_del_static_delegate; #pragma warning restore CA1707, CS1591, SA1300, SA1600 } } } } #if EFL_BETA #pragma warning disable CS1591 public static class Efl_UiTheme_ExtensionMethods { } #pragma warning restore CS1591 #endif