From 8048af38194a2746d715c946c51ea22732764607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Laignel?= Date: Tue, 27 May 2025 11:07:21 +0200 Subject: [PATCH 1/3] gir: update for MR#1622 --- gir | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gir b/gir index b2a1c6f9b362..9e6d0758f347 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit b2a1c6f9b3622c45e67af75479eaf640a8af0081 +Subproject commit 9e6d0758f347dea5ebe365be93bf7740d4626887 From a91cce67cc192c5417e10f9d3c18641f91b28e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Laignel?= Date: Tue, 27 May 2025 11:08:45 +0200 Subject: [PATCH 2/3] regen for git MR#1622 https://github.com/gtk-rs/gir/pull/1622 --- 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/content_formats.rs | 4 ++-- gdk4/src/auto/content_provider.rs | 4 ++-- gdk4/src/auto/versions.txt | 2 +- gdk4/sys/versions.txt | 2 +- gsk4/src/auto/gl_shader_node.rs | 4 ++-- gsk4/src/auto/stroke.rs | 4 ++-- gsk4/src/auto/versions.txt | 2 +- gsk4/sys/versions.txt | 2 +- gtk4/src/auto/icon_theme.rs | 6 +++--- gtk4/src/auto/scale_button.rs | 2 +- gtk4/src/auto/string_list.rs | 4 ++-- gtk4/src/auto/versions.txt | 2 +- gtk4/sys/versions.txt | 2 +- 21 files changed, 28 insertions(+), 28 deletions(-) diff --git a/gdk4-macos/src/auto/versions.txt b/gdk4-macos/src/auto/versions.txt index 9c44f3dbe11d..06dfb1d65192 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 @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) diff --git a/gdk4-macos/sys/versions.txt b/gdk4-macos/sys/versions.txt index 9c44f3dbe11d..06dfb1d65192 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 @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) diff --git a/gdk4-wayland/src/auto/versions.txt b/gdk4-wayland/src/auto/versions.txt index 9c44f3dbe11d..06dfb1d65192 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 @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) diff --git a/gdk4-wayland/sys/versions.txt b/gdk4-wayland/sys/versions.txt index 9c44f3dbe11d..06dfb1d65192 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 @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) diff --git a/gdk4-win32/src/auto/versions.txt b/gdk4-win32/src/auto/versions.txt index 9c44f3dbe11d..06dfb1d65192 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 @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) diff --git a/gdk4-win32/sys/versions.txt b/gdk4-win32/sys/versions.txt index 9c44f3dbe11d..06dfb1d65192 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 @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) diff --git a/gdk4-x11/src/auto/versions.txt b/gdk4-x11/src/auto/versions.txt index 9c44f3dbe11d..06dfb1d65192 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 @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) diff --git a/gdk4-x11/sys/versions.txt b/gdk4-x11/sys/versions.txt index 9c44f3dbe11d..06dfb1d65192 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 @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) diff --git a/gdk4/src/auto/content_formats.rs b/gdk4/src/auto/content_formats.rs index 67ec0bbf66b5..f2dd64457d28 100644 --- a/gdk4/src/auto/content_formats.rs +++ b/gdk4/src/auto/content_formats.rs @@ -18,9 +18,9 @@ glib::wrapper! { impl ContentFormats { #[doc(alias = "gdk_content_formats_new")] - pub fn new(mime_types: &[&str]) -> ContentFormats { + pub fn new(mime_types: Option<&[&str]>) -> ContentFormats { assert_initialized_main_thread!(); - let n_mime_types = mime_types.len() as _; + let n_mime_types = mime_types.map(|arr| arr.len()).unwrap_or(0) as _; unsafe { from_glib_full(ffi::gdk_content_formats_new( mime_types.to_glib_none().0, diff --git a/gdk4/src/auto/content_provider.rs b/gdk4/src/auto/content_provider.rs index 7899ba1d9e1b..e3439b2f0b2f 100644 --- a/gdk4/src/auto/content_provider.rs +++ b/gdk4/src/auto/content_provider.rs @@ -47,9 +47,9 @@ impl ContentProvider { } #[doc(alias = "gdk_content_provider_new_union")] - pub fn new_union(providers: &[ContentProvider]) -> ContentProvider { + pub fn new_union(providers: Option<&[ContentProvider]>) -> ContentProvider { assert_initialized_main_thread!(); - let n_providers = providers.len() as _; + let n_providers = providers.map(|arr| arr.len()).unwrap_or(0) as _; unsafe { from_glib_full(ffi::gdk_content_provider_new_union( providers.to_glib_full(), diff --git a/gdk4/src/auto/versions.txt b/gdk4/src/auto/versions.txt index 9c44f3dbe11d..06dfb1d65192 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 @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) diff --git a/gdk4/sys/versions.txt b/gdk4/sys/versions.txt index 9c44f3dbe11d..06dfb1d65192 100644 --- a/gdk4/sys/versions.txt +++ b/gdk4/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) diff --git a/gsk4/src/auto/gl_shader_node.rs b/gsk4/src/auto/gl_shader_node.rs index e8d994104198..d16464b98940 100644 --- a/gsk4/src/auto/gl_shader_node.rs +++ b/gsk4/src/auto/gl_shader_node.rs @@ -30,10 +30,10 @@ impl GLShaderNode { shader: &GLShader, bounds: &graphene::Rect, args: &glib::Bytes, - children: &[RenderNode], + children: Option<&[RenderNode]>, ) -> GLShaderNode { skip_assert_initialized!(); - let n_children = children.len() as _; + let n_children = children.map(|arr| arr.len()).unwrap_or(0) as _; unsafe { from_glib_full(ffi::gsk_gl_shader_node_new( shader.to_glib_none().0, diff --git a/gsk4/src/auto/stroke.rs b/gsk4/src/auto/stroke.rs index 1d66796a33d7..28340b7e3b99 100644 --- a/gsk4/src/auto/stroke.rs +++ b/gsk4/src/auto/stroke.rs @@ -67,8 +67,8 @@ impl Stroke { } #[doc(alias = "gsk_stroke_set_dash")] - pub fn set_dash(&self, dash: &[f32]) { - let n_dash = dash.len() as _; + pub fn set_dash(&self, dash: Option<&[f32]>) { + let n_dash = dash.map(|arr| arr.len()).unwrap_or(0) as _; unsafe { ffi::gsk_stroke_set_dash( mut_override(self.to_glib_none().0), diff --git a/gsk4/src/auto/versions.txt b/gsk4/src/auto/versions.txt index 9c44f3dbe11d..06dfb1d65192 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 @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) diff --git a/gsk4/sys/versions.txt b/gsk4/sys/versions.txt index 9c44f3dbe11d..06dfb1d65192 100644 --- a/gsk4/sys/versions.txt +++ b/gsk4/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) diff --git a/gtk4/src/auto/icon_theme.rs b/gtk4/src/auto/icon_theme.rs index 34945f033204..531f9ee996b0 100644 --- a/gtk4/src/auto/icon_theme.rs +++ b/gtk4/src/auto/icon_theme.rs @@ -145,7 +145,7 @@ impl IconTheme { pub fn lookup_icon( &self, icon_name: &str, - fallbacks: &[&str], + fallbacks: Option<&[&str]>, size: i32, scale: i32, direction: TextDirection, @@ -166,7 +166,7 @@ impl IconTheme { #[doc(alias = "gtk_icon_theme_set_resource_path")] #[doc(alias = "resource-path")] - pub fn set_resource_path(&self, path: &[&str]) { + pub fn set_resource_path(&self, path: Option<&[&str]>) { unsafe { ffi::gtk_icon_theme_set_resource_path(self.to_glib_none().0, path.to_glib_none().0); } @@ -174,7 +174,7 @@ impl IconTheme { #[doc(alias = "gtk_icon_theme_set_search_path")] #[doc(alias = "search-path")] - pub fn set_search_path(&self, path: &[&std::path::Path]) { + pub fn set_search_path(&self, path: Option<&[&std::path::Path]>) { unsafe { ffi::gtk_icon_theme_set_search_path(self.to_glib_none().0, path.to_glib_none().0); } diff --git a/gtk4/src/auto/scale_button.rs b/gtk4/src/auto/scale_button.rs index c2688d4437f4..f637fd71014d 100644 --- a/gtk4/src/auto/scale_button.rs +++ b/gtk4/src/auto/scale_button.rs @@ -42,7 +42,7 @@ impl ScaleButton { pub const NONE: Option<&'static ScaleButton> = None; #[doc(alias = "gtk_scale_button_new")] - pub fn new(min: f64, max: f64, step: f64, icons: &[&str]) -> ScaleButton { + pub fn new(min: f64, max: f64, step: f64, icons: Option<&[&str]>) -> ScaleButton { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_scale_button_new( diff --git a/gtk4/src/auto/string_list.rs b/gtk4/src/auto/string_list.rs index 610aff404728..251283b1731f 100644 --- a/gtk4/src/auto/string_list.rs +++ b/gtk4/src/auto/string_list.rs @@ -16,7 +16,7 @@ glib::wrapper! { impl StringList { #[doc(alias = "gtk_string_list_new")] - pub fn new(strings: &[&str]) -> StringList { + pub fn new(strings: Option<&[&str]>) -> StringList { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gtk_string_list_new(strings.to_glib_none().0)) } } @@ -54,7 +54,7 @@ impl StringList { } #[doc(alias = "gtk_string_list_splice")] - pub fn splice(&self, position: u32, n_removals: u32, additions: &[&str]) { + pub fn splice(&self, position: u32, n_removals: u32, additions: Option<&[&str]>) { unsafe { ffi::gtk_string_list_splice( self.to_glib_none().0, diff --git a/gtk4/src/auto/versions.txt b/gtk4/src/auto/versions.txt index 9c44f3dbe11d..06dfb1d65192 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 @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) diff --git a/gtk4/sys/versions.txt b/gtk4/sys/versions.txt index 9c44f3dbe11d..06dfb1d65192 100644 --- a/gtk4/sys/versions.txt +++ b/gtk4/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) +Generated by gir (https://github.com/gtk-rs/gir @ 9e6d0758f347) from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) From c7932627f36092400d90de65e6a761c17de16791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Laignel?= Date: Tue, 27 May 2025 11:07:50 +0200 Subject: [PATCH 3/3] gtk4: StringList: update for Option arg constructor --- gtk4/src/string_list.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk4/src/string_list.rs b/gtk4/src/string_list.rs index 404ca2a3dd77..e434e159b14c 100644 --- a/gtk4/src/string_list.rs +++ b/gtk4/src/string_list.rs @@ -5,7 +5,7 @@ use crate::{prelude::*, StringList}; impl FromIterator<&'static str> for StringList { fn from_iter>(iter: I) -> Self { assert_initialized_main_thread!(); - StringList::new(iter.into_iter().collect::>().as_slice()) + StringList::new(Some(iter.into_iter().collect::>().as_slice())) } } @@ -14,7 +14,7 @@ impl Extend<&'static str> for StringList { self.splice( self.n_items(), 0, - iter.into_iter().collect::>().as_slice(), + Some(iter.into_iter().collect::>().as_slice()), ); } } @@ -22,7 +22,7 @@ impl Extend<&'static str> for StringList { impl FromIterator for StringList { fn from_iter>(iter: I) -> Self { assert_initialized_main_thread!(); - let string_list = StringList::new(&[]); + let string_list = StringList::new(None); for s in iter { string_list.append(&s); } @@ -40,7 +40,7 @@ impl Extend for StringList { impl Default for StringList { fn default() -> Self { - Self::new(&[]) + Self::new(None) } }