2 #pragma warning disable CS1591
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
7 using System.Threading;
8 using System.ComponentModel;
13 /// <summary>Efl Ui Theme class</summary>
14 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
15 [Efl.Ui.Theme.NativeMethods]
16 [Efl.Eo.BindingEntity]
17 public class Theme : Efl.Object
19 /// <summary>Pointer to the native class description.</summary>
20 public override System.IntPtr NativeClass
24 if (((object)this).GetType() == typeof(Theme))
26 return GetEflClassStatic();
30 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
35 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
36 efl_ui_theme_class_get();
37 /// <summary>Initializes a new instance of the <see cref="Theme"/> class.</summary>
38 /// <param name="parent">Parent instance.</param>
39 public Theme(Efl.Object parent= null
40 ) : base(efl_ui_theme_class_get(), parent)
42 FinishInstantiation();
45 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
46 /// Do not call this constructor directly.</summary>
47 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
48 protected Theme(ConstructingHandle ch) : base(ch)
52 /// <summary>Initializes a new instance of the <see cref="Theme"/> class.
53 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
54 /// <param name="wh">The native pointer to be wrapped.</param>
55 protected Theme(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
59 /// <summary>Initializes a new instance of the <see cref="Theme"/> class.
60 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
61 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
62 /// <param name="parent">The Efl.Object parent of this instance.</param>
63 protected Theme(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
67 /// <summary>Gets the default theme handle.</summary>
68 /// <returns>The default theme handle</returns>
69 public static Efl.Ui.Theme GetDefault() {
70 var _ret_var = Efl.Ui.Theme.NativeMethods.efl_ui_theme_default_get_ptr.Value.Delegate();
71 Eina.Error.RaiseIfUnhandledException();
74 /// <summary>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 <see cref="Efl.Ui.Theme.AddOverlay"/> for almost all cases.</summary>
75 /// <param name="item">The Edje file path to be used</param>
76 virtual public void AddExtension(System.String item) {
77 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);
78 Eina.Error.RaiseIfUnhandledException();
80 /// <summary>Deletes a theme extension from the list of extensions.</summary>
81 /// <param name="item">The Edje file path not to be used</param>
82 virtual public void DelExtension(System.String item) {
83 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);
84 Eina.Error.RaiseIfUnhandledException();
86 /// <summary>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.</summary>
87 /// <param name="item">The Edje file path to be used</param>
88 virtual public void AddOverlay(System.String item) {
89 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);
90 Eina.Error.RaiseIfUnhandledException();
92 /// <summary>Delete a theme overlay from the list of overlays.</summary>
93 /// <param name="item">The Edje file path not to be used</param>
94 virtual public void DelOverlay(System.String item) {
95 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);
96 Eina.Error.RaiseIfUnhandledException();
98 /// <summary>This is the default theme.
99 /// All widgets use the default theme implicitly unless a specific theme is set.</summary>
100 /// <value>The default theme handle</value>
101 public static Efl.Ui.Theme Default {
102 get { return GetDefault(); }
104 private static IntPtr GetEflClassStatic()
106 return Efl.Ui.Theme.efl_ui_theme_class_get();
108 /// <summary>Wrapper for native methods and virtual method delegates.
109 /// For internal use by generated code only.</summary>
110 public new class NativeMethods : Efl.Object.NativeMethods
112 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
113 /// <summary>Gets the list of Eo operations to override.</summary>
114 /// <returns>The list of Eo operations to be overload.</returns>
115 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
117 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
118 var methods = Efl.Eo.Globals.GetUserMethods(type);
120 if (efl_ui_theme_extension_add_static_delegate == null)
122 efl_ui_theme_extension_add_static_delegate = new efl_ui_theme_extension_add_delegate(extension_add);
125 if (methods.FirstOrDefault(m => m.Name == "AddExtension") != null)
127 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) });
130 if (efl_ui_theme_extension_del_static_delegate == null)
132 efl_ui_theme_extension_del_static_delegate = new efl_ui_theme_extension_del_delegate(extension_del);
135 if (methods.FirstOrDefault(m => m.Name == "DelExtension") != null)
137 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) });
140 if (efl_ui_theme_overlay_add_static_delegate == null)
142 efl_ui_theme_overlay_add_static_delegate = new efl_ui_theme_overlay_add_delegate(overlay_add);
145 if (methods.FirstOrDefault(m => m.Name == "AddOverlay") != null)
147 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) });
150 if (efl_ui_theme_overlay_del_static_delegate == null)
152 efl_ui_theme_overlay_del_static_delegate = new efl_ui_theme_overlay_del_delegate(overlay_del);
155 if (methods.FirstOrDefault(m => m.Name == "DelOverlay") != null)
157 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) });
160 descs.AddRange(base.GetEoOps(type));
163 /// <summary>Returns the Eo class for the native methods of this class.</summary>
164 /// <returns>The native class pointer.</returns>
165 public override IntPtr GetEflClass()
167 return Efl.Ui.Theme.efl_ui_theme_class_get();
170 #pragma warning disable CA1707, CS1591, SA1300, SA1600
172 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
173 private delegate Efl.Ui.Theme efl_ui_theme_default_get_delegate();
175 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
176 public delegate Efl.Ui.Theme efl_ui_theme_default_get_api_delegate();
178 public static Efl.Eo.FunctionWrapper<efl_ui_theme_default_get_api_delegate> efl_ui_theme_default_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_theme_default_get_api_delegate>(Module, "efl_ui_theme_default_get");
180 private static Efl.Ui.Theme default_get(System.IntPtr obj, System.IntPtr pd)
182 Eina.Log.Debug("function efl_ui_theme_default_get was called");
183 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
186 Efl.Ui.Theme _ret_var = default(Efl.Ui.Theme);
189 _ret_var = Theme.GetDefault();
193 Eina.Log.Warning($"Callback error: {e.ToString()}");
194 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
202 return efl_ui_theme_default_get_ptr.Value.Delegate();
207 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);
210 public delegate void efl_ui_theme_extension_add_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item);
212 public static Efl.Eo.FunctionWrapper<efl_ui_theme_extension_add_api_delegate> efl_ui_theme_extension_add_ptr = new Efl.Eo.FunctionWrapper<efl_ui_theme_extension_add_api_delegate>(Module, "efl_ui_theme_extension_add");
214 private static void extension_add(System.IntPtr obj, System.IntPtr pd, System.String item)
216 Eina.Log.Debug("function efl_ui_theme_extension_add was called");
217 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
223 ((Theme)ws.Target).AddExtension(item);
227 Eina.Log.Warning($"Callback error: {e.ToString()}");
228 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
235 efl_ui_theme_extension_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), item);
239 private static efl_ui_theme_extension_add_delegate efl_ui_theme_extension_add_static_delegate;
242 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);
245 public delegate void efl_ui_theme_extension_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item);
247 public static Efl.Eo.FunctionWrapper<efl_ui_theme_extension_del_api_delegate> efl_ui_theme_extension_del_ptr = new Efl.Eo.FunctionWrapper<efl_ui_theme_extension_del_api_delegate>(Module, "efl_ui_theme_extension_del");
249 private static void extension_del(System.IntPtr obj, System.IntPtr pd, System.String item)
251 Eina.Log.Debug("function efl_ui_theme_extension_del was called");
252 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
258 ((Theme)ws.Target).DelExtension(item);
262 Eina.Log.Warning($"Callback error: {e.ToString()}");
263 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
270 efl_ui_theme_extension_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), item);
274 private static efl_ui_theme_extension_del_delegate efl_ui_theme_extension_del_static_delegate;
277 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);
280 public delegate void efl_ui_theme_overlay_add_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item);
282 public static Efl.Eo.FunctionWrapper<efl_ui_theme_overlay_add_api_delegate> efl_ui_theme_overlay_add_ptr = new Efl.Eo.FunctionWrapper<efl_ui_theme_overlay_add_api_delegate>(Module, "efl_ui_theme_overlay_add");
284 private static void overlay_add(System.IntPtr obj, System.IntPtr pd, System.String item)
286 Eina.Log.Debug("function efl_ui_theme_overlay_add was called");
287 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
293 ((Theme)ws.Target).AddOverlay(item);
297 Eina.Log.Warning($"Callback error: {e.ToString()}");
298 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
305 efl_ui_theme_overlay_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), item);
309 private static efl_ui_theme_overlay_add_delegate efl_ui_theme_overlay_add_static_delegate;
312 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);
315 public delegate void efl_ui_theme_overlay_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item);
317 public static Efl.Eo.FunctionWrapper<efl_ui_theme_overlay_del_api_delegate> efl_ui_theme_overlay_del_ptr = new Efl.Eo.FunctionWrapper<efl_ui_theme_overlay_del_api_delegate>(Module, "efl_ui_theme_overlay_del");
319 private static void overlay_del(System.IntPtr obj, System.IntPtr pd, System.String item)
321 Eina.Log.Debug("function efl_ui_theme_overlay_del was called");
322 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
328 ((Theme)ws.Target).DelOverlay(item);
332 Eina.Log.Warning($"Callback error: {e.ToString()}");
333 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
340 efl_ui_theme_overlay_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), item);
344 private static efl_ui_theme_overlay_del_delegate efl_ui_theme_overlay_del_static_delegate;
346 #pragma warning restore CA1707, CS1591, SA1300, SA1600
355 #pragma warning disable CS1591
356 public static class Efl_UiTheme_ExtensionMethods {
359 #pragma warning restore CS1591