diff --git a/gtk4/Gir.toml b/gtk4/Gir.toml index b19feec2c1b1..e27991b255f8 100644 --- a/gtk4/Gir.toml +++ b/gtk4/Gir.toml @@ -129,7 +129,6 @@ generate = [ "Gtk.GestureRotate", "Gtk.GestureSwipe", "Gtk.GestureZoom", - "Gtk.GraphicsOffload", "Gtk.GraphicsOffloadEnabled", "Gtk.Grid", "Gtk.GridLayout", @@ -1370,6 +1369,15 @@ status = "generate" [object.signal.return] nullable = true +[[object]] +name = "Gtk.GraphicsOffload" +status = "generate" + [[object.function]] + name = "new" + # transfer none + # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7159 + manual = true + [[object]] name = "Gtk.GridLayoutChild" status = "generate" diff --git a/gtk4/src/auto/graphics_offload.rs b/gtk4/src/auto/graphics_offload.rs index 9842c42bc042..d499f442cee6 100644 --- a/gtk4/src/auto/graphics_offload.rs +++ b/gtk4/src/auto/graphics_offload.rs @@ -23,17 +23,6 @@ glib::wrapper! { } impl GraphicsOffload { - #[doc(alias = "gtk_graphics_offload_new")] - pub fn new(child: Option<&impl IsA>) -> GraphicsOffload { - assert_initialized_main_thread!(); - unsafe { - Widget::from_glib_full(ffi::gtk_graphics_offload_new( - child.map(|p| p.as_ref()).to_glib_none().0, - )) - .unsafe_cast() - } - } - // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`GraphicsOffload`] objects. /// @@ -122,14 +111,6 @@ impl GraphicsOffload { } } -#[cfg(feature = "v4_14")] -#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] -impl Default for GraphicsOffload { - fn default() -> Self { - glib::object::Object::new::() - } -} - // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`GraphicsOffload`] objects. /// diff --git a/gtk4/src/graphics_offload.rs b/gtk4/src/graphics_offload.rs new file mode 100644 index 000000000000..069c0d6c7cdb --- /dev/null +++ b/gtk4/src/graphics_offload.rs @@ -0,0 +1,26 @@ +// Take a look at the license at the top of the repository in the LICENSE file. + +use glib::translate::*; + +use crate::{prelude::*, GraphicsOffload}; + +impl GraphicsOffload { + #[doc(alias = "gtk_graphics_offload_new")] + pub fn new(child: Option<&impl IsA>) -> GraphicsOffload { + assert_initialized_main_thread!(); + unsafe { + Widget::from_glib_none(ffi::gtk_graphics_offload_new( + child.map(|p| p.as_ref()).to_glib_none().0, + )) + .unsafe_cast() + } + } +} + +#[cfg(feature = "v4_14")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] +impl Default for GraphicsOffload { + fn default() -> Self { + glib::object::Object::new::() + } +} diff --git a/gtk4/src/lib.rs b/gtk4/src/lib.rs index 4becb9b3a0e9..c3d29cc73a17 100644 --- a/gtk4/src/lib.rs +++ b/gtk4/src/lib.rs @@ -145,6 +145,9 @@ mod font_chooser; mod font_dialog; mod functions; mod gesture_stylus; +#[cfg(feature = "v4_14")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] +mod graphics_offload; mod icon_theme; mod im_context_simple; mod info_bar;