From 1f0b5f529ea94a903d8c9e9898560f876182658e Mon Sep 17 00:00:00 2001 From: Lleyton Gray Date: Thu, 15 Aug 2024 10:39:40 -0700 Subject: [PATCH 1/3] regenrate bindings --- He-1.gir | 3208 ++++++++++++------------- libhelium/Gir.toml | 11 +- libhelium/src/application.rs | 6 +- libhelium/src/auto/app_bar.rs | 46 + libhelium/src/auto/application.rs | 149 +- libhelium/src/auto/button.rs | 51 +- libhelium/src/auto/cam16_color.rs | 17 + libhelium/src/auto/color_lch_color.rs | 17 - libhelium/src/auto/color_rgb_color.rs | 17 - libhelium/src/auto/color_xyz_color.rs | 17 - libhelium/src/auto/desktop.rs | 89 +- libhelium/src/auto/enums.rs | 208 -- libhelium/src/auto/hct_color.rs | 17 + libhelium/src/auto/lab_color.rs | 25 + libhelium/src/auto/lch_color.rs | 17 + libhelium/src/auto/mod.rs | 23 +- libhelium/src/auto/rgb_color.rs | 17 + libhelium/src/auto/xyz_color.rs | 17 + libhelium/sys/src/lib.rs | 890 ++----- libhelium/sys/tests/abi.rs | 208 +- libhelium/sys/tests/constant.c | 15 +- libhelium/sys/tests/layout.c | 31 +- 22 files changed, 2231 insertions(+), 2865 deletions(-) create mode 100644 libhelium/src/auto/cam16_color.rs delete mode 100644 libhelium/src/auto/color_lch_color.rs delete mode 100644 libhelium/src/auto/color_rgb_color.rs delete mode 100644 libhelium/src/auto/color_xyz_color.rs create mode 100644 libhelium/src/auto/hct_color.rs create mode 100644 libhelium/src/auto/lab_color.rs create mode 100644 libhelium/src/auto/lch_color.rs create mode 100644 libhelium/src/auto/rgb_color.rs create mode 100644 libhelium/src/auto/xyz_color.rs diff --git a/He-1.gir b/He-1.gir index 93a7574..ce8bce1 100755 --- a/He-1.gir +++ b/He-1.gir @@ -1,262 +1,177 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + + + + + + + + + + + + + + + - + - + + + - - + + - + - + - - + + - - + + - - + + - + - - + + - + - - - + - - - - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + + + - + + + + + + - - - - - - - - - + + - - + + + + - - - - - - - - + - - + + - - - + + + - - + + - - + + + + + - + - + - + - + - + @@ -264,154 +179,226 @@ - - - + + + - - - - - - - + - - - - + - + + + - - + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + + + + + + + + - + - + - + - + + + + + + + + + + + + + + + + + + - + - + - + - - + + - + - + - + - + - + + + + + + + + - + - - - + + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + - + - - + + - + + + + - + - + - - + + - - + + - - + + - + - + @@ -424,1036 +411,378 @@ - + - + + + - + - - + + - - + + - + - + - + - + - + - + - + + + - + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - + + + + + - - + + - - + + + + + - - - + + + + + - - + + - - + + + + + - - - + + + - - - - - + + - - - + + + - - - - - + + - - - + + + - - - - - + + - - - + + + - - - - - + + - - - + + + - - + + - - + + + + + - - - + + <para>An useful method for finding an ancestor of a given widget.</para> + + - - + + - - + + - - - - - - - - - + + - - + + <para>The widget to find the ancestor of. </para> + - - - + + <para>Gives the contrast ratio between two colors.</para> + +Since: 1.0 + + - - + + <para>The red component of the background color. </para> + - - + + <para>The green component of the background color. </para> + + + + <para>The blue component of the background color. </para> + + + + <para>The red component of the foreground color. </para> + + + + <para>The green component of the foreground color. </para> + + + + <para>The blue component of the foreground color. </para> + - - - + + <para>Gives a contrasting foreground color for a given background color.</para> + +Since: 1.0 + + + + - - + + <para>The red component of the background color. </para> + - - + + <para>The green component of the background color. </para> + + + + <para>The blue component of the background color. </para> + + + + <para>The red component of the foreground color. </para> + + + + <para>The green component of the foreground color. </para> + + + + <para>The blue component of the foreground color. </para> + + + + - - - + + <para>Converts a <function>gtk_accelerator_parse</function> style accel string to a human-readable string.</para> + + <para>a human-readable string like &quot;Ctrl + A&quot; or &quot;⯁ + →&quot; </para> + - + + <para>an accelerator label like “&lt;Control&gt;a” or “&lt;Super&gt;Right” </para> - - - - - - + + <para>Takes a description and an array of accels and returns Pango markup for use in a <type>GtkTooltip</type>. This method uses <function>he_misc_accel_label</function> +.</para> +<para>Example:</para> +<para>Description Shortcut 1, Shortcut 2</para> + + <para>Pango markup with the description label on one line and a list of human-readable accels on a new line </para> + - + + <para>string array of accelerator labels like {&quot;&lt;Control&gt;a&quot;, &quot;&lt;Super&gt;Right&quot;} </para> + + + + + - - + + <para>a standard tooltip text string </para> + - - - + + + + + + + + + + + + + <para>An enum that maps colors to internal CSS classes as per HIG.</para> + + + + + + + + + + + + + + + + <para>Returns the CSS class name for the color.</para> + + - - - - - - + + + - + + <para>Returns the color name.</para> + +Since: 1.0 - + - - - + + + - - - + + <para>A TipViewStyle changes the visual look of a tip.</para> + + + + + + + - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <para>An useful method for finding an ancestor of a given widget.</para> - - - - - - - - - - - - - - - <para>The widget to find the ancestor of. </para> - - - - - - <para>Gives the contrast ratio between two colors.</para> - -Since: 1.0 - - - - - - <para>The red component of the background color. </para> - - - - <para>The green component of the background color. </para> - - - - <para>The blue component of the background color. </para> - - - - <para>The red component of the foreground color. </para> - - - - <para>The green component of the foreground color. </para> - - - - <para>The blue component of the foreground color. </para> - - - - - - <para>Gives a contrasting foreground color for a given background color.</para> - -Since: 1.0 - - - - - - - - <para>The red component of the background color. </para> - - - - <para>The green component of the background color. </para> - - - - <para>The blue component of the background color. </para> - - - - <para>The red component of the foreground color. </para> - - - - <para>The green component of the foreground color. </para> - - - - <para>The blue component of the foreground color. </para> - - - - - - - - - <para>Converts a <function>gtk_accelerator_parse</function> style accel string to a human-readable string.</para> - - <para>a human-readable string like &quot;Ctrl + A&quot; or &quot;⯁ + →&quot; </para> - - - - - <para>an accelerator label like “&lt;Control&gt;a” or “&lt;Super&gt;Right” </para> - - - - - - <para>Takes a description and an array of accels and returns Pango markup for use in a <type>GtkTooltip</type>. This method uses <function>he_misc_accel_label</function> -.</para> -<para>Example:</para> -<para>Description Shortcut 1, Shortcut 2</para> - - <para>Pango markup with the description label on one line and a list of human-readable accels on a new line </para> - - - - - <para>string array of accelerator labels like {&quot;&lt;Control&gt;a&quot;, &quot;&lt;Super&gt;Right&quot;} </para> - - - - - - - - - <para>a standard tooltip text string </para> - - - - - - - - - - - - - - - - - <para>An enum that maps colors to internal CSS classes as per HIG.</para> - - - - - - - - - - - - - - - - <para>Returns the CSS class name for the color.</para> - - - - - - - - - - - <para>Returns the color name.</para> - -Since: 1.0 - - - - - - - - - - - <para>A TipViewStyle changes the visual look of a tip.</para> - - - - - - - - - - - - - - - - - + + + @@ -1461,6 +790,20 @@ Since: 1.0 + + + + + + + + + + + + + + @@ -2513,11 +1856,11 @@ Since: 1.0 - + - + @@ -2534,7 +1877,7 @@ Since: 1.0 - + @@ -2564,12 +1907,87 @@ Since: 1.0 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -2586,7 +2004,7 @@ Since: 1.0 - + @@ -2790,126 +2208,6 @@ Since: 1.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <para>A class that manages the style of the application in conjunction with the provided preferences. This is a low-level class that should not be used directly. Instead, let the `He.Application` class manage this for you.</para> @@ -2921,7 +2219,7 @@ used directly. Instead, let the `He.Application` class manage this for you.</ <para>The preferred accent color. If null, a default accent color will be chosen based on the color scheme.</para> - + <para>The preferred font weight.</para> @@ -2936,12 +2234,12 @@ used directly. Instead, let the `He.Application` class manage this for you.</ - <para>Whether to apply styles for contrast modes. 1.0 = low, 2.0 = default, 3.0 = medium, 4.0 = high</para> + <para>Whether to apply styles for contrast modes. -1.0 = low, 0.0 = default, 0.5 = medium, 1.0 = high</para> - + <para>A function that returns a color scheme from a given accent color and whether dark mode is enabled.</para> - + <para>Runs all the necessary updates to apply the current style. If is_registered is false, this will do nothing.</para> @@ -3510,12 +2808,12 @@ title bar can be made always visible. Has an optional back button. The back butt - - + + - + - + @@ -3524,11 +2822,11 @@ title bar can be made always visible. Has an optional back button. The back butt - + - + @@ -3545,7 +2843,7 @@ title bar can be made always visible. Has an optional back button. The back butt - + @@ -3630,96 +2928,16 @@ title bar can be made always visible. Has an optional back button. The back butt - - - - - - <para>The color scheme preference enum, which is used to determine the color scheme of the desktop.</para> - - - - - - <para>The Ensor scheme preference enum, which is used to determine the Ensor scheme of the desktop.</para> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + <para>The color scheme preference enum, which is used to determine the color scheme of the desktop.</para> + + + + @@ -4071,12 +3289,40 @@ area of the cube.</para> - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4085,30 +3331,41 @@ area of the cube.</para> - + - - - - - + + + - - + + + + + + + + + + + + + + + - + - - - + + + @@ -4120,12 +3377,9 @@ area of the cube.</para> - - - - + @@ -4133,21 +3387,50 @@ area of the cube.</para> - - - - + - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5073,6 +4356,32 @@ Since: 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + <para>The title to the left on the AppBar.</para> @@ -6225,7 +5534,7 @@ Since: 1.0 - + @@ -6464,10 +5773,10 @@ Since: 1.0 - + - + @@ -6477,7 +5786,7 @@ Since: 1.0 - + @@ -6874,7 +6183,9 @@ Since: 1.0 - <para>The height of the image.</para> + <para>The height of the image.</para> + +Since: 1.0 @@ -11894,296 +11205,839 @@ Since: 1.0 - - <para>Add a child to the welcome screen, should only be used in the context of a UI or Blueprint file. There should be no need to use this method in -code.</para> + + <para>Add a child to the welcome screen, should only be used in the context of a UI or Blueprint file. There should be no need to use this method in +code.</para> + + + + + + + + + + + + + + + + + + + + <para>Construct a new WelcomeScreen.</para> + +Since: 1.0 + + + + + + <para>The name of the application. </para> + + + + <para>The application description. </para> + + + + + + <para>The name of the application.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>The application description.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - - - - - - - + + - - <para>Construct a new WelcomeScreen.</para> - -Since: 1.0 - - - - - - <para>The name of the application. </para> - - - - <para>The application description. </para> - - - - - - <para>The name of the application.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - <para>The application description.</para> + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <para>A SchemeFactory is a class which implements a method to generate a Scheme from an accent color and boolean representing whether the scheme is -dark or light. Prior runs of the generate method should not affect the output of future runs.</para> - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <para>A struct that contains the color scheme of the app.</para> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libhelium/Gir.toml b/libhelium/Gir.toml index 6b0a8db..303083c 100644 --- a/libhelium/Gir.toml +++ b/libhelium/Gir.toml @@ -18,14 +18,16 @@ trust_return_value_nullability = true external_libraries = ["GLib", "GObject", "Gdk", "GdkPixbuf", "Gtk", "Pango"] generate = [ - "He.ColorRGBColor", - "He.ColorXYZColor", - "He.ColorLCHColor", + "He.RGBColor", + "He.XYZColor", + "He.LCHColor", + "He.LABColor", + "He.CAM16Color", + "He.HCTColor", "He.Colors", "He.Bin", "He.ButtonContent", "He.Window", - "He.DesktopColorScheme", "He.AboutWindow", "He.AboutWindowLicenses", "He.AppBar", @@ -70,7 +72,6 @@ generate = [ "He.ViewChooser", "He.WelcomeScreen", "He.SegmentedButton", - "He.DesktopEnsorScheme", "He.ChipGroup", "He.DatePicker", "He.OverlayButtonTypeButton", diff --git a/libhelium/src/application.rs b/libhelium/src/application.rs index e46490d..0dfa4ae 100644 --- a/libhelium/src/application.rs +++ b/libhelium/src/application.rs @@ -1,6 +1,6 @@ // Borrowed from https://gitlab.gnome.org/World/Rust/libadwaita-rs/-/blob/master/libadwaita/src/application.rs -use crate::{Application, ColorRGBColor}; +use crate::{Application, RGBColor}; use glib::translate::*; use std::cell::RefCell; @@ -46,11 +46,11 @@ impl Application { pub trait ApplicationManual { #[doc(alias = "he_application_set_default_accent_color")] #[doc(alias = "default-accent-color")] - fn set_default_accent_color(&self, value: Option<&mut ColorRGBColor>); + fn set_default_accent_color(&self, value: Option<&mut RGBColor>); } impl> ApplicationManual for O { - fn set_default_accent_color(&self, mut value: Option<&mut ColorRGBColor>) { + fn set_default_accent_color(&self, mut value: Option<&mut RGBColor>) { unsafe { ffi::he_application_set_default_accent_color( self.as_ref().to_glib_none().0, diff --git a/libhelium/src/auto/app_bar.rs b/libhelium/src/auto/app_bar.rs index b829b11..6112e62 100644 --- a/libhelium/src/auto/app_bar.rs +++ b/libhelium/src/auto/app_bar.rs @@ -72,6 +72,12 @@ impl AppBarBuilder { } } + pub fn is_compact(self, is_compact: bool) -> Self { + Self { + builder: self.builder.property("is-compact", is_compact), + } + } + pub fn viewtitle_label(self, viewtitle_label: impl Into) -> Self { Self { builder: self @@ -386,6 +392,23 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { } } + #[doc(alias = "he_app_bar_get_is_compact")] + #[doc(alias = "get_is_compact")] + fn is_compact(&self) -> bool { + unsafe { + from_glib(ffi::he_app_bar_get_is_compact( + self.as_ref().to_glib_none().0, + )) + } + } + + #[doc(alias = "he_app_bar_set_is_compact")] + fn set_is_compact(&self, value: bool) { + unsafe { + ffi::he_app_bar_set_is_compact(self.as_ref().to_glib_none().0, value.into_glib()); + } + } + #[doc(alias = "he_app_bar_get_viewtitle_label")] #[doc(alias = "get_viewtitle_label")] fn viewtitle_label(&self) -> glib::GString { @@ -569,6 +592,29 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { } } + #[doc(alias = "is-compact")] + fn connect_is_compact_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_is_compact_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAppBar, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(AppBar::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::is-compact\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_is_compact_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + #[doc(alias = "viewtitle-label")] fn connect_viewtitle_label_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_viewtitle_label_trampoline< diff --git a/libhelium/src/auto/application.rs b/libhelium/src/auto/application.rs index 12e81c1..99099bc 100644 --- a/libhelium/src/auto/application.rs +++ b/libhelium/src/auto/application.rs @@ -3,7 +3,7 @@ // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi, ColorRGBColor}; +use crate::{ffi, RGBColor}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, @@ -48,7 +48,7 @@ impl ApplicationBuilder { } } - pub fn default_accent_color(self, default_accent_color: &ColorRGBColor) -> Self { + pub fn default_accent_color(self, default_accent_color: &RGBColor) -> Self { Self { builder: self .builder @@ -64,9 +64,27 @@ impl ApplicationBuilder { } } - //pub fn scheme_factory(self, scheme_factory: &impl IsA) -> Self { - // Self { builder: self.builder.property("scheme-factory", scheme_factory.clone().upcast()), } - //} + pub fn override_dark_style(self, override_dark_style: bool) -> Self { + Self { + builder: self + .builder + .property("override-dark-style", override_dark_style), + } + } + + pub fn override_contrast(self, override_contrast: bool) -> Self { + Self { + builder: self + .builder + .property("override-contrast", override_contrast), + } + } + + pub fn default_contrast(self, default_contrast: f64) -> Self { + Self { + builder: self.builder.property("default-contrast", default_contrast), + } + } pub fn menubar(self, menubar: &impl IsA) -> Self { Self { @@ -138,7 +156,7 @@ mod sealed { pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_application_get_default_accent_color")] #[doc(alias = "get_default_accent_color")] - fn default_accent_color(&self) -> Option { + fn default_accent_color(&self) -> Option { unsafe { from_glib_none(ffi::he_application_get_default_accent_color( self.as_ref().to_glib_none().0, @@ -166,14 +184,67 @@ pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { } } + #[doc(alias = "he_application_get_override_dark_style")] + #[doc(alias = "get_override_dark_style")] + fn is_override_dark_style(&self) -> bool { + unsafe { + from_glib(ffi::he_application_get_override_dark_style( + self.as_ref().to_glib_none().0, + )) + } + } + + #[doc(alias = "he_application_set_override_dark_style")] + fn set_override_dark_style(&self, value: bool) { + unsafe { + ffi::he_application_set_override_dark_style( + self.as_ref().to_glib_none().0, + value.into_glib(), + ); + } + } + + #[doc(alias = "he_application_get_override_contrast")] + #[doc(alias = "get_override_contrast")] + fn is_override_contrast(&self) -> bool { + unsafe { + from_glib(ffi::he_application_get_override_contrast( + self.as_ref().to_glib_none().0, + )) + } + } + + #[doc(alias = "he_application_set_override_contrast")] + fn set_override_contrast(&self, value: bool) { + unsafe { + ffi::he_application_set_override_contrast( + self.as_ref().to_glib_none().0, + value.into_glib(), + ); + } + } + + #[doc(alias = "he_application_get_default_contrast")] + #[doc(alias = "get_default_contrast")] + fn default_contrast(&self) -> f64 { + unsafe { ffi::he_application_get_default_contrast(self.as_ref().to_glib_none().0) } + } + + #[doc(alias = "he_application_set_default_contrast")] + fn set_default_contrast(&self, value: f64) { + unsafe { + ffi::he_application_set_default_contrast(self.as_ref().to_glib_none().0, value); + } + } + //#[doc(alias = "he_application_get_scheme_factory")] //#[doc(alias = "get_scheme_factory")] - //fn scheme_factory(&self) -> /*Ignored*/Option { + //fn scheme_factory(&self) -> /*Ignored*/Option { // unsafe { TODO: call ffi:he_application_get_scheme_factory() } //} //#[doc(alias = "he_application_set_scheme_factory")] - //fn set_scheme_factory(&self, value: /*Ignored*/Option<&SchemeFactory>) { + //fn set_scheme_factory(&self, value: /*Ignored*/Option) { // unsafe { TODO: call ffi:he_application_set_scheme_factory() } //} @@ -232,9 +303,61 @@ pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { } } - #[doc(alias = "scheme-factory")] - fn connect_scheme_factory_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_scheme_factory_trampoline< + #[doc(alias = "override-dark-style")] + fn connect_override_dark_style_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_override_dark_style_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::HeApplication, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(Application::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::override-dark-style\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_override_dark_style_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + #[doc(alias = "override-contrast")] + fn connect_override_contrast_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_override_contrast_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::HeApplication, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(Application::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::override-contrast\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_override_contrast_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + #[doc(alias = "default-contrast")] + fn connect_default_contrast_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_default_contrast_trampoline< P: IsA, F: Fn(&P) + 'static, >( @@ -249,9 +372,9 @@ pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, - b"notify::scheme-factory\0".as_ptr() as *const _, + b"notify::default-contrast\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( - notify_scheme_factory_trampoline:: as *const (), + notify_default_contrast_trampoline:: as *const (), )), Box_::into_raw(f), ) diff --git a/libhelium/src/auto/button.rs b/libhelium/src/auto/button.rs index a13881e..6b98936 100644 --- a/libhelium/src/auto/button.rs +++ b/libhelium/src/auto/button.rs @@ -24,12 +24,12 @@ impl Button { pub const NONE: Option<&'static Button> = None; #[doc(alias = "he_button_new")] - pub fn new(icon: Option<&str>, label: Option<&str>) -> Button { + pub fn new(icon: Option<&str>, text: Option<&str>) -> Button { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::he_button_new( icon.to_glib_none().0, - label.to_glib_none().0, + text.to_glib_none().0, )) } } @@ -119,9 +119,9 @@ impl ButtonBuilder { } } - pub fn label(self, label: impl Into) -> Self { + pub fn text(self, text: impl Into) -> Self { Self { - builder: self.builder.property("label", label.into()), + builder: self.builder.property("text", text.into()), } } @@ -151,6 +151,12 @@ impl ButtonBuilder { } } + pub fn label(self, label: impl Into) -> Self { + Self { + builder: self.builder.property("label", label.into()), + } + } + pub fn use_underline(self, use_underline: bool) -> Self { Self { builder: self.builder.property("use-underline", use_underline), @@ -488,16 +494,16 @@ pub trait HeButtonExt: IsA