1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
12 /// <summary>Efl Ui Theme class</summary>
13 [Efl.Ui.Theme.NativeMethods]
14 [Efl.Eo.BindingEntity]
15 public class Theme : Efl.Object
17 ///<summary>Pointer to the native class description.</summary>
18 public override System.IntPtr NativeClass
22 if (((object)this).GetType() == typeof(Theme))
24 return GetEflClassStatic();
28 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
33 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
34 efl_ui_theme_class_get();
35 /// <summary>Initializes a new instance of the <see cref="Theme"/> class.</summary>
36 /// <param name="parent">Parent instance.</param>
37 public Theme(Efl.Object parent= null
38 ) : base(efl_ui_theme_class_get(), parent)
40 FinishInstantiation();
43 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
44 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
45 protected Theme(ConstructingHandle ch) : base(ch)
49 /// <summary>Initializes a new instance of the <see cref="Theme"/> class.
50 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
51 /// <param name="wh">The native pointer to be wrapped.</param>
52 protected Theme(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
56 /// <summary>Initializes a new instance of the <see cref="Theme"/> class.
57 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
58 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
59 /// <param name="parent">The Efl.Object parent of this instance.</param>
60 protected Theme(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
64 /// <summary>Gets the default theme handle.</summary>
65 /// <returns>The default theme handle</returns>
66 public static Efl.Ui.Theme GetDefault() {
67 var _ret_var = Efl.Ui.Theme.NativeMethods.efl_ui_theme_default_get_ptr.Value.Delegate();
68 Eina.Error.RaiseIfUnhandledException();
71 /// <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>
72 /// <param name="item">The Edje file path to be used</param>
73 virtual public void AddExtension(System.String item) {
74 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);
75 Eina.Error.RaiseIfUnhandledException();
77 /// <summary>Deletes a theme extension from the list of extensions.</summary>
78 /// <param name="item">The Edje file path not to be used</param>
79 virtual public void DelExtension(System.String item) {
80 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);
81 Eina.Error.RaiseIfUnhandledException();
83 /// <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>
84 /// <param name="item">The Edje file path to be used</param>
85 virtual public void AddOverlay(System.String item) {
86 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);
87 Eina.Error.RaiseIfUnhandledException();
89 /// <summary>Delete a theme overlay from the list of overlays.</summary>
90 /// <param name="item">The Edje file path not to be used</param>
91 virtual public void DelOverlay(System.String item) {
92 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);
93 Eina.Error.RaiseIfUnhandledException();
95 /// <summary>This is the default theme.
96 /// All widgets use the default theme implicitly unless a specific theme is set.</summary>
97 /// <value>The default theme handle</value>
98 public static Efl.Ui.Theme Default {
99 get { return GetDefault(); }
101 private static IntPtr GetEflClassStatic()
103 return Efl.Ui.Theme.efl_ui_theme_class_get();
105 /// <summary>Wrapper for native methods and virtual method delegates.
106 /// For internal use by generated code only.</summary>
107 public new class NativeMethods : Efl.Object.NativeMethods
109 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
110 /// <summary>Gets the list of Eo operations to override.</summary>
111 /// <returns>The list of Eo operations to be overload.</returns>
112 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
114 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
115 var methods = Efl.Eo.Globals.GetUserMethods(type);
117 if (efl_ui_theme_extension_add_static_delegate == null)
119 efl_ui_theme_extension_add_static_delegate = new efl_ui_theme_extension_add_delegate(extension_add);
122 if (methods.FirstOrDefault(m => m.Name == "AddExtension") != null)
124 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) });
127 if (efl_ui_theme_extension_del_static_delegate == null)
129 efl_ui_theme_extension_del_static_delegate = new efl_ui_theme_extension_del_delegate(extension_del);
132 if (methods.FirstOrDefault(m => m.Name == "DelExtension") != null)
134 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) });
137 if (efl_ui_theme_overlay_add_static_delegate == null)
139 efl_ui_theme_overlay_add_static_delegate = new efl_ui_theme_overlay_add_delegate(overlay_add);
142 if (methods.FirstOrDefault(m => m.Name == "AddOverlay") != null)
144 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) });
147 if (efl_ui_theme_overlay_del_static_delegate == null)
149 efl_ui_theme_overlay_del_static_delegate = new efl_ui_theme_overlay_del_delegate(overlay_del);
152 if (methods.FirstOrDefault(m => m.Name == "DelOverlay") != null)
154 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) });
157 descs.AddRange(base.GetEoOps(type));
160 /// <summary>Returns the Eo class for the native methods of this class.</summary>
161 /// <returns>The native class pointer.</returns>
162 public override IntPtr GetEflClass()
164 return Efl.Ui.Theme.efl_ui_theme_class_get();
167 #pragma warning disable CA1707, CS1591, SA1300, SA1600
169 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
170 private delegate Efl.Ui.Theme efl_ui_theme_default_get_delegate();
172 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
173 public delegate Efl.Ui.Theme efl_ui_theme_default_get_api_delegate();
175 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");
177 private static Efl.Ui.Theme default_get(System.IntPtr obj, System.IntPtr pd)
179 Eina.Log.Debug("function efl_ui_theme_default_get was called");
180 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
183 Efl.Ui.Theme _ret_var = default(Efl.Ui.Theme);
186 _ret_var = Theme.GetDefault();
190 Eina.Log.Warning($"Callback error: {e.ToString()}");
191 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
199 return efl_ui_theme_default_get_ptr.Value.Delegate();
204 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);
207 public delegate void efl_ui_theme_extension_add_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item);
209 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");
211 private static void extension_add(System.IntPtr obj, System.IntPtr pd, System.String item)
213 Eina.Log.Debug("function efl_ui_theme_extension_add was called");
214 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
220 ((Theme)ws.Target).AddExtension(item);
224 Eina.Log.Warning($"Callback error: {e.ToString()}");
225 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
232 efl_ui_theme_extension_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), item);
236 private static efl_ui_theme_extension_add_delegate efl_ui_theme_extension_add_static_delegate;
239 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);
242 public delegate void efl_ui_theme_extension_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item);
244 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");
246 private static void extension_del(System.IntPtr obj, System.IntPtr pd, System.String item)
248 Eina.Log.Debug("function efl_ui_theme_extension_del was called");
249 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
255 ((Theme)ws.Target).DelExtension(item);
259 Eina.Log.Warning($"Callback error: {e.ToString()}");
260 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
267 efl_ui_theme_extension_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), item);
271 private static efl_ui_theme_extension_del_delegate efl_ui_theme_extension_del_static_delegate;
274 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);
277 public delegate void efl_ui_theme_overlay_add_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item);
279 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");
281 private static void overlay_add(System.IntPtr obj, System.IntPtr pd, System.String item)
283 Eina.Log.Debug("function efl_ui_theme_overlay_add was called");
284 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
290 ((Theme)ws.Target).AddOverlay(item);
294 Eina.Log.Warning($"Callback error: {e.ToString()}");
295 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
302 efl_ui_theme_overlay_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), item);
306 private static efl_ui_theme_overlay_add_delegate efl_ui_theme_overlay_add_static_delegate;
309 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);
312 public delegate void efl_ui_theme_overlay_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String item);
314 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");
316 private static void overlay_del(System.IntPtr obj, System.IntPtr pd, System.String item)
318 Eina.Log.Debug("function efl_ui_theme_overlay_del was called");
319 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
325 ((Theme)ws.Target).DelOverlay(item);
329 Eina.Log.Warning($"Callback error: {e.ToString()}");
330 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
337 efl_ui_theme_overlay_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), item);
341 private static efl_ui_theme_overlay_del_delegate efl_ui_theme_overlay_del_static_delegate;
343 #pragma warning restore CA1707, CS1591, SA1300, SA1600