From daf1b439389a766818be800ef93f7fe3402da14b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 6 Oct 2025 08:58:13 +0000 Subject: [PATCH 1/4] Update gir --- gir | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gir b/gir index be9aa145267c..c9947f8f47b6 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit be9aa145267cb915b3c79c4ae6d896beecc061ee +Subproject commit c9947f8f47b69d6884ad79738b77d6291fb63467 From 4c671acad072ac7e92019fdbb763d7abcd93e68e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 6 Oct 2025 08:58:57 +0000 Subject: [PATCH 2/4] Regenerate with latest gir --- gdk4-macos/src/auto/versions.txt | 2 +- gdk4-macos/sys/versions.txt | 2 +- gdk4-wayland/src/auto/versions.txt | 2 +- gdk4-wayland/sys/versions.txt | 2 +- gdk4-win32/src/auto/versions.txt | 2 +- gdk4-win32/sys/versions.txt | 2 +- gdk4-x11/src/auto/versions.txt | 2 +- gdk4-x11/sys/versions.txt | 2 +- gdk4/src/auto/versions.txt | 2 +- gdk4/sys/versions.txt | 2 +- gsk4/src/auto/versions.txt | 2 +- gsk4/sys/versions.txt | 2 +- gtk4/src/auto/versions.txt | 2 +- gtk4/sys/versions.txt | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gdk4-macos/src/auto/versions.txt b/gdk4-macos/src/auto/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gdk4-macos/src/auto/versions.txt +++ b/gdk4-macos/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) diff --git a/gdk4-macos/sys/versions.txt b/gdk4-macos/sys/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gdk4-macos/sys/versions.txt +++ b/gdk4-macos/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) diff --git a/gdk4-wayland/src/auto/versions.txt b/gdk4-wayland/src/auto/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gdk4-wayland/src/auto/versions.txt +++ b/gdk4-wayland/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) diff --git a/gdk4-wayland/sys/versions.txt b/gdk4-wayland/sys/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gdk4-wayland/sys/versions.txt +++ b/gdk4-wayland/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) diff --git a/gdk4-win32/src/auto/versions.txt b/gdk4-win32/src/auto/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gdk4-win32/src/auto/versions.txt +++ b/gdk4-win32/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) diff --git a/gdk4-win32/sys/versions.txt b/gdk4-win32/sys/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gdk4-win32/sys/versions.txt +++ b/gdk4-win32/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) diff --git a/gdk4-x11/src/auto/versions.txt b/gdk4-x11/src/auto/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gdk4-x11/src/auto/versions.txt +++ b/gdk4-x11/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) diff --git a/gdk4-x11/sys/versions.txt b/gdk4-x11/sys/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gdk4-x11/sys/versions.txt +++ b/gdk4-x11/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) diff --git a/gdk4/src/auto/versions.txt b/gdk4/src/auto/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gdk4/src/auto/versions.txt +++ b/gdk4/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) diff --git a/gdk4/sys/versions.txt b/gdk4/sys/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gdk4/sys/versions.txt +++ b/gdk4/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) diff --git a/gsk4/src/auto/versions.txt b/gsk4/src/auto/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gsk4/src/auto/versions.txt +++ b/gsk4/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) diff --git a/gsk4/sys/versions.txt b/gsk4/sys/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gsk4/sys/versions.txt +++ b/gsk4/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) diff --git a/gtk4/src/auto/versions.txt b/gtk4/src/auto/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gtk4/src/auto/versions.txt +++ b/gtk4/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) diff --git a/gtk4/sys/versions.txt b/gtk4/sys/versions.txt index a9408cdf7100..4c38733cdbc6 100644 --- a/gtk4/sys/versions.txt +++ b/gtk4/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ be9aa145267c) +Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) From 8ad310cdc9b37beb679e0d1898c4fc78c8917da5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 6 Oct 2025 08:58:57 +0000 Subject: [PATCH 3/4] Update gir-files --- gir-files | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gir-files b/gir-files index e121d92cee84..0885719c0947 160000 --- a/gir-files +++ b/gir-files @@ -1 +1 @@ -Subproject commit e121d92cee84f498c5d69611326b5b17208db067 +Subproject commit 0885719c094779a19139b9cd93f2114bc1bdfb97 From 963f3215c8d18caaf59cdde00e84c6882879bacb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 6 Oct 2025 08:59:04 +0000 Subject: [PATCH 4/4] Regenerate with latest gir-files --- gdk4-macos/src/auto/versions.txt | 2 +- gdk4-macos/sys/versions.txt | 2 +- gdk4-wayland/src/auto/versions.txt | 2 +- gdk4-wayland/sys/versions.txt | 2 +- gdk4-win32/src/auto/versions.txt | 2 +- gdk4-win32/sys/versions.txt | 2 +- gdk4-x11/src/auto/versions.txt | 2 +- gdk4-x11/sys/versions.txt | 2 +- gdk4/src/auto/flags.rs | 4 +- gdk4/src/auto/versions.txt | 2 +- gdk4/sys/versions.txt | 2 +- gsk4/src/auto/versions.txt | 2 +- gsk4/sys/versions.txt | 2 +- gtk4/src/auto/application.rs | 93 ++++++++++++++++++- gtk4/src/auto/application_window.rs | 5 ++ gtk4/src/auto/builder.rs | 2 +- gtk4/src/auto/enums.rs | 36 ++++---- gtk4/src/auto/flags.rs | 2 + gtk4/src/auto/versions.txt | 2 +- gtk4/sys/src/lib.rs | 133 +++++++++++++++++++++++++++- gtk4/sys/tests/abi.rs | 26 ++++++ gtk4/sys/tests/constant.c | 5 ++ gtk4/sys/tests/layout.c | 3 + gtk4/sys/versions.txt | 2 +- 24 files changed, 296 insertions(+), 41 deletions(-) diff --git a/gdk4-macos/src/auto/versions.txt b/gdk4-macos/src/auto/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gdk4-macos/src/auto/versions.txt +++ b/gdk4-macos/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947) diff --git a/gdk4-macos/sys/versions.txt b/gdk4-macos/sys/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gdk4-macos/sys/versions.txt +++ b/gdk4-macos/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947) diff --git a/gdk4-wayland/src/auto/versions.txt b/gdk4-wayland/src/auto/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gdk4-wayland/src/auto/versions.txt +++ b/gdk4-wayland/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947) diff --git a/gdk4-wayland/sys/versions.txt b/gdk4-wayland/sys/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gdk4-wayland/sys/versions.txt +++ b/gdk4-wayland/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947) diff --git a/gdk4-win32/src/auto/versions.txt b/gdk4-win32/src/auto/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gdk4-win32/src/auto/versions.txt +++ b/gdk4-win32/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947) diff --git a/gdk4-win32/sys/versions.txt b/gdk4-win32/sys/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gdk4-win32/sys/versions.txt +++ b/gdk4-win32/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947) diff --git a/gdk4-x11/src/auto/versions.txt b/gdk4-x11/src/auto/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gdk4-x11/src/auto/versions.txt +++ b/gdk4-x11/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947) diff --git a/gdk4-x11/sys/versions.txt b/gdk4-x11/sys/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gdk4-x11/sys/versions.txt +++ b/gdk4-x11/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947) diff --git a/gdk4/src/auto/flags.rs b/gdk4/src/auto/flags.rs index 255a94bf3128..6d00a9d88914 100644 --- a/gdk4/src/auto/flags.rs +++ b/gdk4/src/auto/flags.rs @@ -628,9 +628,9 @@ bitflags! { #[doc(alias = "GdkPaintableFlags")] pub struct PaintableFlags: u32 { #[doc(alias = "GDK_PAINTABLE_STATIC_SIZE")] - const SIZE = ffi::GDK_PAINTABLE_STATIC_SIZE as _; + const STATIC_SIZE = ffi::GDK_PAINTABLE_STATIC_SIZE as _; #[doc(alias = "GDK_PAINTABLE_STATIC_CONTENTS")] - const CONTENTS = ffi::GDK_PAINTABLE_STATIC_CONTENTS as _; + const STATIC_CONTENTS = ffi::GDK_PAINTABLE_STATIC_CONTENTS as _; } } diff --git a/gdk4/src/auto/versions.txt b/gdk4/src/auto/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gdk4/src/auto/versions.txt +++ b/gdk4/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947) diff --git a/gdk4/sys/versions.txt b/gdk4/sys/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gdk4/sys/versions.txt +++ b/gdk4/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947) diff --git a/gsk4/src/auto/versions.txt b/gsk4/src/auto/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gsk4/src/auto/versions.txt +++ b/gsk4/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947) diff --git a/gsk4/sys/versions.txt b/gsk4/sys/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gsk4/sys/versions.txt +++ b/gsk4/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947) diff --git a/gtk4/src/auto/application.rs b/gtk4/src/auto/application.rs index 77adc40089f6..2123d4486163 100644 --- a/gtk4/src/auto/application.rs +++ b/gtk4/src/auto/application.rs @@ -54,13 +54,21 @@ impl ApplicationBuilder { } } - #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")] + #[cfg_attr(feature = "v4_22", deprecated = "Since 4.22")] pub fn register_session(self, register_session: bool) -> Self { Self { builder: self.builder.property("register-session", register_session), } } + #[cfg(feature = "v4_22")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + pub fn support_save(self, support_save: bool) -> Self { + Self { + builder: self.builder.property("support-save", support_save), + } + } + pub fn application_id(self, application_id: impl Into) -> Self { Self { builder: self @@ -122,6 +130,15 @@ pub trait GtkApplicationExt: IsA + 'static { } } + #[cfg(feature = "v4_22")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + #[doc(alias = "gtk_application_forget")] + fn forget(&self) { + unsafe { + ffi::gtk_application_forget(self.as_ref().to_glib_none().0); + } + } + #[doc(alias = "gtk_application_get_accels_for_action")] #[doc(alias = "get_accels_for_action")] fn accels_for_action(&self, detailed_action_name: &str) -> Vec { @@ -233,6 +250,15 @@ pub trait GtkApplicationExt: IsA + 'static { } } + #[cfg(feature = "v4_22")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + #[doc(alias = "gtk_application_save")] + fn save(&self) { + unsafe { + ffi::gtk_application_save(self.as_ref().to_glib_none().0); + } + } + #[doc(alias = "gtk_application_set_accels_for_action")] fn set_accels_for_action(&self, detailed_action_name: &str, accels: &[&str]) { unsafe { @@ -262,13 +288,13 @@ pub trait GtkApplicationExt: IsA + 'static { } } - #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")] + #[cfg_attr(feature = "v4_22", deprecated = "Since 4.22")] #[doc(alias = "register-session")] fn is_register_session(&self) -> bool { ObjectExt::property(self.as_ref(), "register-session") } - #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")] + #[cfg_attr(feature = "v4_22", deprecated = "Since 4.22")] #[doc(alias = "register-session")] fn set_register_session(&self, register_session: bool) { ObjectExt::set_property(self.as_ref(), "register-session", register_session) @@ -279,6 +305,20 @@ pub trait GtkApplicationExt: IsA + 'static { ObjectExt::property(self.as_ref(), "screensaver-active") } + #[cfg(feature = "v4_22")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + #[doc(alias = "support-save")] + fn supports_save(&self) -> bool { + ObjectExt::property(self.as_ref(), "support-save") + } + + #[cfg(feature = "v4_22")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + #[doc(alias = "support-save")] + fn set_support_save(&self, support_save: bool) { + ObjectExt::set_property(self.as_ref(), "support-save", support_save) + } + #[doc(alias = "query-end")] fn connect_query_end(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn query_end_trampoline, F: Fn(&P) + 'static>( @@ -301,6 +341,23 @@ pub trait GtkApplicationExt: IsA + 'static { } } + //#[doc(alias = "restore-state")] + //fn connect_restore_state(&self, f: F) -> SignalHandlerId { + // Ignored object: Gtk.RestoreReason + //} + + //#[cfg(feature = "v4_22")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + //#[doc(alias = "restore-window")] + //fn connect_restore_window(&self, f: F) -> SignalHandlerId { + // Ignored reason: Gtk.RestoreReason + //} + + //#[doc(alias = "save-state")] + //fn connect_save_state(&self, f: F) -> SignalHandlerId { + // Ignored object: GLib.VariantDict + //} + #[doc(alias = "window-added")] fn connect_window_added(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn window_added_trampoline< @@ -408,7 +465,7 @@ pub trait GtkApplicationExt: IsA + 'static { } } - #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")] + #[cfg_attr(feature = "v4_22", deprecated = "Since 4.22")] #[doc(alias = "register-session")] fn connect_register_session_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_register_session_trampoline< @@ -460,6 +517,34 @@ pub trait GtkApplicationExt: IsA + 'static { ) } } + + #[cfg(feature = "v4_22")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + #[doc(alias = "support-save")] + fn connect_support_save_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_support_save_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GtkApplication, + _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 _, + c"notify::support-save".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_support_save_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } } impl> GtkApplicationExt for O {} diff --git a/gtk4/src/auto/application_window.rs b/gtk4/src/auto/application_window.rs index 6110648955b7..c53103cb8549 100644 --- a/gtk4/src/auto/application_window.rs +++ b/gtk4/src/auto/application_window.rs @@ -495,6 +495,11 @@ pub trait ApplicationWindowExt: IsA + 'static { } } + //#[doc(alias = "save-state")] + //fn connect_save_state(&self, f: F) -> SignalHandlerId { + // Ignored object: GLib.VariantDict + //} + #[doc(alias = "show-menubar")] fn connect_show_menubar_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_show_menubar_trampoline< diff --git a/gtk4/src/auto/builder.rs b/gtk4/src/auto/builder.rs index fea67fead0ec..a08d1ba7796e 100644 --- a/gtk4/src/auto/builder.rs +++ b/gtk4/src/auto/builder.rs @@ -176,7 +176,7 @@ impl Builder { &mut error, ); if error.is_null() { - Ok(from_glib_full(ret)) + Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) } diff --git a/gtk4/src/auto/enums.rs b/gtk4/src/auto/enums.rs index 62299b989a6b..d06b4bc91789 100644 --- a/gtk4/src/auto/enums.rs +++ b/gtk4/src/auto/enums.rs @@ -3296,17 +3296,17 @@ impl From for glib::Value { #[doc(alias = "GtkConstraintVflParserError")] pub enum ConstraintVflParserError { #[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL")] - Symbol, + InvalidSymbol, #[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE")] - Attribute, + InvalidAttribute, #[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW")] - View, + InvalidView, #[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC")] - Metric, + InvalidMetric, #[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY")] - Priority, + InvalidPriority, #[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION")] - Relation, + InvalidRelation, #[doc(hidden)] __Unknown(i32), } @@ -3318,12 +3318,12 @@ impl IntoGlib for ConstraintVflParserError { #[inline] fn into_glib(self) -> ffi::GtkConstraintVflParserError { match self { - Self::Symbol => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL, - Self::Attribute => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE, - Self::View => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW, - Self::Metric => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC, - Self::Priority => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY, - Self::Relation => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION, + Self::InvalidSymbol => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL, + Self::InvalidAttribute => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE, + Self::InvalidView => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW, + Self::InvalidMetric => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC, + Self::InvalidPriority => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY, + Self::InvalidRelation => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION, Self::__Unknown(value) => value, } } @@ -3336,12 +3336,12 @@ impl FromGlib for ConstraintVflParserError { skip_assert_initialized!(); match value { - ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL => Self::Symbol, - ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE => Self::Attribute, - ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW => Self::View, - ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC => Self::Metric, - ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY => Self::Priority, - ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION => Self::Relation, + ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL => Self::InvalidSymbol, + ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE => Self::InvalidAttribute, + ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW => Self::InvalidView, + ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC => Self::InvalidMetric, + ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY => Self::InvalidPriority, + ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION => Self::InvalidRelation, value => Self::__Unknown(value), } } diff --git a/gtk4/src/auto/flags.rs b/gtk4/src/auto/flags.rs index da42afdfc86d..de114217c210 100644 --- a/gtk4/src/auto/flags.rs +++ b/gtk4/src/auto/flags.rs @@ -342,6 +342,8 @@ bitflags! { #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))] #[doc(alias = "GTK_DEBUG_BUILDER")] const BUILDER = ffi::GTK_DEBUG_BUILDER as _; + #[doc(alias = "GTK_DEBUG_SESSION")] + const SESSION = ffi::GTK_DEBUG_SESSION as _; } } diff --git a/gtk4/src/auto/versions.txt b/gtk4/src/auto/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gtk4/src/auto/versions.txt +++ b/gtk4/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947) diff --git a/gtk4/sys/src/lib.rs b/gtk4/sys/src/lib.rs index 5eee3b118252..f83e4c3dc20d 100644 --- a/gtk4/sys/src/lib.rs +++ b/gtk4/sys/src/lib.rs @@ -746,6 +746,12 @@ pub const GTK_RESPONSE_NO: GtkResponseType = -9; pub const GTK_RESPONSE_APPLY: GtkResponseType = -10; pub const GTK_RESPONSE_HELP: GtkResponseType = -11; +pub type GtkRestoreReason = c_int; +pub const GTK_RESTORE_REASON_PRISTINE: GtkRestoreReason = 0; +pub const GTK_RESTORE_REASON_LAUNCH: GtkRestoreReason = 1; +pub const GTK_RESTORE_REASON_RECOVER: GtkRestoreReason = 2; +pub const GTK_RESTORE_REASON_RESTORE: GtkRestoreReason = 3; + pub type GtkRevealerTransitionType = c_int; pub const GTK_REVEALER_TRANSITION_TYPE_NONE: GtkRevealerTransitionType = 0; pub const GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: GtkRevealerTransitionType = 1; @@ -1114,6 +1120,7 @@ pub const GTK_DEBUG_CSS: GtkDebugFlags = 1048576; #[cfg(feature = "v4_18")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))] pub const GTK_DEBUG_BUILDER: GtkDebugFlags = 2097152; +pub const GTK_DEBUG_SESSION: GtkDebugFlags = 4194304; pub type GtkDialogFlags = c_uint; pub const GTK_DIALOG_MODAL: GtkDialogFlags = 1; @@ -1404,6 +1411,41 @@ pub struct _GtkATContextClass { pub type GtkATContextClass = _GtkATContextClass; +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GtkAccessibleHyperlinkClass { + pub parent_class: gobject::GObjectClass, +} + +impl ::std::fmt::Debug for GtkAccessibleHyperlinkClass { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GtkAccessibleHyperlinkClass @ {self:p}")) + .field("parent_class", &self.parent_class) + .finish() + } +} + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GtkAccessibleHypertextInterface { + pub g_iface: gobject::GTypeInterface, + pub get_n_links: Option c_uint>, + pub get_link: Option< + unsafe extern "C" fn(*mut GtkAccessibleHypertext, c_uint) -> *mut GtkAccessibleHyperlink, + >, + pub get_link_at: Option c_uint>, +} + +impl ::std::fmt::Debug for GtkAccessibleHypertextInterface { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GtkAccessibleHypertextInterface @ {self:p}")) + .field("get_n_links", &self.get_n_links) + .field("get_link", &self.get_link) + .field("get_link_at", &self.get_link_at) + .finish() + } +} + #[derive(Copy, Clone)] #[repr(C)] pub struct GtkAccessibleInterface { @@ -1670,7 +1712,18 @@ pub struct GtkApplicationClass { pub parent_class: gio::GApplicationClass, pub window_added: Option, pub window_removed: Option, - pub padding: [gpointer; 8], + pub save_state: + Option gboolean>, + pub restore_state: Option< + unsafe extern "C" fn( + *mut GtkApplication, + GtkRestoreReason, + *mut glib::GVariant, + ) -> gboolean, + >, + pub restore_window: + Option, + pub padding: [gpointer; 5], } impl ::std::fmt::Debug for GtkApplicationClass { @@ -1679,6 +1732,9 @@ impl ::std::fmt::Debug for GtkApplicationClass { .field("parent_class", &self.parent_class) .field("window_added", &self.window_added) .field("window_removed", &self.window_removed) + .field("save_state", &self.save_state) + .field("restore_state", &self.restore_state) + .field("restore_window", &self.restore_window) .finish() } } @@ -1687,13 +1743,17 @@ impl ::std::fmt::Debug for GtkApplicationClass { #[repr(C)] pub struct GtkApplicationWindowClass { pub parent_class: GtkWindowClass, - pub padding: [gpointer; 8], + pub save_state: Option< + unsafe extern "C" fn(*mut GtkApplicationWindow, *mut glib::GVariantDict) -> gboolean, + >, + pub padding: [gpointer; 7], } impl ::std::fmt::Debug for GtkApplicationWindowClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GtkApplicationWindowClass @ {self:p}")) .field("parent_class", &self.parent_class) + .field("save_state", &self.save_state) .finish() } } @@ -5944,6 +6004,20 @@ impl ::std::fmt::Debug for GtkAboutDialog { } } +#[repr(C)] +#[allow(dead_code)] +pub struct GtkAccessibleHyperlink { + _data: [u8; 0], + _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +} + +impl ::std::fmt::Debug for GtkAccessibleHyperlink { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GtkAccessibleHyperlink @ {self:p}")) + .finish() + } +} + #[repr(C)] #[allow(dead_code)] pub struct GtkActionBar { @@ -9611,6 +9685,19 @@ impl ::std::fmt::Debug for GtkAccessible { } } +#[repr(C)] +#[allow(dead_code)] +pub struct GtkAccessibleHypertext { + _data: [u8; 0], + _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +} + +impl ::std::fmt::Debug for GtkAccessibleHypertext { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + write!(f, "GtkAccessibleHypertext @ {self:p}") + } +} + #[repr(C)] #[allow(dead_code)] pub struct GtkAccessibleRange { @@ -10410,6 +10497,13 @@ extern "C" { //========================================================================= pub fn gtk_response_type_get_type() -> GType; + //========================================================================= + // GtkRestoreReason + //========================================================================= + #[cfg(feature = "v4_22")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + pub fn gtk_restore_reason_get_type() -> GType; + //========================================================================= // GtkRevealerTransitionType //========================================================================= @@ -11435,6 +11529,28 @@ extern "C" { ); pub fn gtk_about_dialog_set_wrap_license(about: *mut GtkAboutDialog, wrap_license: gboolean); + //========================================================================= + // GtkAccessibleHyperlink + //========================================================================= + #[cfg(feature = "v4_22")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + pub fn gtk_accessible_hyperlink_get_type() -> GType; + #[cfg(feature = "v4_22")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + pub fn gtk_accessible_hyperlink_new( + parent: *mut GtkAccessibleHypertext, + index: c_uint, + uri: *const c_char, + bounds: *mut GtkAccessibleTextRange, + ) -> *mut GtkAccessibleHyperlink; + #[cfg(feature = "v4_22")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + pub fn gtk_accessible_hyperlink_set_platform_state( + self_: *mut GtkAccessibleHyperlink, + state: GtkAccessiblePlatformState, + enabled: gboolean, + ); + //========================================================================= // GtkActionBar //========================================================================= @@ -11692,6 +11808,9 @@ extern "C" { flags: gio::GApplicationFlags, ) -> *mut GtkApplication; pub fn gtk_application_add_window(application: *mut GtkApplication, window: *mut GtkWindow); + #[cfg(feature = "v4_22")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + pub fn gtk_application_forget(application: *mut GtkApplication); pub fn gtk_application_get_accels_for_action( application: *mut GtkApplication, detailed_action_name: *const c_char, @@ -11721,6 +11840,9 @@ extern "C" { application: *mut GtkApplication, ) -> *mut *mut c_char; pub fn gtk_application_remove_window(application: *mut GtkApplication, window: *mut GtkWindow); + #[cfg(feature = "v4_22")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + pub fn gtk_application_save(application: *mut GtkApplication); pub fn gtk_application_set_accels_for_action( application: *mut GtkApplication, detailed_action_name: *const c_char, @@ -20855,6 +20977,13 @@ extern "C" { values: *const gobject::GValue, ); + //========================================================================= + // GtkAccessibleHypertext + //========================================================================= + #[cfg(feature = "v4_22")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_22")))] + pub fn gtk_accessible_hypertext_get_type() -> GType; + //========================================================================= // GtkAccessibleRange //========================================================================= diff --git a/gtk4/sys/tests/abi.rs b/gtk4/sys/tests/abi.rs index a55d81b73954..4656c1c86237 100644 --- a/gtk4/sys/tests/abi.rs +++ b/gtk4/sys/tests/abi.rs @@ -215,6 +215,20 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GtkAccessibleHyperlinkClass", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), + ( + "GtkAccessibleHypertextInterface", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GtkAccessibleInterface", Layout { @@ -1881,6 +1895,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GtkRestoreReason", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GtkRevealerTransitionType", Layout { @@ -2959,6 +2980,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(guint) GTK_DEBUG_MODULES", "8"), ("(guint) GTK_DEBUG_NO_CSS_CACHE", "512"), ("(guint) GTK_DEBUG_PRINTING", "64"), + ("(guint) GTK_DEBUG_SESSION", "4194304"), ("(guint) GTK_DEBUG_SIZE_REQUEST", "256"), ("(guint) GTK_DEBUG_SNAPSHOT", "16384"), ("(guint) GTK_DEBUG_TEXT", "1"), @@ -3335,6 +3357,10 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) GTK_RESPONSE_OK", "-5"), ("(gint) GTK_RESPONSE_REJECT", "-2"), ("(gint) GTK_RESPONSE_YES", "-8"), + ("(gint) GTK_RESTORE_REASON_LAUNCH", "1"), + ("(gint) GTK_RESTORE_REASON_PRISTINE", "0"), + ("(gint) GTK_RESTORE_REASON_RECOVER", "2"), + ("(gint) GTK_RESTORE_REASON_RESTORE", "3"), ("(gint) GTK_REVEALER_TRANSITION_TYPE_CROSSFADE", "1"), ("(gint) GTK_REVEALER_TRANSITION_TYPE_NONE", "0"), ("(gint) GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN", "5"), diff --git a/gtk4/sys/tests/constant.c b/gtk4/sys/tests/constant.c index 5cac5428f712..f20ba17ed074 100644 --- a/gtk4/sys/tests/constant.c +++ b/gtk4/sys/tests/constant.c @@ -360,6 +360,7 @@ int main() { PRINT_CONSTANT((guint) GTK_DEBUG_MODULES); PRINT_CONSTANT((guint) GTK_DEBUG_NO_CSS_CACHE); PRINT_CONSTANT((guint) GTK_DEBUG_PRINTING); + PRINT_CONSTANT((guint) GTK_DEBUG_SESSION); PRINT_CONSTANT((guint) GTK_DEBUG_SIZE_REQUEST); PRINT_CONSTANT((guint) GTK_DEBUG_SNAPSHOT); PRINT_CONSTANT((guint) GTK_DEBUG_TEXT); @@ -700,6 +701,10 @@ int main() { PRINT_CONSTANT((gint) GTK_RESPONSE_OK); PRINT_CONSTANT((gint) GTK_RESPONSE_REJECT); PRINT_CONSTANT((gint) GTK_RESPONSE_YES); + PRINT_CONSTANT((gint) GTK_RESTORE_REASON_LAUNCH); + PRINT_CONSTANT((gint) GTK_RESTORE_REASON_PRISTINE); + PRINT_CONSTANT((gint) GTK_RESTORE_REASON_RECOVER); + PRINT_CONSTANT((gint) GTK_RESTORE_REASON_RESTORE); PRINT_CONSTANT((gint) GTK_REVEALER_TRANSITION_TYPE_CROSSFADE); PRINT_CONSTANT((gint) GTK_REVEALER_TRANSITION_TYPE_NONE); PRINT_CONSTANT((gint) GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN); diff --git a/gtk4/sys/tests/layout.c b/gtk4/sys/tests/layout.c index 7d090a1a9eea..3594f5117359 100644 --- a/gtk4/sys/tests/layout.c +++ b/gtk4/sys/tests/layout.c @@ -9,6 +9,8 @@ int main() { printf("%s;%zu;%zu\n", "GtkAccessibleAnnouncementPriority", sizeof(GtkAccessibleAnnouncementPriority), alignof(GtkAccessibleAnnouncementPriority)); printf("%s;%zu;%zu\n", "GtkAccessibleAutocomplete", sizeof(GtkAccessibleAutocomplete), alignof(GtkAccessibleAutocomplete)); + printf("%s;%zu;%zu\n", "GtkAccessibleHyperlinkClass", sizeof(GtkAccessibleHyperlinkClass), alignof(GtkAccessibleHyperlinkClass)); + printf("%s;%zu;%zu\n", "GtkAccessibleHypertextInterface", sizeof(GtkAccessibleHypertextInterface), alignof(GtkAccessibleHypertextInterface)); printf("%s;%zu;%zu\n", "GtkAccessibleInterface", sizeof(GtkAccessibleInterface), alignof(GtkAccessibleInterface)); printf("%s;%zu;%zu\n", "GtkAccessibleInvalidState", sizeof(GtkAccessibleInvalidState), alignof(GtkAccessibleInvalidState)); printf("%s;%zu;%zu\n", "GtkAccessiblePlatformState", sizeof(GtkAccessiblePlatformState), alignof(GtkAccessiblePlatformState)); @@ -247,6 +249,7 @@ int main() { printf("%s;%zu;%zu\n", "GtkRequestedSize", sizeof(GtkRequestedSize), alignof(GtkRequestedSize)); printf("%s;%zu;%zu\n", "GtkRequisition", sizeof(GtkRequisition), alignof(GtkRequisition)); printf("%s;%zu;%zu\n", "GtkResponseType", sizeof(GtkResponseType), alignof(GtkResponseType)); + printf("%s;%zu;%zu\n", "GtkRestoreReason", sizeof(GtkRestoreReason), alignof(GtkRestoreReason)); printf("%s;%zu;%zu\n", "GtkRevealerTransitionType", sizeof(GtkRevealerTransitionType), alignof(GtkRevealerTransitionType)); printf("%s;%zu;%zu\n", "GtkScale", sizeof(GtkScale), alignof(GtkScale)); printf("%s;%zu;%zu\n", "GtkScaleButton", sizeof(GtkScaleButton), alignof(GtkScaleButton)); diff --git a/gtk4/sys/versions.txt b/gtk4/sys/versions.txt index 4c38733cdbc6..b7ea734b9032 100644 --- a/gtk4/sys/versions.txt +++ b/gtk4/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ c9947f8f47b6) -from gir-files (https://github.com/gtk-rs/gir-files @ e121d92cee84) +from gir-files (https://github.com/gtk-rs/gir-files @ 0885719c0947)