Repository: gtk-rs/gtk3-rs (language: rust)

Issue:
[BUG] Regression after https://github.com/gtk-rs/gtk3-rs/pull/538
**Bug description**

Property `icon-size` of type `gtk::Image` has wrong type `IconSize` while it should be `i32`.

[gtk3](https://developer.gnome.org/gtk3/stable/GtkImage.html#GtkImage--icon-size)
[gtk4](https://developer.gnome.org/gtk4/stable/GtkImage.html#GtkImage--icon-size)

Creation panics like this:

```
Failed to create an instance of Image: BoolError { message: "property \'icon-size\' of type \'GtkImage\' can\'t be set from the given type (expected: \'gint\', got: \'GtkIconSize\')", filename: "/home/.../gtk-rs/gtk-rs-core/glib/src/object.rs", function: "glib::object", line: 2280 }
```



Discussion / hints:
CC @bilelmoussaoui 
cc @GuillaumeGomez 
Changing the gir file was a bad idea I guess :) 
Yes, you need to convert to the correct internal type when getting/setting the property now. This needs manual code.
We can have a field as manual?
a field how? for the builder pattern? not really
So it's always supposed to take an integer there, including in methods?
> So it's always supposed to take an integer there, including in methods?

Yes, is the enum actually used elsewhere ? If not, maybe we can just replace it's IntoGlib/StaticType implementations
The public API should be the enum, and internally it needs to use integers for the properties.
And so how can I do that? :) Update the gir-files to reflect that will change both the field and the API, no?
Manual code or a new gir feature, I guess

Fix patch:
diff --git a/gtk/Gir.toml b/gtk/Gir.toml
index b592ac7e9c11..27f3742d8e0b 100644
--- a/gtk/Gir.toml
+++ b/gtk/Gir.toml
@@ -1225,7 +1225,8 @@ generate_builder = true
 [[object]]
 name = "Gtk.Image"
 status = "generate"
-generate_builder = true
+generate_builder = false # "icon-size" field should be gint
+manual_traits = ["ImageExtManual"]
     [[object.function]]
     name = "new_from_surface"
         [[object.function.parameter]]
@@ -1243,6 +1244,9 @@ generate_builder = true
     #can return NULL string
     ignore = true
     [[object.property]]
+    name = "icon-size"
+    ignore = true # Has to call conversions to int
+    [[object.property]]
     name = "surface"
     [[object.property]]
     name = "icon-set"
@@ -2074,7 +2078,11 @@ generate_builder = true
 [[object]]
 name = "Gtk.StackSwitcher"
 status = "generate"
-generate_builder = true
+generate_builder = false # "icon-size" property needs to be int internally
+manual_traits = ["StackSwitcherExtManual"]
+    [[object.property]]
+    name = "icon-size"
+    ignore = true # "icon-size" needs conversion between IconSize and integer
 
 [[object]]
 name = "Gtk.Statusbar"
diff --git a/gtk/src/auto/image.rs b/gtk/src/auto/image.rs
index c198226f079d..97f3a4ccc58c 100644
--- a/gtk/src/auto/image.rs
+++ b/gtk/src/auto/image.rs
@@ -2,9 +2,7 @@
 // from gir-files (https://github.com/gtk-rs/gir-files)
 // DO NOT EDIT
 
-use crate::Align;
 use crate::Buildable;
-use crate::Container;
 use crate::IconSize;
 use crate::ImageType;
 use crate::Misc;
@@ -121,14 +119,6 @@ impl Image {
             .unsafe_cast()
         }
     }
-
-    // rustdoc-stripper-ignore-next
-    /// Creates a new builder-style object to construct a [`Image`].
-    ///
-    /// This method returns an instance of [`ImageBuilder`] which can be used to create a [`Image`].
-    pub fn builder() -> ImageBuilder {
-        ImageBuilder::default()
-    }
 }
 
 impl Default for Image {
@@ -137,413 +127,6 @@ impl Default for Image {
     }
 }
 
-#[derive(Clone, Default)]
-// rustdoc-stripper-ignore-next
-/// A builder for generating a [`Image`].
-pub struct ImageBuilder {
-    file: Option<String>,
-    gicon: Option<gio::Icon>,
-    icon_name: Option<String>,
-    icon_size: Option<IconSize>,
-    pixbuf: Option<gdk_pixbuf::Pixbuf>,
-    pixbuf_animation: Option<gdk_pixbuf::PixbufAnimation>,
-    pixel_size: Option<i32>,
-    resource: Option<String>,
-    surface: Option<cairo::Surface>,
-    use_fallback: Option<bool>,
-    app_paintable: Option<bool>,
-    can_default: Option<bool>,
-    can_focus: Option<bool>,
-    events: Option<gdk::EventMask>,
-    expand: Option<bool>,
-    #[cfg(any(feature = "v3_20", feature = "dox"))]
-    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
-    focus_on_click: Option<bool>,
-    halign: Option<Align>,
-    has_default: Option<bool>,
-    has_focus: Option<bool>,
-    has_tooltip: Option<bool>,
-    height_request: Option<i32>,
-    hexpand: Option<bool>,
-    hexpand_set: Option<bool>,
-    is_focus: Option<bool>,
-    margin: Option<i32>,
-    margin_bottom: Option<i32>,
-    margin_end: Option<i32>,
-    margin_start: Option<i32>,
-    margin_top: Option<i32>,
-    name: Option<String>,
-    no_show_all: Option<bool>,
-    opacity: Option<f64>,
-    parent: Option<Container>,
-    receives_default: Option<bool>,
-    sensitive: Option<bool>,
-    tooltip_markup: Option<String>,
-    tooltip_text: Option<String>,
-    valign: Option<Align>,
-    vexpand: Option<bool>,
-    vexpand_set: Option<bool>,
-    visible: Option<bool>,
-    width_request: Option<i32>,
-}
-
-impl ImageBuilder {
-    // rustdoc-stripper-ignore-next
-    /// Create a new [`ImageBuilder`].
-    pub fn new() -> Self {
-        Self::default()
-    }
-
-    // rustdoc-stripper-ignore-next
-    /// Build the [`Image`].
-    pub fn build(self) -> Image {
-        let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
-        if let Some(ref file) = self.file {
-            properties.push(("file", file));
-        }
-        if let Some(ref gicon) = self.gicon {
-            properties.push(("gicon", gicon));
-        }
-        if let Some(ref icon_name) = self.icon_name {
-            properties.push(("icon-name", icon_name));
-        }
-        if let Some(ref icon_size) = self.icon_size {
-            properties.push(("icon-size", icon_size));
-        }
-        if let Some(ref pixbuf) = self.pixbuf {
-            properties.push(("pixbuf", pixbuf));
-        }
-        if let Some(ref pixbuf_animation) = self.pixbuf_animation {
-            properties.push(("pixbuf-animation", pixbuf_animation));
-        }
-        if let Some(ref pixel_size) = self.pixel_size {
-            properties.push(("pixel-size", pixel_size));
-        }
-        if let Some(ref resource) = self.resource {
-            properties.push(("resource", resource));
-        }
-        if let Some(ref surface) = self.surface {
-            properties.push(("surface", surface));
-        }
-        if let Some(ref use_fallback) = self.use_fallback {
-            properties.push(("use-fallback", use_fallback));
-        }
-        if let Some(ref app_paintable) = self.app_paintable {
-            properties.push(("app-paintable", app_paintable));
-        }
-        if let Some(ref can_default) = self.can_default {
-            properties.push(("can-default", can_default));
-        }
-        if let Some(ref can_focus) = self.can_focus {
-            properties.push(("can-focus", can_focus));
-        }
-        if let Some(ref events) = self.events {
-            properties.push(("events", events));
-        }
-        if let Some(ref expand) = self.expand {
-            properties.push(("expand", expand));
-        }
-        #[cfg(any(feature = "v3_20", feature = "dox"))]
-        if let Some(ref focus_on_click) = self.focus_on_click {
-            properties.push(("focus-on-click", focus_on_click));
-        }
-        if let Some(ref halign) = self.halign {
-            properties.push(("halign", halign));
-        }
-        if let Some(ref has_default) = self.has_default {
-            properties.push(("has-default", has_default));
-        }
-        if let Some(ref has_focus) = self.has_focus {
-            properties.push(("has-focus", has_focus));
-        }
-        if let Some(ref has_tooltip) = self.has_tooltip {
-            properties.push(("has-tooltip", has_tooltip));
-        }
-        if let Some(ref height_request) = self.height_request {
-            properties.push(("height-request", height_request));
-        }
-        if let Some(ref hexpand) = self.hexpand {
-            properties.push(("hexpand", hexpand));
-        }
-        if let Some(ref hexpand_set) = self.hexpand_set {
-            properties.push(("hexpand-set", hexpand_set));
-        }
-        if let Some(ref is_focus) = self.is_focus {
-            properties.push(("is-focus", is_focus));
-        }
-        if let Some(ref margin) = self.margin {
-            properties.push(("margin", margin));
-        }
-        if let Some(ref margin_bottom) = self.margin_bottom {
-            properties.push(("margin-bottom", margin_bottom));
-        }
-        if let Some(ref margin_end) = self.margin_end {
-            properties.push(("margin-end", margin_end));
-        }
-        if let Some(ref margin_start) = self.margin_start {
-            properties.push(("margin-start", margin_start));
-        }
-        if let Some(ref margin_top) = self.margin_top {
-            properties.push(("margin-top", margin_top));
-        }
-        if let Some(ref name) = self.name {
-            properties.push(("name", name));
-        }
-        if let Some(ref no_show_all) = self.no_show_all {
-            properties.push(("no-show-all", no_show_all));
-        }
-        if let Some(ref opacity) = self.opacity {
-            properties.push(("opacity", opacity));
-        }
-        if let Some(ref parent) = self.parent {
-            properties.push(("parent", parent));
-        }
-        if let Some(ref receives_default) = self.receives_default {
-            properties.push(("receives-default", receives_default));
-        }
-        if let Some(ref sensitive) = self.sensitive {
-            properties.push(("sensitive", sensitive));
-        }
-        if let Some(ref tooltip_markup) = self.tooltip_markup {
-            properties.push(("tooltip-markup", tooltip_markup));
-        }
-        if let Some(ref tooltip_text) = self.tooltip_text {
-            properties.push(("tooltip-text", tooltip_text));
-        }
-        if let Some(ref valign) = self.valign {
-            properties.push(("valign", valign));
-        }
-        if let Some(ref vexpand) = self.vexpand {
-            properties.push(("vexpand", vexpand));
-        }
-        if let Some(ref vexpand_set) = self.vexpand_set {
-            properties.push(("vexpand-set", vexpand_set));
-        }
-        if let Some(ref visible) = self.visible {
-            properties.push(("visible", visible));
-        }
-        if let Some(ref width_request) = self.width_request {
-            properties.push(("width-request", width_request));
-        }
-        glib::Object::new::<Image>(&properties).expect("Failed to create an instance of Image")
-    }
-
-    pub fn file(mut self, file: &str) -> Self {
-        self.file = Some(file.to_string());
-        self
-    }
-
-    pub fn gicon<P: IsA<gio::Icon>>(mut self, gicon: &P) -> Self {
-        self.gicon = Some(gicon.clone().upcast());
-        self
-    }
-
-    pub fn icon_name(mut self, icon_name: &str) -> Self {
-        self.icon_name = Some(icon_name.to_string());
-        self
-    }
-
-    pub fn icon_size(mut self, icon_size: IconSize) -> Self {
-        self.icon_size = Some(icon_size);
-        self
-    }
-
-    pub fn pixbuf(mut self, pixbuf: &gdk_pixbuf::Pixbuf) -> Self {
-        self.pixbuf = Some(pixbuf.clone());
-        self
-    }
-
-    pub fn pixbuf_animation<P: IsA<gdk_pixbuf::PixbufAnimation>>(
-        mut self,
-        pixbuf_animation: &P,
-    ) -> Self {
-        self.pixbuf_animation = Some(pixbuf_animation.clone().upcast());
-        self
-    }
-
-    pub fn pixel_size(mut self, pixel_size: i32) -> Self {
-        self.pixel_size = Some(pixel_size);
-        self
-    }
-
-    pub fn resource(mut self, resource: &str) -> Self {
-        self.resource = Some(resource.to_string());
-        self
-    }
-
-    pub fn surface(mut self, surface: &cairo::Surface) -> Self {
-        self.surface = Some(surface.clone());
-        self
-    }
-
-    pub fn use_fallback(mut self, use_fallback: bool) -> Self {
-        self.use_fallback = Some(use_fallback);
-        self
-    }
-
-    pub fn app_paintable(mut self, app_paintable: bool) -> Self {
-        self.app_paintable = Some(app_paintable);
-        self
-    }
-
-    pub fn can_default(mut self, can_default: bool) -> Self {
-        self.can_default = Some(can_default);
-        self
-    }
-
-    pub fn can_focus(mut self, can_focus: bool) -> Self {
-        self.can_focus = Some(can_focus);
-        self
-    }
-
-    pub fn events(mut self, events: gdk::EventMask) -> Self {
-        self.events = Some(events);
-        self
-    }
-
-    pub fn expand(mut self, expand: bool) -> Self {
-        self.expand = Some(expand);
-        self
-    }
-
-    #[cfg(any(feature = "v3_20", feature = "dox"))]
-    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
-    pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
-        self.focus_on_click = Some(focus_on_click);
-        self
-    }
-
-    pub fn halign(mut self, halign: Align) -> Self {
-        self.halign = Some(halign);
-        self
-    }
-
-    pub fn has_default(mut self, has_default: bool) -> Self {
-        self.has_default = Some(has_default);
-        self
-    }
-
-    pub fn has_focus(mut self, has_focus: bool) -> Self {
-        self.has_focus = Some(has_focus);
-        self
-    }
-
-    pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
-        self.has_tooltip = Some(has_tooltip);
-        self
-    }
-
-    pub fn height_request(mut self, height_request: i32) -> Self {
-        self.height_request = Some(height_request);
-        self
-    }
-
-    pub fn hexpand(mut self, hexpand: bool) -> Self {
-        self.hexpand = Some(hexpand);
-        self
-    }
-
-    pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
-        self.hexpand_set = Some(hexpand_set);
-        self
-    }
-
-    pub fn is_focus(mut self, is_focus: bool) -> Self {
-        self.is_focus = Some(is_focus);
-        self
-    }
-
-    pub fn margin(mut self, margin: i32) -> Self {
-        self.margin = Some(margin);
-        self
-    }
-
-    pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
-        self.margin_bottom = Some(margin_bottom);
-        self
-    }
-
-    pub fn margin_end(mut self, margin_end: i32) -> Self {
-        self.margin_end = Some(margin_end);
-        self
-    }
-
-    pub fn margin_start(mut self, margin_start: i32) -> Self {
-        self.margin_start = Some(margin_start);
-        self
-    }
-
-    pub fn margin_top(mut self, margin_top: i32) -> Self {
-        self.margin_top = Some(margin_top);
-        self
-    }
-
-    pub fn name(mut self, name: &str) -> Self {
-        self.name = Some(name.to_string());
-        self
-    }
-
-    pub fn no_show_all(mut self, no_show_all: bool) -> Self {
-        self.no_show_all = Some(no_show_all);
-        self
-    }
-
-    pub fn opacity(mut self, opacity: f64) -> Self {
-        self.opacity = Some(opacity);
-        self
-    }
-
-    pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self {
-        self.parent = Some(parent.clone().upcast());
-        self
-    }
-
-    pub fn receives_default(mut self, receives_default: bool) -> Self {
-        self.receives_default = Some(receives_default);
-        self
-    }
-
-    pub fn sensitive(mut self, sensitive: bool) -> Self {
-        self.sensitive = Some(sensitive);
-        self
-    }
-
-    pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
-        self.tooltip_markup = Some(tooltip_markup.to_string());
-        self
-    }
-
-    pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
-        self.tooltip_text = Some(tooltip_text.to_string());
-        self
-    }
-
-    pub fn valign(mut self, valign: Align) -> Self {
-        self.valign = Some(valign);
-        self
-    }
-
-    pub fn vexpand(mut self, vexpand: bool) -> Self {
-        self.vexpand = Some(vexpand);
-        self
-    }
-
-    pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
-        self.vexpand_set = Some(vexpand_set);
-        self
-    }
-
-    pub fn visible(mut self, visible: bool) -> Self {
-        self.visible = Some(visible);
-        self
-    }
-
-    pub fn width_request(mut self, width_request: i32) -> Self {
-        self.width_request = Some(width_request);
-        self
-    }
-}
-
 pub const NONE_IMAGE: Option<&Image> = None;
 
 pub trait ImageExt: 'static {
@@ -606,12 +189,6 @@ pub trait ImageExt: 'static {
     #[doc(alias = "icon-name")]
     fn set_icon_name(&self, icon_name: Option<&str>);
 
-    #[doc(alias = "icon-size")]
-    fn icon_size(&self) -> IconSize;
-
-    #[doc(alias = "icon-size")]
-    fn set_icon_size(&self, icon_size: IconSize);
-
     fn set_pixbuf(&self, pixbuf: Option<&gdk_pixbuf::Pixbuf>);
 
     #[doc(alias = "pixbuf-animation")]
@@ -646,9 +223,6 @@ pub trait ImageExt: 'static {
     #[doc(alias = "icon-name")]
     fn connect_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
 
-    #[doc(alias = "icon-size")]
-    fn connect_icon_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
-
     #[doc(alias = "pixbuf")]
     fn connect_pixbuf_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
 
@@ -838,30 +412,6 @@ impl<O: IsA<Image>> ImageExt for O {
         }
     }
 
-    fn icon_size(&self) -> IconSize {
-        unsafe {
-            let mut value = glib::Value::from_type(<IconSize as StaticType>::static_type());
-            glib::gobject_ffi::g_object_get_property(
-                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
-                b"icon-size\0".as_ptr() as *const _,
-                value.to_glib_none_mut().0,
-            );
-            value
-                .get()
-                .expect("Return Value for property `icon-size` getter")
-        }
-    }
-
-    fn set_icon_size(&self, icon_size: IconSize) {
-        unsafe {
-            glib::gobject_ffi::g_object_set_property(
-                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
-                b"icon-size\0".as_ptr() as *const _,
-                icon_size.to_value().to_glib_none().0,
-            );
-        }
-    }
-
     fn set_pixbuf(&self, pixbuf: Option<&gdk_pixbuf::Pixbuf>) {
         unsafe {
             glib::gobject_ffi::g_object_set_property(
@@ -1038,28 +588,6 @@ impl<O: IsA<Image>> ImageExt for O {
         }
     }
 
-    fn connect_icon_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
-        unsafe extern "C" fn notify_icon_size_trampoline<P: IsA<Image>, F: Fn(&P) + 'static>(
-            this: *mut ffi::GtkImage,
-            _param_spec: glib::ffi::gpointer,
-            f: glib::ffi::gpointer,
-        ) {
-            let f: &F = &*(f as *const F);
-            f(&Image::from_glib_borrow(this).unsafe_cast_ref())
-        }
-        unsafe {
-            let f: Box_<F> = Box_::new(f);
-            connect_raw(
-                self.as_ptr() as *mut _,
-                b"notify::icon-size\0".as_ptr() as *const _,
-                Some(transmute::<_, unsafe extern "C" fn()>(
-                    notify_icon_size_trampoline::<Self, F> as *const (),
-                )),
-                Box_::into_raw(f),
-            )
-        }
-    }
-
     fn connect_pixbuf_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
         unsafe extern "C" fn notify_pixbuf_trampoline<P: IsA<Image>, F: Fn(&P) + 'static>(
             this: *mut ffi::GtkImage,
diff --git a/gtk/src/auto/mod.rs b/gtk/src/auto/mod.rs
index b78eb3864488..f2d49aefd551 100644
--- a/gtk/src/auto/mod.rs
+++ b/gtk/src/auto/mod.rs
@@ -357,7 +357,6 @@ pub use self::icon_view::IconViewBuilder;
 pub use self::icon_view::{IconView, NONE_ICON_VIEW};
 
 mod image;
-pub use self::image::ImageBuilder;
 pub use self::image::{Image, NONE_IMAGE};
 
 mod info_bar;
@@ -679,7 +678,6 @@ pub use self::stack_sidebar::StackSidebarBuilder;
 pub use self::stack_sidebar::{StackSidebar, NONE_STACK_SIDEBAR};
 
 mod stack_switcher;
-pub use self::stack_switcher::StackSwitcherBuilder;
 pub use self::stack_switcher::{StackSwitcher, NONE_STACK_SWITCHER};
 
 mod statusbar;
diff --git a/gtk/src/auto/stack_switcher.rs b/gtk/src/auto/stack_switcher.rs
index 50cbab5dffab..af97d63b2d35 100644
--- a/gtk/src/auto/stack_switcher.rs
+++ b/gtk/src/auto/stack_switcher.rs
@@ -2,17 +2,10 @@
 // from gir-files (https://github.com/gtk-rs/gir-files)
 // DO NOT EDIT
 
-use crate::Align;
-use crate::BaselinePosition;
 use crate::Box;
 use crate::Buildable;
 use crate::Container;
-#[cfg(any(feature = "v3_20", feature = "dox"))]
-#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
-use crate::IconSize;
 use crate::Orientable;
-use crate::Orientation;
-use crate::ResizeMode;
 use crate::Stack;
 use crate::Widget;
 use glib::object::Cast;
@@ -20,8 +13,6 @@ use glib::object::IsA;
 use glib::signal::connect_raw;
 use glib::signal::SignalHandlerId;
 use glib::translate::*;
-use glib::StaticType;
-use glib::ToValue;
 use std::boxed::Box as Box_;
 use std::fmt;
 use std::mem::transmute;
@@ -41,14 +32,6 @@ impl StackSwitcher {
         assert_initialized_main_thread!();
         unsafe { Widget::from_glib_none(ffi::gtk_stack_switcher_new()).unsafe_cast() }
     }
-
-    // rustdoc-stripper-ignore-next
-    /// Creates a new builder-style object to construct a [`StackSwitcher`].
-    ///
-    /// This method returns an instance of [`StackSwitcherBuilder`] which can be used to create a [`StackSwitcher`].
-    pub fn builder() -> StackSwitcherBuilder {
-        StackSwitcherBuilder::default()
-    }
 }
 
 impl Default for StackSwitcher {
@@ -57,407 +40,6 @@ impl Default for StackSwitcher {
     }
 }
 
-#[derive(Clone, Default)]
-// rustdoc-stripper-ignore-next
-/// A builder for generating a [`StackSwitcher`].
-pub struct StackSwitcherBuilder {
-    #[cfg(any(feature = "v3_20", feature = "dox"))]
-    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
-    icon_size: Option<IconSize>,
-    stack: Option<Stack>,
-    baseline_position: Option<BaselinePosition>,
-    homogeneous: Option<bool>,
-    spacing: Option<i32>,
-    border_width: Option<u32>,
-    child: Option<Widget>,
-    resize_mode: Option<ResizeMode>,
-    app_paintable: Option<bool>,
-    can_default: Option<bool>,
-    can_focus: Option<bool>,
-    events: Option<gdk::EventMask>,
-    expand: Option<bool>,
-    #[cfg(any(feature = "v3_20", feature = "dox"))]
-    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
-    focus_on_click: Option<bool>,
-    halign: Option<Align>,
-    has_default: Option<bool>,
-    has_focus: Option<bool>,
-    has_tooltip: Option<bool>,
-    height_request: Option<i32>,
-    hexpand: Option<bool>,
-    hexpand_set: Option<bool>,
-    is_focus: Option<bool>,
-    margin: Option<i32>,
-    margin_bottom: Option<i32>,
-    margin_end: Option<i32>,
-    margin_start: Option<i32>,
-    margin_top: Option<i32>,
-    name: Option<String>,
-    no_show_all: Option<bool>,
-    opacity: Option<f64>,
-    parent: Option<Container>,
-    receives_default: Option<bool>,
-    sensitive: Option<bool>,
-    tooltip_markup: Option<String>,
-    tooltip_text: Option<String>,
-    valign: Option<Align>,
-    vexpand: Option<bool>,
-    vexpand_set: Option<bool>,
-    visible: Option<bool>,
-    width_request: Option<i32>,
-    orientation: Option<Orientation>,
-}
-
-impl StackSwitcherBuilder {
-    // rustdoc-stripper-ignore-next
-    /// Create a new [`StackSwitcherBuilder`].
-    pub fn new() -> Self {
-        Self::default()
-    }
-
-    // rustdoc-stripper-ignore-next
-    /// Build the [`StackSwitcher`].
-    pub fn build(self) -> StackSwitcher {
-        let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
-        #[cfg(any(feature = "v3_20", feature = "dox"))]
-        if let Some(ref icon_size) = self.icon_size {
-            properties.push(("icon-size", icon_size));
-        }
-        if let Some(ref stack) = self.stack {
-            properties.push(("stack", stack));
-        }
-        if let Some(ref baseline_position) = self.baseline_position {
-            properties.push(("baseline-position", baseline_position));
-        }
-        if let Some(ref homogeneous) = self.homogeneous {
-            properties.push(("homogeneous", homogeneous));
-        }
-        if let Some(ref spacing) = self.spacing {
-            properties.push(("spacing", spacing));
-        }
-        if let Some(ref border_width) = self.border_width {
-            properties.push(("border-width", border_width));
-        }
-        if let Some(ref child) = self.child {
-            properties.push(("child", child));
-        }
-        if let Some(ref resize_mode) = self.resize_mode {
-            properties.push(("resize-mode", resize_mode));
-        }
-        if let Some(ref app_paintable) = self.app_paintable {
-            properties.push(("app-paintable", app_paintable));
-        }
-        if let Some(ref can_default) = self.can_default {
-            properties.push(("can-default", can_default));
-        }
-        if let Some(ref can_focus) = self.can_focus {
-            properties.push(("can-focus", can_focus));
-        }
-        if let Some(ref events) = self.events {
-            properties.push(("events", events));
-        }
-        if let Some(ref expand) = self.expand {
-            properties.push(("expand", expand));
-        }
-        #[cfg(any(feature = "v3_20", feature = "dox"))]
-        if let Some(ref focus_on_click) = self.focus_on_click {
-            properties.push(("focus-on-click", focus_on_click));
-        }
-        if let Some(ref halign) = self.halign {
-            properties.push(("halign", halign));
-        }
-        if let Some(ref has_default) = self.has_default {
-            properties.push(("has-default", has_default));
-        }
-        if let Some(ref has_focus) = self.has_focus {
-            properties.push(("has-focus", has_focus));
-        }
-        if let Some(ref has_tooltip) = self.has_tooltip {
-            properties.push(("has-tooltip", has_tooltip));
-        }
-        if let Some(ref height_request) = self.height_request {
-            properties.push(("height-request", height_request));
-        }
-        if let Some(ref hexpand) = self.hexpand {
-            properties.push(("hexpand", hexpand));
-        }
-        if let Some(ref hexpand_set) = self.hexpand_set {
-            properties.push(("hexpand-set", hexpand_set));
-        }
-        if let Some(ref is_focus) = self.is_focus {
-            properties.push(("is-focus", is_focus));
-        }
-        if let Some(ref margin) = self.margin {
-            properties.push(("margin", margin));
-        }
-        if let Some(ref margin_bottom) = self.margin_bottom {
-            properties.push(("margin-bottom", margin_bottom));
-        }
-        if let Some(ref margin_end) = self.margin_end {
-            properties.push(("margin-end", margin_end));
-        }
-        if let Some(ref margin_start) = self.margin_start {
-            properties.push(("margin-start", margin_start));
-        }
-        if let Some(ref margin_top) = self.margin_top {
-            properties.push(("margin-top", margin_top));
-        }
-        if let Some(ref name) = self.name {
-            properties.push(("name", name));
-        }
-        if let Some(ref no_show_all) = self.no_show_all {
-            properties.push(("no-show-all", no_show_all));
-        }
-        if let Some(ref opacity) = self.opacity {
-            properties.push(("opacity", opacity));
-        }
-        if let Some(ref parent) = self.parent {
-            properties.push(("parent", parent));
-        }
-        if let Some(ref receives_default) = self.receives_default {
-            properties.push(("receives-default", receives_default));
-        }
-        if let Some(ref sensitive) = self.sensitive {
-            properties.push(("sensitive", sensitive));
-        }
-        if let Some(ref tooltip_markup) = self.tooltip_markup {
-            properties.push(("tooltip-markup", tooltip_markup));
-        }
-        if let Some(ref tooltip_text) = self.tooltip_text {
-            properties.push(("tooltip-text", tooltip_text));
-        }
-        if let Some(ref valign) = self.valign {
-            properties.push(("valign", valign));
-        }
-        if let Some(ref vexpand) = self.vexpand {
-            properties.push(("vexpand", vexpand));
-        }
-        if let Some(ref vexpand_set) = self.vexpand_set {
-            properties.push(("vexpand-set", vexpand_set));
-        }
-        if let Some(ref visible) = self.visible {
-            properties.push(("visible", visible));
-        }
-        if let Some(ref width_request) = self.width_request {
-            properties.push(("width-request", width_request));
-        }
-        if let Some(ref orientation) = self.orientation {
-            properties.push(("orientation", orientation));
-        }
-        glib::Object::new::<StackSwitcher>(&properties)
-            .expect("Failed to create an instance of StackSwitcher")
-    }
-
-    #[cfg(any(feature = "v3_20", feature = "dox"))]
-    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
-    pub fn icon_size(mut self, icon_size: IconSize) -> Self {
-        self.icon_size = Some(icon_size);
-        self
-    }
-
-    pub fn stack<P: IsA<Stack>>(mut self, stack: &P) -> Self {
-        self.stack = Some(stack.clone().upcast());
-        self
-    }
-
-    pub fn baseline_position(mut self, baseline_position: BaselinePosition) -> Self {
-        self.baseline_position = Some(baseline_position);
-        self
-    }
-
-    pub fn homogeneous(mut self, homogeneous: bool) -> Self {
-        self.homogeneous = Some(homogeneous);
-        self
-    }
-
-    pub fn spacing(mut self, spacing: i32) -> Self {
-        self.spacing = Some(spacing);
-        self
-    }
-
-    pub fn border_width(mut self, border_width: u32) -> Self {
-        self.border_width = Some(border_width);
-        self
-    }
-
-    pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self {
-        self.child = Some(child.clone().upcast());
-        self
-    }
-
-    pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
-        self.resize_mode = Some(resize_mode);
-        self
-    }
-
-    pub fn app_paintable(mut self, app_paintable: bool) -> Self {
-        self.app_paintable = Some(app_paintable);
-        self
-    }
-
-    pub fn can_default(mut self, can_default: bool) -> Self {
-        self.can_default = Some(can_default);
-        self
-    }
-
-    pub fn can_focus(mut self, can_focus: bool) -> Self {
-        self.can_focus = Some(can_focus);
-        self
-    }
-
-    pub fn events(mut self, events: gdk::EventMask) -> Self {
-        self.events = Some(events);
-        self
-    }
-
-    pub fn expand(mut self, expand: bool) -> Self {
-        self.expand = Some(expand);
-        self
-    }
-
-    #[cfg(any(feature = "v3_20", feature = "dox"))]
-    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
-    pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
-        self.focus_on_click = Some(focus_on_click);
-        self
-    }
-
-    pub fn halign(mut self, halign: Align) -> Self {
-        self.halign = Some(halign);
-        self
-    }
-
-    pub fn has_default(mut self, has_default: bool) -> Self {
-        self.has_default = Some(has_default);
-        self
-    }
-
-    pub fn has_focus(mut self, has_focus: bool) -> Self {
-        self.has_focus = Some(has_focus);
-        self
-    }
-
-    pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
-        self.has_tooltip = Some(has_tooltip);
-        self
-    }
-
-    pub fn height_request(mut self, height_request: i32) -> Self {
-        self.height_request = Some(height_request);
-        self
-    }
-
-    pub fn hexpand(mut self, hexpand: bool) -> Self {
-        self.hexpand = Some(hexpand);
-        self
-    }
-
-    pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
-        self.hexpand_set = Some(hexpand_set);
-        self
-    }
-
-    pub fn is_focus(mut self, is_focus: bool) -> Self {
-        self.is_focus = Some(is_focus);
-        self
-    }
-
-    pub fn margin(mut self, margin: i32) -> Self {
-        self.margin = Some(margin);
-        self
-    }
-
-    pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
-        self.margin_bottom = Some(margin_bottom);
-        self
-    }
-
-    pub fn margin_end(mut self, margin_end: i32) -> Self {
-        self.margin_end = Some(margin_end);
-        self
-    }
-
-    pub fn margin_start(mut self, margin_start: i32) -> Self {
-        self.margin_start = Some(margin_start);
-        self
-    }
-
-    pub fn margin_top(mut self, margin_top: i32) -> Self {
-        self.margin_top = Some(margin_top);
-        self
-    }
-
-    pub fn name(mut self, name: &str) -> Self {
-        self.name = Some(name.to_string());
-        self
-    }
-
-    pub fn no_show_all(mut self, no_show_all: bool) -> Self {
-        self.no_show_all = Some(no_show_all);
-        self
-    }
-
-    pub fn opacity(mut self, opacity: f64) -> Self {
-        self.opacity = Some(opacity);
-        self
-    }
-
-    pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self {
-        self.parent = Some(parent.clone().upcast());
-        self
-    }
-
-    pub fn receives_default(mut self, receives_default: bool) -> Self {
-        self.receives_default = Some(receives_default);
-        self
-    }
-
-    pub fn sensitive(mut self, sensitive: bool) -> Self {
-        self.sensitive = Some(sensitive);
-        self
-    }
-
-    pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
-        self.tooltip_markup = Some(tooltip_markup.to_string());
-        self
-    }
-
-    pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
-        self.tooltip_text = Some(tooltip_text.to_string());
-        self
-    }
-
-    pub fn valign(mut self, valign: Align) -> Self {
-        self.valign = Some(valign);
-        self
-    }
-
-    pub fn vexpand(mut self, vexpand: bool) -> Self {
-        self.vexpand = Some(vexpand);
-        self
-    }
-
-    pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
-        self.vexpand_set = Some(vexpand_set);
-        self
-    }
-
-    pub fn visible(mut self, visible: bool) -> Self {
-        self.visible = Some(visible);
-        self
-    }
-
-    pub fn width_request(mut self, width_request: i32) -> Self {
-        self.width_request = Some(width_request);
-        self
-    }
-
-    pub fn orientation(mut self, orientation: Orientation) -> Self {
-        self.orientation = Some(orientation);
-        self
-    }
-}
-
 pub const NONE_STACK_SWITCHER: Option<&StackSwitcher> = None;
 
 pub trait StackSwitcherExt: 'static {
@@ -468,21 +50,6 @@ pub trait StackSwitcherExt: 'static {
     #[doc(alias = "gtk_stack_switcher_set_stack")]
     fn set_stack<P: IsA<Stack>>(&self, stack: Option<&P>);
 
-    #[cfg(any(feature = "v3_20", feature = "dox"))]
-    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
-    #[doc(alias = "icon-size")]
-    fn icon_size(&self) -> IconSize;
-
-    #[cfg(any(feature = "v3_20", feature = "dox"))]
-    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
-    #[doc(alias = "icon-size")]
-    fn set_icon_size(&self, icon_size: IconSize);
-
-    #[cfg(any(feature = "v3_20", feature = "dox"))]
-    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
-    #[doc(alias = "icon-size")]
-    fn connect_icon_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
-
     #[doc(alias = "stack")]
     fn connect_stack_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
 }
@@ -505,61 +72,6 @@ impl<O: IsA<StackSwitcher>> StackSwitcherExt for O {
         }
     }
 
-    #[cfg(any(feature = "v3_20", feature = "dox"))]
-    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
-    fn icon_size(&self) -> IconSize {
-        unsafe {
-            let mut value = glib::Value::from_type(<IconSize as StaticType>::static_type());
-            glib::gobject_ffi::g_object_get_property(
-                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
-                b"icon-size\0".as_ptr() as *const _,
-                value.to_glib_none_mut().0,
-            );
-            value
-                .get()
-                .expect("Return Value for property `icon-size` getter")
-        }
-    }
-
-    #[cfg(any(feature = "v3_20", feature = "dox"))]
-    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
-    fn set_icon_size(&self, icon_size: IconSize) {
-        unsafe {
-            glib::gobject_ffi::g_object_set_property(
-                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
-                b"icon-size\0".as_ptr() as *const _,
-                icon_size.to_value().to_glib_none().0,
-            );
-        }
-    }
-
-    #[cfg(any(feature = "v3_20", feature = "dox"))]
-    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
-    fn connect_icon_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
-        unsafe extern "C" fn notify_icon_size_trampoline<
-            P: IsA<StackSwitcher>,
-            F: Fn(&P) + 'static,
-        >(
-            this: *mut ffi::GtkStackSwitcher,
-            _param_spec: glib::ffi::gpointer,
-            f: glib::ffi::gpointer,
-        ) {
-            let f: &F = &*(f as *const F);
-            f(&StackSwitcher::from_glib_borrow(this).unsafe_cast_ref())
-        }
-        unsafe {
-            let f: Box_<F> = Box_::new(f);
-            connect_raw(
-                self.as_ptr() as *mut _,
-                b"notify::icon-size\0".as_ptr() as *const _,
-                Some(transmute::<_, unsafe extern "C" fn()>(
-                    notify_icon_size_trampoline::<Self, F> as *const (),
-                )),
-                Box_::into_raw(f),
-            )
-        }
-    }
-
     fn connect_stack_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
         unsafe extern "C" fn notify_stack_trampoline<P: IsA<StackSwitcher>, F: Fn(&P) + 'static>(
             this: *mut ffi::GtkStackSwitcher,
diff --git a/gtk/src/image.rs b/gtk/src/image.rs
new file mode 100644
index 000000000000..95caee66bbec
--- /dev/null
+++ b/gtk/src/image.rs
@@ -0,0 +1,492 @@
+// Take a look at the license at the top of the repository in the LICENSE file.
+
+use crate::Align;
+use crate::Container;
+use crate::IconSize;
+use crate::Image;
+use glib::object::IsA;
+use glib::signal::{connect_raw, SignalHandlerId};
+use glib::translate::{FromGlib, FromGlibPtrBorrow, IntoGlib, ToGlibPtr, ToGlibPtrMut};
+use glib::Cast;
+use glib::StaticType;
+use glib::ToValue;
+use std::boxed::Box as Box_;
+use std::mem::transmute;
+
+pub trait ImageExtManual: 'static {
+    #[doc(alias = "icon-size")]
+    fn icon_size(&self) -> IconSize;
+
+    #[doc(alias = "icon-size")]
+    fn set_icon_size(&self, icon_size: IconSize);
+
+    #[doc(alias = "icon-size")]
+    fn connect_icon_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
+}
+
+impl<O: IsA<Image>> ImageExtManual for O {
+    fn icon_size(&self) -> IconSize {
+        unsafe {
+            let mut value = glib::Value::from_type(i32::static_type());
+            glib::gobject_ffi::g_object_get_property(
+                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
+                b"icon-size\0".as_ptr() as *const _,
+                value.to_glib_none_mut().0,
+            );
+            value
+                .get::<i32>()
+                .map(|v| IconSize::from_glib(v))
+                .expect("Return Value for property `icon-size` getter")
+        }
+    }
+
+    fn set_icon_size(&self, icon_size: IconSize) {
+        unsafe {
+            glib::gobject_ffi::g_object_set_property(
+                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
+                b"icon-size\0".as_ptr() as *const _,
+                icon_size.into_glib().to_value().to_glib_none().0,
+            );
+        }
+    }
+
+    fn connect_icon_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
+        unsafe extern "C" fn notify_icon_size_trampoline<P: IsA<Image>, F: Fn(&P) + 'static>(
+            this: *mut ffi::GtkImage,
+            _param_spec: glib::ffi::gpointer,
+            f: glib::ffi::gpointer,
+        ) {
+            let f: &F = &*(f as *const F);
+            f(&Image::from_glib_borrow(this).unsafe_cast_ref())
+        }
+        unsafe {
+            let f: Box_<F> = Box_::new(f);
+            connect_raw(
+                self.as_ptr() as *mut _,
+                b"notify::icon-size\0".as_ptr() as *const _,
+                Some(transmute::<_, unsafe extern "C" fn()>(
+                    notify_icon_size_trampoline::<Self, F> as *const (),
+                )),
+                Box_::into_raw(f),
+            )
+        }
+    }
+}
+
+impl Image {
+    // rustdoc-stripper-ignore-next
+    /// Creates a new builder-style object to construct a [`Image`].
+    ///
+    /// This method returns an instance of [`ImageBuilder`] which can be used to create a [`Image`].
+    pub fn builder() -> ImageBuilder {
+        ImageBuilder::default()
+    }
+}
+
+#[derive(Clone, Default)]
+// rustdoc-stripper-ignore-next
+/// A builder for generating a [`Image`].
+pub struct ImageBuilder {
+    file: Option<String>,
+    gicon: Option<gio::Icon>,
+    icon_name: Option<String>,
+    icon_size: Option<i32>,
+    pixbuf: Option<gdk_pixbuf::Pixbuf>,
+    pixbuf_animation: Option<gdk_pixbuf::PixbufAnimation>,
+    pixel_size: Option<i32>,
+    resource: Option<String>,
+    surface: Option<cairo::Surface>,
+    use_fallback: Option<bool>,
+    app_paintable: Option<bool>,
+    can_default: Option<bool>,
+    can_focus: Option<bool>,
+    events: Option<gdk::EventMask>,
+    expand: Option<bool>,
+    #[cfg(any(feature = "v3_20", feature = "dox"))]
+    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+    focus_on_click: Option<bool>,
+    halign: Option<Align>,
+    has_default: Option<bool>,
+    has_focus: Option<bool>,
+    has_tooltip: Option<bool>,
+    height_request: Option<i32>,
+    hexpand: Option<bool>,
+    hexpand_set: Option<bool>,
+    is_focus: Option<bool>,
+    margin: Option<i32>,
+    margin_bottom: Option<i32>,
+    margin_end: Option<i32>,
+    margin_start: Option<i32>,
+    margin_top: Option<i32>,
+    name: Option<String>,
+    no_show_all: Option<bool>,
+    opacity: Option<f64>,
+    parent: Option<Container>,
+    receives_default: Option<bool>,
+    sensitive: Option<bool>,
+    tooltip_markup: Option<String>,
+    tooltip_text: Option<String>,
+    valign: Option<Align>,
+    vexpand: Option<bool>,
+    vexpand_set: Option<bool>,
+    visible: Option<bool>,
+    width_request: Option<i32>,
+}
+
+impl ImageBuilder {
+    // rustdoc-stripper-ignore-next
+    /// Create a new [`ImageBuilder`].
+    pub fn new() -> Self {
+        Self::default()
+    }
+
+    // rustdoc-stripper-ignore-next
+    /// Build the [`Image`].
+    pub fn build(self) -> Image {
+        let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
+        if let Some(ref file) = self.file {
+            properties.push(("file", file));
+        }
+        if let Some(ref gicon) = self.gicon {
+            properties.push(("gicon", gicon));
+        }
+        if let Some(ref icon_name) = self.icon_name {
+            properties.push(("icon-name", icon_name));
+        }
+        if let Some(ref icon_size) = self.icon_size {
+            properties.push(("icon-size", icon_size));
+        }
+        if let Some(ref pixbuf) = self.pixbuf {
+            properties.push(("pixbuf", pixbuf));
+        }
+        if let Some(ref pixbuf_animation) = self.pixbuf_animation {
+            properties.push(("pixbuf-animation", pixbuf_animation));
+        }
+        if let Some(ref pixel_size) = self.pixel_size {
+            properties.push(("pixel-size", pixel_size));
+        }
+        if let Some(ref resource) = self.resource {
+            properties.push(("resource", resource));
+        }
+        if let Some(ref surface) = self.surface {
+            properties.push(("surface", surface));
+        }
+        if let Some(ref use_fallback) = self.use_fallback {
+            properties.push(("use-fallback", use_fallback));
+        }
+        if let Some(ref app_paintable) = self.app_paintable {
+            properties.push(("app-paintable", app_paintable));
+        }
+        if let Some(ref can_default) = self.can_default {
+            properties.push(("can-default", can_default));
+        }
+        if let Some(ref can_focus) = self.can_focus {
+            properties.push(("can-focus", can_focus));
+        }
+        if let Some(ref events) = self.events {
+            properties.push(("events", events));
+        }
+        if let Some(ref expand) = self.expand {
+            properties.push(("expand", expand));
+        }
+        #[cfg(any(feature = "v3_20", feature = "dox"))]
+        if let Some(ref focus_on_click) = self.focus_on_click {
+            properties.push(("focus-on-click", focus_on_click));
+        }
+        if let Some(ref halign) = self.halign {
+            properties.push(("halign", halign));
+        }
+        if let Some(ref has_default) = self.has_default {
+            properties.push(("has-default", has_default));
+        }
+        if let Some(ref has_focus) = self.has_focus {
+            properties.push(("has-focus", has_focus));
+        }
+        if let Some(ref has_tooltip) = self.has_tooltip {
+            properties.push(("has-tooltip", has_tooltip));
+        }
+        if let Some(ref height_request) = self.height_request {
+            properties.push(("height-request", height_request));
+        }
+        if let Some(ref hexpand) = self.hexpand {
+            properties.push(("hexpand", hexpand));
+        }
+        if let Some(ref hexpand_set) = self.hexpand_set {
+            properties.push(("hexpand-set", hexpand_set));
+        }
+        if let Some(ref is_focus) = self.is_focus {
+            properties.push(("is-focus", is_focus));
+        }
+        if let Some(ref margin) = self.margin {
+            properties.push(("margin", margin));
+        }
+        if let Some(ref margin_bottom) = self.margin_bottom {
+            properties.push(("margin-bottom", margin_bottom));
+        }
+        if let Some(ref margin_end) = self.margin_end {
+            properties.push(("margin-end", margin_end));
+        }
+        if let Some(ref margin_start) = self.margin_start {
+            properties.push(("margin-start", margin_start));
+        }
+        if let Some(ref margin_top) = self.margin_top {
+            properties.push(("margin-top", margin_top));
+        }
+        if let Some(ref name) = self.name {
+            properties.push(("name", name));
+        }
+        if let Some(ref no_show_all) = self.no_show_all {
+            properties.push(("no-show-all", no_show_all));
+        }
+        if let Some(ref opacity) = self.opacity {
+            properties.push(("opacity", opacity));
+        }
+        if let Some(ref parent) = self.parent {
+            properties.push(("parent", parent));
+        }
+        if let Some(ref receives_default) = self.receives_default {
+            properties.push(("receives-default", receives_default));
+        }
+        if let Some(ref sensitive) = self.sensitive {
+            properties.push(("sensitive", sensitive));
+        }
+        if let Some(ref tooltip_markup) = self.tooltip_markup {
+            properties.push(("tooltip-markup", tooltip_markup));
+        }
+        if let Some(ref tooltip_text) = self.tooltip_text {
+            properties.push(("tooltip-text", tooltip_text));
+        }
+        if let Some(ref valign) = self.valign {
+            properties.push(("valign", valign));
+        }
+        if let Some(ref vexpand) = self.vexpand {
+            properties.push(("vexpand", vexpand));
+        }
+        if let Some(ref vexpand_set) = self.vexpand_set {
+            properties.push(("vexpand-set", vexpand_set));
+        }
+        if let Some(ref visible) = self.visible {
+            properties.push(("visible", visible));
+        }
+        if let Some(ref width_request) = self.width_request {
+            properties.push(("width-request", width_request));
+        }
+        glib::Object::new::<Image>(&properties).expect("Failed to create an instance of Image")
+    }
+
+    pub fn file(mut self, file: &str) -> Self {
+        self.file = Some(file.to_string());
+        self
+    }
+
+    pub fn gicon<P: IsA<gio::Icon>>(mut self, gicon: &P) -> Self {
+        self.gicon = Some(gicon.clone().upcast());
+        self
+    }
+
+    pub fn icon_name(mut self, icon_name: &str) -> Self {
+        self.icon_name = Some(icon_name.to_string());
+        self
+    }
+
+    pub fn icon_size(mut self, icon_size: IconSize) -> Self {
+        self.icon_size = Some(icon_size.into_glib());
+        self
+    }
+
+    pub fn pixbuf(mut self, pixbuf: &gdk_pixbuf::Pixbuf) -> Self {
+        self.pixbuf = Some(pixbuf.clone());
+        self
+    }
+
+    pub fn pixbuf_animation<P: IsA<gdk_pixbuf::PixbufAnimation>>(
+        mut self,
+        pixbuf_animation: &P,
+    ) -> Self {
+        self.pixbuf_animation = Some(pixbuf_animation.clone().upcast());
+        self
+    }
+
+    pub fn pixel_size(mut self, pixel_size: i32) -> Self {
+        self.pixel_size = Some(pixel_size);
+        self
+    }
+
+    pub fn resource(mut self, resource: &str) -> Self {
+        self.resource = Some(resource.to_string());
+        self
+    }
+
+    pub fn surface(mut self, surface: &cairo::Surface) -> Self {
+        self.surface = Some(surface.clone());
+        self
+    }
+
+    pub fn use_fallback(mut self, use_fallback: bool) -> Self {
+        self.use_fallback = Some(use_fallback);
+        self
+    }
+
+    pub fn app_paintable(mut self, app_paintable: bool) -> Self {
+        self.app_paintable = Some(app_paintable);
+        self
+    }
+
+    pub fn can_default(mut self, can_default: bool) -> Self {
+        self.can_default = Some(can_default);
+        self
+    }
+
+    pub fn can_focus(mut self, can_focus: bool) -> Self {
+        self.can_focus = Some(can_focus);
+        self
+    }
+
+    pub fn events(mut self, events: gdk::EventMask) -> Self {
+        self.events = Some(events);
+        self
+    }
+
+    pub fn expand(mut self, expand: bool) -> Self {
+        self.expand = Some(expand);
+        self
+    }
+
+    #[cfg(any(feature = "v3_20", feature = "dox"))]
+    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+    pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
+        self.focus_on_click = Some(focus_on_click);
+        self
+    }
+
+    pub fn halign(mut self, halign: Align) -> Self {
+        self.halign = Some(halign);
+        self
+    }
+
+    pub fn has_default(mut self, has_default: bool) -> Self {
+        self.has_default = Some(has_default);
+        self
+    }
+
+    pub fn has_focus(mut self, has_focus: bool) -> Self {
+        self.has_focus = Some(has_focus);
+        self
+    }
+
+    pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
+        self.has_tooltip = Some(has_tooltip);
+        self
+    }
+
+    pub fn height_request(mut self, height_request: i32) -> Self {
+        self.height_request = Some(height_request);
+        self
+    }
+
+    pub fn hexpand(mut self, hexpand: bool) -> Self {
+        self.hexpand = Some(hexpand);
+        self
+    }
+
+    pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
+        self.hexpand_set = Some(hexpand_set);
+        self
+    }
+
+    #[allow(clippy::wrong_self_convention)]
+    pub fn is_focus(mut self, is_focus: bool) -> Self {
+        self.is_focus = Some(is_focus);
+        self
+    }
+
+    pub fn margin(mut self, margin: i32) -> Self {
+        self.margin = Some(margin);
+        self
+    }
+
+    pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
+        self.margin_bottom = Some(margin_bottom);
+        self
+    }
+
+    pub fn margin_end(mut self, margin_end: i32) -> Self {
+        self.margin_end = Some(margin_end);
+        self
+    }
+
+    pub fn margin_start(mut self, margin_start: i32) -> Self {
+        self.margin_start = Some(margin_start);
+        self
+    }
+
+    pub fn margin_top(mut self, margin_top: i32) -> Self {
+        self.margin_top = Some(margin_top);
+        self
+    }
+
+    pub fn name(mut self, name: &str) -> Self {
+        self.name = Some(name.to_string());
+        self
+    }
+
+    pub fn no_show_all(mut self, no_show_all: bool) -> Self {
+        self.no_show_all = Some(no_show_all);
+        self
+    }
+
+    pub fn opacity(mut self, opacity: f64) -> Self {
+        self.opacity = Some(opacity);
+        self
+    }
+
+    pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self {
+        self.parent = Some(parent.clone().upcast());
+        self
+    }
+
+    pub fn receives_default(mut self, receives_default: bool) -> Self {
+        self.receives_default = Some(receives_default);
+        self
+    }
+
+    pub fn sensitive(mut self, sensitive: bool) -> Self {
+        self.sensitive = Some(sensitive);
+        self
+    }
+
+    pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
+        self.tooltip_markup = Some(tooltip_markup.to_string());
+        self
+    }
+
+    pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
+        self.tooltip_text = Some(tooltip_text.to_string());
+        self
+    }
+
+    pub fn valign(mut self, valign: Align) -> Self {
+        self.valign = Some(valign);
+        self
+    }
+
+    pub fn vexpand(mut self, vexpand: bool) -> Self {
+        self.vexpand = Some(vexpand);
+        self
+    }
+
+    pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
+        self.vexpand_set = Some(vexpand_set);
+        self
+    }
+
+    pub fn visible(mut self, visible: bool) -> Self {
+        self.visible = Some(visible);
+        self
+    }
+
+    pub fn width_request(mut self, width_request: i32) -> Self {
+        self.width_request = Some(width_request);
+        self
+    }
+}
diff --git a/gtk/src/lib.rs b/gtk/src/lib.rs
index 2ac58e4f227a..68b575877c2e 100644
--- a/gtk/src/lib.rs
+++ b/gtk/src/lib.rs
@@ -203,6 +203,7 @@ mod flow_box;
 #[cfg(any(feature = "v3_24", feature = "dox"))]
 mod gesture_stylus;
 mod im_context_simple;
+mod image;
 mod invisible;
 mod list_box;
 mod list_store;
@@ -226,6 +227,7 @@ mod requisition;
 mod response_type;
 mod selection_data;
 mod signal;
+mod stack_switcher;
 mod style_context;
 mod switch;
 mod target_entry;
@@ -255,10 +257,12 @@ pub use gdk::Rectangle;
 pub use crate::app_chooser::AppChooser;
 pub use crate::border::Border;
 pub use crate::entry_buffer::EntryBuffer;
+pub use crate::image::ImageBuilder;
 pub use crate::page_range::PageRange;
 pub use crate::recent_data::RecentData;
 pub use crate::requisition::Requisition;
 pub use crate::response_type::ResponseType;
+pub use crate::stack_switcher::StackSwitcherBuilder;
 pub use crate::target_entry::TargetEntry;
 pub use crate::tree_sortable::SortColumn;
 pub use crate::widget::TickCallbackId;
diff --git a/gtk/src/prelude.rs b/gtk/src/prelude.rs
index 6185c55c4d21..736d638ac7b5 100644
--- a/gtk/src/prelude.rs
+++ b/gtk/src/prelude.rs
@@ -34,6 +34,7 @@ pub use crate::flow_box::FlowBoxExtManual;
 #[cfg(any(feature = "v3_24", feature = "dox"))]
 pub use crate::gesture_stylus::GestureStylusExtManual;
 pub use crate::im_context_simple::IMContextSimpleExtManual;
+pub use crate::image::ImageExtManual;
 pub use crate::invisible::InvisibleExtManual;
 pub use crate::list_box::ListBoxExtManual;
 pub use crate::list_store::GtkListStoreExtManual;
@@ -41,6 +42,8 @@ pub use crate::menu::GtkMenuExtManual;
 #[cfg(any(feature = "v3_20", feature = "dox"))]
 pub use crate::native_dialog::NativeDialogExtManual;
 pub use crate::notebook::NotebookExtManual;
+#[cfg(any(feature = "v3_20", feature = "dox"))]
+pub use crate::stack_switcher::StackSwitcherExtManual;
 pub use crate::style_context::StyleContextExtManual;
 pub use crate::switch::SwitchExtManual;
 pub use crate::text_buffer::TextBufferExtManual;
diff --git a/gtk/src/stack_switcher.rs b/gtk/src/stack_switcher.rs
new file mode 100644
index 000000000000..17dc4f92a638
--- /dev/null
+++ b/gtk/src/stack_switcher.rs
@@ -0,0 +1,510 @@
+// Take a look at the license at the top of the repository in the LICENSE file.
+
+use crate::Align;
+use crate::BaselinePosition;
+use crate::Container;
+#[cfg(any(feature = "v3_20", feature = "dox"))]
+#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+use crate::IconSize;
+use crate::Orientation;
+use crate::ResizeMode;
+use crate::Stack;
+use crate::StackSwitcher;
+use crate::Widget;
+use glib::object::IsA;
+#[cfg(any(feature = "v3_20", feature = "dox"))]
+#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+use glib::signal::{connect_raw, SignalHandlerId};
+#[cfg(any(feature = "v3_20", feature = "dox"))]
+#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+use glib::translate::{FromGlib, FromGlibPtrBorrow, IntoGlib, ToGlibPtr, ToGlibPtrMut};
+use glib::Cast;
+#[cfg(any(feature = "v3_20", feature = "dox"))]
+#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+use glib::StaticType;
+use glib::ToValue;
+#[cfg(any(feature = "v3_20", feature = "dox"))]
+#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+use std::boxed::Box as Box_;
+#[cfg(any(feature = "v3_20", feature = "dox"))]
+#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+use std::mem::transmute;
+
+#[cfg(any(feature = "v3_20", feature = "dox"))]
+#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+pub trait StackSwitcherExtManual: 'static {
+    #[doc(alias = "icon-size")]
+    fn icon_size(&self) -> IconSize;
+
+    #[doc(alias = "icon-size")]
+    fn set_icon_size(&self, icon_size: IconSize);
+
+    #[doc(alias = "icon-size")]
+    fn connect_icon_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
+}
+
+#[cfg(any(feature = "v3_20", feature = "dox"))]
+#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+impl<O: IsA<StackSwitcher>> StackSwitcherExtManual for O {
+    fn icon_size(&self) -> IconSize {
+        unsafe {
+            let mut value = glib::Value::from_type(i32::static_type());
+            glib::gobject_ffi::g_object_get_property(
+                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
+                b"icon-size\0".as_ptr() as *const _,
+                value.to_glib_none_mut().0,
+            );
+            value
+                .get()
+                .map(|v| IconSize::from_glib(v))
+                .expect("Return Value for property `icon-size` getter")
+        }
+    }
+
+    fn set_icon_size(&self, icon_size: IconSize) {
+        unsafe {
+            glib::gobject_ffi::g_object_set_property(
+                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
+                b"icon-size\0".as_ptr() as *const _,
+                icon_size.into_glib().to_value().to_glib_none().0,
+            );
+        }
+    }
+
+    fn connect_icon_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
+        unsafe extern "C" fn notify_icon_size_trampoline<
+            P: IsA<StackSwitcher>,
+            F: Fn(&P) + 'static,
+        >(
+            this: *mut ffi::GtkStackSwitcher,
+            _param_spec: glib::ffi::gpointer,
+            f: glib::ffi::gpointer,
+        ) {
+            let f: &F = &*(f as *const F);
+            f(&StackSwitcher::from_glib_borrow(this).unsafe_cast_ref())
+        }
+        unsafe {
+            let f: Box_<F> = Box_::new(f);
+            connect_raw(
+                self.as_ptr() as *mut _,
+                b"notify::icon-size\0".as_ptr() as *const _,
+                Some(transmute::<_, unsafe extern "C" fn()>(
+                    notify_icon_size_trampoline::<Self, F> as *const (),
+                )),
+                Box_::into_raw(f),
+            )
+        }
+    }
+}
+
+impl StackSwitcher {
+    // rustdoc-stripper-ignore-next
+    /// Creates a new builder-style object to construct a [`StackSwitcher`].
+    ///
+    /// This method returns an instance of [`StackSwitcherBuilder`] which can be used to create a [`StackSwitcher`].
+    pub fn builder() -> StackSwitcherBuilder {
+        StackSwitcherBuilder::default()
+    }
+}
+
+#[derive(Clone, Default)]
+// rustdoc-stripper-ignore-next
+/// A builder for generating a [`StackSwitcher`].
+pub struct StackSwitcherBuilder {
+    #[cfg(any(feature = "v3_20", feature = "dox"))]
+    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+    icon_size: Option<i32>,
+    stack: Option<Stack>,
+    baseline_position: Option<BaselinePosition>,
+    homogeneous: Option<bool>,
+    spacing: Option<i32>,
+    border_width: Option<u32>,
+    child: Option<Widget>,
+    resize_mode: Option<ResizeMode>,
+    app_paintable: Option<bool>,
+    can_default: Option<bool>,
+    can_focus: Option<bool>,
+    events: Option<gdk::EventMask>,
+    expand: Option<bool>,
+    #[cfg(any(feature = "v3_20", feature = "dox"))]
+    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+    focus_on_click: Option<bool>,
+    halign: Option<Align>,
+    has_default: Option<bool>,
+    has_focus: Option<bool>,
+    has_tooltip: Option<bool>,
+    height_request: Option<i32>,
+    hexpand: Option<bool>,
+    hexpand_set: Option<bool>,
+    is_focus: Option<bool>,
+    margin: Option<i32>,
+    margin_bottom: Option<i32>,
+    margin_end: Option<i32>,
+    margin_start: Option<i32>,
+    margin_top: Option<i32>,
+    name: Option<String>,
+    no_show_all: Option<bool>,
+    opacity: Option<f64>,
+    parent: Option<Container>,
+    receives_default: Option<bool>,
+    sensitive: Option<bool>,
+    tooltip_markup: Option<String>,
+    tooltip_text: Option<String>,
+    valign: Option<Align>,
+    vexpand: Option<bool>,
+    vexpand_set: Option<bool>,
+    visible: Option<bool>,
+    width_request: Option<i32>,
+    orientation: Option<Orientation>,
+}
+
+impl StackSwitcherBuilder {
+    // rustdoc-stripper-ignore-next
+    /// Create a new [`StackSwitcherBuilder`].
+    pub fn new() -> Self {
+        Self::default()
+    }
+
+    // rustdoc-stripper-ignore-next
+    /// Build the [`StackSwitcher`].
+    pub fn build(self) -> StackSwitcher {
+        let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
+        #[cfg(any(feature = "v3_20", feature = "dox"))]
+        if let Some(ref icon_size) = self.icon_size {
+            properties.push(("icon-size", icon_size));
+        }
+        if let Some(ref stack) = self.stack {
+            properties.push(("stack", stack));
+        }
+        if let Some(ref baseline_position) = self.baseline_position {
+            properties.push(("baseline-position", baseline_position));
+        }
+        if let Some(ref homogeneous) = self.homogeneous {
+            properties.push(("homogeneous", homogeneous));
+        }
+        if let Some(ref spacing) = self.spacing {
+            properties.push(("spacing", spacing));
+        }
+        if let Some(ref border_width) = self.border_width {
+            properties.push(("border-width", border_width));
+        }
+        if let Some(ref child) = self.child {
+            properties.push(("child", child));
+        }
+        if let Some(ref resize_mode) = self.resize_mode {
+            properties.push(("resize-mode", resize_mode));
+        }
+        if let Some(ref app_paintable) = self.app_paintable {
+            properties.push(("app-paintable", app_paintable));
+        }
+        if let Some(ref can_default) = self.can_default {
+            properties.push(("can-default", can_default));
+        }
+        if let Some(ref can_focus) = self.can_focus {
+            properties.push(("can-focus", can_focus));
+        }
+        if let Some(ref events) = self.events {
+            properties.push(("events", events));
+        }
+        if let Some(ref expand) = self.expand {
+            properties.push(("expand", expand));
+        }
+        #[cfg(any(feature = "v3_20", feature = "dox"))]
+        if let Some(ref focus_on_click) = self.focus_on_click {
+            properties.push(("focus-on-click", focus_on_click));
+        }
+        if let Some(ref halign) = self.halign {
+            properties.push(("halign", halign));
+        }
+        if let Some(ref has_default) = self.has_default {
+            properties.push(("has-default", has_default));
+        }
+        if let Some(ref has_focus) = self.has_focus {
+            properties.push(("has-focus", has_focus));
+        }
+        if let Some(ref has_tooltip) = self.has_tooltip {
+            properties.push(("has-tooltip", has_tooltip));
+        }
+        if let Some(ref height_request) = self.height_request {
+            properties.push(("height-request", height_request));
+        }
+        if let Some(ref hexpand) = self.hexpand {
+            properties.push(("hexpand", hexpand));
+        }
+        if let Some(ref hexpand_set) = self.hexpand_set {
+            properties.push(("hexpand-set", hexpand_set));
+        }
+        if let Some(ref is_focus) = self.is_focus {
+            properties.push(("is-focus", is_focus));
+        }
+        if let Some(ref margin) = self.margin {
+            properties.push(("margin", margin));
+        }
+        if let Some(ref margin_bottom) = self.margin_bottom {
+            properties.push(("margin-bottom", margin_bottom));
+        }
+        if let Some(ref margin_end) = self.margin_end {
+            properties.push(("margin-end", margin_end));
+        }
+        if let Some(ref margin_start) = self.margin_start {
+            properties.push(("margin-start", margin_start));
+        }
+        if let Some(ref margin_top) = self.margin_top {
+            properties.push(("margin-top", margin_top));
+        }
+        if let Some(ref name) = self.name {
+            properties.push(("name", name));
+        }
+        if let Some(ref no_show_all) = self.no_show_all {
+            properties.push(("no-show-all", no_show_all));
+        }
+        if let Some(ref opacity) = self.opacity {
+            properties.push(("opacity", opacity));
+        }
+        if let Some(ref parent) = self.parent {
+            properties.push(("parent", parent));
+        }
+        if let Some(ref receives_default) = self.receives_default {
+            properties.push(("receives-default", receives_default));
+        }
+        if let Some(ref sensitive) = self.sensitive {
+            properties.push(("sensitive", sensitive));
+        }
+        if let Some(ref tooltip_markup) = self.tooltip_markup {
+            properties.push(("tooltip-markup", tooltip_markup));
+        }
+        if let Some(ref tooltip_text) = self.tooltip_text {
+            properties.push(("tooltip-text", tooltip_text));
+        }
+        if let Some(ref valign) = self.valign {
+            properties.push(("valign", valign));
+        }
+        if let Some(ref vexpand) = self.vexpand {
+            properties.push(("vexpand", vexpand));
+        }
+        if let Some(ref vexpand_set) = self.vexpand_set {
+            properties.push(("vexpand-set", vexpand_set));
+        }
+        if let Some(ref visible) = self.visible {
+            properties.push(("visible", visible));
+        }
+        if let Some(ref width_request) = self.width_request {
+            properties.push(("width-request", width_request));
+        }
+        if let Some(ref orientation) = self.orientation {
+            properties.push(("orientation", orientation));
+        }
+        glib::Object::new::<StackSwitcher>(&properties)
+            .expect("Failed to create an instance of StackSwitcher")
+    }
+
+    #[cfg(any(feature = "v3_20", feature = "dox"))]
+    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+    pub fn icon_size(mut self, icon_size: IconSize) -> Self {
+        self.icon_size = Some(icon_size.into_glib());
+        self
+    }
+
+    pub fn stack<P: IsA<Stack>>(mut self, stack: &P) -> Self {
+        self.stack = Some(stack.clone().upcast());
+        self
+    }
+
+    pub fn baseline_position(mut self, baseline_position: BaselinePosition) -> Self {
+        self.baseline_position = Some(baseline_position);
+        self
+    }
+
+    pub fn homogeneous(mut self, homogeneous: bool) -> Self {
+        self.homogeneous = Some(homogeneous);
+        self
+    }
+
+    pub fn spacing(mut self, spacing: i32) -> Self {
+        self.spacing = Some(spacing);
+        self
+    }
+
+    pub fn border_width(mut self, border_width: u32) -> Self {
+        self.border_width = Some(border_width);
+        self
+    }
+
+    pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self {
+        self.child = Some(child.clone().upcast());
+        self
+    }
+
+    pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
+        self.resize_mode = Some(resize_mode);
+        self
+    }
+
+    pub fn app_paintable(mut self, app_paintable: bool) -> Self {
+        self.app_paintable = Some(app_paintable);
+        self
+    }
+
+    pub fn can_default(mut self, can_default: bool) -> Self {
+        self.can_default = Some(can_default);
+        self
+    }
+
+    pub fn can_focus(mut self, can_focus: bool) -> Self {
+        self.can_focus = Some(can_focus);
+        self
+    }
+
+    pub fn events(mut self, events: gdk::EventMask) -> Self {
+        self.events = Some(events);
+        self
+    }
+
+    pub fn expand(mut self, expand: bool) -> Self {
+        self.expand = Some(expand);
+        self
+    }
+
+    #[cfg(any(feature = "v3_20", feature = "dox"))]
+    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
+    pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
+        self.focus_on_click = Some(focus_on_click);
+        self
+    }
+
+    pub fn halign(mut self, halign: Align) -> Self {
+        self.halign = Some(halign);
+        self
+    }
+
+    pub fn has_default(mut self, has_default: bool) -> Self {
+        self.has_default = Some(has_default);
+        self
+    }
+
+    pub fn has_focus(mut self, has_focus: bool) -> Self {
+        self.has_focus = Some(has_focus);
+        self
+    }
+
+    pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
+        self.has_tooltip = Some(has_tooltip);
+        self
+    }
+
+    pub fn height_request(mut self, height_request: i32) -> Self {
+        self.height_request = Some(height_request);
+        self
+    }
+
+    pub fn hexpand(mut self, hexpand: bool) -> Self {
+        self.hexpand = Some(hexpand);
+        self
+    }
+
+    pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
+        self.hexpand_set = Some(hexpand_set);
+        self
+    }
+
+    #[allow(clippy::wrong_self_convention)]
+    pub fn is_focus(mut self, is_focus: bool) -> Self {
+        self.is_focus = Some(is_focus);
+        self
+    }
+
+    pub fn margin(mut self, margin: i32) -> Self {
+        self.margin = Some(margin);
+        self
+    }
+
+    pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
+        self.margin_bottom = Some(margin_bottom);
+        self
+    }
+
+    pub fn margin_end(mut self, margin_end: i32) -> Self {
+        self.margin_end = Some(margin_end);
+        self
+    }
+
+    pub fn margin_start(mut self, margin_start: i32) -> Self {
+        self.margin_start = Some(margin_start);
+        self
+    }
+
+    pub fn margin_top(mut self, margin_top: i32) -> Self {
+        self.margin_top = Some(margin_top);
+        self
+    }
+
+    pub fn name(mut self, name: &str) -> Self {
+        self.name = Some(name.to_string());
+        self
+    }
+
+    pub fn no_show_all(mut self, no_show_all: bool) -> Self {
+        self.no_show_all = Some(no_show_all);
+        self
+    }
+
+    pub fn opacity(mut self, opacity: f64) -> Self {
+        self.opacity = Some(opacity);
+        self
+    }
+
+    pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self {
+        self.parent = Some(parent.clone().upcast());
+        self
+    }
+
+    pub fn receives_default(mut self, receives_default: bool) -> Self {
+        self.receives_default = Some(receives_default);
+        self
+    }
+
+    pub fn sensitive(mut self, sensitive: bool) -> Self {
+        self.sensitive = Some(sensitive);
+        self
+    }
+
+    pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
+        self.tooltip_markup = Some(tooltip_markup.to_string());
+        self
+    }
+
+    pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
+        self.tooltip_text = Some(tooltip_text.to_string());
+        self
+    }
+
+    pub fn valign(mut self, valign: Align) -> Self {
+        self.valign = Some(valign);
+        self
+    }
+
+    pub fn vexpand(mut self, vexpand: bool) -> Self {
+        self.vexpand = Some(vexpand);
+        self
+    }
+
+    pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
+        self.vexpand_set = Some(vexpand_set);
+        self
+    }
+
+    pub fn visible(mut self, visible: bool) -> Self {
+        self.visible = Some(visible);
+        self
+    }
+
+    pub fn width_request(mut self, width_request: i32) -> Self {
+        self.width_request = Some(width_request);
+        self
+    }
+
+    pub fn orientation(mut self, orientation: Orientation) -> Self {
+        self.orientation = Some(orientation);
+        self
+    }
+}


Test patch: