From b0f1d17a488ead400be76d28976136f98c7dc098 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 25 Apr 2025 09:45:59 +0000 Subject: [PATCH 1/7] Update gir --- gir | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gir b/gir index 491114ad76bd..13192296259b 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit 491114ad76bde3d0c2c30312638782c6638c00c2 +Subproject commit 13192296259b5c9b5d55630acb26ec32069fe867 From 9ff647287d8f5fdd6b449a4ee175aed0814adf87 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 25 Apr 2025 09:46:50 +0000 Subject: [PATCH 2/7] 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 1f935f15fcd9..01aec28c6ad2 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 @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) diff --git a/gdk4-macos/sys/versions.txt b/gdk4-macos/sys/versions.txt index 1f935f15fcd9..01aec28c6ad2 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 @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) diff --git a/gdk4-wayland/src/auto/versions.txt b/gdk4-wayland/src/auto/versions.txt index 1f935f15fcd9..01aec28c6ad2 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 @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) diff --git a/gdk4-wayland/sys/versions.txt b/gdk4-wayland/sys/versions.txt index 1f935f15fcd9..01aec28c6ad2 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 @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) diff --git a/gdk4-win32/src/auto/versions.txt b/gdk4-win32/src/auto/versions.txt index 1f935f15fcd9..01aec28c6ad2 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 @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) diff --git a/gdk4-win32/sys/versions.txt b/gdk4-win32/sys/versions.txt index 1f935f15fcd9..01aec28c6ad2 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 @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) diff --git a/gdk4-x11/src/auto/versions.txt b/gdk4-x11/src/auto/versions.txt index 1f935f15fcd9..01aec28c6ad2 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 @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) diff --git a/gdk4-x11/sys/versions.txt b/gdk4-x11/sys/versions.txt index 1f935f15fcd9..01aec28c6ad2 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 @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) diff --git a/gdk4/src/auto/versions.txt b/gdk4/src/auto/versions.txt index 1f935f15fcd9..01aec28c6ad2 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 @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) diff --git a/gdk4/sys/versions.txt b/gdk4/sys/versions.txt index 1f935f15fcd9..01aec28c6ad2 100644 --- a/gdk4/sys/versions.txt +++ b/gdk4/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) diff --git a/gsk4/src/auto/versions.txt b/gsk4/src/auto/versions.txt index 1f935f15fcd9..01aec28c6ad2 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 @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) diff --git a/gsk4/sys/versions.txt b/gsk4/sys/versions.txt index 1f935f15fcd9..01aec28c6ad2 100644 --- a/gsk4/sys/versions.txt +++ b/gsk4/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) diff --git a/gtk4/src/auto/versions.txt b/gtk4/src/auto/versions.txt index 1f935f15fcd9..01aec28c6ad2 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 @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) diff --git a/gtk4/sys/versions.txt b/gtk4/sys/versions.txt index 1f935f15fcd9..01aec28c6ad2 100644 --- a/gtk4/sys/versions.txt +++ b/gtk4/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 491114ad76bd) +Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) From 8b30882af12394cb607b0990b43c88be6288e509 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 25 Apr 2025 09:46:50 +0000 Subject: [PATCH 3/7] Update gir-files --- gir-files | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gir-files b/gir-files index 56728a5eb215..6668d0f5551a 160000 --- a/gir-files +++ b/gir-files @@ -1 +1 @@ -Subproject commit 56728a5eb2157746f6377b11416c91a5970e7518 +Subproject commit 6668d0f5551ae71a2da254cfa5f3fe5a0805506e From 2e5530c1c7bd8496518dd115bac5c5865483bd51 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 25 Apr 2025 09:46:57 +0000 Subject: [PATCH 4/7] 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/enums.rs | 184 ++++++++++++++++++++++++ gdk4/src/auto/memory_texture_builder.rs | 40 ++++++ gdk4/src/auto/texture_downloader.rs | 7 + gdk4/src/auto/toplevel.rs | 86 +++++++++++ gdk4/src/auto/versions.txt | 2 +- gdk4/sys/Cargo.toml | 4 + gdk4/sys/build_version.rs | 4 +- gdk4/sys/src/lib.rs | 146 ++++++++++++++++++- gdk4/sys/tests/abi.rs | 40 +++++- gdk4/sys/tests/constant.c | 31 ++++ gdk4/sys/tests/layout.c | 1 + gdk4/sys/versions.txt | 2 +- gsk4/src/auto/versions.txt | 2 +- gsk4/sys/versions.txt | 2 +- gtk4/src/auto/about_dialog.rs | 5 + gtk4/src/auto/application_window.rs | 5 + gtk4/src/auto/assistant.rs | 5 + gtk4/src/auto/calendar.rs | 54 +++++++ gtk4/src/auto/color_chooser_dialog.rs | 5 + gtk4/src/auto/dialog.rs | 5 + gtk4/src/auto/file_chooser_dialog.rs | 5 + gtk4/src/auto/flags.rs | 6 + gtk4/src/auto/font_chooser_dialog.rs | 5 + gtk4/src/auto/message_dialog.rs | 5 + gtk4/src/auto/page_setup_unix_dialog.rs | 5 + gtk4/src/auto/print_unix_dialog.rs | 5 + gtk4/src/auto/shortcuts_window.rs | 5 + gtk4/src/auto/versions.txt | 2 +- gtk4/src/auto/window.rs | 46 ++++++ gtk4/sys/src/lib.rs | 38 +++++ gtk4/sys/tests/abi.rs | 23 +++ gtk4/sys/tests/constant.c | 16 +++ gtk4/sys/tests/layout.c | 1 + gtk4/sys/versions.txt | 2 +- 42 files changed, 793 insertions(+), 17 deletions(-) diff --git a/gdk4-macos/src/auto/versions.txt b/gdk4-macos/src/auto/versions.txt index 01aec28c6ad2..401378930208 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 @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) diff --git a/gdk4-macos/sys/versions.txt b/gdk4-macos/sys/versions.txt index 01aec28c6ad2..401378930208 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 @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) diff --git a/gdk4-wayland/src/auto/versions.txt b/gdk4-wayland/src/auto/versions.txt index 01aec28c6ad2..401378930208 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 @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) diff --git a/gdk4-wayland/sys/versions.txt b/gdk4-wayland/sys/versions.txt index 01aec28c6ad2..401378930208 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 @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) diff --git a/gdk4-win32/src/auto/versions.txt b/gdk4-win32/src/auto/versions.txt index 01aec28c6ad2..401378930208 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 @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) diff --git a/gdk4-win32/sys/versions.txt b/gdk4-win32/sys/versions.txt index 01aec28c6ad2..401378930208 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 @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) diff --git a/gdk4-x11/src/auto/versions.txt b/gdk4-x11/src/auto/versions.txt index 01aec28c6ad2..401378930208 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 @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) diff --git a/gdk4-x11/sys/versions.txt b/gdk4-x11/sys/versions.txt index 01aec28c6ad2..401378930208 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 @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) diff --git a/gdk4/src/auto/enums.rs b/gdk4/src/auto/enums.rs index dac4a98e24f1..a739156d087e 100644 --- a/gdk4/src/auto/enums.rs +++ b/gdk4/src/auto/enums.rs @@ -1737,6 +1737,98 @@ pub enum MemoryFormat { #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(alias = "GDK_MEMORY_X8B8G8R8")] X8b8g8r8, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_B8R8_420")] + G8B8r8420, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_R8B8_420")] + G8R8b8420, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_B8R8_422")] + G8B8r8422, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_R8B8_422")] + G8R8b8422, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_B8R8_444")] + G8B8r8444, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_R8B8_444")] + G8R8b8444, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G10X6_B10X6R10X6_420")] + G10x6B10x6r10x6420, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G12X4_B12X4R12X4_420")] + G12x4B12x4r12x4420, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G16_B16R16_420")] + G16B16r16420, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_B8_R8_410")] + G8B8R8410, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_R8_B8_410")] + G8R8B8410, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_B8_R8_411")] + G8B8R8411, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_R8_B8_411")] + G8R8B8411, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_B8_R8_420")] + G8B8R8420, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_R8_B8_420")] + G8R8B8420, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_B8_R8_422")] + G8B8R8422, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_R8_B8_422")] + G8R8B8422, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_B8_R8_444")] + G8B8R8444, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8_R8_B8_444")] + G8R8B8444, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8B8G8R8_422")] + G8b8g8r8422, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_G8R8G8B8_422")] + G8r8g8b8422, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_R8G8B8G8_422")] + R8g8b8g8422, + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_MEMORY_B8G8R8G8_422")] + B8g8r8g8422, #[doc(hidden)] __Unknown(i32), } @@ -1808,6 +1900,52 @@ impl IntoGlib for MemoryFormat { Self::R8g8b8x8 => ffi::GDK_MEMORY_R8G8B8X8, #[cfg(feature = "v4_14")] Self::X8b8g8r8 => ffi::GDK_MEMORY_X8B8G8R8, + #[cfg(feature = "v4_20")] + Self::G8B8r8420 => ffi::GDK_MEMORY_G8_B8R8_420, + #[cfg(feature = "v4_20")] + Self::G8R8b8420 => ffi::GDK_MEMORY_G8_R8B8_420, + #[cfg(feature = "v4_20")] + Self::G8B8r8422 => ffi::GDK_MEMORY_G8_B8R8_422, + #[cfg(feature = "v4_20")] + Self::G8R8b8422 => ffi::GDK_MEMORY_G8_R8B8_422, + #[cfg(feature = "v4_20")] + Self::G8B8r8444 => ffi::GDK_MEMORY_G8_B8R8_444, + #[cfg(feature = "v4_20")] + Self::G8R8b8444 => ffi::GDK_MEMORY_G8_R8B8_444, + #[cfg(feature = "v4_20")] + Self::G10x6B10x6r10x6420 => ffi::GDK_MEMORY_G10X6_B10X6R10X6_420, + #[cfg(feature = "v4_20")] + Self::G12x4B12x4r12x4420 => ffi::GDK_MEMORY_G12X4_B12X4R12X4_420, + #[cfg(feature = "v4_20")] + Self::G16B16r16420 => ffi::GDK_MEMORY_G16_B16R16_420, + #[cfg(feature = "v4_20")] + Self::G8B8R8410 => ffi::GDK_MEMORY_G8_B8_R8_410, + #[cfg(feature = "v4_20")] + Self::G8R8B8410 => ffi::GDK_MEMORY_G8_R8_B8_410, + #[cfg(feature = "v4_20")] + Self::G8B8R8411 => ffi::GDK_MEMORY_G8_B8_R8_411, + #[cfg(feature = "v4_20")] + Self::G8R8B8411 => ffi::GDK_MEMORY_G8_R8_B8_411, + #[cfg(feature = "v4_20")] + Self::G8B8R8420 => ffi::GDK_MEMORY_G8_B8_R8_420, + #[cfg(feature = "v4_20")] + Self::G8R8B8420 => ffi::GDK_MEMORY_G8_R8_B8_420, + #[cfg(feature = "v4_20")] + Self::G8B8R8422 => ffi::GDK_MEMORY_G8_B8_R8_422, + #[cfg(feature = "v4_20")] + Self::G8R8B8422 => ffi::GDK_MEMORY_G8_R8_B8_422, + #[cfg(feature = "v4_20")] + Self::G8B8R8444 => ffi::GDK_MEMORY_G8_B8_R8_444, + #[cfg(feature = "v4_20")] + Self::G8R8B8444 => ffi::GDK_MEMORY_G8_R8_B8_444, + #[cfg(feature = "v4_20")] + Self::G8b8g8r8422 => ffi::GDK_MEMORY_G8B8G8R8_422, + #[cfg(feature = "v4_20")] + Self::G8r8g8b8422 => ffi::GDK_MEMORY_G8R8G8B8_422, + #[cfg(feature = "v4_20")] + Self::R8g8b8g8422 => ffi::GDK_MEMORY_R8G8B8G8_422, + #[cfg(feature = "v4_20")] + Self::B8g8r8g8422 => ffi::GDK_MEMORY_B8G8R8G8_422, Self::__Unknown(value) => value, } } @@ -1880,6 +2018,52 @@ impl FromGlib for MemoryFormat { ffi::GDK_MEMORY_R8G8B8X8 => Self::R8g8b8x8, #[cfg(feature = "v4_14")] ffi::GDK_MEMORY_X8B8G8R8 => Self::X8b8g8r8, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_B8R8_420 => Self::G8B8r8420, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_R8B8_420 => Self::G8R8b8420, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_B8R8_422 => Self::G8B8r8422, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_R8B8_422 => Self::G8R8b8422, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_B8R8_444 => Self::G8B8r8444, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_R8B8_444 => Self::G8R8b8444, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G10X6_B10X6R10X6_420 => Self::G10x6B10x6r10x6420, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G12X4_B12X4R12X4_420 => Self::G12x4B12x4r12x4420, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G16_B16R16_420 => Self::G16B16r16420, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_B8_R8_410 => Self::G8B8R8410, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_R8_B8_410 => Self::G8R8B8410, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_B8_R8_411 => Self::G8B8R8411, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_R8_B8_411 => Self::G8R8B8411, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_B8_R8_420 => Self::G8B8R8420, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_R8_B8_420 => Self::G8R8B8420, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_B8_R8_422 => Self::G8B8R8422, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_R8_B8_422 => Self::G8R8B8422, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_B8_R8_444 => Self::G8B8R8444, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8_R8_B8_444 => Self::G8R8B8444, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8B8G8R8_422 => Self::G8b8g8r8422, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_G8R8G8B8_422 => Self::G8r8g8b8422, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_R8G8B8G8_422 => Self::R8g8b8g8422, + #[cfg(feature = "v4_20")] + ffi::GDK_MEMORY_B8G8R8G8_422 => Self::B8g8r8g8422, value => Self::__Unknown(value), } } diff --git a/gdk4/src/auto/memory_texture_builder.rs b/gdk4/src/auto/memory_texture_builder.rs index cedd638964a6..4f48641428ce 100644 --- a/gdk4/src/auto/memory_texture_builder.rs +++ b/gdk4/src/auto/memory_texture_builder.rs @@ -68,12 +68,30 @@ impl MemoryTextureBuilder { unsafe { ffi::gdk_memory_texture_builder_get_height(self.to_glib_none().0) } } + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "gdk_memory_texture_builder_get_offset")] + #[doc(alias = "get_offset")] + pub fn offset(&self, plane: u32) -> usize { + unsafe { ffi::gdk_memory_texture_builder_get_offset(self.to_glib_none().0, plane) } + } + #[doc(alias = "gdk_memory_texture_builder_get_stride")] #[doc(alias = "get_stride")] pub fn stride(&self) -> usize { unsafe { ffi::gdk_memory_texture_builder_get_stride(self.to_glib_none().0) } } + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "gdk_memory_texture_builder_get_stride_for_plane")] + #[doc(alias = "get_stride_for_plane")] + pub fn stride_for_plane(&self, plane: u32) -> usize { + unsafe { + ffi::gdk_memory_texture_builder_get_stride_for_plane(self.to_glib_none().0, plane) + } + } + #[doc(alias = "gdk_memory_texture_builder_get_update_region")] #[doc(alias = "get_update_region")] #[doc(alias = "update-region")] @@ -140,6 +158,15 @@ impl MemoryTextureBuilder { } } + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "gdk_memory_texture_builder_set_offset")] + pub fn set_offset(&self, plane: u32, offset: usize) { + unsafe { + ffi::gdk_memory_texture_builder_set_offset(self.to_glib_none().0, plane, offset); + } + } + #[doc(alias = "gdk_memory_texture_builder_set_stride")] #[doc(alias = "stride")] pub fn set_stride(&self, stride: usize) { @@ -148,6 +175,19 @@ impl MemoryTextureBuilder { } } + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "gdk_memory_texture_builder_set_stride_for_plane")] + pub fn set_stride_for_plane(&self, plane: u32, stride: usize) { + unsafe { + ffi::gdk_memory_texture_builder_set_stride_for_plane( + self.to_glib_none().0, + plane, + stride, + ); + } + } + #[doc(alias = "gdk_memory_texture_builder_set_update_region")] #[doc(alias = "update-region")] pub fn set_update_region(&self, region: Option<&cairo::Region>) { diff --git a/gdk4/src/auto/texture_downloader.rs b/gdk4/src/auto/texture_downloader.rs index 37616be4f799..cda1ce86adc3 100644 --- a/gdk4/src/auto/texture_downloader.rs +++ b/gdk4/src/auto/texture_downloader.rs @@ -42,6 +42,13 @@ impl TextureDownloader { } } + //#[cfg(feature = "v4_20")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //#[doc(alias = "gdk_texture_downloader_download_bytes_with_planes")] + //pub fn download_bytes_with_planes(&self, out_offsets: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 18 }; 4, out_strides: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 18 }; 4) -> glib::Bytes { + // unsafe { TODO: call ffi:gdk_texture_downloader_download_bytes_with_planes() } + //} + //#[doc(alias = "gdk_texture_downloader_download_into")] //pub fn download_into(&self, data: &[u8], stride: usize) { // unsafe { TODO: call ffi:gdk_texture_downloader_download_into() } diff --git a/gdk4/src/auto/toplevel.rs b/gdk4/src/auto/toplevel.rs index 035a740b3d2b..9c00318bf36f 100644 --- a/gdk4/src/auto/toplevel.rs +++ b/gdk4/src/auto/toplevel.rs @@ -2,6 +2,9 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::Gravity; #[cfg(feature = "v4_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))] use crate::TitlebarGesture; @@ -74,6 +77,26 @@ pub trait ToplevelExt: IsA + 'static { } } + //#[cfg(feature = "v4_20")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //#[doc(alias = "gdk_toplevel_get_capabilities")] + //#[doc(alias = "get_capabilities")] + //fn capabilities(&self) -> /*Ignored*/ToplevelCapabilities { + // unsafe { TODO: call ffi:gdk_toplevel_get_capabilities() } + //} + + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "gdk_toplevel_get_gravity")] + #[doc(alias = "get_gravity")] + fn gravity(&self) -> Gravity { + unsafe { + from_glib(ffi::gdk_toplevel_get_gravity( + self.as_ref().to_glib_none().0, + )) + } + } + #[doc(alias = "gdk_toplevel_get_state")] #[doc(alias = "get_state")] fn state(&self) -> ToplevelState { @@ -130,6 +153,16 @@ pub trait ToplevelExt: IsA + 'static { } } + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "gdk_toplevel_set_gravity")] + #[doc(alias = "gravity")] + fn set_gravity(&self, gravity: Gravity) { + unsafe { + ffi::gdk_toplevel_set_gravity(self.as_ref().to_glib_none().0, gravity.into_glib()); + } + } + #[doc(alias = "gdk_toplevel_set_icon_list")] #[doc(alias = "icon-list")] fn set_icon_list(&self, surfaces: &[Texture]) { @@ -256,6 +289,34 @@ pub trait ToplevelExt: IsA + 'static { ObjectExt::property(self.as_ref(), "transient-for") } + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "capabilities")] + fn connect_capabilities_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_capabilities_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GdkToplevel, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(Toplevel::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + c"notify::capabilities".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_capabilities_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + #[doc(alias = "decorated")] fn connect_decorated_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_decorated_trampoline, F: Fn(&P) + 'static>( @@ -328,6 +389,31 @@ pub trait ToplevelExt: IsA + 'static { } } + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "gravity")] + fn connect_gravity_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_gravity_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::GdkToplevel, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(Toplevel::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + c"notify::gravity".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_gravity_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + #[doc(alias = "icon-list")] fn connect_icon_list_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_icon_list_trampoline, F: Fn(&P) + 'static>( diff --git a/gdk4/src/auto/versions.txt b/gdk4/src/auto/versions.txt index 01aec28c6ad2..401378930208 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 @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) diff --git a/gdk4/sys/Cargo.toml b/gdk4/sys/Cargo.toml index 6939acb92d35..b8663271be25 100644 --- a/gdk4/sys/Cargo.toml +++ b/gdk4/sys/Cargo.toml @@ -60,6 +60,9 @@ version = "4.16" [package.metadata.system-deps.gtk4.v4_18] version = "4.18" +[package.metadata.system-deps.gtk4.v4_20] +version = "4.20" + [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] @@ -78,6 +81,7 @@ v4_12 = ["v4_10"] v4_14 = ["v4_12"] v4_16 = ["v4_14"] v4_18 = ["v4_16"] +v4_20 = ["v4_18"] [dependencies] libc = "0.2" diff --git a/gdk4/sys/build_version.rs b/gdk4/sys/build_version.rs index 5e1ee35cfc21..901a85a1f35d 100644 --- a/gdk4/sys/build_version.rs +++ b/gdk4/sys/build_version.rs @@ -3,7 +3,9 @@ // DO NOT EDIT pub fn version() -> &'static str { -if cfg!(feature = "v4_18") { +if cfg!(feature = "v4_20") { + "4.20" + } else if cfg!(feature = "v4_18") { "4.18" } else if cfg!(feature = "v4_16") { "4.16" diff --git a/gdk4/sys/src/lib.rs b/gdk4/sys/src/lib.rs index 9af177a0bb2b..6d96e08e6f6c 100644 --- a/gdk4/sys/src/lib.rs +++ b/gdk4/sys/src/lib.rs @@ -238,7 +238,76 @@ pub const GDK_MEMORY_R8G8B8X8: GdkMemoryFormat = 31; #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub const GDK_MEMORY_X8B8G8R8: GdkMemoryFormat = 32; -pub const GDK_MEMORY_N_FORMATS: GdkMemoryFormat = 33; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_B8R8_420: GdkMemoryFormat = 33; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_R8B8_420: GdkMemoryFormat = 34; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_B8R8_422: GdkMemoryFormat = 35; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_R8B8_422: GdkMemoryFormat = 36; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_B8R8_444: GdkMemoryFormat = 37; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_R8B8_444: GdkMemoryFormat = 38; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G10X6_B10X6R10X6_420: GdkMemoryFormat = 39; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G12X4_B12X4R12X4_420: GdkMemoryFormat = 40; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G16_B16R16_420: GdkMemoryFormat = 41; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_B8_R8_410: GdkMemoryFormat = 42; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_R8_B8_410: GdkMemoryFormat = 43; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_B8_R8_411: GdkMemoryFormat = 44; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_R8_B8_411: GdkMemoryFormat = 45; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_B8_R8_420: GdkMemoryFormat = 46; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_R8_B8_420: GdkMemoryFormat = 47; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_B8_R8_422: GdkMemoryFormat = 48; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_R8_B8_422: GdkMemoryFormat = 49; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_B8_R8_444: GdkMemoryFormat = 50; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8_R8_B8_444: GdkMemoryFormat = 51; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8B8G8R8_422: GdkMemoryFormat = 52; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_G8R8G8B8_422: GdkMemoryFormat = 53; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_R8G8B8G8_422: GdkMemoryFormat = 54; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_MEMORY_B8G8R8G8_422: GdkMemoryFormat = 55; +pub const GDK_MEMORY_N_FORMATS: GdkMemoryFormat = 56; pub type GdkNotifyType = c_int; pub const GDK_NOTIFY_ANCESTOR: GdkNotifyType = 0; @@ -2835,6 +2904,32 @@ pub const GDK_SEAT_CAPABILITY_TABLET_PAD: GdkSeatCapabilities = 16; pub const GDK_SEAT_CAPABILITY_ALL_POINTING: GdkSeatCapabilities = 7; pub const GDK_SEAT_CAPABILITY_ALL: GdkSeatCapabilities = 31; +pub type GdkToplevelCapabilities = c_uint; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_TOPLEVEL_CAPABILITIES_EDGE_CONSTRAINTS: GdkToplevelCapabilities = 1; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_TOPLEVEL_CAPABILITIES_INHIBIT_SHORTCUTS: GdkToplevelCapabilities = 2; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_TOPLEVEL_CAPABILITIES_TITLEBAR_GESTURES: GdkToplevelCapabilities = 4; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_TOPLEVEL_CAPABILITIES_WINDOW_MENU: GdkToplevelCapabilities = 8; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_TOPLEVEL_CAPABILITIES_MAXIMIZE: GdkToplevelCapabilities = 16; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_TOPLEVEL_CAPABILITIES_FULLSCREEN: GdkToplevelCapabilities = 32; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_TOPLEVEL_CAPABILITIES_MINIMIZE: GdkToplevelCapabilities = 64; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GDK_TOPLEVEL_CAPABILITIES_LOWER: GdkToplevelCapabilities = 128; + pub type GdkToplevelState = c_uint; pub const GDK_TOPLEVEL_STATE_MINIMIZED: GdkToplevelState = 1; pub const GDK_TOPLEVEL_STATE_MAXIMIZED: GdkToplevelState = 2; @@ -4174,6 +4269,13 @@ extern "C" { //========================================================================= pub fn gdk_seat_capabilities_get_type() -> GType; + //========================================================================= + // GdkToplevelCapabilities + //========================================================================= + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + pub fn gdk_toplevel_capabilities_get_type() -> GType; + //========================================================================= // GdkToplevelState //========================================================================= @@ -4497,6 +4599,13 @@ extern "C" { self_: *const GdkTextureDownloader, out_stride: *mut size_t, ) -> *mut glib::GBytes; + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + pub fn gdk_texture_downloader_download_bytes_with_planes( + self_: *const GdkTextureDownloader, + out_offsets: *mut [size_t; 4], + out_strides: *mut [size_t; 4], + ) -> *mut glib::GBytes; #[cfg(feature = "v4_10")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))] pub fn gdk_texture_downloader_download_into( @@ -5595,9 +5704,21 @@ extern "C" { #[cfg(feature = "v4_16")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] pub fn gdk_memory_texture_builder_get_height(self_: *mut GdkMemoryTextureBuilder) -> c_int; + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + pub fn gdk_memory_texture_builder_get_offset( + self_: *mut GdkMemoryTextureBuilder, + plane: c_uint, + ) -> size_t; #[cfg(feature = "v4_16")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] pub fn gdk_memory_texture_builder_get_stride(self_: *mut GdkMemoryTextureBuilder) -> size_t; + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + pub fn gdk_memory_texture_builder_get_stride_for_plane( + self_: *mut GdkMemoryTextureBuilder, + plane: c_uint, + ) -> size_t; #[cfg(feature = "v4_16")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] pub fn gdk_memory_texture_builder_get_update_region( @@ -5635,12 +5756,26 @@ extern "C" { self_: *mut GdkMemoryTextureBuilder, height: c_int, ); + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + pub fn gdk_memory_texture_builder_set_offset( + self_: *mut GdkMemoryTextureBuilder, + plane: c_uint, + offset: size_t, + ); #[cfg(feature = "v4_16")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] pub fn gdk_memory_texture_builder_set_stride( self_: *mut GdkMemoryTextureBuilder, stride: size_t, ); + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + pub fn gdk_memory_texture_builder_set_stride_for_plane( + self_: *mut GdkMemoryTextureBuilder, + plane: c_uint, + stride: size_t, + ); #[cfg(feature = "v4_16")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] pub fn gdk_memory_texture_builder_set_update_region( @@ -5973,6 +6108,12 @@ extern "C" { timestamp: u32, ); pub fn gdk_toplevel_focus(toplevel: *mut GdkToplevel, timestamp: u32); + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + pub fn gdk_toplevel_get_capabilities(toplevel: *mut GdkToplevel) -> GdkToplevelCapabilities; + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + pub fn gdk_toplevel_get_gravity(toplevel: *mut GdkToplevel) -> GdkGravity; pub fn gdk_toplevel_get_state(toplevel: *mut GdkToplevel) -> GdkToplevelState; pub fn gdk_toplevel_inhibit_system_shortcuts(toplevel: *mut GdkToplevel, event: *mut GdkEvent); pub fn gdk_toplevel_lower(toplevel: *mut GdkToplevel) -> gboolean; @@ -5981,6 +6122,9 @@ extern "C" { pub fn gdk_toplevel_restore_system_shortcuts(toplevel: *mut GdkToplevel); pub fn gdk_toplevel_set_decorated(toplevel: *mut GdkToplevel, decorated: gboolean); pub fn gdk_toplevel_set_deletable(toplevel: *mut GdkToplevel, deletable: gboolean); + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + pub fn gdk_toplevel_set_gravity(toplevel: *mut GdkToplevel, gravity: GdkGravity); pub fn gdk_toplevel_set_icon_list(toplevel: *mut GdkToplevel, surfaces: *mut glib::GList); pub fn gdk_toplevel_set_modal(toplevel: *mut GdkToplevel, modal: gboolean); pub fn gdk_toplevel_set_startup_id(toplevel: *mut GdkToplevel, startup_id: *const c_char); diff --git a/gdk4/sys/tests/abi.rs b/gdk4/sys/tests/abi.rs index b109788b19b9..ea41fbed89ae 100644 --- a/gdk4/sys/tests/abi.rs +++ b/gdk4/sys/tests/abi.rs @@ -460,6 +460,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GdkToplevelCapabilities", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GdkToplevelState", Layout { @@ -3070,14 +3077,36 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) GDK_MEMORY_B8G8R8", "8"), ("(gint) GDK_MEMORY_B8G8R8A8", "3"), ("(gint) GDK_MEMORY_B8G8R8A8_PREMULTIPLIED", "0"), + ("(gint) GDK_MEMORY_B8G8R8G8_422", "55"), ("(gint) GDK_MEMORY_B8G8R8X8", "29"), + ("(gint) GDK_MEMORY_G10X6_B10X6R10X6_420", "39"), + ("(gint) GDK_MEMORY_G12X4_B12X4R12X4_420", "40"), ("(gint) GDK_MEMORY_G16", "23"), ("(gint) GDK_MEMORY_G16A16", "22"), ("(gint) GDK_MEMORY_G16A16_PREMULTIPLIED", "21"), + ("(gint) GDK_MEMORY_G16_B16R16_420", "41"), ("(gint) GDK_MEMORY_G8", "20"), ("(gint) GDK_MEMORY_G8A8", "19"), ("(gint) GDK_MEMORY_G8A8_PREMULTIPLIED", "18"), - ("(gint) GDK_MEMORY_N_FORMATS", "33"), + ("(gint) GDK_MEMORY_G8B8G8R8_422", "52"), + ("(gint) GDK_MEMORY_G8R8G8B8_422", "53"), + ("(gint) GDK_MEMORY_G8_B8R8_420", "33"), + ("(gint) GDK_MEMORY_G8_B8R8_422", "35"), + ("(gint) GDK_MEMORY_G8_B8R8_444", "37"), + ("(gint) GDK_MEMORY_G8_B8_R8_410", "42"), + ("(gint) GDK_MEMORY_G8_B8_R8_411", "44"), + ("(gint) GDK_MEMORY_G8_B8_R8_420", "46"), + ("(gint) GDK_MEMORY_G8_B8_R8_422", "48"), + ("(gint) GDK_MEMORY_G8_B8_R8_444", "50"), + ("(gint) GDK_MEMORY_G8_R8B8_420", "34"), + ("(gint) GDK_MEMORY_G8_R8B8_422", "36"), + ("(gint) GDK_MEMORY_G8_R8B8_444", "38"), + ("(gint) GDK_MEMORY_G8_R8_B8_410", "43"), + ("(gint) GDK_MEMORY_G8_R8_B8_411", "45"), + ("(gint) GDK_MEMORY_G8_R8_B8_420", "47"), + ("(gint) GDK_MEMORY_G8_R8_B8_422", "49"), + ("(gint) GDK_MEMORY_G8_R8_B8_444", "51"), + ("(gint) GDK_MEMORY_N_FORMATS", "56"), ("(gint) GDK_MEMORY_R16G16B16", "9"), ("(gint) GDK_MEMORY_R16G16B16A16", "11"), ("(gint) GDK_MEMORY_R16G16B16A16_FLOAT", "14"), @@ -3090,6 +3119,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) GDK_MEMORY_R8G8B8", "7"), ("(gint) GDK_MEMORY_R8G8B8A8", "5"), ("(gint) GDK_MEMORY_R8G8B8A8_PREMULTIPLIED", "2"), + ("(gint) GDK_MEMORY_R8G8B8G8_422", "54"), ("(gint) GDK_MEMORY_R8G8B8X8", "31"), ("(gint) GDK_MEMORY_X8B8G8R8", "32"), ("(gint) GDK_MEMORY_X8R8G8B8", "30"), @@ -3159,6 +3189,14 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) GDK_TITLEBAR_GESTURE_DOUBLE_CLICK", "1"), ("(gint) GDK_TITLEBAR_GESTURE_MIDDLE_CLICK", "3"), ("(gint) GDK_TITLEBAR_GESTURE_RIGHT_CLICK", "2"), + ("(guint) GDK_TOPLEVEL_CAPABILITIES_EDGE_CONSTRAINTS", "1"), + ("(guint) GDK_TOPLEVEL_CAPABILITIES_FULLSCREEN", "32"), + ("(guint) GDK_TOPLEVEL_CAPABILITIES_INHIBIT_SHORTCUTS", "2"), + ("(guint) GDK_TOPLEVEL_CAPABILITIES_LOWER", "128"), + ("(guint) GDK_TOPLEVEL_CAPABILITIES_MAXIMIZE", "16"), + ("(guint) GDK_TOPLEVEL_CAPABILITIES_MINIMIZE", "64"), + ("(guint) GDK_TOPLEVEL_CAPABILITIES_TITLEBAR_GESTURES", "4"), + ("(guint) GDK_TOPLEVEL_CAPABILITIES_WINDOW_MENU", "8"), ("(guint) GDK_TOPLEVEL_STATE_ABOVE", "16"), ("(guint) GDK_TOPLEVEL_STATE_BELOW", "32"), ("(guint) GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE", "8192"), diff --git a/gdk4/sys/tests/constant.c b/gdk4/sys/tests/constant.c index 135686774448..5a8ede18b953 100644 --- a/gdk4/sys/tests/constant.c +++ b/gdk4/sys/tests/constant.c @@ -2614,13 +2614,35 @@ int main() { PRINT_CONSTANT((gint) GDK_MEMORY_B8G8R8); PRINT_CONSTANT((gint) GDK_MEMORY_B8G8R8A8); PRINT_CONSTANT((gint) GDK_MEMORY_B8G8R8A8_PREMULTIPLIED); + PRINT_CONSTANT((gint) GDK_MEMORY_B8G8R8G8_422); PRINT_CONSTANT((gint) GDK_MEMORY_B8G8R8X8); + PRINT_CONSTANT((gint) GDK_MEMORY_G10X6_B10X6R10X6_420); + PRINT_CONSTANT((gint) GDK_MEMORY_G12X4_B12X4R12X4_420); PRINT_CONSTANT((gint) GDK_MEMORY_G16); PRINT_CONSTANT((gint) GDK_MEMORY_G16A16); PRINT_CONSTANT((gint) GDK_MEMORY_G16A16_PREMULTIPLIED); + PRINT_CONSTANT((gint) GDK_MEMORY_G16_B16R16_420); PRINT_CONSTANT((gint) GDK_MEMORY_G8); PRINT_CONSTANT((gint) GDK_MEMORY_G8A8); PRINT_CONSTANT((gint) GDK_MEMORY_G8A8_PREMULTIPLIED); + PRINT_CONSTANT((gint) GDK_MEMORY_G8B8G8R8_422); + PRINT_CONSTANT((gint) GDK_MEMORY_G8R8G8B8_422); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_B8R8_420); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_B8R8_422); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_B8R8_444); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_B8_R8_410); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_B8_R8_411); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_B8_R8_420); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_B8_R8_422); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_B8_R8_444); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_R8B8_420); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_R8B8_422); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_R8B8_444); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_R8_B8_410); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_R8_B8_411); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_R8_B8_420); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_R8_B8_422); + PRINT_CONSTANT((gint) GDK_MEMORY_G8_R8_B8_444); PRINT_CONSTANT((gint) GDK_MEMORY_N_FORMATS); PRINT_CONSTANT((gint) GDK_MEMORY_R16G16B16); PRINT_CONSTANT((gint) GDK_MEMORY_R16G16B16A16); @@ -2634,6 +2656,7 @@ int main() { PRINT_CONSTANT((gint) GDK_MEMORY_R8G8B8); PRINT_CONSTANT((gint) GDK_MEMORY_R8G8B8A8); PRINT_CONSTANT((gint) GDK_MEMORY_R8G8B8A8_PREMULTIPLIED); + PRINT_CONSTANT((gint) GDK_MEMORY_R8G8B8G8_422); PRINT_CONSTANT((gint) GDK_MEMORY_R8G8B8X8); PRINT_CONSTANT((gint) GDK_MEMORY_X8B8G8R8); PRINT_CONSTANT((gint) GDK_MEMORY_X8R8G8B8); @@ -2703,6 +2726,14 @@ int main() { PRINT_CONSTANT((gint) GDK_TITLEBAR_GESTURE_DOUBLE_CLICK); PRINT_CONSTANT((gint) GDK_TITLEBAR_GESTURE_MIDDLE_CLICK); PRINT_CONSTANT((gint) GDK_TITLEBAR_GESTURE_RIGHT_CLICK); + PRINT_CONSTANT((guint) GDK_TOPLEVEL_CAPABILITIES_EDGE_CONSTRAINTS); + PRINT_CONSTANT((guint) GDK_TOPLEVEL_CAPABILITIES_FULLSCREEN); + PRINT_CONSTANT((guint) GDK_TOPLEVEL_CAPABILITIES_INHIBIT_SHORTCUTS); + PRINT_CONSTANT((guint) GDK_TOPLEVEL_CAPABILITIES_LOWER); + PRINT_CONSTANT((guint) GDK_TOPLEVEL_CAPABILITIES_MAXIMIZE); + PRINT_CONSTANT((guint) GDK_TOPLEVEL_CAPABILITIES_MINIMIZE); + PRINT_CONSTANT((guint) GDK_TOPLEVEL_CAPABILITIES_TITLEBAR_GESTURES); + PRINT_CONSTANT((guint) GDK_TOPLEVEL_CAPABILITIES_WINDOW_MENU); PRINT_CONSTANT((guint) GDK_TOPLEVEL_STATE_ABOVE); PRINT_CONSTANT((guint) GDK_TOPLEVEL_STATE_BELOW); PRINT_CONSTANT((guint) GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE); diff --git a/gdk4/sys/tests/layout.c b/gdk4/sys/tests/layout.c index e9ee3fb85549..f37f2bd73c51 100644 --- a/gdk4/sys/tests/layout.c +++ b/gdk4/sys/tests/layout.c @@ -44,6 +44,7 @@ int main() { printf("%s;%zu;%zu\n", "GdkTextureError", sizeof(GdkTextureError), alignof(GdkTextureError)); printf("%s;%zu;%zu\n", "GdkTimeCoord", sizeof(GdkTimeCoord), alignof(GdkTimeCoord)); printf("%s;%zu;%zu\n", "GdkTitlebarGesture", sizeof(GdkTitlebarGesture), alignof(GdkTitlebarGesture)); + printf("%s;%zu;%zu\n", "GdkToplevelCapabilities", sizeof(GdkToplevelCapabilities), alignof(GdkToplevelCapabilities)); printf("%s;%zu;%zu\n", "GdkToplevelState", sizeof(GdkToplevelState), alignof(GdkToplevelState)); printf("%s;%zu;%zu\n", "GdkTouchpadGesturePhase", sizeof(GdkTouchpadGesturePhase), alignof(GdkTouchpadGesturePhase)); printf("%s;%zu;%zu\n", "GdkVulkanError", sizeof(GdkVulkanError), alignof(GdkVulkanError)); diff --git a/gdk4/sys/versions.txt b/gdk4/sys/versions.txt index 01aec28c6ad2..401378930208 100644 --- a/gdk4/sys/versions.txt +++ b/gdk4/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) diff --git a/gsk4/src/auto/versions.txt b/gsk4/src/auto/versions.txt index 01aec28c6ad2..401378930208 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 @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) diff --git a/gsk4/sys/versions.txt b/gsk4/sys/versions.txt index 01aec28c6ad2..401378930208 100644 --- a/gsk4/sys/versions.txt +++ b/gsk4/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) diff --git a/gtk4/src/auto/about_dialog.rs b/gtk4/src/auto/about_dialog.rs index dcc1cf12f8c6..917b9216983d 100644 --- a/gtk4/src/auto/about_dialog.rs +++ b/gtk4/src/auto/about_dialog.rs @@ -949,6 +949,11 @@ impl AboutDialogBuilder { } } + // #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { + // Self { builder: self.builder.property("gravity", gravity), } + //} #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/application_window.rs b/gtk4/src/auto/application_window.rs index 381f0860192c..a76e0849f9dc 100644 --- a/gtk4/src/auto/application_window.rs +++ b/gtk4/src/auto/application_window.rs @@ -154,6 +154,11 @@ impl ApplicationWindowBuilder { } } + // #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { + // Self { builder: self.builder.property("gravity", gravity), } + //} #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/assistant.rs b/gtk4/src/auto/assistant.rs index ef6ead0173cb..b86527e2ae3b 100644 --- a/gtk4/src/auto/assistant.rs +++ b/gtk4/src/auto/assistant.rs @@ -567,6 +567,11 @@ impl AssistantBuilder { } } + // #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { + // Self { builder: self.builder.property("gravity", gravity), } + //} #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/calendar.rs b/gtk4/src/auto/calendar.rs index 54bbed17ef07..116792bafee8 100644 --- a/gtk4/src/auto/calendar.rs +++ b/gtk4/src/auto/calendar.rs @@ -1,6 +1,7 @@ // This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT +#![allow(deprecated)] use crate::{ ffi, Accessible, AccessibleRole, Align, Buildable, ConstraintTarget, LayoutManager, Overflow, @@ -118,6 +119,8 @@ impl Calendar { } } + #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")] + #[allow(deprecated)] #[doc(alias = "gtk_calendar_select_day")] pub fn select_day(&self, date: &glib::DateTime) { unsafe { @@ -125,6 +128,16 @@ impl Calendar { } } + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "gtk_calendar_set_date")] + #[doc(alias = "date")] + pub fn set_date(&self, date: &glib::DateTime) { + unsafe { + ffi::gtk_calendar_set_date(self.to_glib_none().0, date.to_glib_none().0); + } + } + #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] #[doc(alias = "gtk_calendar_set_day")] @@ -186,6 +199,12 @@ impl Calendar { } } + #[cfg(not(feature = "v4_20"))] + #[cfg_attr(docsrs, doc(cfg(not(feature = "v4_20"))))] + pub fn set_date(&self, date: Option<&glib::DateTime>) { + ObjectExt::set_property(self, "date", date) + } + #[doc(alias = "day-selected")] pub fn connect_day_selected(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn day_selected_trampoline( @@ -296,6 +315,30 @@ impl Calendar { } } + #[doc(alias = "date")] + pub fn connect_date_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_date_trampoline( + this: *mut ffi::GtkCalendar, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(&from_glib_borrow(this)) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + c"notify::date".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_date_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")] #[doc(alias = "day")] pub fn connect_day_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_day_trampoline( @@ -319,6 +362,7 @@ impl Calendar { } } + #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")] #[doc(alias = "month")] pub fn connect_month_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_month_trampoline( @@ -414,6 +458,7 @@ impl Calendar { } } + #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")] #[doc(alias = "year")] pub fn connect_year_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_year_trampoline( @@ -460,12 +505,20 @@ impl CalendarBuilder { } } + pub fn date(self, date: &glib::DateTime) -> Self { + Self { + builder: self.builder.property("date", date.clone()), + } + } + + #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")] pub fn day(self, day: i32) -> Self { Self { builder: self.builder.property("day", day), } } + #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")] pub fn month(self, month: i32) -> Self { Self { builder: self.builder.property("month", month), @@ -492,6 +545,7 @@ impl CalendarBuilder { } } + #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")] pub fn year(self, year: i32) -> Self { Self { builder: self.builder.property("year", year), diff --git a/gtk4/src/auto/color_chooser_dialog.rs b/gtk4/src/auto/color_chooser_dialog.rs index 8c0d227f8836..e04671c331d9 100644 --- a/gtk4/src/auto/color_chooser_dialog.rs +++ b/gtk4/src/auto/color_chooser_dialog.rs @@ -195,6 +195,11 @@ impl ColorChooserDialogBuilder { } } + // #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { + // Self { builder: self.builder.property("gravity", gravity), } + //} #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/dialog.rs b/gtk4/src/auto/dialog.rs index a4c60078b4bf..83a8d8767ce8 100644 --- a/gtk4/src/auto/dialog.rs +++ b/gtk4/src/auto/dialog.rs @@ -154,6 +154,11 @@ impl DialogBuilder { } } + // #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { + // Self { builder: self.builder.property("gravity", gravity), } + //} #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/file_chooser_dialog.rs b/gtk4/src/auto/file_chooser_dialog.rs index 5b46241b02ae..823b1f802167 100644 --- a/gtk4/src/auto/file_chooser_dialog.rs +++ b/gtk4/src/auto/file_chooser_dialog.rs @@ -132,6 +132,11 @@ impl FileChooserDialogBuilder { } } + // #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { + // Self { builder: self.builder.property("gravity", gravity), } + //} #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/flags.rs b/gtk4/src/auto/flags.rs index de8578da7a5b..b1a0e46f1aca 100644 --- a/gtk4/src/auto/flags.rs +++ b/gtk4/src/auto/flags.rs @@ -310,6 +310,10 @@ bitflags! { const NO_CSS_CACHE = ffi::GTK_DEBUG_NO_CSS_CACHE as _; #[doc(alias = "GTK_DEBUG_INTERACTIVE")] const INTERACTIVE = ffi::GTK_DEBUG_INTERACTIVE as _; + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GTK_DEBUG_TOUCHSCREEN")] + const TOUCHSCREEN = ffi::GTK_DEBUG_TOUCHSCREEN as _; #[doc(alias = "GTK_DEBUG_ACTIONS")] const ACTIONS = ffi::GTK_DEBUG_ACTIONS as _; #[doc(alias = "GTK_DEBUG_LAYOUT")] @@ -334,6 +338,8 @@ bitflags! { #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] #[doc(alias = "GTK_DEBUG_CSS")] const CSS = ffi::GTK_DEBUG_CSS as _; + #[cfg(feature = "v4_18")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))] #[doc(alias = "GTK_DEBUG_BUILDER")] const BUILDER = ffi::GTK_DEBUG_BUILDER as _; } diff --git a/gtk4/src/auto/font_chooser_dialog.rs b/gtk4/src/auto/font_chooser_dialog.rs index 501ad6ac080f..146558f027ad 100644 --- a/gtk4/src/auto/font_chooser_dialog.rs +++ b/gtk4/src/auto/font_chooser_dialog.rs @@ -152,6 +152,11 @@ impl FontChooserDialogBuilder { } } + // #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { + // Self { builder: self.builder.property("gravity", gravity), } + //} #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/message_dialog.rs b/gtk4/src/auto/message_dialog.rs index 6b67933bb1e7..797b7e467531 100644 --- a/gtk4/src/auto/message_dialog.rs +++ b/gtk4/src/auto/message_dialog.rs @@ -389,6 +389,11 @@ impl MessageDialogBuilder { } } + // #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { + // Self { builder: self.builder.property("gravity", gravity), } + //} #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/page_setup_unix_dialog.rs b/gtk4/src/auto/page_setup_unix_dialog.rs index 733236dabd58..de381243d3f2 100644 --- a/gtk4/src/auto/page_setup_unix_dialog.rs +++ b/gtk4/src/auto/page_setup_unix_dialog.rs @@ -189,6 +189,11 @@ impl PageSetupUnixDialogBuilder { } } + // #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { + // Self { builder: self.builder.property("gravity", gravity), } + //} #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/print_unix_dialog.rs b/gtk4/src/auto/print_unix_dialog.rs index dbf2ed59a851..c36f52d73dbc 100644 --- a/gtk4/src/auto/print_unix_dialog.rs +++ b/gtk4/src/auto/print_unix_dialog.rs @@ -579,6 +579,11 @@ impl PrintUnixDialogBuilder { } } + // #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { + // Self { builder: self.builder.property("gravity", gravity), } + //} #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/shortcuts_window.rs b/gtk4/src/auto/shortcuts_window.rs index 4128ee4a8a86..3d2d8b959b81 100644 --- a/gtk4/src/auto/shortcuts_window.rs +++ b/gtk4/src/auto/shortcuts_window.rs @@ -286,6 +286,11 @@ impl ShortcutsWindowBuilder { } } + // #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { + // Self { builder: self.builder.property("gravity", gravity), } + //} #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/versions.txt b/gtk4/src/auto/versions.txt index 01aec28c6ad2..401378930208 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 @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) diff --git a/gtk4/src/auto/window.rs b/gtk4/src/auto/window.rs index 9b0479c49862..4c0e26e0a18a 100644 --- a/gtk4/src/auto/window.rs +++ b/gtk4/src/auto/window.rs @@ -188,6 +188,11 @@ impl WindowBuilder { } } + // #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { + // Self { builder: self.builder.property("gravity", gravity), } + //} #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { @@ -590,6 +595,14 @@ pub trait GtkWindowExt: IsA + 'static { } } + //#[cfg(feature = "v4_20")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //#[doc(alias = "gtk_window_get_gravity")] + //#[doc(alias = "get_gravity")] + //fn gravity(&self) -> /*Ignored*/WindowGravity { + // unsafe { TODO: call ffi:gtk_window_get_gravity() } + //} + #[doc(alias = "gtk_window_get_group")] #[doc(alias = "get_group")] fn group(&self) -> WindowGroup { @@ -846,6 +859,14 @@ pub trait GtkWindowExt: IsA + 'static { } } + //#[cfg(feature = "v4_20")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + //#[doc(alias = "gtk_window_set_gravity")] + //#[doc(alias = "gravity")] + //fn set_gravity(&self, gravity: /*Ignored*/WindowGravity) { + // unsafe { TODO: call ffi:gtk_window_set_gravity() } + //} + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] #[doc(alias = "gtk_window_set_handle_menubar_accel")] @@ -1423,6 +1444,31 @@ pub trait GtkWindowExt: IsA + 'static { } } + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "gravity")] + fn connect_gravity_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_gravity_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::GtkWindow, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(Window::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + c"notify::gravity".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_gravity_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] #[doc(alias = "handle-menubar-accel")] diff --git a/gtk4/sys/src/lib.rs b/gtk4/sys/src/lib.rs index ccd72014ba32..7ed68ac19f6e 100644 --- a/gtk4/sys/src/lib.rs +++ b/gtk4/sys/src/lib.rs @@ -920,6 +920,23 @@ pub const GTK_UNIT_POINTS: GtkUnit = 1; pub const GTK_UNIT_INCH: GtkUnit = 2; pub const GTK_UNIT_MM: GtkUnit = 3; +pub type GtkWindowGravity = c_int; +pub const GTK_WINDOW_GRAVITY_TOP_LEFT: GtkWindowGravity = 0; +pub const GTK_WINDOW_GRAVITY_TOP: GtkWindowGravity = 1; +pub const GTK_WINDOW_GRAVITY_TOP_RIGHT: GtkWindowGravity = 2; +pub const GTK_WINDOW_GRAVITY_LEFT: GtkWindowGravity = 3; +pub const GTK_WINDOW_GRAVITY_CENTER: GtkWindowGravity = 4; +pub const GTK_WINDOW_GRAVITY_RIGHT: GtkWindowGravity = 5; +pub const GTK_WINDOW_GRAVITY_BOTTOM_LEFT: GtkWindowGravity = 6; +pub const GTK_WINDOW_GRAVITY_BOTTOM: GtkWindowGravity = 7; +pub const GTK_WINDOW_GRAVITY_BOTTOM_RIGHT: GtkWindowGravity = 8; +pub const GTK_WINDOW_GRAVITY_TOP_START: GtkWindowGravity = 9; +pub const GTK_WINDOW_GRAVITY_TOP_END: GtkWindowGravity = 10; +pub const GTK_WINDOW_GRAVITY_START: GtkWindowGravity = 11; +pub const GTK_WINDOW_GRAVITY_END: GtkWindowGravity = 12; +pub const GTK_WINDOW_GRAVITY_BOTTOM_START: GtkWindowGravity = 13; +pub const GTK_WINDOW_GRAVITY_BOTTOM_END: GtkWindowGravity = 14; + pub type GtkWrapMode = c_int; pub const GTK_WRAP_NONE: GtkWrapMode = 0; pub const GTK_WRAP_CHAR: GtkWrapMode = 1; @@ -1051,6 +1068,9 @@ pub const GTK_DEBUG_BUILDER_TRACE: GtkDebugFlags = 128; pub const GTK_DEBUG_SIZE_REQUEST: GtkDebugFlags = 256; pub const GTK_DEBUG_NO_CSS_CACHE: GtkDebugFlags = 512; pub const GTK_DEBUG_INTERACTIVE: GtkDebugFlags = 1024; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub const GTK_DEBUG_TOUCHSCREEN: GtkDebugFlags = 2048; pub const GTK_DEBUG_ACTIONS: GtkDebugFlags = 4096; pub const GTK_DEBUG_LAYOUT: GtkDebugFlags = 8192; pub const GTK_DEBUG_SNAPSHOT: GtkDebugFlags = 16384; @@ -1066,6 +1086,8 @@ pub const GTK_DEBUG_INVERT_TEXT_DIR: GtkDebugFlags = 524288; #[cfg(feature = "v4_16")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))] 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 type GtkDialogFlags = c_uint; @@ -10422,6 +10444,13 @@ extern "C" { //========================================================================= pub fn gtk_unit_get_type() -> GType; + //========================================================================= + // GtkWindowGravity + //========================================================================= + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + pub fn gtk_window_gravity_get_type() -> GType; + //========================================================================= // GtkWrapMode //========================================================================= @@ -11999,6 +12028,9 @@ extern "C" { pub fn gtk_calendar_get_year(self_: *mut GtkCalendar) -> c_int; pub fn gtk_calendar_mark_day(calendar: *mut GtkCalendar, day: c_uint); pub fn gtk_calendar_select_day(self_: *mut GtkCalendar, date: *mut glib::GDateTime); + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + pub fn gtk_calendar_set_date(self_: *mut GtkCalendar, date: *mut glib::GDateTime); #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] pub fn gtk_calendar_set_day(self_: *mut GtkCalendar, day: c_int); @@ -20444,6 +20476,9 @@ extern "C" { pub fn gtk_window_get_destroy_with_parent(window: *mut GtkWindow) -> gboolean; pub fn gtk_window_get_focus(window: *mut GtkWindow) -> *mut GtkWidget; pub fn gtk_window_get_focus_visible(window: *mut GtkWindow) -> gboolean; + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + pub fn gtk_window_get_gravity(window: *mut GtkWindow) -> GtkWindowGravity; pub fn gtk_window_get_group(window: *mut GtkWindow) -> *mut GtkWindowGroup; #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] @@ -20477,6 +20512,9 @@ extern "C" { pub fn gtk_window_set_display(window: *mut GtkWindow, display: *mut gdk::GdkDisplay); pub fn gtk_window_set_focus(window: *mut GtkWindow, focus: *mut GtkWidget); pub fn gtk_window_set_focus_visible(window: *mut GtkWindow, setting: gboolean); + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + pub fn gtk_window_set_gravity(window: *mut GtkWindow, gravity: GtkWindowGravity); #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn gtk_window_set_handle_menubar_accel( diff --git a/gtk4/sys/tests/abi.rs b/gtk4/sys/tests/abi.rs index 200e4a4ea981..ecf9dd70480c 100644 --- a/gtk4/sys/tests/abi.rs +++ b/gtk4/sys/tests/abi.rs @@ -2532,6 +2532,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GtkWindowGravity", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GtkWindowGroup", Layout { @@ -2934,6 +2941,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(guint) GTK_DEBUG_SIZE_REQUEST", "256"), ("(guint) GTK_DEBUG_SNAPSHOT", "16384"), ("(guint) GTK_DEBUG_TEXT", "1"), + ("(guint) GTK_DEBUG_TOUCHSCREEN", "2048"), ("(guint) GTK_DEBUG_TREE", "2"), ("(gint) GTK_DELETE_CHARS", "0"), ("(gint) GTK_DELETE_DISPLAY_LINES", "3"), @@ -3470,6 +3478,21 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) GTK_UNIT_POINTS", "1"), ("(gint) GTK_UPDATE_ALWAYS", "0"), ("(gint) GTK_UPDATE_IF_VALID", "1"), + ("(gint) GTK_WINDOW_GRAVITY_BOTTOM", "7"), + ("(gint) GTK_WINDOW_GRAVITY_BOTTOM_END", "14"), + ("(gint) GTK_WINDOW_GRAVITY_BOTTOM_LEFT", "6"), + ("(gint) GTK_WINDOW_GRAVITY_BOTTOM_RIGHT", "8"), + ("(gint) GTK_WINDOW_GRAVITY_BOTTOM_START", "13"), + ("(gint) GTK_WINDOW_GRAVITY_CENTER", "4"), + ("(gint) GTK_WINDOW_GRAVITY_END", "12"), + ("(gint) GTK_WINDOW_GRAVITY_LEFT", "3"), + ("(gint) GTK_WINDOW_GRAVITY_RIGHT", "5"), + ("(gint) GTK_WINDOW_GRAVITY_START", "11"), + ("(gint) GTK_WINDOW_GRAVITY_TOP", "1"), + ("(gint) GTK_WINDOW_GRAVITY_TOP_END", "10"), + ("(gint) GTK_WINDOW_GRAVITY_TOP_LEFT", "0"), + ("(gint) GTK_WINDOW_GRAVITY_TOP_RIGHT", "2"), + ("(gint) GTK_WINDOW_GRAVITY_TOP_START", "9"), ("(gint) GTK_WRAP_CHAR", "1"), ("(gint) GTK_WRAP_NONE", "0"), ("(gint) GTK_WRAP_WORD", "2"), diff --git a/gtk4/sys/tests/constant.c b/gtk4/sys/tests/constant.c index 30bd9d230fb7..e00aa98fd402 100644 --- a/gtk4/sys/tests/constant.c +++ b/gtk4/sys/tests/constant.c @@ -363,6 +363,7 @@ int main() { PRINT_CONSTANT((guint) GTK_DEBUG_SIZE_REQUEST); PRINT_CONSTANT((guint) GTK_DEBUG_SNAPSHOT); PRINT_CONSTANT((guint) GTK_DEBUG_TEXT); + PRINT_CONSTANT((guint) GTK_DEBUG_TOUCHSCREEN); PRINT_CONSTANT((guint) GTK_DEBUG_TREE); PRINT_CONSTANT((gint) GTK_DELETE_CHARS); PRINT_CONSTANT((gint) GTK_DELETE_DISPLAY_LINES); @@ -866,6 +867,21 @@ int main() { PRINT_CONSTANT((gint) GTK_UNIT_POINTS); PRINT_CONSTANT((gint) GTK_UPDATE_ALWAYS); PRINT_CONSTANT((gint) GTK_UPDATE_IF_VALID); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_BOTTOM); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_BOTTOM_END); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_BOTTOM_LEFT); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_BOTTOM_RIGHT); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_BOTTOM_START); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_CENTER); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_END); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_LEFT); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_RIGHT); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_START); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_TOP); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_TOP_END); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_TOP_LEFT); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_TOP_RIGHT); + PRINT_CONSTANT((gint) GTK_WINDOW_GRAVITY_TOP_START); PRINT_CONSTANT((gint) GTK_WRAP_CHAR); PRINT_CONSTANT((gint) GTK_WRAP_NONE); PRINT_CONSTANT((gint) GTK_WRAP_WORD); diff --git a/gtk4/sys/tests/layout.c b/gtk4/sys/tests/layout.c index d8e82c350206..edf0c3ad669d 100644 --- a/gtk4/sys/tests/layout.c +++ b/gtk4/sys/tests/layout.c @@ -340,6 +340,7 @@ int main() { printf("%s;%zu;%zu\n", "GtkWindow", sizeof(GtkWindow), alignof(GtkWindow)); printf("%s;%zu;%zu\n", "GtkWindowClass", sizeof(GtkWindowClass), alignof(GtkWindowClass)); printf("%s;%zu;%zu\n", "GtkWindowControlsClass", sizeof(GtkWindowControlsClass), alignof(GtkWindowControlsClass)); + printf("%s;%zu;%zu\n", "GtkWindowGravity", sizeof(GtkWindowGravity), alignof(GtkWindowGravity)); printf("%s;%zu;%zu\n", "GtkWindowGroup", sizeof(GtkWindowGroup), alignof(GtkWindowGroup)); printf("%s;%zu;%zu\n", "GtkWindowGroupClass", sizeof(GtkWindowGroupClass), alignof(GtkWindowGroupClass)); printf("%s;%zu;%zu\n", "GtkWindowHandleClass", sizeof(GtkWindowHandleClass), alignof(GtkWindowHandleClass)); diff --git a/gtk4/sys/versions.txt b/gtk4/sys/versions.txt index 01aec28c6ad2..401378930208 100644 --- a/gtk4/sys/versions.txt +++ b/gtk4/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 13192296259b) -from gir-files (https://github.com/gtk-rs/gir-files @ 56728a5eb215) +from gir-files (https://github.com/gtk-rs/gir-files @ 6668d0f5551a) From 33885fa771abf80ba991e11993302a65cc5eb33f Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sat, 26 Apr 2025 10:43:34 +0200 Subject: [PATCH 5/7] Generate new 4.20 types --- gdk4/Gir.toml | 5 +- gdk4/src/auto/flags.rs | 132 +++++++++++++++++++ gdk4/src/auto/mod.rs | 3 + gdk4/src/auto/toplevel.rs | 24 ++-- gtk4/Gir.toml | 13 +- gtk4/src/auto/about_dialog.rs | 14 +- gtk4/src/auto/application_window.rs | 14 +- gtk4/src/auto/assistant.rs | 14 +- gtk4/src/auto/color_chooser_dialog.rs | 14 +- gtk4/src/auto/dialog.rs | 14 +- gtk4/src/auto/enums.rs | 164 ++++++++++++++++++++++++ gtk4/src/auto/file_chooser_dialog.rs | 14 +- gtk4/src/auto/font_chooser_dialog.rs | 14 +- gtk4/src/auto/message_dialog.rs | 14 +- gtk4/src/auto/mod.rs | 3 + gtk4/src/auto/page_setup_unix_dialog.rs | 14 +- gtk4/src/auto/print_unix_dialog.rs | 14 +- gtk4/src/auto/shortcuts_window.rs | 14 +- gtk4/src/auto/window.rs | 44 ++++--- 19 files changed, 462 insertions(+), 80 deletions(-) diff --git a/gdk4/Gir.toml b/gdk4/Gir.toml index cbaec4d770f6..d6fbf953c62f 100644 --- a/gdk4/Gir.toml +++ b/gdk4/Gir.toml @@ -62,6 +62,7 @@ generate = [ "Gdk.TextureDownloader", "Gdk.TextureError", "Gdk.TitlebarGesture", + "Gdk.ToplevelCapabilities", "Gdk.ToplevelLayout", "Gdk.TouchEvent", "Gdk.TouchpadEvent", @@ -144,11 +145,11 @@ status = "generate" [[object.function]] name = "pango_layout_get_clip_region" manual = true - doc_ignore_parameters = ["n_ranges"] + doc_ignore_parameters = ["n_ranges"] [[object.function]] name = "pango_layout_line_get_clip_region" manual = true - doc_ignore_parameters = ["n_ranges"] + doc_ignore_parameters = ["n_ranges"] [[object.function]] name = "content_register_deserializer" manual = true diff --git a/gdk4/src/auto/flags.rs b/gdk4/src/auto/flags.rs index fdc72d3810dc..1b6e683cef63 100644 --- a/gdk4/src/auto/flags.rs +++ b/gdk4/src/auto/flags.rs @@ -803,6 +803,138 @@ impl From for glib::Value { } } +#[cfg(feature = "v4_20")] +bitflags! { + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] + #[doc(alias = "GdkToplevelCapabilities")] + pub struct ToplevelCapabilities: u32 { + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_EDGE_CONSTRAINTS")] + const EDGE_CONSTRAINTS = ffi::GDK_TOPLEVEL_CAPABILITIES_EDGE_CONSTRAINTS as _; + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_INHIBIT_SHORTCUTS")] + const INHIBIT_SHORTCUTS = ffi::GDK_TOPLEVEL_CAPABILITIES_INHIBIT_SHORTCUTS as _; + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_TITLEBAR_GESTURES")] + const TITLEBAR_GESTURES = ffi::GDK_TOPLEVEL_CAPABILITIES_TITLEBAR_GESTURES as _; + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_WINDOW_MENU")] + const WINDOW_MENU = ffi::GDK_TOPLEVEL_CAPABILITIES_WINDOW_MENU as _; + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_MAXIMIZE")] + const MAXIMIZE = ffi::GDK_TOPLEVEL_CAPABILITIES_MAXIMIZE as _; + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_FULLSCREEN")] + const FULLSCREEN = ffi::GDK_TOPLEVEL_CAPABILITIES_FULLSCREEN as _; + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_MINIMIZE")] + const MINIMIZE = ffi::GDK_TOPLEVEL_CAPABILITIES_MINIMIZE as _; + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_LOWER")] + const LOWER = ffi::GDK_TOPLEVEL_CAPABILITIES_LOWER as _; + } +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +#[doc(hidden)] +impl IntoGlib for ToplevelCapabilities { + type GlibType = ffi::GdkToplevelCapabilities; + + #[inline] + fn into_glib(self) -> ffi::GdkToplevelCapabilities { + self.bits() + } +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +#[doc(hidden)] +impl FromGlib for ToplevelCapabilities { + #[inline] + unsafe fn from_glib(value: ffi::GdkToplevelCapabilities) -> Self { + skip_assert_initialized!(); + Self::from_bits_truncate(value) + } +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +impl StaticType for ToplevelCapabilities { + #[inline] + #[doc(alias = "gdk_toplevel_capabilities_get_type")] + fn static_type() -> glib::Type { + unsafe { from_glib(ffi::gdk_toplevel_capabilities_get_type()) } + } +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +impl glib::HasParamSpec for ToplevelCapabilities { + type ParamSpec = glib::ParamSpecFlags; + type SetValue = Self; + type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + Self::ParamSpec::builder + } +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +impl glib::value::ValueType for ToplevelCapabilities { + type Type = Self; +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +unsafe impl<'a> glib::value::FromValue<'a> for ToplevelCapabilities { + type Checker = glib::value::GenericValueTypeChecker; + + #[inline] + unsafe fn from_value(value: &'a glib::Value) -> Self { + skip_assert_initialized!(); + from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) + } +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +impl ToValue for ToplevelCapabilities { + #[inline] + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + #[inline] + fn value_type(&self) -> glib::Type { + Self::static_type() + } +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +impl From for glib::Value { + #[inline] + fn from(v: ToplevelCapabilities) -> Self { + skip_assert_initialized!(); + ToValue::to_value(&v) + } +} + bitflags! { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "GdkToplevelState")] diff --git a/gdk4/src/auto/mod.rs b/gdk4/src/auto/mod.rs index 929a9cd512c0..44e0fbdeb4b4 100644 --- a/gdk4/src/auto/mod.rs +++ b/gdk4/src/auto/mod.rs @@ -263,6 +263,9 @@ pub use self::flags::FrameClockPhase; pub use self::flags::ModifierType; pub use self::flags::PaintableFlags; pub use self::flags::SeatCapabilities; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub use self::flags::ToplevelCapabilities; pub use self::flags::ToplevelState; #[cfg(feature = "v4_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))] diff --git a/gdk4/src/auto/toplevel.rs b/gdk4/src/auto/toplevel.rs index 9c00318bf36f..fc72d0616302 100644 --- a/gdk4/src/auto/toplevel.rs +++ b/gdk4/src/auto/toplevel.rs @@ -2,9 +2,6 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -#[cfg(feature = "v4_20")] -#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] -use crate::Gravity; #[cfg(feature = "v4_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))] use crate::TitlebarGesture; @@ -12,6 +9,9 @@ use crate::{ ffi, Device, Event, FullscreenMode, Surface, SurfaceEdge, Texture, ToplevelLayout, ToplevelState, }; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::{Gravity, ToplevelCapabilities}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, @@ -77,13 +77,17 @@ pub trait ToplevelExt: IsA + 'static { } } - //#[cfg(feature = "v4_20")] - //#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //#[doc(alias = "gdk_toplevel_get_capabilities")] - //#[doc(alias = "get_capabilities")] - //fn capabilities(&self) -> /*Ignored*/ToplevelCapabilities { - // unsafe { TODO: call ffi:gdk_toplevel_get_capabilities() } - //} + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "gdk_toplevel_get_capabilities")] + #[doc(alias = "get_capabilities")] + fn capabilities(&self) -> ToplevelCapabilities { + unsafe { + from_glib(ffi::gdk_toplevel_get_capabilities( + self.as_ref().to_glib_none().0, + )) + } + } #[cfg(feature = "v4_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] diff --git a/gtk4/Gir.toml b/gtk4/Gir.toml index f84ce348d804..5deec8e0757e 100644 --- a/gtk4/Gir.toml +++ b/gtk4/Gir.toml @@ -144,7 +144,7 @@ generate = [ "Gtk.IconViewDropPosition", "Gtk.ImageType", "Gtk.IMContext", - "Gtk.IMMulticontext", + "Gtk.IMMulticontext", "Gtk.InputHints", "Gtk.InputPurpose", "Gtk.Inscription", @@ -276,6 +276,7 @@ generate = [ "Gtk.Viewport", "Gtk.VolumeButton", "Gtk.WindowControls", + "Gtk.WindowGravity", "Gtk.WindowGroup", "Gtk.WindowHandle", "Gtk.WrapMode", @@ -906,7 +907,7 @@ manual_traits = ["ComboBoxExtManual"] const = true # iter shouldn't be mutable here [[object.function]] name = "set_active" - manual = true # use Option so we can allow -1 to unselect the active item + manual = true # use Option so we can allow -1 to unselect the active item doc_trait_name = "ComboBoxExtManual" [[object.function]] name = "get_active" @@ -998,7 +999,7 @@ status = "generate" manual_traits = ["DialogExtManual"] [[object.function]] name = "add_buttons" - manual = true # to call Dialog::add_button + manual = true # to call Dialog::add_button doc_trait_name = "DialogExtManual" [[object.function]] name = "new_with_buttons" @@ -2335,7 +2336,7 @@ manual_traits = ["TreeModelExtManual"] ignore = true # unsafe [[object.function]] pattern = "(get_value|get_valist)" - ignore = true # generated manually to check for column + ignore = true # generated manually to check for column [[object.function]] name = "get" manual = true @@ -2524,7 +2525,7 @@ generate_builder = false nullable = false # use unset_select_function [[object.function]] name = "get_user_data" - ignore = true # unsafe + ignore = true # unsafe [[object]] name = "Gtk.TreeSortable" @@ -2689,7 +2690,7 @@ status = "generate" [[object.function]] name = "new" [[object.function.parameter]] - name = "uri" # we have Default for creating instances without "uri" + name = "uri" # we have Default for creating instances without "uri" nullable = false [[object]] diff --git a/gtk4/src/auto/about_dialog.rs b/gtk4/src/auto/about_dialog.rs index 917b9216983d..2f03097dcc94 100644 --- a/gtk4/src/auto/about_dialog.rs +++ b/gtk4/src/auto/about_dialog.rs @@ -2,6 +2,9 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::WindowGravity; use crate::{ ffi, Accessible, AccessibleRole, Align, Application, Buildable, ConstraintTarget, LayoutManager, License, Native, Overflow, Root, ShortcutManager, Widget, Window, @@ -949,11 +952,14 @@ impl AboutDialogBuilder { } } - // #[cfg(feature = "v4_20")] + #[cfg(feature = "v4_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { - // Self { builder: self.builder.property("gravity", gravity), } - //} + pub fn gravity(self, gravity: WindowGravity) -> Self { + Self { + builder: self.builder.property("gravity", gravity), + } + } + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/application_window.rs b/gtk4/src/auto/application_window.rs index a76e0849f9dc..6110648955b7 100644 --- a/gtk4/src/auto/application_window.rs +++ b/gtk4/src/auto/application_window.rs @@ -3,6 +3,9 @@ // DO NOT EDIT #![allow(deprecated)] +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::WindowGravity; use crate::{ ffi, Accessible, AccessibleRole, Align, Application, Buildable, ConstraintTarget, LayoutManager, Native, Overflow, Root, ShortcutManager, ShortcutsWindow, Widget, Window, @@ -154,11 +157,14 @@ impl ApplicationWindowBuilder { } } - // #[cfg(feature = "v4_20")] + #[cfg(feature = "v4_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { - // Self { builder: self.builder.property("gravity", gravity), } - //} + pub fn gravity(self, gravity: WindowGravity) -> Self { + Self { + builder: self.builder.property("gravity", gravity), + } + } + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/assistant.rs b/gtk4/src/auto/assistant.rs index b86527e2ae3b..0e330fccb95a 100644 --- a/gtk4/src/auto/assistant.rs +++ b/gtk4/src/auto/assistant.rs @@ -3,6 +3,9 @@ // DO NOT EDIT #![allow(deprecated)] +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::WindowGravity; use crate::{ ffi, Accessible, AccessibleRole, Align, Application, AssistantPage, AssistantPageType, Buildable, ConstraintTarget, LayoutManager, Native, Overflow, Root, ShortcutManager, Widget, @@ -567,11 +570,14 @@ impl AssistantBuilder { } } - // #[cfg(feature = "v4_20")] + #[cfg(feature = "v4_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { - // Self { builder: self.builder.property("gravity", gravity), } - //} + pub fn gravity(self, gravity: WindowGravity) -> Self { + Self { + builder: self.builder.property("gravity", gravity), + } + } + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/color_chooser_dialog.rs b/gtk4/src/auto/color_chooser_dialog.rs index e04671c331d9..9e8ece2a8c2e 100644 --- a/gtk4/src/auto/color_chooser_dialog.rs +++ b/gtk4/src/auto/color_chooser_dialog.rs @@ -3,6 +3,9 @@ // DO NOT EDIT #![allow(deprecated)] +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::WindowGravity; use crate::{ ffi, Accessible, AccessibleRole, Align, Application, Buildable, ColorChooser, ConstraintTarget, Dialog, LayoutManager, Native, Overflow, Root, ShortcutManager, Widget, Window, @@ -195,11 +198,14 @@ impl ColorChooserDialogBuilder { } } - // #[cfg(feature = "v4_20")] + #[cfg(feature = "v4_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { - // Self { builder: self.builder.property("gravity", gravity), } - //} + pub fn gravity(self, gravity: WindowGravity) -> Self { + Self { + builder: self.builder.property("gravity", gravity), + } + } + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/dialog.rs b/gtk4/src/auto/dialog.rs index 83a8d8767ce8..aa937eeabee2 100644 --- a/gtk4/src/auto/dialog.rs +++ b/gtk4/src/auto/dialog.rs @@ -3,6 +3,9 @@ // DO NOT EDIT #![allow(deprecated)] +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::WindowGravity; use crate::{ ffi, Accessible, AccessibleRole, Align, Application, Box, Buildable, ConstraintTarget, HeaderBar, LayoutManager, Native, Overflow, ResponseType, Root, ShortcutManager, Widget, @@ -154,11 +157,14 @@ impl DialogBuilder { } } - // #[cfg(feature = "v4_20")] + #[cfg(feature = "v4_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { - // Self { builder: self.builder.property("gravity", gravity), } - //} + pub fn gravity(self, gravity: WindowGravity) -> Self { + Self { + builder: self.builder.property("gravity", gravity), + } + } + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/enums.rs b/gtk4/src/auto/enums.rs index 286eb3047b0b..89f5afbe1400 100644 --- a/gtk4/src/auto/enums.rs +++ b/gtk4/src/auto/enums.rs @@ -12107,6 +12107,170 @@ impl From for glib::Value { } } +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[non_exhaustive] +#[doc(alias = "GtkWindowGravity")] +pub enum WindowGravity { + #[doc(alias = "GTK_WINDOW_GRAVITY_TOP_LEFT")] + TopLeft, + #[doc(alias = "GTK_WINDOW_GRAVITY_TOP")] + Top, + #[doc(alias = "GTK_WINDOW_GRAVITY_TOP_RIGHT")] + TopRight, + #[doc(alias = "GTK_WINDOW_GRAVITY_LEFT")] + Left, + #[doc(alias = "GTK_WINDOW_GRAVITY_CENTER")] + Center, + #[doc(alias = "GTK_WINDOW_GRAVITY_RIGHT")] + Right, + #[doc(alias = "GTK_WINDOW_GRAVITY_BOTTOM_LEFT")] + BottomLeft, + #[doc(alias = "GTK_WINDOW_GRAVITY_BOTTOM")] + Bottom, + #[doc(alias = "GTK_WINDOW_GRAVITY_BOTTOM_RIGHT")] + BottomRight, + #[doc(alias = "GTK_WINDOW_GRAVITY_TOP_START")] + TopStart, + #[doc(alias = "GTK_WINDOW_GRAVITY_TOP_END")] + TopEnd, + #[doc(alias = "GTK_WINDOW_GRAVITY_START")] + Start, + #[doc(alias = "GTK_WINDOW_GRAVITY_END")] + End, + #[doc(alias = "GTK_WINDOW_GRAVITY_BOTTOM_START")] + BottomStart, + #[doc(alias = "GTK_WINDOW_GRAVITY_BOTTOM_END")] + BottomEnd, + #[doc(hidden)] + __Unknown(i32), +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +#[doc(hidden)] +impl IntoGlib for WindowGravity { + type GlibType = ffi::GtkWindowGravity; + + fn into_glib(self) -> ffi::GtkWindowGravity { + match self { + Self::TopLeft => ffi::GTK_WINDOW_GRAVITY_TOP_LEFT, + Self::Top => ffi::GTK_WINDOW_GRAVITY_TOP, + Self::TopRight => ffi::GTK_WINDOW_GRAVITY_TOP_RIGHT, + Self::Left => ffi::GTK_WINDOW_GRAVITY_LEFT, + Self::Center => ffi::GTK_WINDOW_GRAVITY_CENTER, + Self::Right => ffi::GTK_WINDOW_GRAVITY_RIGHT, + Self::BottomLeft => ffi::GTK_WINDOW_GRAVITY_BOTTOM_LEFT, + Self::Bottom => ffi::GTK_WINDOW_GRAVITY_BOTTOM, + Self::BottomRight => ffi::GTK_WINDOW_GRAVITY_BOTTOM_RIGHT, + Self::TopStart => ffi::GTK_WINDOW_GRAVITY_TOP_START, + Self::TopEnd => ffi::GTK_WINDOW_GRAVITY_TOP_END, + Self::Start => ffi::GTK_WINDOW_GRAVITY_START, + Self::End => ffi::GTK_WINDOW_GRAVITY_END, + Self::BottomStart => ffi::GTK_WINDOW_GRAVITY_BOTTOM_START, + Self::BottomEnd => ffi::GTK_WINDOW_GRAVITY_BOTTOM_END, + Self::__Unknown(value) => value, + } + } +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +#[doc(hidden)] +impl FromGlib for WindowGravity { + unsafe fn from_glib(value: ffi::GtkWindowGravity) -> Self { + skip_assert_initialized!(); + + match value { + ffi::GTK_WINDOW_GRAVITY_TOP_LEFT => Self::TopLeft, + ffi::GTK_WINDOW_GRAVITY_TOP => Self::Top, + ffi::GTK_WINDOW_GRAVITY_TOP_RIGHT => Self::TopRight, + ffi::GTK_WINDOW_GRAVITY_LEFT => Self::Left, + ffi::GTK_WINDOW_GRAVITY_CENTER => Self::Center, + ffi::GTK_WINDOW_GRAVITY_RIGHT => Self::Right, + ffi::GTK_WINDOW_GRAVITY_BOTTOM_LEFT => Self::BottomLeft, + ffi::GTK_WINDOW_GRAVITY_BOTTOM => Self::Bottom, + ffi::GTK_WINDOW_GRAVITY_BOTTOM_RIGHT => Self::BottomRight, + ffi::GTK_WINDOW_GRAVITY_TOP_START => Self::TopStart, + ffi::GTK_WINDOW_GRAVITY_TOP_END => Self::TopEnd, + ffi::GTK_WINDOW_GRAVITY_START => Self::Start, + ffi::GTK_WINDOW_GRAVITY_END => Self::End, + ffi::GTK_WINDOW_GRAVITY_BOTTOM_START => Self::BottomStart, + ffi::GTK_WINDOW_GRAVITY_BOTTOM_END => Self::BottomEnd, + value => Self::__Unknown(value), + } + } +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +impl StaticType for WindowGravity { + #[inline] + #[doc(alias = "gtk_window_gravity_get_type")] + fn static_type() -> glib::Type { + unsafe { from_glib(ffi::gtk_window_gravity_get_type()) } + } +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +impl glib::HasParamSpec for WindowGravity { + type ParamSpec = glib::ParamSpecEnum; + type SetValue = Self; + type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + Self::ParamSpec::builder_with_default + } +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +impl glib::value::ValueType for WindowGravity { + type Type = Self; +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +unsafe impl<'a> glib::value::FromValue<'a> for WindowGravity { + type Checker = glib::value::GenericValueTypeChecker; + + #[inline] + unsafe fn from_value(value: &'a glib::Value) -> Self { + skip_assert_initialized!(); + from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +impl ToValue for WindowGravity { + #[inline] + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + #[inline] + fn value_type(&self) -> glib::Type { + Self::static_type() + } +} + +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +impl From for glib::Value { + #[inline] + fn from(v: WindowGravity) -> Self { + skip_assert_initialized!(); + ToValue::to_value(&v) + } +} + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GtkWrapMode")] diff --git a/gtk4/src/auto/file_chooser_dialog.rs b/gtk4/src/auto/file_chooser_dialog.rs index 823b1f802167..c8ad4268b8be 100644 --- a/gtk4/src/auto/file_chooser_dialog.rs +++ b/gtk4/src/auto/file_chooser_dialog.rs @@ -3,6 +3,9 @@ // DO NOT EDIT #![allow(deprecated)] +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::WindowGravity; use crate::{ ffi, Accessible, AccessibleRole, Align, Application, Buildable, ConstraintTarget, Dialog, FileChooser, FileChooserAction, FileFilter, LayoutManager, Native, Overflow, Root, @@ -132,11 +135,14 @@ impl FileChooserDialogBuilder { } } - // #[cfg(feature = "v4_20")] + #[cfg(feature = "v4_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { - // Self { builder: self.builder.property("gravity", gravity), } - //} + pub fn gravity(self, gravity: WindowGravity) -> Self { + Self { + builder: self.builder.property("gravity", gravity), + } + } + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/font_chooser_dialog.rs b/gtk4/src/auto/font_chooser_dialog.rs index 146558f027ad..8b3a0789733a 100644 --- a/gtk4/src/auto/font_chooser_dialog.rs +++ b/gtk4/src/auto/font_chooser_dialog.rs @@ -3,6 +3,9 @@ // DO NOT EDIT #![allow(deprecated)] +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::WindowGravity; use crate::{ ffi, Accessible, AccessibleRole, Align, Application, Buildable, ConstraintTarget, Dialog, FontChooser, FontChooserLevel, LayoutManager, Native, Overflow, Root, ShortcutManager, Widget, @@ -152,11 +155,14 @@ impl FontChooserDialogBuilder { } } - // #[cfg(feature = "v4_20")] + #[cfg(feature = "v4_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { - // Self { builder: self.builder.property("gravity", gravity), } - //} + pub fn gravity(self, gravity: WindowGravity) -> Self { + Self { + builder: self.builder.property("gravity", gravity), + } + } + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/message_dialog.rs b/gtk4/src/auto/message_dialog.rs index 797b7e467531..858f15f14d30 100644 --- a/gtk4/src/auto/message_dialog.rs +++ b/gtk4/src/auto/message_dialog.rs @@ -3,6 +3,9 @@ // DO NOT EDIT #![allow(deprecated)] +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::WindowGravity; use crate::{ ffi, Accessible, AccessibleRole, Align, Application, Buildable, ButtonsType, ConstraintTarget, Dialog, LayoutManager, MessageType, Native, Overflow, Root, ShortcutManager, Widget, Window, @@ -389,11 +392,14 @@ impl MessageDialogBuilder { } } - // #[cfg(feature = "v4_20")] + #[cfg(feature = "v4_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { - // Self { builder: self.builder.property("gravity", gravity), } - //} + pub fn gravity(self, gravity: WindowGravity) -> Self { + Self { + builder: self.builder.property("gravity", gravity), + } + } + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/mod.rs b/gtk4/src/auto/mod.rs index efbf7a684f4a..6eab0f8ee095 100644 --- a/gtk4/src/auto/mod.rs +++ b/gtk4/src/auto/mod.rs @@ -1271,6 +1271,9 @@ pub use self::enums::TreeViewDropPosition; #[allow(deprecated)] pub use self::enums::TreeViewGridLines; pub use self::enums::Unit; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +pub use self::enums::WindowGravity; pub use self::enums::WrapMode; mod flags; diff --git a/gtk4/src/auto/page_setup_unix_dialog.rs b/gtk4/src/auto/page_setup_unix_dialog.rs index de381243d3f2..a32d5afd9246 100644 --- a/gtk4/src/auto/page_setup_unix_dialog.rs +++ b/gtk4/src/auto/page_setup_unix_dialog.rs @@ -2,6 +2,9 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::WindowGravity; use crate::{ ffi, Accessible, AccessibleRole, Align, Application, Buildable, ConstraintTarget, Dialog, LayoutManager, Native, Overflow, PageSetup, PrintSettings, Root, ShortcutManager, Widget, @@ -189,11 +192,14 @@ impl PageSetupUnixDialogBuilder { } } - // #[cfg(feature = "v4_20")] + #[cfg(feature = "v4_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { - // Self { builder: self.builder.property("gravity", gravity), } - //} + pub fn gravity(self, gravity: WindowGravity) -> Self { + Self { + builder: self.builder.property("gravity", gravity), + } + } + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/print_unix_dialog.rs b/gtk4/src/auto/print_unix_dialog.rs index c36f52d73dbc..ade563e25ccf 100644 --- a/gtk4/src/auto/print_unix_dialog.rs +++ b/gtk4/src/auto/print_unix_dialog.rs @@ -2,6 +2,9 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::WindowGravity; use crate::{ ffi, Accessible, AccessibleRole, Align, Application, Buildable, ConstraintTarget, Dialog, LayoutManager, Native, Overflow, PageSetup, PrintCapabilities, PrintSettings, Printer, Root, @@ -579,11 +582,14 @@ impl PrintUnixDialogBuilder { } } - // #[cfg(feature = "v4_20")] + #[cfg(feature = "v4_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { - // Self { builder: self.builder.property("gravity", gravity), } - //} + pub fn gravity(self, gravity: WindowGravity) -> Self { + Self { + builder: self.builder.property("gravity", gravity), + } + } + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/shortcuts_window.rs b/gtk4/src/auto/shortcuts_window.rs index 3d2d8b959b81..afcf4c56b214 100644 --- a/gtk4/src/auto/shortcuts_window.rs +++ b/gtk4/src/auto/shortcuts_window.rs @@ -6,6 +6,9 @@ #[cfg(feature = "v4_14")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] use crate::ShortcutsSection; +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::WindowGravity; use crate::{ ffi, Accessible, AccessibleRole, Align, Application, Buildable, ConstraintTarget, LayoutManager, Native, Overflow, Root, ShortcutManager, Widget, Window, @@ -286,11 +289,14 @@ impl ShortcutsWindowBuilder { } } - // #[cfg(feature = "v4_20")] + #[cfg(feature = "v4_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { - // Self { builder: self.builder.property("gravity", gravity), } - //} + pub fn gravity(self, gravity: WindowGravity) -> Self { + Self { + builder: self.builder.property("gravity", gravity), + } + } + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { diff --git a/gtk4/src/auto/window.rs b/gtk4/src/auto/window.rs index 4c0e26e0a18a..7753f82a0da3 100644 --- a/gtk4/src/auto/window.rs +++ b/gtk4/src/auto/window.rs @@ -3,6 +3,9 @@ // DO NOT EDIT #![allow(deprecated)] +#[cfg(feature = "v4_20")] +#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] +use crate::WindowGravity; use crate::{ ffi, Accessible, AccessibleRole, Align, Application, Buildable, ConstraintTarget, LayoutManager, Native, Overflow, Root, ShortcutManager, Widget, WindowGroup, @@ -188,11 +191,14 @@ impl WindowBuilder { } } - // #[cfg(feature = "v4_20")] + #[cfg(feature = "v4_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //pub fn gravity(self, gravity: /*Ignored*/WindowGravity) -> Self { - // Self { builder: self.builder.property("gravity", gravity), } - //} + pub fn gravity(self, gravity: WindowGravity) -> Self { + Self { + builder: self.builder.property("gravity", gravity), + } + } + #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self { @@ -595,13 +601,13 @@ pub trait GtkWindowExt: IsA + 'static { } } - //#[cfg(feature = "v4_20")] - //#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //#[doc(alias = "gtk_window_get_gravity")] - //#[doc(alias = "get_gravity")] - //fn gravity(&self) -> /*Ignored*/WindowGravity { - // unsafe { TODO: call ffi:gtk_window_get_gravity() } - //} + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "gtk_window_get_gravity")] + #[doc(alias = "get_gravity")] + fn gravity(&self) -> WindowGravity { + unsafe { from_glib(ffi::gtk_window_get_gravity(self.as_ref().to_glib_none().0)) } + } #[doc(alias = "gtk_window_get_group")] #[doc(alias = "get_group")] @@ -859,13 +865,15 @@ pub trait GtkWindowExt: IsA + 'static { } } - //#[cfg(feature = "v4_20")] - //#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] - //#[doc(alias = "gtk_window_set_gravity")] - //#[doc(alias = "gravity")] - //fn set_gravity(&self, gravity: /*Ignored*/WindowGravity) { - // unsafe { TODO: call ffi:gtk_window_set_gravity() } - //} + #[cfg(feature = "v4_20")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))] + #[doc(alias = "gtk_window_set_gravity")] + #[doc(alias = "gravity")] + fn set_gravity(&self, gravity: WindowGravity) { + unsafe { + ffi::gtk_window_set_gravity(self.as_ref().to_glib_none().0, gravity.into_glib()); + } + } #[cfg(feature = "v4_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))] From 232b46442ffc6a718802c9347a4b40134235e3ed Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sat, 26 Apr 2025 10:45:21 +0200 Subject: [PATCH 6/7] gdk: Export v4.20 feature --- gdk4/Cargo.toml | 1 + gdk4/README.md | 1 + gdk4/sys/Cargo.toml | 2 +- gtk4/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gdk4/Cargo.toml b/gdk4/Cargo.toml index b3d226235cc0..4f8cdf9715af 100644 --- a/gdk4/Cargo.toml +++ b/gdk4/Cargo.toml @@ -26,6 +26,7 @@ v4_12 = ["gdk4-sys/v4_12", "v4_10"] v4_14 = ["gdk4-sys/v4_14", "v4_12"] v4_16 = ["gdk4-sys/v4_16", "v4_14"] v4_18 = ["gdk4-sys/v4_18", "v4_16"] +v4_20 = ["gdk4-sys/v4_20", "v4_18"] gl = ["dep:gl"] [dependencies] diff --git a/gdk4/README.md b/gdk4/README.md index 045355b47efa..22e54dc9dc4d 100644 --- a/gdk4/README.md +++ b/gdk4/README.md @@ -40,6 +40,7 @@ gdk = { git = "https://github.com/gtk-rs/gtk4-rs.git", package = "gdk4" } | Feature | Description | | --- | ----------- | +| `v4_20 | Enable the new APIs part of GTK 4.20 | | `v4_18` | Enable the new APIs part of GTK 4.18 | | `v4_16` | Enable the new APIs part of GTK 4.16 | | `v4_14` | Enable the new APIs part of GTK 4.14 | diff --git a/gdk4/sys/Cargo.toml b/gdk4/sys/Cargo.toml index b8663271be25..6a7dc69accf6 100644 --- a/gdk4/sys/Cargo.toml +++ b/gdk4/sys/Cargo.toml @@ -61,7 +61,7 @@ version = "4.16" version = "4.18" [package.metadata.system-deps.gtk4.v4_20] -version = "4.20" +version = "4.19" [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] diff --git a/gtk4/Cargo.toml b/gtk4/Cargo.toml index e9bf6fbed81f..e019020dfba3 100644 --- a/gtk4/Cargo.toml +++ b/gtk4/Cargo.toml @@ -26,7 +26,7 @@ v4_12 = ["gtk4-sys/v4_12", "v4_10", "gdk/v4_12"] v4_14 = ["gtk4-sys/v4_14", "v4_12", "gdk/v4_14", "gsk/v4_14"] v4_16 = ["gtk4-sys/v4_16", "v4_14", "gdk/v4_16", "gsk/v4_16"] v4_18 = ["gtk4-sys/v4_18", "gdk/v4_18", "v4_16"] -v4_20 = ["gtk4-sys/v4_20", "v4_18"] +v4_20 = ["gtk4-sys/v4_20", "gdk/v4_20", "v4_18"] gio_v2_80 = ["gio/v2_80"] xml_validation = ["gtk4-macros/xml_validation"] blueprint = ["gtk4-macros/blueprint"] From ce45b4a921afd524cecd25d3fd9202450d7622ad Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sat, 26 Apr 2025 10:45:45 +0200 Subject: [PATCH 7/7] ci: Test v4.20 --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bb473678d8df..cb237293f291 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -49,11 +49,11 @@ jobs: conf: - { name: "gtk4", - features: "v4_18,xml_validation,blueprint", + features: "v4_20,xml_validation,blueprint", test_sys: false, } - { name: "gsk4", features: "v4_18,broadway,vulkan", test_sys: true } - - { name: "gdk4", features: "v4_18,gl", test_sys: true } + - { name: "gdk4", features: "v4_20,gl", test_sys: true } - { name: "gdk4-wayland", features: "v4_18,wayland_crate,egl",