From 0c940482a47ace5d4f35ded2fbacd2ba754e803b Mon Sep 17 00:00:00 2001 From: Lleyton Gray Date: Sun, 1 Sep 2024 20:10:37 -0700 Subject: [PATCH] libhelium: sync with latest GIR --- He-1.gir | 2711 +++++++++++++++-- libhelium/Gir.toml | 2 +- libhelium/src/auto/about_window.rs | 953 ++++-- libhelium/src/auto/animation.rs | 128 +- libhelium/src/auto/animation_target.rs | 9 +- libhelium/src/auto/app_bar.rs | 675 ++-- libhelium/src/auto/application.rs | 313 +- libhelium/src/auto/application_window.rs | 573 ++-- libhelium/src/auto/avatar.rs | 407 ++- libhelium/src/auto/badge.rs | 342 ++- libhelium/src/auto/banner.rs | 400 ++- libhelium/src/auto/bin.rs | 344 ++- libhelium/src/auto/bottom_bar.rs | 494 ++- libhelium/src/auto/bottom_sheet.rs | 534 ++-- libhelium/src/auto/button.rs | 647 ++-- libhelium/src/auto/button_content.rs | 358 ++- .../src/auto/callback_animation_target.rs | 23 +- libhelium/src/auto/cam16_color.rs | 4 +- libhelium/src/auto/chip.rs | 407 ++- libhelium/src/auto/chip_group.rs | 374 ++- libhelium/src/auto/content_block.rs | 514 +++- libhelium/src/auto/content_block_image.rs | 403 ++- .../src/auto/content_block_image_cluster.rs | 436 ++- libhelium/src/auto/content_list.rs | 379 ++- libhelium/src/auto/date_picker.rs | 733 +++-- libhelium/src/auto/desktop.rs | 248 +- libhelium/src/auto/dialog.rs | 676 ++-- libhelium/src/auto/divider.rs | 361 ++- libhelium/src/auto/dropdown.rs | 475 +-- libhelium/src/auto/empty_page.rs | 449 ++- libhelium/src/auto/enums.rs | 618 ++-- libhelium/src/auto/hct_color.rs | 4 +- libhelium/src/auto/lab_color.rs | 10 +- libhelium/src/auto/lch_color.rs | 4 +- libhelium/src/auto/mini_content_block.rs | 581 ++-- libhelium/src/auto/mod.rs | 3 +- libhelium/src/auto/modifier_badge.rs | 428 ++- libhelium/src/auto/navigation_rail.rs | 427 ++- libhelium/src/auto/navigation_section.rs | 377 ++- libhelium/src/auto/overlay_button.rs | 706 +++-- libhelium/src/auto/progress_bar.rs | 376 ++- .../src/auto/property_animation_target.rs | 126 +- libhelium/src/auto/rgb_color.rs | 4 +- libhelium/src/auto/segmented_button.rs | 343 ++- libhelium/src/auto/settings_list.rs | 379 ++- libhelium/src/auto/settings_page.rs | 338 +- libhelium/src/auto/settings_row.rs | 602 ++-- libhelium/src/auto/settings_window.rs | 521 ++-- libhelium/src/auto/side_bar.rs | 595 ++-- libhelium/src/auto/slider.rs | 404 ++- libhelium/src/auto/spring_animation.rs | 364 ++- libhelium/src/auto/spring_params.rs | 188 +- libhelium/src/auto/switch.rs | 361 ++- libhelium/src/auto/switch_bar.rs | 414 ++- libhelium/src/auto/tab.rs | 517 ++-- libhelium/src/auto/tab_page.rs | 338 +- libhelium/src/auto/tab_switcher.rs | 824 +++-- libhelium/src/auto/text_field.rs | 785 +++-- libhelium/src/auto/time_picker.rs | 761 +++-- libhelium/src/auto/timed_animation.rs | 329 +- libhelium/src/auto/tip.rs | 185 +- libhelium/src/auto/toast.rs | 401 ++- libhelium/src/auto/view.rs | 114 +- libhelium/src/auto/view_aux.rs | 357 ++- libhelium/src/auto/view_chooser.rs | 333 +- libhelium/src/auto/view_dual.rs | 433 ++- libhelium/src/auto/view_mono.rs | 761 ++++- libhelium/src/auto/view_sub_title.rs | 338 +- libhelium/src/auto/view_switcher.rs | 333 +- libhelium/src/auto/view_title.rs | 333 +- libhelium/src/auto/welcome_screen.rs | 392 ++- libhelium/src/auto/window.rs | 585 ++-- libhelium/src/auto/xyz_color.rs | 4 +- libhelium/sys/build.rs | 2 +- libhelium/sys/src/lib.rs | 2101 ++++++++++--- libhelium/sys/tests/abi.rs | 1621 ++++++++-- libhelium/sys/tests/constant.c | 5 + libhelium/sys/tests/layout.c | 29 + 78 files changed, 23938 insertions(+), 10488 deletions(-) diff --git a/He-1.gir b/He-1.gir index ce8bce1..34d83d0 100755 --- a/He-1.gir +++ b/He-1.gir @@ -1985,7 +1985,7 @@ Since: 1.0 - + @@ -1995,7 +1995,7 @@ Since: 1.0 - + @@ -2237,9 +2237,9 @@ used directly. Instead, let the `He.Application` class manage this for you.</ <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> @@ -2252,6 +2252,32 @@ used directly. Instead, let the `He.Application` class manage this for you.</ + + + + + + + + + + + + + + + + + + + + + + + + + + <para>Register the style manager with GTK. This will also call update.</para> @@ -2808,12 +2834,12 @@ title bar can be made always visible. Has an optional back button. The back butt - - + + - + - + @@ -2938,86 +2964,126 @@ title bar can be made always visible. Has an optional back button. The back butt - + + <para>The Ensor scheme preference enum, which is used to determine the Ensor scheme of the desktop.</para> + + + + + + + + + + + + + + + + + - + + + + - + - + + <para>Contrast ratio is a measure of legibility, used to compare the lightness of two colors.</para> - + - - - - - - - + + - - + + - - + + + + <para>Contrast ratio of two tones &lpar;T in HCT, L* in L*a*b*&rpar;.</para> + + + + + + + + + - - + + + <para>Returns tone &gt;= tone parameter that ensures the ratio with the input tone.</para> - + - - - - - - - + + - - + + - - + + + + <para>Tone &gt;= tone parameter that ensures ratio. Returns 100 if ratio cannot be achieved.</para> + + + + + + + + + - + + + <para>Returns tone &lt;= tone parameter that ensures the ratio with the input tone.</para> + + + + + + + + + + + + + + <para>Tone &lt;= tone parameter that ensures ratio. Returns 0 if ratio cannot be achieved.</para> + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - + - - + + @@ -3025,175 +3091,1848 @@ title bar can be made always visible. Has an optional back button. The back butt - + - - - - - - + - - - - + - - - - - - - + + - - + + - - + + + + + - - - - - - - - - - <para>Creates a dictionary with keys of colors, and values of count of the color</para> - - - - - - - + + - - - - + - + + + + - - - - - - + - + - - + + - + - - - - - + + - - - - - - - - - - - - - - - - - + + - - - - - + + - - + + - + + + + + + + + + + + + + + + + + + + - - - - + - - - - + + - - + + - - - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>Tones less than ~50 always permit white at 4.5 contrast.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>Creates a dictionary with keys of colors, and values of count of the color</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>An image quantizer that divides the image&apos;s pixels into clusters by recursively cutting an RGB cube, based on the weight of pixels in each +area of the cube.</para> +<para>&lt;p&gt;The algorithm was described by Xiaolin Wu in Graphic Gems II, published in 1991.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>A theme in which the primary color does not shift. Useful for content such as Album Art, Images, etc. suppling color for UI.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>The default theme</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>A theme with no colors</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>A theme with just a tiny amount of color</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>A theme with a party of color</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>A class that contains the color scheme of the app.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + - + - + - - - <para>An image quantizer that divides the image&apos;s pixels into clusters by recursively cutting an RGB cube, based on the weight of pixels in each -area of the cube.</para> -<para>&lt;p&gt;The algorithm was described by Xiaolin Wu in Graphic Gems II, published in 1991.</para> + + - + - + - + + <para>A theme with ALL the color</para> - + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -3438,6 +5177,230 @@ area of the cube.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7294,18 +9257,22 @@ Since: 1.0 - + <para>The title of the content block. </para> - + <para>The subtitle of the content block. </para> - + <para>The primary button of the content block. </para> + + <para>The widget of the content block. </para> + + @@ -7316,6 +9283,32 @@ Since: 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + <para>Sets the title of the content block.</para> @@ -7702,6 +9695,35 @@ Since: 1.0 + + <para>Whether to hide the item labels or not. Useful if the icon for the item is descriptive enough.</para> + +Since: 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + @@ -11023,25 +13045,278 @@ Since: 1.0 - - <para>A ViewMono is a view that is a single-column layout.</para> - -Since: 1.0 + + <para>A ViewMono is a component containing its own AppBar, title, subtitle, and elements.</para> + - + + <para>Create a new ViewMono.</para> + + + <para>The title of the ViewMono. </para> + + + + <para>The subtitle of the ViewMono. </para> + + + + + <para>The title of the sidebar.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>The title widget of the sidebar.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>The title of the sidebar.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>Whether the ViewMono should show the buttons.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>Whether the ViewMono should show the buttons.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>Whether the back button should be shown.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>The stack that the ViewMono&apos;s AppBar is attached to.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>The stack that the ViewMono&apos;s AppBar is attached to.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + <para>Whether the view child has margins or is full-bleed.</para> + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -11412,6 +13687,58 @@ Since: 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libhelium/Gir.toml b/libhelium/Gir.toml index 303083c..3efea1c 100644 --- a/libhelium/Gir.toml +++ b/libhelium/Gir.toml @@ -151,7 +151,7 @@ manual = [ "GLib.Regex", "Gtk.Grid", "Gtk.DropDown", - "Pango.EllipsizeMode", + "Pango.EllipsizeMode" ] [[object]] diff --git a/libhelium/src/auto/about_window.rs b/libhelium/src/auto/about_window.rs index 73dc88c..335575e 100644 --- a/libhelium/src/auto/about_window.rs +++ b/libhelium/src/auto/about_window.rs @@ -1,11 +1,15 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi,AboutWindowLicenses,Colors,Window}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; -use std::{boxed::Box as Box_}; +use crate::{ffi, AboutWindowLicenses, Colors, Window}; +use glib::{ + prelude::*, + signal::{connect_raw, SignalHandlerId}, + translate::*, +}; +use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "HeAboutWindow")] @@ -17,330 +21,507 @@ glib::wrapper! { } impl AboutWindow { - pub const NONE: Option<&'static AboutWindow> = None; - + pub const NONE: Option<&'static AboutWindow> = None; #[doc(alias = "he_about_window_new")] - pub fn new(parent: &impl IsA, app_name: &str, app_id: &str, version: &str, icon: &str, translate_url: Option<&str>, issue_url: Option<&str>, more_info_url: Option<&str>, translators: &[&str], developers: &[&str], copyright_year: i32, license: AboutWindowLicenses, color: Colors) -> AboutWindow { + pub fn new( + parent: &impl IsA, + app_name: &str, + app_id: &str, + version: &str, + icon: &str, + translate_url: Option<&str>, + issue_url: Option<&str>, + more_info_url: Option<&str>, + translators: &[&str], + developers: &[&str], + copyright_year: i32, + license: AboutWindowLicenses, + color: Colors, + ) -> AboutWindow { assert_initialized_main_thread!(); let translators_length1 = translators.len() as _; let developers_length1 = developers.len() as _; unsafe { - from_glib_none(ffi::he_about_window_new(parent.as_ref().to_glib_none().0, app_name.to_glib_none().0, app_id.to_glib_none().0, version.to_glib_none().0, icon.to_glib_none().0, translate_url.to_glib_none().0, issue_url.to_glib_none().0, more_info_url.to_glib_none().0, translators.to_glib_none().0, translators_length1, developers.to_glib_none().0, developers_length1, copyright_year, license.into_glib(), color.into_glib())) + from_glib_none(ffi::he_about_window_new( + parent.as_ref().to_glib_none().0, + app_name.to_glib_none().0, + app_id.to_glib_none().0, + version.to_glib_none().0, + icon.to_glib_none().0, + translate_url.to_glib_none().0, + issue_url.to_glib_none().0, + more_info_url.to_glib_none().0, + translators.to_glib_none().0, + translators_length1, + developers.to_glib_none().0, + developers_length1, + copyright_year, + license.into_glib(), + color.into_glib(), + )) } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`AboutWindow`] objects. - /// - /// This method returns an instance of [`AboutWindowBuilder`](crate::builders::AboutWindowBuilder) which can be used to create [`AboutWindow`] objects. - pub fn builder() -> AboutWindowBuilder { - AboutWindowBuilder::new() - } - + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`AboutWindow`] objects. + /// + /// This method returns an instance of [`AboutWindowBuilder`](crate::builders::AboutWindowBuilder) which can be used to create [`AboutWindow`] objects. + pub fn builder() -> AboutWindowBuilder { + AboutWindowBuilder::new() + } } impl Default for AboutWindow { - fn default() -> Self { - glib::object::Object::new::() - } - } + fn default() -> Self { + glib::object::Object::new::() + } +} // rustdoc-stripper-ignore-next - /// A [builder-pattern] type to construct [`AboutWindow`] objects. - /// - /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html +/// A [builder-pattern] type to construct [`AboutWindow`] objects. +/// +/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct AboutWindowBuilder { - builder: glib::object::ObjectBuilder<'static, AboutWindow>, - } + builder: glib::object::ObjectBuilder<'static, AboutWindow>, +} - impl AboutWindowBuilder { - fn new() -> Self { - Self { builder: glib::object::Object::builder() } +impl AboutWindowBuilder { + fn new() -> Self { + Self { + builder: glib::object::Object::builder(), } + } - pub fn color(self, color: Colors) -> Self { - Self { builder: self.builder.property("color", color), } - } + pub fn color(self, color: Colors) -> Self { + Self { + builder: self.builder.property("color", color), + } + } - pub fn license(self, license: AboutWindowLicenses) -> Self { - Self { builder: self.builder.property("license", license), } - } + pub fn license(self, license: AboutWindowLicenses) -> Self { + Self { + builder: self.builder.property("license", license), + } + } - pub fn version(self, version: impl Into) -> Self { - Self { builder: self.builder.property("version", version.into()), } - } + pub fn version(self, version: impl Into) -> Self { + Self { + builder: self.builder.property("version", version.into()), + } + } - pub fn app_name(self, app_name: impl Into) -> Self { - Self { builder: self.builder.property("app-name", app_name.into()), } - } + pub fn app_name(self, app_name: impl Into) -> Self { + Self { + builder: self.builder.property("app-name", app_name.into()), + } + } - pub fn icon(self, icon: impl Into) -> Self { - Self { builder: self.builder.property("icon", icon.into()), } - } + pub fn icon(self, icon: impl Into) -> Self { + Self { + builder: self.builder.property("icon", icon.into()), + } + } - pub fn translator_names(self, translator_names: impl Into) -> Self { - Self { builder: self.builder.property("translator-names", translator_names.into()), } - } + pub fn translator_names(self, translator_names: impl Into) -> Self { + Self { + builder: self + .builder + .property("translator-names", translator_names.into()), + } + } - pub fn developer_names(self, developer_names: impl Into) -> Self { - Self { builder: self.builder.property("developer-names", developer_names.into()), } - } + pub fn developer_names(self, developer_names: impl Into) -> Self { + Self { + builder: self + .builder + .property("developer-names", developer_names.into()), + } + } - pub fn copyright_year(self, copyright_year: i32) -> Self { - Self { builder: self.builder.property("copyright-year", copyright_year), } - } + pub fn copyright_year(self, copyright_year: i32) -> Self { + Self { + builder: self.builder.property("copyright-year", copyright_year), + } + } - pub fn app_id(self, app_id: impl Into) -> Self { - Self { builder: self.builder.property("app-id", app_id.into()), } - } + pub fn app_id(self, app_id: impl Into) -> Self { + Self { + builder: self.builder.property("app-id", app_id.into()), + } + } - pub fn translate_url(self, translate_url: impl Into) -> Self { - Self { builder: self.builder.property("translate-url", translate_url.into()), } - } + pub fn translate_url(self, translate_url: impl Into) -> Self { + Self { + builder: self.builder.property("translate-url", translate_url.into()), + } + } - pub fn issue_url(self, issue_url: impl Into) -> Self { - Self { builder: self.builder.property("issue-url", issue_url.into()), } - } + pub fn issue_url(self, issue_url: impl Into) -> Self { + Self { + builder: self.builder.property("issue-url", issue_url.into()), + } + } - pub fn more_info_url(self, more_info_url: impl Into) -> Self { - Self { builder: self.builder.property("more-info-url", more_info_url.into()), } - } + pub fn more_info_url(self, more_info_url: impl Into) -> Self { + Self { + builder: self.builder.property("more-info-url", more_info_url.into()), + } + } - pub fn parent(self, parent: &impl IsA) -> Self { - Self { builder: self.builder.property("parent", parent.clone().upcast()), } - } + pub fn parent(self, parent: &impl IsA) -> Self { + Self { + builder: self.builder.property("parent", parent.clone().upcast()), + } + } - pub fn has_title(self, has_title: bool) -> Self { - Self { builder: self.builder.property("has-title", has_title), } - } + pub fn has_title(self, has_title: bool) -> Self { + Self { + builder: self.builder.property("has-title", has_title), + } + } - pub fn has_back_button(self, has_back_button: bool) -> Self { - Self { builder: self.builder.property("has-back-button", has_back_button), } - } + pub fn has_back_button(self, has_back_button: bool) -> Self { + Self { + builder: self.builder.property("has-back-button", has_back_button), + } + } - pub fn application(self, application: &impl IsA) -> Self { - Self { builder: self.builder.property("application", application.clone().upcast()), } - } + pub fn application(self, application: &impl IsA) -> Self { + Self { + builder: self + .builder + .property("application", application.clone().upcast()), + } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { builder: self.builder.property("child", child.clone().upcast()), } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { + builder: self.builder.property("child", child.clone().upcast()), + } + } - pub fn decorated(self, decorated: bool) -> Self { - Self { builder: self.builder.property("decorated", decorated), } - } + pub fn decorated(self, decorated: bool) -> Self { + Self { + builder: self.builder.property("decorated", decorated), + } + } - pub fn default_height(self, default_height: i32) -> Self { - Self { builder: self.builder.property("default-height", default_height), } - } + pub fn default_height(self, default_height: i32) -> Self { + Self { + builder: self.builder.property("default-height", default_height), + } + } - pub fn default_widget(self, default_widget: &impl IsA) -> Self { - Self { builder: self.builder.property("default-widget", default_widget.clone().upcast()), } - } + pub fn default_widget(self, default_widget: &impl IsA) -> Self { + Self { + builder: self + .builder + .property("default-widget", default_widget.clone().upcast()), + } + } - pub fn default_width(self, default_width: i32) -> Self { - Self { builder: self.builder.property("default-width", default_width), } - } + pub fn default_width(self, default_width: i32) -> Self { + Self { + builder: self.builder.property("default-width", default_width), + } + } - pub fn deletable(self, deletable: bool) -> Self { - Self { builder: self.builder.property("deletable", deletable), } - } + pub fn deletable(self, deletable: bool) -> Self { + Self { + builder: self.builder.property("deletable", deletable), + } + } - pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self { - Self { builder: self.builder.property("destroy-with-parent", destroy_with_parent), } - } + pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self { + Self { + builder: self + .builder + .property("destroy-with-parent", destroy_with_parent), + } + } - //pub fn display(self, display: /*Ignored*/&gdk::Display) -> Self { - // Self { builder: self.builder.property("display", display), } - //} + //pub fn display(self, display: /*Ignored*/&gdk::Display) -> Self { + // Self { builder: self.builder.property("display", display), } + //} - pub fn focus_visible(self, focus_visible: bool) -> Self { - Self { builder: self.builder.property("focus-visible", focus_visible), } - } + pub fn focus_visible(self, focus_visible: bool) -> Self { + Self { + builder: self.builder.property("focus-visible", focus_visible), + } + } - pub fn focus_widget(self, focus_widget: &impl IsA) -> Self { - Self { builder: self.builder.property("focus-widget", focus_widget.clone().upcast()), } - } + pub fn focus_widget(self, focus_widget: &impl IsA) -> Self { + Self { + builder: self + .builder + .property("focus-widget", focus_widget.clone().upcast()), + } + } - pub fn fullscreened(self, fullscreened: bool) -> Self { - Self { builder: self.builder.property("fullscreened", fullscreened), } - } + pub fn fullscreened(self, fullscreened: bool) -> Self { + Self { + builder: self.builder.property("fullscreened", fullscreened), + } + } - #[cfg(feature = "gtk_v4_2")] + #[cfg(feature = "gtk_v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { - Self { builder: self.builder.property("handle-menubar-accel", handle_menubar_accel), } - } + Self { + builder: self + .builder + .property("handle-menubar-accel", handle_menubar_accel), + } + } - pub fn hide_on_close(self, hide_on_close: bool) -> Self { - Self { builder: self.builder.property("hide-on-close", hide_on_close), } - } + pub fn hide_on_close(self, hide_on_close: bool) -> Self { + Self { + builder: self.builder.property("hide-on-close", hide_on_close), + } + } - pub fn icon_name(self, icon_name: impl Into) -> Self { - Self { builder: self.builder.property("icon-name", icon_name.into()), } - } + pub fn icon_name(self, icon_name: impl Into) -> Self { + Self { + builder: self.builder.property("icon-name", icon_name.into()), + } + } - pub fn maximized(self, maximized: bool) -> Self { - Self { builder: self.builder.property("maximized", maximized), } - } + pub fn maximized(self, maximized: bool) -> Self { + Self { + builder: self.builder.property("maximized", maximized), + } + } - pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self { - Self { builder: self.builder.property("mnemonics-visible", mnemonics_visible), } - } + pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self { + Self { + builder: self + .builder + .property("mnemonics-visible", mnemonics_visible), + } + } - pub fn modal(self, modal: bool) -> Self { - Self { builder: self.builder.property("modal", modal), } - } + pub fn modal(self, modal: bool) -> Self { + Self { + builder: self.builder.property("modal", modal), + } + } - pub fn resizable(self, resizable: bool) -> Self { - Self { builder: self.builder.property("resizable", resizable), } - } + pub fn resizable(self, resizable: bool) -> Self { + Self { + builder: self.builder.property("resizable", resizable), + } + } - pub fn startup_id(self, startup_id: impl Into) -> Self { - Self { builder: self.builder.property("startup-id", startup_id.into()), } - } + pub fn startup_id(self, startup_id: impl Into) -> Self { + Self { + builder: self.builder.property("startup-id", startup_id.into()), + } + } - pub fn title(self, title: impl Into) -> Self { - Self { builder: self.builder.property("title", title.into()), } - } + pub fn title(self, title: impl Into) -> Self { + Self { + builder: self.builder.property("title", title.into()), + } + } - #[cfg(feature = "gtk_v4_6")] + #[cfg(feature = "gtk_v4_6")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_6")))] pub fn titlebar(self, titlebar: &impl IsA) -> Self { - Self { builder: self.builder.property("titlebar", titlebar.clone().upcast()), } - } + Self { + builder: self.builder.property("titlebar", titlebar.clone().upcast()), + } + } - pub fn transient_for(self, transient_for: &impl IsA) -> Self { - Self { builder: self.builder.property("transient-for", transient_for.clone().upcast()), } - } + pub fn transient_for(self, transient_for: &impl IsA) -> Self { + Self { + builder: self + .builder + .property("transient-for", transient_for.clone().upcast()), + } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { builder: self.builder.property("can-focus", can_focus), } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { + builder: self.builder.property("can-focus", can_focus), + } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { builder: self.builder.property("can-target", can_target), } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { + builder: self.builder.property("can-target", can_target), + } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { builder: self.builder.property("css-classes", css_classes.into()), } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { + builder: self.builder.property("css-classes", css_classes.into()), + } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { builder: self.builder.property("css-name", css_name.into()), } - } + pub fn css_name(self, css_name: impl Into) -> Self { + Self { + builder: self.builder.property("css-name", css_name.into()), + } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { builder: self.builder.property("focus-on-click", focus_on_click), } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { + builder: self.builder.property("focus-on-click", focus_on_click), + } + } - pub fn focusable(self, focusable: bool) -> Self { - Self { builder: self.builder.property("focusable", focusable), } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { + builder: self.builder.property("focusable", focusable), + } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { builder: self.builder.property("halign", halign), } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { + builder: self.builder.property("halign", halign), + } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { builder: self.builder.property("has-tooltip", has_tooltip), } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { + builder: self.builder.property("has-tooltip", has_tooltip), + } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { builder: self.builder.property("height-request", height_request), } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { + builder: self.builder.property("height-request", height_request), + } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { builder: self.builder.property("hexpand", hexpand), } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { + builder: self.builder.property("hexpand", hexpand), + } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { builder: self.builder.property("hexpand-set", hexpand_set), } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { + builder: self.builder.property("hexpand-set", hexpand_set), + } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { builder: self.builder.property("margin-bottom", margin_bottom), } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { + builder: self.builder.property("margin-bottom", margin_bottom), + } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { builder: self.builder.property("margin-end", margin_end), } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { + builder: self.builder.property("margin-end", margin_end), + } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { builder: self.builder.property("margin-start", margin_start), } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { + builder: self.builder.property("margin-start", margin_start), + } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { builder: self.builder.property("margin-top", margin_top), } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { + builder: self.builder.property("margin-top", margin_top), + } + } - pub fn name(self, name: impl Into) -> Self { - Self { builder: self.builder.property("name", name.into()), } - } + pub fn name(self, name: impl Into) -> Self { + Self { + builder: self.builder.property("name", name.into()), + } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { builder: self.builder.property("opacity", opacity), } - } + pub fn opacity(self, opacity: f64) -> Self { + Self { + builder: self.builder.property("opacity", opacity), + } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn receives_default(self, receives_default: bool) -> Self { - Self { builder: self.builder.property("receives-default", receives_default), } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { + builder: self.builder.property("receives-default", receives_default), + } + } - pub fn sensitive(self, sensitive: bool) -> Self { - Self { builder: self.builder.property("sensitive", sensitive), } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { + builder: self.builder.property("sensitive", sensitive), + } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { + builder: self + .builder + .property("tooltip-markup", tooltip_markup.into()), + } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { + builder: self.builder.property("tooltip-text", tooltip_text.into()), + } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { builder: self.builder.property("valign", valign), } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { + builder: self.builder.property("valign", valign), + } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { builder: self.builder.property("vexpand", vexpand), } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { + builder: self.builder.property("vexpand", vexpand), + } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { builder: self.builder.property("vexpand-set", vexpand_set), } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { + builder: self.builder.property("vexpand-set", vexpand_set), + } + } - pub fn visible(self, visible: bool) -> Self { - Self { builder: self.builder.property("visible", visible), } - } + pub fn visible(self, visible: bool) -> Self { + Self { + builder: self.builder.property("visible", visible), + } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { builder: self.builder.property("width-request", width_request), } - } + pub fn width_request(self, width_request: i32) -> Self { + Self { + builder: self.builder.property("width-request", width_request), + } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`AboutWindow`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> AboutWindow { - self.builder.build() } + self.builder.build() + } } mod sealed { @@ -353,7 +534,9 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_color")] fn color(&self) -> Colors { unsafe { - from_glib(ffi::he_about_window_get_color(self.as_ref().to_glib_none().0)) + from_glib(ffi::he_about_window_get_color( + self.as_ref().to_glib_none().0, + )) } } @@ -368,7 +551,9 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_license")] fn license(&self) -> AboutWindowLicenses { unsafe { - from_glib(ffi::he_about_window_get_license(self.as_ref().to_glib_none().0)) + from_glib(ffi::he_about_window_get_license( + self.as_ref().to_glib_none().0, + )) } } @@ -383,14 +568,19 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_version")] fn version(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_about_window_get_version(self.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_about_window_get_version( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_about_window_set_version")] fn set_version(&self, value: &str) { unsafe { - ffi::he_about_window_set_version(self.as_ref().to_glib_none().0, value.to_glib_none().0); + ffi::he_about_window_set_version( + self.as_ref().to_glib_none().0, + value.to_glib_none().0, + ); } } @@ -398,14 +588,19 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_app_name")] fn app_name(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_about_window_get_app_name(self.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_about_window_get_app_name( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_about_window_set_app_name")] fn set_app_name(&self, value: &str) { unsafe { - ffi::he_about_window_set_app_name(self.as_ref().to_glib_none().0, value.to_glib_none().0); + ffi::he_about_window_set_app_name( + self.as_ref().to_glib_none().0, + value.to_glib_none().0, + ); } } @@ -413,7 +608,9 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_icon")] fn icon(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_about_window_get_icon(self.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_about_window_get_icon( + self.as_ref().to_glib_none().0, + )) } } @@ -429,7 +626,13 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { fn translator_names(&self) -> Vec { unsafe { let mut result_length1 = std::mem::MaybeUninit::uninit(); - let ret = FromGlibContainer::from_glib_none_num(ffi::he_about_window_get_translator_names(self.as_ref().to_glib_none().0, result_length1.as_mut_ptr()), result_length1.assume_init() as _); + let ret = FromGlibContainer::from_glib_none_num( + ffi::he_about_window_get_translator_names( + self.as_ref().to_glib_none().0, + result_length1.as_mut_ptr(), + ), + result_length1.assume_init() as _, + ); ret } } @@ -438,7 +641,11 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { fn set_translator_names(&self, value: &[&str]) { let value_length1 = value.len() as _; unsafe { - ffi::he_about_window_set_translator_names(self.as_ref().to_glib_none().0, value.to_glib_none().0, value_length1); + ffi::he_about_window_set_translator_names( + self.as_ref().to_glib_none().0, + value.to_glib_none().0, + value_length1, + ); } } @@ -447,7 +654,13 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { fn developer_names(&self) -> Vec { unsafe { let mut result_length1 = std::mem::MaybeUninit::uninit(); - let ret = FromGlibContainer::from_glib_none_num(ffi::he_about_window_get_developer_names(self.as_ref().to_glib_none().0, result_length1.as_mut_ptr()), result_length1.assume_init() as _); + let ret = FromGlibContainer::from_glib_none_num( + ffi::he_about_window_get_developer_names( + self.as_ref().to_glib_none().0, + result_length1.as_mut_ptr(), + ), + result_length1.assume_init() as _, + ); ret } } @@ -456,16 +669,18 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { fn set_developer_names(&self, value: &[&str]) { let value_length1 = value.len() as _; unsafe { - ffi::he_about_window_set_developer_names(self.as_ref().to_glib_none().0, value.to_glib_none().0, value_length1); + ffi::he_about_window_set_developer_names( + self.as_ref().to_glib_none().0, + value.to_glib_none().0, + value_length1, + ); } } #[doc(alias = "he_about_window_get_copyright_year")] #[doc(alias = "get_copyright_year")] fn copyright_year(&self) -> i32 { - unsafe { - ffi::he_about_window_get_copyright_year(self.as_ref().to_glib_none().0) - } + unsafe { ffi::he_about_window_get_copyright_year(self.as_ref().to_glib_none().0) } } #[doc(alias = "he_about_window_set_copyright_year")] @@ -479,7 +694,9 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_app_id")] fn app_id(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_about_window_get_app_id(self.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_about_window_get_app_id( + self.as_ref().to_glib_none().0, + )) } } @@ -494,14 +711,19 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_translate_url")] fn translate_url(&self) -> Option { unsafe { - from_glib_none(ffi::he_about_window_get_translate_url(self.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_about_window_get_translate_url( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_about_window_set_translate_url")] fn set_translate_url(&self, value: Option<&str>) { unsafe { - ffi::he_about_window_set_translate_url(self.as_ref().to_glib_none().0, value.to_glib_none().0); + ffi::he_about_window_set_translate_url( + self.as_ref().to_glib_none().0, + value.to_glib_none().0, + ); } } @@ -509,14 +731,19 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_issue_url")] fn issue_url(&self) -> Option { unsafe { - from_glib_none(ffi::he_about_window_get_issue_url(self.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_about_window_get_issue_url( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_about_window_set_issue_url")] fn set_issue_url(&self, value: Option<&str>) { unsafe { - ffi::he_about_window_set_issue_url(self.as_ref().to_glib_none().0, value.to_glib_none().0); + ffi::he_about_window_set_issue_url( + self.as_ref().to_glib_none().0, + value.to_glib_none().0, + ); } } @@ -524,170 +751,316 @@ pub trait AboutWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_more_info_url")] fn more_info_url(&self) -> Option { unsafe { - from_glib_none(ffi::he_about_window_get_more_info_url(self.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_about_window_get_more_info_url( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_about_window_set_more_info_url")] fn set_more_info_url(&self, value: Option<&str>) { unsafe { - ffi::he_about_window_set_more_info_url(self.as_ref().to_glib_none().0, value.to_glib_none().0); + ffi::he_about_window_set_more_info_url( + self.as_ref().to_glib_none().0, + value.to_glib_none().0, + ); } } #[doc(alias = "color")] fn connect_color_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_color_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_color_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAboutWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::color\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_color_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::color\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_color_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "license")] fn connect_license_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_license_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_license_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAboutWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::license\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_license_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::license\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_license_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "version")] fn connect_version_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_version_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_version_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAboutWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::version\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_version_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::version\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_version_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "app-name")] fn connect_app_name_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_app_name_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_app_name_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::HeAboutWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::app-name\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_app_name_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::app-name\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_app_name_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "icon")] fn connect_icon_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_icon_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_icon_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAboutWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::icon\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_icon_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::icon\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_icon_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "translator-names")] fn connect_translator_names_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_translator_names_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_translator_names_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::HeAboutWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::translator-names\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_translator_names_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::translator-names\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_translator_names_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "developer-names")] fn connect_developer_names_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_developer_names_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_developer_names_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::HeAboutWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::developer-names\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_developer_names_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::developer-names\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_developer_names_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "copyright-year")] fn connect_copyright_year_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_copyright_year_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_copyright_year_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::HeAboutWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::copyright-year\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_copyright_year_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::copyright-year\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_copyright_year_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "app-id")] fn connect_app_id_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_app_id_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_app_id_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAboutWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::app-id\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_app_id_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::app-id\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_app_id_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "translate-url")] fn connect_translate_url_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_translate_url_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_translate_url_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::HeAboutWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::translate-url\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_translate_url_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::translate-url\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_translate_url_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "issue-url")] fn connect_issue_url_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_issue_url_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_issue_url_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::HeAboutWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::issue-url\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_issue_url_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::issue-url\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_issue_url_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "more-info-url")] fn connect_more_info_url_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_more_info_url_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAboutWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_more_info_url_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::HeAboutWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(AboutWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::more-info-url\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_more_info_url_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::more-info-url\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_more_info_url_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } } diff --git a/libhelium/src/auto/animation.rs b/libhelium/src/auto/animation.rs index 07ea87e..f64190c 100644 --- a/libhelium/src/auto/animation.rs +++ b/libhelium/src/auto/animation.rs @@ -1,11 +1,15 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi,AnimationState,AnimationTarget}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; -use std::{boxed::Box as Box_}; +use crate::{ffi, AnimationState, AnimationTarget}; +use glib::{ + prelude::*, + signal::{connect_raw, SignalHandlerId}, + translate::*, +}; +use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "HeAnimation")] @@ -17,8 +21,7 @@ glib::wrapper! { } impl Animation { - pub const NONE: Option<&'static Animation> = None; - + pub const NONE: Option<&'static Animation> = None; } mod sealed { @@ -64,24 +67,18 @@ pub trait AnimationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_animation_estimate_duration")] fn estimate_duration(&self) -> u32 { - unsafe { - ffi::he_animation_estimate_duration(self.as_ref().to_glib_none().0) - } + unsafe { ffi::he_animation_estimate_duration(self.as_ref().to_glib_none().0) } } #[doc(alias = "he_animation_calculate_value")] fn calculate_value(&self, t: u32) -> f64 { - unsafe { - ffi::he_animation_calculate_value(self.as_ref().to_glib_none().0, t) - } + unsafe { ffi::he_animation_calculate_value(self.as_ref().to_glib_none().0, t) } } #[doc(alias = "he_animation_get_state")] #[doc(alias = "get_state")] fn state(&self) -> AnimationState { - unsafe { - from_glib(ffi::he_animation_get_state(self.as_ref().to_glib_none().0)) - } + unsafe { from_glib(ffi::he_animation_get_state(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_animation_set_state")] @@ -94,39 +91,39 @@ pub trait AnimationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_animation_get_target")] #[doc(alias = "get_target")] fn target(&self) -> AnimationTarget { - unsafe { - from_glib_none(ffi::he_animation_get_target(self.as_ref().to_glib_none().0)) - } + unsafe { from_glib_none(ffi::he_animation_get_target(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_animation_set_target")] fn set_target(&self, value: &impl IsA) { unsafe { - ffi::he_animation_set_target(self.as_ref().to_glib_none().0, value.as_ref().to_glib_none().0); + ffi::he_animation_set_target( + self.as_ref().to_glib_none().0, + value.as_ref().to_glib_none().0, + ); } } #[doc(alias = "he_animation_get_widget")] #[doc(alias = "get_widget")] fn widget(&self) -> gtk::Widget { - unsafe { - from_glib_none(ffi::he_animation_get_widget(self.as_ref().to_glib_none().0)) - } + unsafe { from_glib_none(ffi::he_animation_get_widget(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_animation_set_widget")] fn set_widget(&self, value: &impl IsA) { unsafe { - ffi::he_animation_set_widget(self.as_ref().to_glib_none().0, value.as_ref().to_glib_none().0); + ffi::he_animation_set_widget( + self.as_ref().to_glib_none().0, + value.as_ref().to_glib_none().0, + ); } } #[doc(alias = "he_animation_get_avalue")] #[doc(alias = "get_avalue")] fn avalue(&self) -> f64 { - unsafe { - ffi::he_animation_get_avalue(self.as_ref().to_glib_none().0) - } + unsafe { ffi::he_animation_get_avalue(self.as_ref().to_glib_none().0) } } #[doc(alias = "he_animation_set_avalue")] @@ -138,66 +135,115 @@ pub trait AnimationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "done")] fn connect_done(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn done_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, f: glib::ffi::gpointer) { + unsafe extern "C" fn done_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAnimation, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"done\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(done_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"done\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + done_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "state")] fn connect_state_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_state_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_state_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAnimation, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::state\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_state_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::state\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_state_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "target")] fn connect_target_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_target_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_target_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAnimation, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::target\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_target_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::target\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_target_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "widget")] fn connect_widget_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_widget_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_widget_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAnimation, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::widget\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_widget_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::widget\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_widget_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "avalue")] fn connect_avalue_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_avalue_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAnimation, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_avalue_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAnimation, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Animation::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::avalue\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_avalue_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::avalue\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_avalue_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } } diff --git a/libhelium/src/auto/animation_target.rs b/libhelium/src/auto/animation_target.rs index 4274d4a..a743c8b 100644 --- a/libhelium/src/auto/animation_target.rs +++ b/libhelium/src/auto/animation_target.rs @@ -1,10 +1,10 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi}; -use glib::{prelude::*,translate::*}; +use crate::ffi; +use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "HeAnimationTarget")] @@ -16,8 +16,7 @@ glib::wrapper! { } impl AnimationTarget { - pub const NONE: Option<&'static AnimationTarget> = None; - + pub const NONE: Option<&'static AnimationTarget> = None; } mod sealed { diff --git a/libhelium/src/auto/app_bar.rs b/libhelium/src/auto/app_bar.rs index b49ba7a..6112e62 100644 --- a/libhelium/src/auto/app_bar.rs +++ b/libhelium/src/auto/app_bar.rs @@ -1,11 +1,15 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi,Bin}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; -use std::{boxed::Box as Box_}; +use crate::{ffi, Bin}; +use glib::{ + prelude::*, + signal::{connect_raw, SignalHandlerId}, + translate::*, +}; +use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "HeAppBar")] @@ -17,216 +21,303 @@ glib::wrapper! { } impl AppBar { - pub const NONE: Option<&'static AppBar> = None; - + pub const NONE: Option<&'static AppBar> = None; #[doc(alias = "he_app_bar_new")] pub fn new() -> AppBar { assert_initialized_main_thread!(); - unsafe { - from_glib_none(ffi::he_app_bar_new()) - } + unsafe { from_glib_none(ffi::he_app_bar_new()) } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`AppBar`] objects. - /// - /// This method returns an instance of [`AppBarBuilder`](crate::builders::AppBarBuilder) which can be used to create [`AppBar`] objects. - pub fn builder() -> AppBarBuilder { - AppBarBuilder::new() - } - + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`AppBar`] objects. + /// + /// This method returns an instance of [`AppBarBuilder`](crate::builders::AppBarBuilder) which can be used to create [`AppBar`] objects. + pub fn builder() -> AppBarBuilder { + AppBarBuilder::new() + } } impl Default for AppBar { - fn default() -> Self { - Self::new() - } - } + fn default() -> Self { + Self::new() + } +} // rustdoc-stripper-ignore-next - /// A [builder-pattern] type to construct [`AppBar`] objects. - /// - /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html +/// A [builder-pattern] type to construct [`AppBar`] objects. +/// +/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct AppBarBuilder { - builder: glib::object::ObjectBuilder<'static, AppBar>, - } + builder: glib::object::ObjectBuilder<'static, AppBar>, +} - impl AppBarBuilder { - fn new() -> Self { - Self { builder: glib::object::Object::builder() } +impl AppBarBuilder { + fn new() -> Self { + Self { + builder: glib::object::Object::builder(), } + } - pub fn stack(self, stack: >k::Stack) -> Self { - Self { builder: self.builder.property("stack", stack.clone()), } - } + pub fn stack(self, stack: >k::Stack) -> Self { + Self { + builder: self.builder.property("stack", stack.clone()), + } + } - pub fn scroller(self, scroller: >k::ScrolledWindow) -> Self { - Self { builder: self.builder.property("scroller", scroller.clone()), } - } + pub fn scroller(self, scroller: >k::ScrolledWindow) -> Self { + Self { + builder: self.builder.property("scroller", scroller.clone()), + } + } - pub fn is_compact(self, is_compact: bool) -> Self { - Self { builder: self.builder.property("is-compact", is_compact), } - } + 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.builder.property("viewtitle-label", viewtitle_label.into()), } - } + pub fn viewtitle_label(self, viewtitle_label: impl Into) -> Self { + Self { + builder: self + .builder + .property("viewtitle-label", viewtitle_label.into()), + } + } - pub fn viewtitle_widget(self, viewtitle_widget: &impl IsA) -> Self { - Self { builder: self.builder.property("viewtitle-widget", viewtitle_widget.clone().upcast()), } - } + pub fn viewtitle_widget(self, viewtitle_widget: &impl IsA) -> Self { + Self { + builder: self + .builder + .property("viewtitle-widget", viewtitle_widget.clone().upcast()), + } + } - pub fn viewsubtitle_label(self, viewsubtitle_label: impl Into) -> Self { - Self { builder: self.builder.property("viewsubtitle-label", viewsubtitle_label.into()), } - } + pub fn viewsubtitle_label(self, viewsubtitle_label: impl Into) -> Self { + Self { + builder: self + .builder + .property("viewsubtitle-label", viewsubtitle_label.into()), + } + } - pub fn show_left_title_buttons(self, show_left_title_buttons: bool) -> Self { - Self { builder: self.builder.property("show-left-title-buttons", show_left_title_buttons), } - } + pub fn show_left_title_buttons(self, show_left_title_buttons: bool) -> Self { + Self { + builder: self + .builder + .property("show-left-title-buttons", show_left_title_buttons), + } + } - pub fn show_right_title_buttons(self, show_right_title_buttons: bool) -> Self { - Self { builder: self.builder.property("show-right-title-buttons", show_right_title_buttons), } - } + pub fn show_right_title_buttons(self, show_right_title_buttons: bool) -> Self { + Self { + builder: self + .builder + .property("show-right-title-buttons", show_right_title_buttons), + } + } - pub fn decoration_layout(self, decoration_layout: impl Into) -> Self { - Self { builder: self.builder.property("decoration-layout", decoration_layout.into()), } - } + pub fn decoration_layout(self, decoration_layout: impl Into) -> Self { + Self { + builder: self + .builder + .property("decoration-layout", decoration_layout.into()), + } + } - pub fn show_back(self, show_back: bool) -> Self { - Self { builder: self.builder.property("show-back", show_back), } - } + pub fn show_back(self, show_back: bool) -> Self { + Self { + builder: self.builder.property("show-back", show_back), + } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { builder: self.builder.property("child", child.clone().upcast()), } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { + builder: self.builder.property("child", child.clone().upcast()), + } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { builder: self.builder.property("can-focus", can_focus), } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { + builder: self.builder.property("can-focus", can_focus), + } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { builder: self.builder.property("can-target", can_target), } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { + builder: self.builder.property("can-target", can_target), + } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { builder: self.builder.property("css-classes", css_classes.into()), } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { + builder: self.builder.property("css-classes", css_classes.into()), + } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { builder: self.builder.property("css-name", css_name.into()), } - } + pub fn css_name(self, css_name: impl Into) -> Self { + Self { + builder: self.builder.property("css-name", css_name.into()), + } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { builder: self.builder.property("focus-on-click", focus_on_click), } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { + builder: self.builder.property("focus-on-click", focus_on_click), + } + } - pub fn focusable(self, focusable: bool) -> Self { - Self { builder: self.builder.property("focusable", focusable), } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { + builder: self.builder.property("focusable", focusable), + } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { builder: self.builder.property("halign", halign), } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { + builder: self.builder.property("halign", halign), + } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { builder: self.builder.property("has-tooltip", has_tooltip), } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { + builder: self.builder.property("has-tooltip", has_tooltip), + } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { builder: self.builder.property("height-request", height_request), } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { + builder: self.builder.property("height-request", height_request), + } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { builder: self.builder.property("hexpand", hexpand), } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { + builder: self.builder.property("hexpand", hexpand), + } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { builder: self.builder.property("hexpand-set", hexpand_set), } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { + builder: self.builder.property("hexpand-set", hexpand_set), + } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { builder: self.builder.property("margin-bottom", margin_bottom), } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { + builder: self.builder.property("margin-bottom", margin_bottom), + } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { builder: self.builder.property("margin-end", margin_end), } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { + builder: self.builder.property("margin-end", margin_end), + } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { builder: self.builder.property("margin-start", margin_start), } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { + builder: self.builder.property("margin-start", margin_start), + } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { builder: self.builder.property("margin-top", margin_top), } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { + builder: self.builder.property("margin-top", margin_top), + } + } - pub fn name(self, name: impl Into) -> Self { - Self { builder: self.builder.property("name", name.into()), } - } + pub fn name(self, name: impl Into) -> Self { + Self { + builder: self.builder.property("name", name.into()), + } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { builder: self.builder.property("opacity", opacity), } - } + pub fn opacity(self, opacity: f64) -> Self { + Self { + builder: self.builder.property("opacity", opacity), + } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn receives_default(self, receives_default: bool) -> Self { - Self { builder: self.builder.property("receives-default", receives_default), } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { + builder: self.builder.property("receives-default", receives_default), + } + } - pub fn sensitive(self, sensitive: bool) -> Self { - Self { builder: self.builder.property("sensitive", sensitive), } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { + builder: self.builder.property("sensitive", sensitive), + } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { + builder: self + .builder + .property("tooltip-markup", tooltip_markup.into()), + } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { + builder: self.builder.property("tooltip-text", tooltip_text.into()), + } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { builder: self.builder.property("valign", valign), } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { + builder: self.builder.property("valign", valign), + } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { builder: self.builder.property("vexpand", vexpand), } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { + builder: self.builder.property("vexpand", vexpand), + } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { builder: self.builder.property("vexpand-set", vexpand_set), } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { + builder: self.builder.property("vexpand-set", vexpand_set), + } + } - pub fn visible(self, visible: bool) -> Self { - Self { builder: self.builder.property("visible", visible), } - } + pub fn visible(self, visible: bool) -> Self { + Self { + builder: self.builder.property("visible", visible), + } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { builder: self.builder.property("width-request", width_request), } - } + pub fn width_request(self, width_request: i32) -> Self { + Self { + builder: self.builder.property("width-request", width_request), + } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`AppBar`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> AppBar { - self.builder.build() } + self.builder.build() + } } mod sealed { @@ -238,37 +329,47 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_app_bar_append")] fn append(&self, child: &impl IsA) { unsafe { - ffi::he_app_bar_append(self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0); + ffi::he_app_bar_append( + self.as_ref().to_glib_none().0, + child.as_ref().to_glib_none().0, + ); } } #[doc(alias = "he_app_bar_append_toggle")] fn append_toggle(&self, child: &impl IsA) { unsafe { - ffi::he_app_bar_append_toggle(self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0); + ffi::he_app_bar_append_toggle( + self.as_ref().to_glib_none().0, + child.as_ref().to_glib_none().0, + ); } } #[doc(alias = "he_app_bar_append_menu")] fn append_menu(&self, child: &impl IsA) { unsafe { - ffi::he_app_bar_append_menu(self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0); + ffi::he_app_bar_append_menu( + self.as_ref().to_glib_none().0, + child.as_ref().to_glib_none().0, + ); } } #[doc(alias = "he_app_bar_remove")] fn remove(&self, child: &impl IsA) { unsafe { - ffi::he_app_bar_remove(self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0); + ffi::he_app_bar_remove( + self.as_ref().to_glib_none().0, + child.as_ref().to_glib_none().0, + ); } } #[doc(alias = "he_app_bar_get_stack")] #[doc(alias = "get_stack")] fn stack(&self) -> gtk::Stack { - unsafe { - from_glib_none(ffi::he_app_bar_get_stack(self.as_ref().to_glib_none().0)) - } + unsafe { from_glib_none(ffi::he_app_bar_get_stack(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_app_bar_set_stack")] @@ -281,9 +382,7 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_app_bar_get_scroller")] #[doc(alias = "get_scroller")] fn scroller(&self) -> gtk::ScrolledWindow { - unsafe { - from_glib_none(ffi::he_app_bar_get_scroller(self.as_ref().to_glib_none().0)) - } + unsafe { from_glib_none(ffi::he_app_bar_get_scroller(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_app_bar_set_scroller")] @@ -297,7 +396,9 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[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)) + from_glib(ffi::he_app_bar_get_is_compact( + self.as_ref().to_glib_none().0, + )) } } @@ -312,14 +413,19 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_viewtitle_label")] fn viewtitle_label(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_app_bar_get_viewtitle_label(self.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_app_bar_get_viewtitle_label( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_app_bar_set_viewtitle_label")] fn set_viewtitle_label(&self, value: &str) { unsafe { - ffi::he_app_bar_set_viewtitle_label(self.as_ref().to_glib_none().0, value.to_glib_none().0); + ffi::he_app_bar_set_viewtitle_label( + self.as_ref().to_glib_none().0, + value.to_glib_none().0, + ); } } @@ -327,14 +433,19 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_viewtitle_widget")] fn viewtitle_widget(&self) -> Option { unsafe { - from_glib_none(ffi::he_app_bar_get_viewtitle_widget(self.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_app_bar_get_viewtitle_widget( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_app_bar_set_viewtitle_widget")] fn set_viewtitle_widget(&self, value: Option<&impl IsA>) { unsafe { - ffi::he_app_bar_set_viewtitle_widget(self.as_ref().to_glib_none().0, value.map(|p| p.as_ref()).to_glib_none().0); + ffi::he_app_bar_set_viewtitle_widget( + self.as_ref().to_glib_none().0, + value.map(|p| p.as_ref()).to_glib_none().0, + ); } } @@ -342,14 +453,19 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_viewsubtitle_label")] fn viewsubtitle_label(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_app_bar_get_viewsubtitle_label(self.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_app_bar_get_viewsubtitle_label( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_app_bar_set_viewsubtitle_label")] fn set_viewsubtitle_label(&self, value: &str) { unsafe { - ffi::he_app_bar_set_viewsubtitle_label(self.as_ref().to_glib_none().0, value.to_glib_none().0); + ffi::he_app_bar_set_viewsubtitle_label( + self.as_ref().to_glib_none().0, + value.to_glib_none().0, + ); } } @@ -357,14 +473,19 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_show_left_title_buttons")] fn shows_left_title_buttons(&self) -> bool { unsafe { - from_glib(ffi::he_app_bar_get_show_left_title_buttons(self.as_ref().to_glib_none().0)) + from_glib(ffi::he_app_bar_get_show_left_title_buttons( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_app_bar_set_show_left_title_buttons")] fn set_show_left_title_buttons(&self, value: bool) { unsafe { - ffi::he_app_bar_set_show_left_title_buttons(self.as_ref().to_glib_none().0, value.into_glib()); + ffi::he_app_bar_set_show_left_title_buttons( + self.as_ref().to_glib_none().0, + value.into_glib(), + ); } } @@ -372,14 +493,19 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_show_right_title_buttons")] fn shows_right_title_buttons(&self) -> bool { unsafe { - from_glib(ffi::he_app_bar_get_show_right_title_buttons(self.as_ref().to_glib_none().0)) + from_glib(ffi::he_app_bar_get_show_right_title_buttons( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_app_bar_set_show_right_title_buttons")] fn set_show_right_title_buttons(&self, value: bool) { unsafe { - ffi::he_app_bar_set_show_right_title_buttons(self.as_ref().to_glib_none().0, value.into_glib()); + ffi::he_app_bar_set_show_right_title_buttons( + self.as_ref().to_glib_none().0, + value.into_glib(), + ); } } @@ -387,14 +513,19 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_decoration_layout")] fn decoration_layout(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_app_bar_get_decoration_layout(self.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_app_bar_get_decoration_layout( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_app_bar_set_decoration_layout")] fn set_decoration_layout(&self, value: &str) { unsafe { - ffi::he_app_bar_set_decoration_layout(self.as_ref().to_glib_none().0, value.to_glib_none().0); + ffi::he_app_bar_set_decoration_layout( + self.as_ref().to_glib_none().0, + value.to_glib_none().0, + ); } } @@ -402,7 +533,9 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_show_back")] fn shows_back(&self) -> bool { unsafe { - from_glib(ffi::he_app_bar_get_show_back(self.as_ref().to_glib_none().0)) + from_glib(ffi::he_app_bar_get_show_back( + self.as_ref().to_glib_none().0, + )) } } @@ -415,131 +548,255 @@ pub trait AppBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "stack")] fn connect_stack_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_stack_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_stack_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::stack\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_stack_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::stack\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_stack_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "scroller")] fn connect_scroller_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_scroller_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_scroller_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::scroller\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_scroller_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::scroller\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_scroller_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[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) { + 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)) + 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, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_viewtitle_label_trampoline< + P: IsA, + 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::viewtitle-label\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_viewtitle_label_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::viewtitle-label\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_viewtitle_label_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "viewtitle-widget")] fn connect_viewtitle_widget_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_viewtitle_widget_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_viewtitle_widget_trampoline< + P: IsA, + 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::viewtitle-widget\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_viewtitle_widget_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::viewtitle-widget\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_viewtitle_widget_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "viewsubtitle-label")] fn connect_viewsubtitle_label_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_viewsubtitle_label_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_viewsubtitle_label_trampoline< + P: IsA, + 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::viewsubtitle-label\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_viewsubtitle_label_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::viewsubtitle-label\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_viewsubtitle_label_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "show-left-title-buttons")] - fn connect_show_left_title_buttons_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_show_left_title_buttons_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + fn connect_show_left_title_buttons_notify( + &self, + f: F, + ) -> SignalHandlerId { + unsafe extern "C" fn notify_show_left_title_buttons_trampoline< + P: IsA, + 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::show-left-title-buttons\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_show_left_title_buttons_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::show-left-title-buttons\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_show_left_title_buttons_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "show-right-title-buttons")] - fn connect_show_right_title_buttons_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_show_right_title_buttons_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + fn connect_show_right_title_buttons_notify( + &self, + f: F, + ) -> SignalHandlerId { + unsafe extern "C" fn notify_show_right_title_buttons_trampoline< + P: IsA, + 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::show-right-title-buttons\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_show_right_title_buttons_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::show-right-title-buttons\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_show_right_title_buttons_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "decoration-layout")] fn connect_decoration_layout_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_decoration_layout_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_decoration_layout_trampoline< + P: IsA, + 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::decoration-layout\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_decoration_layout_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::decoration-layout\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_decoration_layout_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "show-back")] fn connect_show_back_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_show_back_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAppBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_show_back_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::show-back\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_show_back_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::show-back\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_show_back_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } } diff --git a/libhelium/src/auto/application.rs b/libhelium/src/auto/application.rs index 7e277e1..e5c9b16 100644 --- a/libhelium/src/auto/application.rs +++ b/libhelium/src/auto/application.rs @@ -1,11 +1,15 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi,RGBColor}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; -use std::{boxed::Box as Box_}; +use crate::{ffi, RGBColor}; +use glib::{ + prelude::*, + signal::{connect_raw, SignalHandlerId}, + translate::*, +}; +use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "HeApplication")] @@ -17,92 +21,130 @@ glib::wrapper! { } impl Application { - pub const NONE: Option<&'static Application> = None; - - - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Application`] objects. - /// - /// This method returns an instance of [`ApplicationBuilder`](crate::builders::ApplicationBuilder) which can be used to create [`Application`] objects. - pub fn builder() -> ApplicationBuilder { - ApplicationBuilder::new() - } - + pub const NONE: Option<&'static Application> = None; + + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Application`] objects. + /// + /// This method returns an instance of [`ApplicationBuilder`](crate::builders::ApplicationBuilder) which can be used to create [`Application`] objects. + pub fn builder() -> ApplicationBuilder { + ApplicationBuilder::new() + } } // rustdoc-stripper-ignore-next - /// A [builder-pattern] type to construct [`Application`] objects. - /// - /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html +/// A [builder-pattern] type to construct [`Application`] objects. +/// +/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct ApplicationBuilder { - builder: glib::object::ObjectBuilder<'static, Application>, - } + builder: glib::object::ObjectBuilder<'static, Application>, +} - impl ApplicationBuilder { - fn new() -> Self { - Self { builder: glib::object::Object::builder() } +impl ApplicationBuilder { + fn new() -> Self { + Self { + builder: glib::object::Object::builder(), } + } - pub fn default_accent_color(self, default_accent_color: &RGBColor) -> Self { - Self { builder: self.builder.property("default-accent-color", default_accent_color), } - } + pub fn default_accent_color(self, default_accent_color: &RGBColor) -> Self { + Self { + builder: self + .builder + .property("default-accent-color", default_accent_color), + } + } - pub fn override_accent_color(self, override_accent_color: bool) -> Self { - Self { builder: self.builder.property("override-accent-color", override_accent_color), } - } + pub fn override_accent_color(self, override_accent_color: bool) -> Self { + Self { + builder: self + .builder + .property("override-accent-color", override_accent_color), + } + } - 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_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 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 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 { builder: self.builder.property("menubar", menubar.clone().upcast()), } - } + pub fn menubar(self, menubar: &impl IsA) -> Self { + Self { + builder: self.builder.property("menubar", menubar.clone().upcast()), + } + } - pub fn register_session(self, register_session: bool) -> Self { - Self { builder: self.builder.property("register-session", register_session), } - } + pub fn register_session(self, register_session: bool) -> Self { + Self { + builder: self.builder.property("register-session", register_session), + } + } - pub fn application_id(self, application_id: impl Into) -> Self { - Self { builder: self.builder.property("application-id", application_id.into()), } - } + pub fn application_id(self, application_id: impl Into) -> Self { + Self { + builder: self + .builder + .property("application-id", application_id.into()), + } + } - pub fn flags(self, flags: gio::ApplicationFlags) -> Self { - Self { builder: self.builder.property("flags", flags), } - } + pub fn flags(self, flags: gio::ApplicationFlags) -> Self { + Self { + builder: self.builder.property("flags", flags), + } + } - pub fn inactivity_timeout(self, inactivity_timeout: u32) -> Self { - Self { builder: self.builder.property("inactivity-timeout", inactivity_timeout), } - } + pub fn inactivity_timeout(self, inactivity_timeout: u32) -> Self { + Self { + builder: self + .builder + .property("inactivity-timeout", inactivity_timeout), + } + } - pub fn resource_base_path(self, resource_base_path: impl Into) -> Self { - Self { builder: self.builder.property("resource-base-path", resource_base_path.into()), } - } + pub fn resource_base_path(self, resource_base_path: impl Into) -> Self { + Self { + builder: self + .builder + .property("resource-base-path", resource_base_path.into()), + } + } - #[cfg(feature = "gio_v2_80")] + #[cfg(feature = "gio_v2_80")] #[cfg_attr(docsrs, doc(cfg(feature = "gio_v2_80")))] pub fn version(self, version: impl Into) -> Self { - Self { builder: self.builder.property("version", version.into()), } - } + Self { + builder: self.builder.property("version", version.into()), + } + } // rustdoc-stripper-ignore-next /// Build the [`Application`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Application { - let ret = self.builder.build(); + let ret = self.builder.build(); { Application::register_startup_hook(&ret); } - ret + ret } } @@ -116,7 +158,9 @@ pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_default_accent_color")] fn default_accent_color(&self) -> Option { unsafe { - from_glib_none(ffi::he_application_get_default_accent_color(self.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_application_get_default_accent_color( + self.as_ref().to_glib_none().0, + )) } } @@ -124,14 +168,19 @@ pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_override_accent_color")] fn is_override_accent_color(&self) -> bool { unsafe { - from_glib(ffi::he_application_get_override_accent_color(self.as_ref().to_glib_none().0)) + from_glib(ffi::he_application_get_override_accent_color( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_application_set_override_accent_color")] fn set_override_accent_color(&self, value: bool) { unsafe { - ffi::he_application_set_override_accent_color(self.as_ref().to_glib_none().0, value.into_glib()); + ffi::he_application_set_override_accent_color( + self.as_ref().to_glib_none().0, + value.into_glib(), + ); } } @@ -139,14 +188,19 @@ pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { #[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)) + 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()); + ffi::he_application_set_override_dark_style( + self.as_ref().to_glib_none().0, + value.into_glib(), + ); } } @@ -154,23 +208,26 @@ pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { #[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)) + 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()); + 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) - } + unsafe { ffi::he_application_get_default_contrast(self.as_ref().to_glib_none().0) } } #[doc(alias = "he_application_set_default_contrast")] @@ -180,79 +237,147 @@ pub trait HeApplicationExt: IsA + sealed::Sealed + 'static { } } - //#[doc(alias = "he_application_get_scheme_factory")] - //#[doc(alias = "get_scheme_factory")] - //fn scheme_factory(&self) -> /*Ignored*/Option { - // unsafe { TODO: call ffi:he_application_get_scheme_factory() } + //#[doc(alias = "he_application_get_default_scheme_variant")] + //#[doc(alias = "get_default_scheme_variant")] + //fn default_scheme_variant(&self) -> /*Ignored*/Option { + // unsafe { TODO: call ffi:he_application_get_default_scheme_variant() } //} - //#[doc(alias = "he_application_set_scheme_factory")] - //fn set_scheme_factory(&self, value: /*Ignored*/Option) { - // unsafe { TODO: call ffi:he_application_set_scheme_factory() } + //#[doc(alias = "he_application_set_default_scheme_variant")] + //fn set_default_scheme_variant(&self, value: /*Ignored*/Option) { + // unsafe { TODO: call ffi:he_application_set_default_scheme_variant() } //} #[doc(alias = "default-accent-color")] fn connect_default_accent_color_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_default_accent_color_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_default_accent_color_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::default-accent-color\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_default_accent_color_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::default-accent-color\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_default_accent_color_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "override-accent-color")] - fn connect_override_accent_color_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_override_accent_color_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + fn connect_override_accent_color_notify( + &self, + f: F, + ) -> SignalHandlerId { + unsafe extern "C" fn notify_override_accent_color_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-accent-color\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_override_accent_color_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::override-accent-color\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_override_accent_color_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "override-dark-style")] fn connect_override_dark_style_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_override_dark_style_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + 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)) + 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, F: Fn(&P) + 'static>(this: *mut ffi::HeApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + 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)) + 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, F: Fn(&P) + 'static>(this: *mut ffi::HeApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_default_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::default-contrast\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_default_contrast_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::default-contrast\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_default_contrast_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } } diff --git a/libhelium/src/auto/application_window.rs b/libhelium/src/auto/application_window.rs index b2eb9b8..c8319f7 100644 --- a/libhelium/src/auto/application_window.rs +++ b/libhelium/src/auto/application_window.rs @@ -1,11 +1,15 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi,Application}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; -use std::{boxed::Box as Box_}; +use crate::{ffi, Application}; +use glib::{ + prelude::*, + signal::{connect_raw, SignalHandlerId}, + translate::*, +}; +use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "HeApplicationWindow")] @@ -17,280 +21,401 @@ glib::wrapper! { } impl ApplicationWindow { - pub const NONE: Option<&'static ApplicationWindow> = None; - + pub const NONE: Option<&'static ApplicationWindow> = None; #[doc(alias = "he_application_window_new")] pub fn new(app: &impl IsA) -> ApplicationWindow { skip_assert_initialized!(); unsafe { - from_glib_none(ffi::he_application_window_new(app.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_application_window_new( + app.as_ref().to_glib_none().0, + )) } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`ApplicationWindow`] objects. - /// - /// This method returns an instance of [`ApplicationWindowBuilder`](crate::builders::ApplicationWindowBuilder) which can be used to create [`ApplicationWindow`] objects. - pub fn builder() -> ApplicationWindowBuilder { - ApplicationWindowBuilder::new() - } - + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`ApplicationWindow`] objects. + /// + /// This method returns an instance of [`ApplicationWindowBuilder`](crate::builders::ApplicationWindowBuilder) which can be used to create [`ApplicationWindow`] objects. + pub fn builder() -> ApplicationWindowBuilder { + ApplicationWindowBuilder::new() + } } impl Default for ApplicationWindow { - fn default() -> Self { - glib::object::Object::new::() - } - } + fn default() -> Self { + glib::object::Object::new::() + } +} // rustdoc-stripper-ignore-next - /// A [builder-pattern] type to construct [`ApplicationWindow`] objects. - /// - /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html +/// A [builder-pattern] type to construct [`ApplicationWindow`] objects. +/// +/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct ApplicationWindowBuilder { - builder: glib::object::ObjectBuilder<'static, ApplicationWindow>, - } + builder: glib::object::ObjectBuilder<'static, ApplicationWindow>, +} - impl ApplicationWindowBuilder { - fn new() -> Self { - Self { builder: glib::object::Object::builder() } +impl ApplicationWindowBuilder { + fn new() -> Self { + Self { + builder: glib::object::Object::builder(), } + } - pub fn has_title(self, has_title: bool) -> Self { - Self { builder: self.builder.property("has-title", has_title), } - } + pub fn has_title(self, has_title: bool) -> Self { + Self { + builder: self.builder.property("has-title", has_title), + } + } - pub fn has_back_button(self, has_back_button: bool) -> Self { - Self { builder: self.builder.property("has-back-button", has_back_button), } - } + pub fn has_back_button(self, has_back_button: bool) -> Self { + Self { + builder: self.builder.property("has-back-button", has_back_button), + } + } - pub fn show_menubar(self, show_menubar: bool) -> Self { - Self { builder: self.builder.property("show-menubar", show_menubar), } - } + pub fn show_menubar(self, show_menubar: bool) -> Self { + Self { + builder: self.builder.property("show-menubar", show_menubar), + } + } - pub fn application(self, application: &impl IsA) -> Self { - Self { builder: self.builder.property("application", application.clone().upcast()), } - } + pub fn application(self, application: &impl IsA) -> Self { + Self { + builder: self + .builder + .property("application", application.clone().upcast()), + } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { builder: self.builder.property("child", child.clone().upcast()), } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { + builder: self.builder.property("child", child.clone().upcast()), + } + } - pub fn decorated(self, decorated: bool) -> Self { - Self { builder: self.builder.property("decorated", decorated), } - } + pub fn decorated(self, decorated: bool) -> Self { + Self { + builder: self.builder.property("decorated", decorated), + } + } - pub fn default_height(self, default_height: i32) -> Self { - Self { builder: self.builder.property("default-height", default_height), } - } + pub fn default_height(self, default_height: i32) -> Self { + Self { + builder: self.builder.property("default-height", default_height), + } + } - pub fn default_widget(self, default_widget: &impl IsA) -> Self { - Self { builder: self.builder.property("default-widget", default_widget.clone().upcast()), } - } + pub fn default_widget(self, default_widget: &impl IsA) -> Self { + Self { + builder: self + .builder + .property("default-widget", default_widget.clone().upcast()), + } + } - pub fn default_width(self, default_width: i32) -> Self { - Self { builder: self.builder.property("default-width", default_width), } - } + pub fn default_width(self, default_width: i32) -> Self { + Self { + builder: self.builder.property("default-width", default_width), + } + } - pub fn deletable(self, deletable: bool) -> Self { - Self { builder: self.builder.property("deletable", deletable), } - } + pub fn deletable(self, deletable: bool) -> Self { + Self { + builder: self.builder.property("deletable", deletable), + } + } - pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self { - Self { builder: self.builder.property("destroy-with-parent", destroy_with_parent), } - } + pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self { + Self { + builder: self + .builder + .property("destroy-with-parent", destroy_with_parent), + } + } - //pub fn display(self, display: /*Ignored*/&gdk::Display) -> Self { - // Self { builder: self.builder.property("display", display), } - //} + //pub fn display(self, display: /*Ignored*/&gdk::Display) -> Self { + // Self { builder: self.builder.property("display", display), } + //} - pub fn focus_visible(self, focus_visible: bool) -> Self { - Self { builder: self.builder.property("focus-visible", focus_visible), } - } + pub fn focus_visible(self, focus_visible: bool) -> Self { + Self { + builder: self.builder.property("focus-visible", focus_visible), + } + } - pub fn focus_widget(self, focus_widget: &impl IsA) -> Self { - Self { builder: self.builder.property("focus-widget", focus_widget.clone().upcast()), } - } + pub fn focus_widget(self, focus_widget: &impl IsA) -> Self { + Self { + builder: self + .builder + .property("focus-widget", focus_widget.clone().upcast()), + } + } - pub fn fullscreened(self, fullscreened: bool) -> Self { - Self { builder: self.builder.property("fullscreened", fullscreened), } - } + pub fn fullscreened(self, fullscreened: bool) -> Self { + Self { + builder: self.builder.property("fullscreened", fullscreened), + } + } - #[cfg(feature = "gtk_v4_2")] + #[cfg(feature = "gtk_v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { - Self { builder: self.builder.property("handle-menubar-accel", handle_menubar_accel), } - } + Self { + builder: self + .builder + .property("handle-menubar-accel", handle_menubar_accel), + } + } - pub fn hide_on_close(self, hide_on_close: bool) -> Self { - Self { builder: self.builder.property("hide-on-close", hide_on_close), } - } + pub fn hide_on_close(self, hide_on_close: bool) -> Self { + Self { + builder: self.builder.property("hide-on-close", hide_on_close), + } + } - pub fn icon_name(self, icon_name: impl Into) -> Self { - Self { builder: self.builder.property("icon-name", icon_name.into()), } - } + pub fn icon_name(self, icon_name: impl Into) -> Self { + Self { + builder: self.builder.property("icon-name", icon_name.into()), + } + } - pub fn maximized(self, maximized: bool) -> Self { - Self { builder: self.builder.property("maximized", maximized), } - } + pub fn maximized(self, maximized: bool) -> Self { + Self { + builder: self.builder.property("maximized", maximized), + } + } - pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self { - Self { builder: self.builder.property("mnemonics-visible", mnemonics_visible), } - } + pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self { + Self { + builder: self + .builder + .property("mnemonics-visible", mnemonics_visible), + } + } - pub fn modal(self, modal: bool) -> Self { - Self { builder: self.builder.property("modal", modal), } - } + pub fn modal(self, modal: bool) -> Self { + Self { + builder: self.builder.property("modal", modal), + } + } - pub fn resizable(self, resizable: bool) -> Self { - Self { builder: self.builder.property("resizable", resizable), } - } + pub fn resizable(self, resizable: bool) -> Self { + Self { + builder: self.builder.property("resizable", resizable), + } + } - pub fn startup_id(self, startup_id: impl Into) -> Self { - Self { builder: self.builder.property("startup-id", startup_id.into()), } - } + pub fn startup_id(self, startup_id: impl Into) -> Self { + Self { + builder: self.builder.property("startup-id", startup_id.into()), + } + } - pub fn title(self, title: impl Into) -> Self { - Self { builder: self.builder.property("title", title.into()), } - } + pub fn title(self, title: impl Into) -> Self { + Self { + builder: self.builder.property("title", title.into()), + } + } - #[cfg(feature = "gtk_v4_6")] + #[cfg(feature = "gtk_v4_6")] #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_6")))] pub fn titlebar(self, titlebar: &impl IsA) -> Self { - Self { builder: self.builder.property("titlebar", titlebar.clone().upcast()), } - } + Self { + builder: self.builder.property("titlebar", titlebar.clone().upcast()), + } + } - pub fn transient_for(self, transient_for: &impl IsA) -> Self { - Self { builder: self.builder.property("transient-for", transient_for.clone().upcast()), } - } + pub fn transient_for(self, transient_for: &impl IsA) -> Self { + Self { + builder: self + .builder + .property("transient-for", transient_for.clone().upcast()), + } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { builder: self.builder.property("can-focus", can_focus), } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { + builder: self.builder.property("can-focus", can_focus), + } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { builder: self.builder.property("can-target", can_target), } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { + builder: self.builder.property("can-target", can_target), + } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { builder: self.builder.property("css-classes", css_classes.into()), } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { + builder: self.builder.property("css-classes", css_classes.into()), + } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { builder: self.builder.property("css-name", css_name.into()), } - } + pub fn css_name(self, css_name: impl Into) -> Self { + Self { + builder: self.builder.property("css-name", css_name.into()), + } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { builder: self.builder.property("focus-on-click", focus_on_click), } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { + builder: self.builder.property("focus-on-click", focus_on_click), + } + } - pub fn focusable(self, focusable: bool) -> Self { - Self { builder: self.builder.property("focusable", focusable), } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { + builder: self.builder.property("focusable", focusable), + } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { builder: self.builder.property("halign", halign), } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { + builder: self.builder.property("halign", halign), + } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { builder: self.builder.property("has-tooltip", has_tooltip), } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { + builder: self.builder.property("has-tooltip", has_tooltip), + } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { builder: self.builder.property("height-request", height_request), } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { + builder: self.builder.property("height-request", height_request), + } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { builder: self.builder.property("hexpand", hexpand), } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { + builder: self.builder.property("hexpand", hexpand), + } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { builder: self.builder.property("hexpand-set", hexpand_set), } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { + builder: self.builder.property("hexpand-set", hexpand_set), + } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { builder: self.builder.property("margin-bottom", margin_bottom), } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { + builder: self.builder.property("margin-bottom", margin_bottom), + } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { builder: self.builder.property("margin-end", margin_end), } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { + builder: self.builder.property("margin-end", margin_end), + } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { builder: self.builder.property("margin-start", margin_start), } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { + builder: self.builder.property("margin-start", margin_start), + } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { builder: self.builder.property("margin-top", margin_top), } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { + builder: self.builder.property("margin-top", margin_top), + } + } - pub fn name(self, name: impl Into) -> Self { - Self { builder: self.builder.property("name", name.into()), } - } + pub fn name(self, name: impl Into) -> Self { + Self { + builder: self.builder.property("name", name.into()), + } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { builder: self.builder.property("opacity", opacity), } - } + pub fn opacity(self, opacity: f64) -> Self { + Self { + builder: self.builder.property("opacity", opacity), + } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn receives_default(self, receives_default: bool) -> Self { - Self { builder: self.builder.property("receives-default", receives_default), } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { + builder: self.builder.property("receives-default", receives_default), + } + } - pub fn sensitive(self, sensitive: bool) -> Self { - Self { builder: self.builder.property("sensitive", sensitive), } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { + builder: self.builder.property("sensitive", sensitive), + } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { + builder: self + .builder + .property("tooltip-markup", tooltip_markup.into()), + } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { + builder: self.builder.property("tooltip-text", tooltip_text.into()), + } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { builder: self.builder.property("valign", valign), } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { + builder: self.builder.property("valign", valign), + } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { builder: self.builder.property("vexpand", vexpand), } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { + builder: self.builder.property("vexpand", vexpand), + } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { builder: self.builder.property("vexpand-set", vexpand_set), } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { + builder: self.builder.property("vexpand-set", vexpand_set), + } + } - pub fn visible(self, visible: bool) -> Self { - Self { builder: self.builder.property("visible", visible), } - } + pub fn visible(self, visible: bool) -> Self { + Self { + builder: self.builder.property("visible", visible), + } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { builder: self.builder.property("width-request", width_request), } - } + pub fn width_request(self, width_request: i32) -> Self { + Self { + builder: self.builder.property("width-request", width_request), + } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`ApplicationWindow`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> ApplicationWindow { - self.builder.build() } + self.builder.build() + } } mod sealed { @@ -303,14 +428,19 @@ pub trait ApplicationWindowExt: IsA + sealed::Sealed + 'stati #[doc(alias = "get_has_title")] fn has_title(&self) -> bool { unsafe { - from_glib(ffi::he_application_window_get_has_title(self.as_ref().to_glib_none().0)) + from_glib(ffi::he_application_window_get_has_title( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_application_window_set_has_title")] fn set_has_title(&self, value: bool) { unsafe { - ffi::he_application_window_set_has_title(self.as_ref().to_glib_none().0, value.into_glib()); + ffi::he_application_window_set_has_title( + self.as_ref().to_glib_none().0, + value.into_glib(), + ); } } @@ -318,40 +448,71 @@ pub trait ApplicationWindowExt: IsA + sealed::Sealed + 'stati #[doc(alias = "get_has_back_button")] fn has_back_button(&self) -> bool { unsafe { - from_glib(ffi::he_application_window_get_has_back_button(self.as_ref().to_glib_none().0)) + from_glib(ffi::he_application_window_get_has_back_button( + self.as_ref().to_glib_none().0, + )) } } #[doc(alias = "he_application_window_set_has_back_button")] fn set_has_back_button(&self, value: bool) { unsafe { - ffi::he_application_window_set_has_back_button(self.as_ref().to_glib_none().0, value.into_glib()); + ffi::he_application_window_set_has_back_button( + self.as_ref().to_glib_none().0, + value.into_glib(), + ); } } #[doc(alias = "has-title")] fn connect_has_title_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_has_title_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeApplicationWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_has_title_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::HeApplicationWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(ApplicationWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::has-title\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_has_title_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::has-title\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_has_title_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "has-back-button")] fn connect_has_back_button_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_has_back_button_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeApplicationWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_has_back_button_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::HeApplicationWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(ApplicationWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::has-back-button\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_has_back_button_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::has-back-button\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_has_back_button_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } } diff --git a/libhelium/src/auto/avatar.rs b/libhelium/src/auto/avatar.rs index d5602fa..366bb0d 100644 --- a/libhelium/src/auto/avatar.rs +++ b/libhelium/src/auto/avatar.rs @@ -1,11 +1,15 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi,Bin}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; -use std::{boxed::Box as Box_}; +use crate::{ffi, Bin}; +use glib::{ + prelude::*, + signal::{connect_raw, SignalHandlerId}, + translate::*, +}; +use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "HeAvatar")] @@ -17,178 +21,243 @@ glib::wrapper! { } impl Avatar { - pub const NONE: Option<&'static Avatar> = None; - - - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Avatar`] objects. - /// - /// This method returns an instance of [`AvatarBuilder`](crate::builders::AvatarBuilder) which can be used to create [`Avatar`] objects. - pub fn builder() -> AvatarBuilder { - AvatarBuilder::new() - } - + pub const NONE: Option<&'static Avatar> = None; + + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Avatar`] objects. + /// + /// This method returns an instance of [`AvatarBuilder`](crate::builders::AvatarBuilder) which can be used to create [`Avatar`] objects. + pub fn builder() -> AvatarBuilder { + AvatarBuilder::new() + } } // rustdoc-stripper-ignore-next - /// A [builder-pattern] type to construct [`Avatar`] objects. - /// - /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html +/// A [builder-pattern] type to construct [`Avatar`] objects. +/// +/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct AvatarBuilder { - builder: glib::object::ObjectBuilder<'static, Avatar>, - } + builder: glib::object::ObjectBuilder<'static, Avatar>, +} - impl AvatarBuilder { - fn new() -> Self { - Self { builder: glib::object::Object::builder() } +impl AvatarBuilder { + fn new() -> Self { + Self { + builder: glib::object::Object::builder(), } + } - pub fn size(self, size: i32) -> Self { - Self { builder: self.builder.property("size", size), } - } + pub fn size(self, size: i32) -> Self { + Self { + builder: self.builder.property("size", size), + } + } - pub fn text(self, text: impl Into) -> Self { - Self { builder: self.builder.property("text", text.into()), } - } + pub fn text(self, text: impl Into) -> Self { + Self { + builder: self.builder.property("text", text.into()), + } + } - pub fn status(self, status: bool) -> Self { - Self { builder: self.builder.property("status", status), } - } + pub fn status(self, status: bool) -> Self { + Self { + builder: self.builder.property("status", status), + } + } - pub fn image(self, image: impl Into) -> Self { - Self { builder: self.builder.property("image", image.into()), } - } + pub fn image(self, image: impl Into) -> Self { + Self { + builder: self.builder.property("image", image.into()), + } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { builder: self.builder.property("child", child.clone().upcast()), } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { + builder: self.builder.property("child", child.clone().upcast()), + } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { builder: self.builder.property("can-focus", can_focus), } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { + builder: self.builder.property("can-focus", can_focus), + } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { builder: self.builder.property("can-target", can_target), } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { + builder: self.builder.property("can-target", can_target), + } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { builder: self.builder.property("css-classes", css_classes.into()), } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { + builder: self.builder.property("css-classes", css_classes.into()), + } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { builder: self.builder.property("css-name", css_name.into()), } - } + pub fn css_name(self, css_name: impl Into) -> Self { + Self { + builder: self.builder.property("css-name", css_name.into()), + } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { builder: self.builder.property("focus-on-click", focus_on_click), } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { + builder: self.builder.property("focus-on-click", focus_on_click), + } + } - pub fn focusable(self, focusable: bool) -> Self { - Self { builder: self.builder.property("focusable", focusable), } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { + builder: self.builder.property("focusable", focusable), + } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { builder: self.builder.property("halign", halign), } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { + builder: self.builder.property("halign", halign), + } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { builder: self.builder.property("has-tooltip", has_tooltip), } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { + builder: self.builder.property("has-tooltip", has_tooltip), + } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { builder: self.builder.property("height-request", height_request), } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { + builder: self.builder.property("height-request", height_request), + } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { builder: self.builder.property("hexpand", hexpand), } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { + builder: self.builder.property("hexpand", hexpand), + } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { builder: self.builder.property("hexpand-set", hexpand_set), } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { + builder: self.builder.property("hexpand-set", hexpand_set), + } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { builder: self.builder.property("margin-bottom", margin_bottom), } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { + builder: self.builder.property("margin-bottom", margin_bottom), + } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { builder: self.builder.property("margin-end", margin_end), } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { + builder: self.builder.property("margin-end", margin_end), + } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { builder: self.builder.property("margin-start", margin_start), } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { + builder: self.builder.property("margin-start", margin_start), + } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { builder: self.builder.property("margin-top", margin_top), } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { + builder: self.builder.property("margin-top", margin_top), + } + } - pub fn name(self, name: impl Into) -> Self { - Self { builder: self.builder.property("name", name.into()), } - } + pub fn name(self, name: impl Into) -> Self { + Self { + builder: self.builder.property("name", name.into()), + } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { builder: self.builder.property("opacity", opacity), } - } + pub fn opacity(self, opacity: f64) -> Self { + Self { + builder: self.builder.property("opacity", opacity), + } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn receives_default(self, receives_default: bool) -> Self { - Self { builder: self.builder.property("receives-default", receives_default), } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { + builder: self.builder.property("receives-default", receives_default), + } + } - pub fn sensitive(self, sensitive: bool) -> Self { - Self { builder: self.builder.property("sensitive", sensitive), } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { + builder: self.builder.property("sensitive", sensitive), + } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { + builder: self + .builder + .property("tooltip-markup", tooltip_markup.into()), + } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { + builder: self.builder.property("tooltip-text", tooltip_text.into()), + } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { builder: self.builder.property("valign", valign), } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { + builder: self.builder.property("valign", valign), + } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { builder: self.builder.property("vexpand", vexpand), } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { + builder: self.builder.property("vexpand", vexpand), + } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { builder: self.builder.property("vexpand-set", vexpand_set), } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { + builder: self.builder.property("vexpand-set", vexpand_set), + } + } - pub fn visible(self, visible: bool) -> Self { - Self { builder: self.builder.property("visible", visible), } - } + pub fn visible(self, visible: bool) -> Self { + Self { + builder: self.builder.property("visible", visible), + } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { builder: self.builder.property("width-request", width_request), } - } + pub fn width_request(self, width_request: i32) -> Self { + Self { + builder: self.builder.property("width-request", width_request), + } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`Avatar`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Avatar { - self.builder.build() } + self.builder.build() + } } mod sealed { @@ -200,9 +269,7 @@ pub trait AvatarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_avatar_get_size")] #[doc(alias = "get_size")] fn size(&self) -> i32 { - unsafe { - ffi::he_avatar_get_size(self.as_ref().to_glib_none().0) - } + unsafe { ffi::he_avatar_get_size(self.as_ref().to_glib_none().0) } } #[doc(alias = "he_avatar_set_size")] @@ -215,9 +282,7 @@ pub trait AvatarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_avatar_get_text")] #[doc(alias = "get_text")] fn text(&self) -> Option { - unsafe { - from_glib_none(ffi::he_avatar_get_text(self.as_ref().to_glib_none().0)) - } + unsafe { from_glib_none(ffi::he_avatar_get_text(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_avatar_set_text")] @@ -230,9 +295,7 @@ pub trait AvatarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_avatar_get_status")] #[doc(alias = "get_status")] fn is_status(&self) -> bool { - unsafe { - from_glib(ffi::he_avatar_get_status(self.as_ref().to_glib_none().0)) - } + unsafe { from_glib(ffi::he_avatar_get_status(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_avatar_set_status")] @@ -245,9 +308,7 @@ pub trait AvatarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_avatar_get_image")] #[doc(alias = "get_image")] fn image(&self) -> Option { - unsafe { - from_glib_none(ffi::he_avatar_get_image(self.as_ref().to_glib_none().0)) - } + unsafe { from_glib_none(ffi::he_avatar_get_image(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_avatar_set_image")] @@ -259,53 +320,93 @@ pub trait AvatarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "size")] fn connect_size_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_size_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAvatar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_size_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAvatar, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Avatar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::size\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_size_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::size\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_size_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "text")] fn connect_text_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_text_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAvatar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_text_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAvatar, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Avatar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::text\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_text_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::text\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_text_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "status")] fn connect_status_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_status_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAvatar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_status_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAvatar, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Avatar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::status\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_status_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::status\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_status_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "image")] fn connect_image_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_image_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeAvatar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_image_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeAvatar, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Avatar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::image\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_image_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::image\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_image_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } } diff --git a/libhelium/src/auto/badge.rs b/libhelium/src/auto/badge.rs index 1bbcbd5..be06ecf 100644 --- a/libhelium/src/auto/badge.rs +++ b/libhelium/src/auto/badge.rs @@ -1,11 +1,15 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi,Bin}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; -use std::{boxed::Box as Box_}; +use crate::{ffi, Bin}; +use glib::{ + prelude::*, + signal::{connect_raw, SignalHandlerId}, + translate::*, +}; +use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "HeBadge")] @@ -17,180 +21,237 @@ glib::wrapper! { } impl Badge { - pub const NONE: Option<&'static Badge> = None; - + pub const NONE: Option<&'static Badge> = None; #[doc(alias = "he_badge_new")] pub fn new() -> Badge { assert_initialized_main_thread!(); - unsafe { - from_glib_none(ffi::he_badge_new()) - } + unsafe { from_glib_none(ffi::he_badge_new()) } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Badge`] objects. - /// - /// This method returns an instance of [`BadgeBuilder`](crate::builders::BadgeBuilder) which can be used to create [`Badge`] objects. - pub fn builder() -> BadgeBuilder { - BadgeBuilder::new() - } - + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Badge`] objects. + /// + /// This method returns an instance of [`BadgeBuilder`](crate::builders::BadgeBuilder) which can be used to create [`Badge`] objects. + pub fn builder() -> BadgeBuilder { + BadgeBuilder::new() + } } impl Default for Badge { - fn default() -> Self { - Self::new() - } - } + fn default() -> Self { + Self::new() + } +} // rustdoc-stripper-ignore-next - /// A [builder-pattern] type to construct [`Badge`] objects. - /// - /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html +/// A [builder-pattern] type to construct [`Badge`] objects. +/// +/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct BadgeBuilder { - builder: glib::object::ObjectBuilder<'static, Badge>, - } + builder: glib::object::ObjectBuilder<'static, Badge>, +} - impl BadgeBuilder { - fn new() -> Self { - Self { builder: glib::object::Object::builder() } +impl BadgeBuilder { + fn new() -> Self { + Self { + builder: glib::object::Object::builder(), } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { builder: self.builder.property("child", child.clone().upcast()), } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { + builder: self.builder.property("child", child.clone().upcast()), + } + } - pub fn label(self, label: impl Into) -> Self { - Self { builder: self.builder.property("label", label.into()), } - } + pub fn label(self, label: impl Into) -> Self { + Self { + builder: self.builder.property("label", label.into()), + } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { builder: self.builder.property("can-focus", can_focus), } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { + builder: self.builder.property("can-focus", can_focus), + } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { builder: self.builder.property("can-target", can_target), } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { + builder: self.builder.property("can-target", can_target), + } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { builder: self.builder.property("css-classes", css_classes.into()), } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { + builder: self.builder.property("css-classes", css_classes.into()), + } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { builder: self.builder.property("css-name", css_name.into()), } - } + pub fn css_name(self, css_name: impl Into) -> Self { + Self { + builder: self.builder.property("css-name", css_name.into()), + } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { builder: self.builder.property("focus-on-click", focus_on_click), } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { + builder: self.builder.property("focus-on-click", focus_on_click), + } + } - pub fn focusable(self, focusable: bool) -> Self { - Self { builder: self.builder.property("focusable", focusable), } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { + builder: self.builder.property("focusable", focusable), + } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { builder: self.builder.property("halign", halign), } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { + builder: self.builder.property("halign", halign), + } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { builder: self.builder.property("has-tooltip", has_tooltip), } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { + builder: self.builder.property("has-tooltip", has_tooltip), + } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { builder: self.builder.property("height-request", height_request), } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { + builder: self.builder.property("height-request", height_request), + } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { builder: self.builder.property("hexpand", hexpand), } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { + builder: self.builder.property("hexpand", hexpand), + } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { builder: self.builder.property("hexpand-set", hexpand_set), } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { + builder: self.builder.property("hexpand-set", hexpand_set), + } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { builder: self.builder.property("margin-bottom", margin_bottom), } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { + builder: self.builder.property("margin-bottom", margin_bottom), + } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { builder: self.builder.property("margin-end", margin_end), } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { + builder: self.builder.property("margin-end", margin_end), + } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { builder: self.builder.property("margin-start", margin_start), } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { + builder: self.builder.property("margin-start", margin_start), + } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { builder: self.builder.property("margin-top", margin_top), } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { + builder: self.builder.property("margin-top", margin_top), + } + } - pub fn name(self, name: impl Into) -> Self { - Self { builder: self.builder.property("name", name.into()), } - } + pub fn name(self, name: impl Into) -> Self { + Self { + builder: self.builder.property("name", name.into()), + } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { builder: self.builder.property("opacity", opacity), } - } + pub fn opacity(self, opacity: f64) -> Self { + Self { + builder: self.builder.property("opacity", opacity), + } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn receives_default(self, receives_default: bool) -> Self { - Self { builder: self.builder.property("receives-default", receives_default), } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { + builder: self.builder.property("receives-default", receives_default), + } + } - pub fn sensitive(self, sensitive: bool) -> Self { - Self { builder: self.builder.property("sensitive", sensitive), } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { + builder: self.builder.property("sensitive", sensitive), + } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { + builder: self + .builder + .property("tooltip-markup", tooltip_markup.into()), + } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { + builder: self.builder.property("tooltip-text", tooltip_text.into()), + } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { builder: self.builder.property("valign", valign), } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { + builder: self.builder.property("valign", valign), + } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { builder: self.builder.property("vexpand", vexpand), } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { + builder: self.builder.property("vexpand", vexpand), + } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { builder: self.builder.property("vexpand-set", vexpand_set), } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { + builder: self.builder.property("vexpand-set", vexpand_set), + } + } - pub fn visible(self, visible: bool) -> Self { - Self { builder: self.builder.property("visible", visible), } - } + pub fn visible(self, visible: bool) -> Self { + Self { + builder: self.builder.property("visible", visible), + } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { builder: self.builder.property("width-request", width_request), } - } + pub fn width_request(self, width_request: i32) -> Self { + Self { + builder: self.builder.property("width-request", width_request), + } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`Badge`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Badge { - self.builder.build() } + self.builder.build() + } } mod sealed { @@ -202,24 +263,23 @@ pub trait BadgeExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_badge_get_child")] #[doc(alias = "get_child")] fn child(&self) -> Option { - unsafe { - from_glib_none(ffi::he_badge_get_child(self.as_ref().to_glib_none().0)) - } + unsafe { from_glib_none(ffi::he_badge_get_child(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_badge_set_child")] fn set_child(&self, value: Option<&impl IsA>) { unsafe { - ffi::he_badge_set_child(self.as_ref().to_glib_none().0, value.map(|p| p.as_ref()).to_glib_none().0); + ffi::he_badge_set_child( + self.as_ref().to_glib_none().0, + value.map(|p| p.as_ref()).to_glib_none().0, + ); } } #[doc(alias = "he_badge_get_label")] #[doc(alias = "get_label")] fn label(&self) -> Option { - unsafe { - from_glib_none(ffi::he_badge_get_label(self.as_ref().to_glib_none().0)) - } + unsafe { from_glib_none(ffi::he_badge_get_label(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_badge_set_label")] @@ -231,14 +291,24 @@ pub trait BadgeExt: IsA + sealed::Sealed + 'static { #[doc(alias = "label")] fn connect_label_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_label_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeBadge, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_label_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeBadge, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Badge::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::label\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_label_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::label\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_label_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } } diff --git a/libhelium/src/auto/banner.rs b/libhelium/src/auto/banner.rs index 94a2830..d889b49 100644 --- a/libhelium/src/auto/banner.rs +++ b/libhelium/src/auto/banner.rs @@ -1,11 +1,15 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi,BannerStyle,Bin}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; -use std::{boxed::Box as Box_}; +use crate::{ffi, BannerStyle, Bin}; +use glib::{ + prelude::*, + signal::{connect_raw, SignalHandlerId}, + translate::*, +}; +use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "HeBanner")] @@ -17,188 +21,254 @@ glib::wrapper! { } impl Banner { - pub const NONE: Option<&'static Banner> = None; - + pub const NONE: Option<&'static Banner> = None; #[doc(alias = "he_banner_new")] pub fn new(title: &str, description: &str) -> Banner { assert_initialized_main_thread!(); unsafe { - from_glib_none(ffi::he_banner_new(title.to_glib_none().0, description.to_glib_none().0)) + from_glib_none(ffi::he_banner_new( + title.to_glib_none().0, + description.to_glib_none().0, + )) } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Banner`] objects. - /// - /// This method returns an instance of [`BannerBuilder`](crate::builders::BannerBuilder) which can be used to create [`Banner`] objects. - pub fn builder() -> BannerBuilder { - BannerBuilder::new() - } - + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Banner`] objects. + /// + /// This method returns an instance of [`BannerBuilder`](crate::builders::BannerBuilder) which can be used to create [`Banner`] objects. + pub fn builder() -> BannerBuilder { + BannerBuilder::new() + } } impl Default for Banner { - fn default() -> Self { - glib::object::Object::new::() - } - } + fn default() -> Self { + glib::object::Object::new::() + } +} // rustdoc-stripper-ignore-next - /// A [builder-pattern] type to construct [`Banner`] objects. - /// - /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html +/// A [builder-pattern] type to construct [`Banner`] objects. +/// +/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct BannerBuilder { - builder: glib::object::ObjectBuilder<'static, Banner>, - } + builder: glib::object::ObjectBuilder<'static, Banner>, +} - impl BannerBuilder { - fn new() -> Self { - Self { builder: glib::object::Object::builder() } +impl BannerBuilder { + fn new() -> Self { + Self { + builder: glib::object::Object::builder(), } + } - pub fn title(self, title: impl Into) -> Self { - Self { builder: self.builder.property("title", title.into()), } - } + pub fn title(self, title: impl Into) -> Self { + Self { + builder: self.builder.property("title", title.into()), + } + } - pub fn description(self, description: impl Into) -> Self { - Self { builder: self.builder.property("description", description.into()), } - } + pub fn description(self, description: impl Into) -> Self { + Self { + builder: self.builder.property("description", description.into()), + } + } - pub fn style(self, style: BannerStyle) -> Self { - Self { builder: self.builder.property("style", style), } - } + pub fn style(self, style: BannerStyle) -> Self { + Self { + builder: self.builder.property("style", style), + } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { builder: self.builder.property("child", child.clone().upcast()), } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { + builder: self.builder.property("child", child.clone().upcast()), + } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { builder: self.builder.property("can-focus", can_focus), } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { + builder: self.builder.property("can-focus", can_focus), + } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { builder: self.builder.property("can-target", can_target), } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { + builder: self.builder.property("can-target", can_target), + } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { builder: self.builder.property("css-classes", css_classes.into()), } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { + builder: self.builder.property("css-classes", css_classes.into()), + } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { builder: self.builder.property("css-name", css_name.into()), } - } + pub fn css_name(self, css_name: impl Into) -> Self { + Self { + builder: self.builder.property("css-name", css_name.into()), + } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { builder: self.builder.property("focus-on-click", focus_on_click), } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { + builder: self.builder.property("focus-on-click", focus_on_click), + } + } - pub fn focusable(self, focusable: bool) -> Self { - Self { builder: self.builder.property("focusable", focusable), } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { + builder: self.builder.property("focusable", focusable), + } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { builder: self.builder.property("halign", halign), } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { + builder: self.builder.property("halign", halign), + } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { builder: self.builder.property("has-tooltip", has_tooltip), } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { + builder: self.builder.property("has-tooltip", has_tooltip), + } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { builder: self.builder.property("height-request", height_request), } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { + builder: self.builder.property("height-request", height_request), + } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { builder: self.builder.property("hexpand", hexpand), } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { + builder: self.builder.property("hexpand", hexpand), + } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { builder: self.builder.property("hexpand-set", hexpand_set), } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { + builder: self.builder.property("hexpand-set", hexpand_set), + } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { builder: self.builder.property("margin-bottom", margin_bottom), } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { + builder: self.builder.property("margin-bottom", margin_bottom), + } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { builder: self.builder.property("margin-end", margin_end), } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { + builder: self.builder.property("margin-end", margin_end), + } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { builder: self.builder.property("margin-start", margin_start), } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { + builder: self.builder.property("margin-start", margin_start), + } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { builder: self.builder.property("margin-top", margin_top), } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { + builder: self.builder.property("margin-top", margin_top), + } + } - pub fn name(self, name: impl Into) -> Self { - Self { builder: self.builder.property("name", name.into()), } - } + pub fn name(self, name: impl Into) -> Self { + Self { + builder: self.builder.property("name", name.into()), + } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { builder: self.builder.property("opacity", opacity), } - } + pub fn opacity(self, opacity: f64) -> Self { + Self { + builder: self.builder.property("opacity", opacity), + } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn receives_default(self, receives_default: bool) -> Self { - Self { builder: self.builder.property("receives-default", receives_default), } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { + builder: self.builder.property("receives-default", receives_default), + } + } - pub fn sensitive(self, sensitive: bool) -> Self { - Self { builder: self.builder.property("sensitive", sensitive), } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { + builder: self.builder.property("sensitive", sensitive), + } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { + builder: self + .builder + .property("tooltip-markup", tooltip_markup.into()), + } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { + builder: self.builder.property("tooltip-text", tooltip_text.into()), + } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { builder: self.builder.property("valign", valign), } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { + builder: self.builder.property("valign", valign), + } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { builder: self.builder.property("vexpand", vexpand), } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { + builder: self.builder.property("vexpand", vexpand), + } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { builder: self.builder.property("vexpand-set", vexpand_set), } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { + builder: self.builder.property("vexpand-set", vexpand_set), + } + } - pub fn visible(self, visible: bool) -> Self { - Self { builder: self.builder.property("visible", visible), } - } + pub fn visible(self, visible: bool) -> Self { + Self { + builder: self.builder.property("visible", visible), + } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { builder: self.builder.property("width-request", width_request), } - } + pub fn width_request(self, width_request: i32) -> Self { + Self { + builder: self.builder.property("width-request", width_request), + } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`Banner`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Banner { - self.builder.build() } + self.builder.build() + } } mod sealed { @@ -210,14 +280,20 @@ pub trait BannerExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_banner_add_action_button")] fn add_action_button(&self, widget: &impl IsA) { unsafe { - ffi::he_banner_add_action_button(self.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0); + ffi::he_banner_add_action_button( + self.as_ref().to_glib_none().0, + widget.as_ref().to_glib_none().0, + ); } } #[doc(alias = "he_banner_remove_action")] fn remove_action(&self, widget: &impl IsA) { unsafe { - ffi::he_banner_remove_action(self.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0); + ffi::he_banner_remove_action( + self.as_ref().to_glib_none().0, + widget.as_ref().to_glib_none().0, + ); } } @@ -231,9 +307,7 @@ pub trait BannerExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_banner_get_title")] #[doc(alias = "get_title")] fn title(&self) -> glib::GString { - unsafe { - from_glib_none(ffi::he_banner_get_title(self.as_ref().to_glib_none().0)) - } + unsafe { from_glib_none(ffi::he_banner_get_title(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_banner_set_title")] @@ -247,7 +321,9 @@ pub trait BannerExt: IsA + sealed::Sealed + 'static { #[doc(alias = "get_description")] fn description(&self) -> glib::GString { unsafe { - from_glib_none(ffi::he_banner_get_description(self.as_ref().to_glib_none().0)) + from_glib_none(ffi::he_banner_get_description( + self.as_ref().to_glib_none().0, + )) } } @@ -261,9 +337,7 @@ pub trait BannerExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_banner_get_style")] #[doc(alias = "get_style")] fn style(&self) -> BannerStyle { - unsafe { - from_glib(ffi::he_banner_get_style(self.as_ref().to_glib_none().0)) - } + unsafe { from_glib(ffi::he_banner_get_style(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_banner_set_style")] @@ -275,40 +349,70 @@ pub trait BannerExt: IsA + sealed::Sealed + 'static { #[doc(alias = "title")] fn connect_title_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_title_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeBanner, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_title_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeBanner, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Banner::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::title\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_title_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::title\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_title_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "description")] fn connect_description_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_description_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeBanner, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_description_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeBanner, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Banner::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::description\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_description_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::description\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_description_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } #[doc(alias = "style")] fn connect_style_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_style_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeBanner, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_style_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeBanner, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Banner::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::style\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_style_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::style\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_style_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } } diff --git a/libhelium/src/auto/bin.rs b/libhelium/src/auto/bin.rs index 203bb43..c60ff7b 100644 --- a/libhelium/src/auto/bin.rs +++ b/libhelium/src/auto/bin.rs @@ -1,11 +1,15 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; -use std::{boxed::Box as Box_}; +use crate::ffi; +use glib::{ + prelude::*, + signal::{connect_raw, SignalHandlerId}, + translate::*, +}; +use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "HeBin")] @@ -17,176 +21,231 @@ glib::wrapper! { } impl Bin { - pub const NONE: Option<&'static Bin> = None; - + pub const NONE: Option<&'static Bin> = None; #[doc(alias = "he_bin_new")] pub fn new() -> Bin { assert_initialized_main_thread!(); - unsafe { - from_glib_none(ffi::he_bin_new()) - } + unsafe { from_glib_none(ffi::he_bin_new()) } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`Bin`] objects. - /// - /// This method returns an instance of [`BinBuilder`](crate::builders::BinBuilder) which can be used to create [`Bin`] objects. - pub fn builder() -> BinBuilder { - BinBuilder::new() - } - + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`Bin`] objects. + /// + /// This method returns an instance of [`BinBuilder`](crate::builders::BinBuilder) which can be used to create [`Bin`] objects. + pub fn builder() -> BinBuilder { + BinBuilder::new() + } } impl Default for Bin { - fn default() -> Self { - Self::new() - } - } + fn default() -> Self { + Self::new() + } +} // rustdoc-stripper-ignore-next - /// A [builder-pattern] type to construct [`Bin`] objects. - /// - /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html +/// A [builder-pattern] type to construct [`Bin`] objects. +/// +/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct BinBuilder { - builder: glib::object::ObjectBuilder<'static, Bin>, - } + builder: glib::object::ObjectBuilder<'static, Bin>, +} - impl BinBuilder { - fn new() -> Self { - Self { builder: glib::object::Object::builder() } +impl BinBuilder { + fn new() -> Self { + Self { + builder: glib::object::Object::builder(), } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { builder: self.builder.property("child", child.clone().upcast()), } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { + builder: self.builder.property("child", child.clone().upcast()), + } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { builder: self.builder.property("can-focus", can_focus), } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { + builder: self.builder.property("can-focus", can_focus), + } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { builder: self.builder.property("can-target", can_target), } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { + builder: self.builder.property("can-target", can_target), + } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { builder: self.builder.property("css-classes", css_classes.into()), } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { + builder: self.builder.property("css-classes", css_classes.into()), + } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { builder: self.builder.property("css-name", css_name.into()), } - } + pub fn css_name(self, css_name: impl Into) -> Self { + Self { + builder: self.builder.property("css-name", css_name.into()), + } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { builder: self.builder.property("focus-on-click", focus_on_click), } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { + builder: self.builder.property("focus-on-click", focus_on_click), + } + } - pub fn focusable(self, focusable: bool) -> Self { - Self { builder: self.builder.property("focusable", focusable), } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { + builder: self.builder.property("focusable", focusable), + } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { builder: self.builder.property("halign", halign), } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { + builder: self.builder.property("halign", halign), + } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { builder: self.builder.property("has-tooltip", has_tooltip), } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { + builder: self.builder.property("has-tooltip", has_tooltip), + } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { builder: self.builder.property("height-request", height_request), } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { + builder: self.builder.property("height-request", height_request), + } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { builder: self.builder.property("hexpand", hexpand), } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { + builder: self.builder.property("hexpand", hexpand), + } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { builder: self.builder.property("hexpand-set", hexpand_set), } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { + builder: self.builder.property("hexpand-set", hexpand_set), + } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { builder: self.builder.property("margin-bottom", margin_bottom), } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { + builder: self.builder.property("margin-bottom", margin_bottom), + } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { builder: self.builder.property("margin-end", margin_end), } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { + builder: self.builder.property("margin-end", margin_end), + } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { builder: self.builder.property("margin-start", margin_start), } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { + builder: self.builder.property("margin-start", margin_start), + } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { builder: self.builder.property("margin-top", margin_top), } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { + builder: self.builder.property("margin-top", margin_top), + } + } - pub fn name(self, name: impl Into) -> Self { - Self { builder: self.builder.property("name", name.into()), } - } + pub fn name(self, name: impl Into) -> Self { + Self { + builder: self.builder.property("name", name.into()), + } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { builder: self.builder.property("opacity", opacity), } - } + pub fn opacity(self, opacity: f64) -> Self { + Self { + builder: self.builder.property("opacity", opacity), + } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn receives_default(self, receives_default: bool) -> Self { - Self { builder: self.builder.property("receives-default", receives_default), } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { + builder: self.builder.property("receives-default", receives_default), + } + } - pub fn sensitive(self, sensitive: bool) -> Self { - Self { builder: self.builder.property("sensitive", sensitive), } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { + builder: self.builder.property("sensitive", sensitive), + } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { + builder: self + .builder + .property("tooltip-markup", tooltip_markup.into()), + } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { + builder: self.builder.property("tooltip-text", tooltip_text.into()), + } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { builder: self.builder.property("valign", valign), } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { + builder: self.builder.property("valign", valign), + } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { builder: self.builder.property("vexpand", vexpand), } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { + builder: self.builder.property("vexpand", vexpand), + } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { builder: self.builder.property("vexpand-set", vexpand_set), } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { + builder: self.builder.property("vexpand-set", vexpand_set), + } + } - pub fn visible(self, visible: bool) -> Self { - Self { builder: self.builder.property("visible", visible), } - } + pub fn visible(self, visible: bool) -> Self { + Self { + builder: self.builder.property("visible", visible), + } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { builder: self.builder.property("width-request", width_request), } - } + pub fn width_request(self, width_request: i32) -> Self { + Self { + builder: self.builder.property("width-request", width_request), + } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`Bin`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Bin { - self.builder.build() } + self.builder.build() + } } mod sealed { @@ -196,37 +255,58 @@ mod sealed { pub trait BinExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_bin_add_child")] - fn add_child(&self, builder: >k::Builder, child: &impl IsA, type_: Option<&str>) { + fn add_child( + &self, + builder: >k::Builder, + child: &impl IsA, + type_: Option<&str>, + ) { unsafe { - ffi::he_bin_add_child(self.as_ref().to_glib_none().0, builder.to_glib_none().0, child.as_ref().to_glib_none().0, type_.to_glib_none().0); + ffi::he_bin_add_child( + self.as_ref().to_glib_none().0, + builder.to_glib_none().0, + child.as_ref().to_glib_none().0, + type_.to_glib_none().0, + ); } } #[doc(alias = "he_bin_get_child")] #[doc(alias = "get_child")] fn child(&self) -> gtk::Widget { - unsafe { - from_glib_none(ffi::he_bin_get_child(self.as_ref().to_glib_none().0)) - } + unsafe { from_glib_none(ffi::he_bin_get_child(self.as_ref().to_glib_none().0)) } } #[doc(alias = "he_bin_set_child")] fn set_child(&self, value: &impl IsA) { unsafe { - ffi::he_bin_set_child(self.as_ref().to_glib_none().0, value.as_ref().to_glib_none().0); + ffi::he_bin_set_child( + self.as_ref().to_glib_none().0, + value.as_ref().to_glib_none().0, + ); } } #[doc(alias = "child")] fn connect_child_notify(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn notify_child_trampoline, F: Fn(&P) + 'static>(this: *mut ffi::HeBin, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) { + unsafe extern "C" fn notify_child_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::HeBin, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { let f: &F = &*(f as *const F); f(Bin::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); - connect_raw(self.as_ptr() as *mut _, b"notify::child\0".as_ptr() as *const _, - Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_child_trampoline:: as *const ())), Box_::into_raw(f)) + connect_raw( + self.as_ptr() as *mut _, + b"notify::child\0".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_child_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) } } } diff --git a/libhelium/src/auto/bottom_bar.rs b/libhelium/src/auto/bottom_bar.rs index 0b0fbe1..c798688 100644 --- a/libhelium/src/auto/bottom_bar.rs +++ b/libhelium/src/auto/bottom_bar.rs @@ -1,11 +1,15 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) -// from +// from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT -use crate::{ffi,Bin,BottomBarPosition,Button}; -use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; -use std::{boxed::Box as Box_}; +use crate::{ffi, Bin, BottomBarPosition, Button}; +use glib::{ + prelude::*, + signal::{connect_raw, SignalHandlerId}, + translate::*, +}; +use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "HeBottomBar")] @@ -17,200 +21,268 @@ glib::wrapper! { } impl BottomBar { - pub const NONE: Option<&'static BottomBar> = None; - + pub const NONE: Option<&'static BottomBar> = None; #[doc(alias = "he_bottom_bar_new_with_details")] pub fn with_details(title: &str, description: &str) -> BottomBar { assert_initialized_main_thread!(); unsafe { - from_glib_none(ffi::he_bottom_bar_new_with_details(title.to_glib_none().0, description.to_glib_none().0)) + from_glib_none(ffi::he_bottom_bar_new_with_details( + title.to_glib_none().0, + description.to_glib_none().0, + )) } } #[doc(alias = "he_bottom_bar_new")] pub fn new() -> BottomBar { assert_initialized_main_thread!(); - unsafe { - from_glib_none(ffi::he_bottom_bar_new()) - } + unsafe { from_glib_none(ffi::he_bottom_bar_new()) } } - // rustdoc-stripper-ignore-next - /// Creates a new builder-pattern struct instance to construct [`BottomBar`] objects. - /// - /// This method returns an instance of [`BottomBarBuilder`](crate::builders::BottomBarBuilder) which can be used to create [`BottomBar`] objects. - pub fn builder() -> BottomBarBuilder { - BottomBarBuilder::new() - } - + // rustdoc-stripper-ignore-next + /// Creates a new builder-pattern struct instance to construct [`BottomBar`] objects. + /// + /// This method returns an instance of [`BottomBarBuilder`](crate::builders::BottomBarBuilder) which can be used to create [`BottomBar`] objects. + pub fn builder() -> BottomBarBuilder { + BottomBarBuilder::new() + } } impl Default for BottomBar { - fn default() -> Self { - Self::new() - } - } + fn default() -> Self { + Self::new() + } +} // rustdoc-stripper-ignore-next - /// A [builder-pattern] type to construct [`BottomBar`] objects. - /// - /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html +/// A [builder-pattern] type to construct [`BottomBar`] objects. +/// +/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct BottomBarBuilder { - builder: glib::object::ObjectBuilder<'static, BottomBar>, - } + builder: glib::object::ObjectBuilder<'static, BottomBar>, +} - impl BottomBarBuilder { - fn new() -> Self { - Self { builder: glib::object::Object::builder() } +impl BottomBarBuilder { + fn new() -> Self { + Self { + builder: glib::object::Object::builder(), } + } - pub fn title(self, title: impl Into) -> Self { - Self { builder: self.builder.property("title", title.into()), } - } + pub fn title(self, title: impl Into) -> Self { + Self { + builder: self.builder.property("title", title.into()), + } + } - pub fn description(self, description: impl Into) -> Self { - Self { builder: self.builder.property("description", description.into()), } - } + pub fn description(self, description: impl Into) -> Self { + Self { + builder: self.builder.property("description", description.into()), + } + } - pub fn menu_model(self, menu_model: &impl IsA) -> Self { - Self { builder: self.builder.property("menu-model", menu_model.clone().upcast()), } - } + pub fn menu_model(self, menu_model: &impl IsA) -> Self { + Self { + builder: self + .builder + .property("menu-model", menu_model.clone().upcast()), + } + } - pub fn collapse_actions(self, collapse_actions: bool) -> Self { - Self { builder: self.builder.property("collapse-actions", collapse_actions), } - } + pub fn collapse_actions(self, collapse_actions: bool) -> Self { + Self { + builder: self.builder.property("collapse-actions", collapse_actions), + } + } - pub fn child(self, child: &impl IsA) -> Self { - Self { builder: self.builder.property("child", child.clone().upcast()), } - } + pub fn child(self, child: &impl IsA) -> Self { + Self { + builder: self.builder.property("child", child.clone().upcast()), + } + } - pub fn can_focus(self, can_focus: bool) -> Self { - Self { builder: self.builder.property("can-focus", can_focus), } - } + pub fn can_focus(self, can_focus: bool) -> Self { + Self { + builder: self.builder.property("can-focus", can_focus), + } + } - pub fn can_target(self, can_target: bool) -> Self { - Self { builder: self.builder.property("can-target", can_target), } - } + pub fn can_target(self, can_target: bool) -> Self { + Self { + builder: self.builder.property("can-target", can_target), + } + } - pub fn css_classes(self, css_classes: impl Into) -> Self { - Self { builder: self.builder.property("css-classes", css_classes.into()), } - } + pub fn css_classes(self, css_classes: impl Into) -> Self { + Self { + builder: self.builder.property("css-classes", css_classes.into()), + } + } - pub fn css_name(self, css_name: impl Into) -> Self { - Self { builder: self.builder.property("css-name", css_name.into()), } - } + pub fn css_name(self, css_name: impl Into) -> Self { + Self { + builder: self.builder.property("css-name", css_name.into()), + } + } - //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { - // Self { builder: self.builder.property("cursor", cursor), } - //} + //pub fn cursor(self, cursor: /*Ignored*/&gdk::Cursor) -> Self { + // Self { builder: self.builder.property("cursor", cursor), } + //} - pub fn focus_on_click(self, focus_on_click: bool) -> Self { - Self { builder: self.builder.property("focus-on-click", focus_on_click), } - } + pub fn focus_on_click(self, focus_on_click: bool) -> Self { + Self { + builder: self.builder.property("focus-on-click", focus_on_click), + } + } - pub fn focusable(self, focusable: bool) -> Self { - Self { builder: self.builder.property("focusable", focusable), } - } + pub fn focusable(self, focusable: bool) -> Self { + Self { + builder: self.builder.property("focusable", focusable), + } + } - pub fn halign(self, halign: gtk::Align) -> Self { - Self { builder: self.builder.property("halign", halign), } - } + pub fn halign(self, halign: gtk::Align) -> Self { + Self { + builder: self.builder.property("halign", halign), + } + } - pub fn has_tooltip(self, has_tooltip: bool) -> Self { - Self { builder: self.builder.property("has-tooltip", has_tooltip), } - } + pub fn has_tooltip(self, has_tooltip: bool) -> Self { + Self { + builder: self.builder.property("has-tooltip", has_tooltip), + } + } - pub fn height_request(self, height_request: i32) -> Self { - Self { builder: self.builder.property("height-request", height_request), } - } + pub fn height_request(self, height_request: i32) -> Self { + Self { + builder: self.builder.property("height-request", height_request), + } + } - pub fn hexpand(self, hexpand: bool) -> Self { - Self { builder: self.builder.property("hexpand", hexpand), } - } + pub fn hexpand(self, hexpand: bool) -> Self { + Self { + builder: self.builder.property("hexpand", hexpand), + } + } - pub fn hexpand_set(self, hexpand_set: bool) -> Self { - Self { builder: self.builder.property("hexpand-set", hexpand_set), } - } + pub fn hexpand_set(self, hexpand_set: bool) -> Self { + Self { + builder: self.builder.property("hexpand-set", hexpand_set), + } + } - //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { - // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } - //} + //pub fn layout_manager(self, layout_manager: &impl IsA) -> Self { + // Self { builder: self.builder.property("layout-manager", layout_manager.clone().upcast()), } + //} - pub fn margin_bottom(self, margin_bottom: i32) -> Self { - Self { builder: self.builder.property("margin-bottom", margin_bottom), } - } + pub fn margin_bottom(self, margin_bottom: i32) -> Self { + Self { + builder: self.builder.property("margin-bottom", margin_bottom), + } + } - pub fn margin_end(self, margin_end: i32) -> Self { - Self { builder: self.builder.property("margin-end", margin_end), } - } + pub fn margin_end(self, margin_end: i32) -> Self { + Self { + builder: self.builder.property("margin-end", margin_end), + } + } - pub fn margin_start(self, margin_start: i32) -> Self { - Self { builder: self.builder.property("margin-start", margin_start), } - } + pub fn margin_start(self, margin_start: i32) -> Self { + Self { + builder: self.builder.property("margin-start", margin_start), + } + } - pub fn margin_top(self, margin_top: i32) -> Self { - Self { builder: self.builder.property("margin-top", margin_top), } - } + pub fn margin_top(self, margin_top: i32) -> Self { + Self { + builder: self.builder.property("margin-top", margin_top), + } + } - pub fn name(self, name: impl Into) -> Self { - Self { builder: self.builder.property("name", name.into()), } - } + pub fn name(self, name: impl Into) -> Self { + Self { + builder: self.builder.property("name", name.into()), + } + } - pub fn opacity(self, opacity: f64) -> Self { - Self { builder: self.builder.property("opacity", opacity), } - } + pub fn opacity(self, opacity: f64) -> Self { + Self { + builder: self.builder.property("opacity", opacity), + } + } - //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { - // Self { builder: self.builder.property("overflow", overflow), } - //} + //pub fn overflow(self, overflow: /*Ignored*/gtk::Overflow) -> Self { + // Self { builder: self.builder.property("overflow", overflow), } + //} - pub fn receives_default(self, receives_default: bool) -> Self { - Self { builder: self.builder.property("receives-default", receives_default), } - } + pub fn receives_default(self, receives_default: bool) -> Self { + Self { + builder: self.builder.property("receives-default", receives_default), + } + } - pub fn sensitive(self, sensitive: bool) -> Self { - Self { builder: self.builder.property("sensitive", sensitive), } - } + pub fn sensitive(self, sensitive: bool) -> Self { + Self { + builder: self.builder.property("sensitive", sensitive), + } + } - pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-markup", tooltip_markup.into()), } - } + pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { + Self { + builder: self + .builder + .property("tooltip-markup", tooltip_markup.into()), + } + } - pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { - Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } - } + pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { + Self { + builder: self.builder.property("tooltip-text", tooltip_text.into()), + } + } - pub fn valign(self, valign: gtk::Align) -> Self { - Self { builder: self.builder.property("valign", valign), } - } + pub fn valign(self, valign: gtk::Align) -> Self { + Self { + builder: self.builder.property("valign", valign), + } + } - pub fn vexpand(self, vexpand: bool) -> Self { - Self { builder: self.builder.property("vexpand", vexpand), } - } + pub fn vexpand(self, vexpand: bool) -> Self { + Self { + builder: self.builder.property("vexpand", vexpand), + } + } - pub fn vexpand_set(self, vexpand_set: bool) -> Self { - Self { builder: self.builder.property("vexpand-set", vexpand_set), } - } + pub fn vexpand_set(self, vexpand_set: bool) -> Self { + Self { + builder: self.builder.property("vexpand-set", vexpand_set), + } + } - pub fn visible(self, visible: bool) -> Self { - Self { builder: self.builder.property("visible", visible), } - } + pub fn visible(self, visible: bool) -> Self { + Self { + builder: self.builder.property("visible", visible), + } + } - pub fn width_request(self, width_request: i32) -> Self { - Self { builder: self.builder.property("width-request", width_request), } - } + pub fn width_request(self, width_request: i32) -> Self { + Self { + builder: self.builder.property("width-request", width_request), + } + } - //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { - // Self { builder: self.builder.property("accessible-role", accessible_role), } - //} + //pub fn accessible_role(self, accessible_role: /*Ignored*/gtk::AccessibleRole) -> Self { + // Self { builder: self.builder.property("accessible-role", accessible_role), } + //} // rustdoc-stripper-ignore-next /// Build the [`BottomBar`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> BottomBar { - self.builder.build() } + self.builder.build() + } } mod sealed { @@ -222,44 +294,74 @@ pub trait BottomBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "he_bottom_bar_append_button")] fn append_button(&self, icon: &impl IsA