From 4d323a7992d721df3f05c1f4d95d822e0d59fc46 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 20 May 2025 09:21:15 +0000 Subject: [PATCH 01/11] Update gir --- gir | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gir b/gir index 19e8a2f15e0e..1364a207b03e 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit 19e8a2f15e0eb97563cbee857846b2d57506ec7d +Subproject commit 1364a207b03eb2014a7346b557088c2bfe8cc9af From f835fa3354c77c9a924d9a2db95ccb1fcda57af7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 20 May 2025 09:22:04 +0000 Subject: [PATCH 02/11] Regenerate with latest gir --- gdk-pixbuf/src/auto/versions.txt | 2 +- gdk-pixbuf/sys/versions.txt | 2 +- gio/src/auto/versions.txt | 2 +- gio/sys/versions.txt | 2 +- glib/gobject-sys/versions.txt | 2 +- glib/src/auto/versions.txt | 2 +- glib/sys/versions.txt | 2 +- graphene/src/auto/versions.txt | 2 +- graphene/sys/versions.txt | 2 +- pango/src/auto/versions.txt | 2 +- pango/sys/versions.txt | 2 +- pangocairo/src/auto/versions.txt | 2 +- pangocairo/sys/versions.txt | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gdk-pixbuf/src/auto/versions.txt b/gdk-pixbuf/src/auto/versions.txt index 25101d8e282d..25537964a793 100644 --- a/gdk-pixbuf/src/auto/versions.txt +++ b/gdk-pixbuf/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e) +Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) diff --git a/gdk-pixbuf/sys/versions.txt b/gdk-pixbuf/sys/versions.txt index 25101d8e282d..25537964a793 100644 --- a/gdk-pixbuf/sys/versions.txt +++ b/gdk-pixbuf/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e) +Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) diff --git a/gio/src/auto/versions.txt b/gio/src/auto/versions.txt index 25101d8e282d..25537964a793 100644 --- a/gio/src/auto/versions.txt +++ b/gio/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e) +Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) diff --git a/gio/sys/versions.txt b/gio/sys/versions.txt index 25101d8e282d..25537964a793 100644 --- a/gio/sys/versions.txt +++ b/gio/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e) +Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) diff --git a/glib/gobject-sys/versions.txt b/glib/gobject-sys/versions.txt index 25101d8e282d..25537964a793 100644 --- a/glib/gobject-sys/versions.txt +++ b/glib/gobject-sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e) +Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) diff --git a/glib/src/auto/versions.txt b/glib/src/auto/versions.txt index 25101d8e282d..25537964a793 100644 --- a/glib/src/auto/versions.txt +++ b/glib/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e) +Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) diff --git a/glib/sys/versions.txt b/glib/sys/versions.txt index 25101d8e282d..25537964a793 100644 --- a/glib/sys/versions.txt +++ b/glib/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e) +Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) diff --git a/graphene/src/auto/versions.txt b/graphene/src/auto/versions.txt index 25101d8e282d..25537964a793 100644 --- a/graphene/src/auto/versions.txt +++ b/graphene/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e) +Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) diff --git a/graphene/sys/versions.txt b/graphene/sys/versions.txt index 25101d8e282d..25537964a793 100644 --- a/graphene/sys/versions.txt +++ b/graphene/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e) +Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) diff --git a/pango/src/auto/versions.txt b/pango/src/auto/versions.txt index 25101d8e282d..25537964a793 100644 --- a/pango/src/auto/versions.txt +++ b/pango/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e) +Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) diff --git a/pango/sys/versions.txt b/pango/sys/versions.txt index 25101d8e282d..25537964a793 100644 --- a/pango/sys/versions.txt +++ b/pango/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e) +Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) diff --git a/pangocairo/src/auto/versions.txt b/pangocairo/src/auto/versions.txt index 25101d8e282d..25537964a793 100644 --- a/pangocairo/src/auto/versions.txt +++ b/pangocairo/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e) +Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) diff --git a/pangocairo/sys/versions.txt b/pangocairo/sys/versions.txt index 25101d8e282d..25537964a793 100644 --- a/pangocairo/sys/versions.txt +++ b/pangocairo/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 19e8a2f15e0e) +Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) From e9cf5499b636f6d7398887f44ab17e1a27d02137 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 20 May 2025 09:22:04 +0000 Subject: [PATCH 03/11] Update gir-files --- gir-files | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gir-files b/gir-files index be4559caec2b..5262e0fefdc7 160000 --- a/gir-files +++ b/gir-files @@ -1 +1 @@ -Subproject commit be4559caec2b8c8a7ad098669486da174838c796 +Subproject commit 5262e0fefdc77120e81e62fe32257a84f11a64bf From 5e8cc5e0fdabbd597baa6babc789c258d042abf9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 20 May 2025 09:22:09 +0000 Subject: [PATCH 04/11] Regenerate with latest gir-files --- gdk-pixbuf/src/auto/versions.txt | 2 +- gdk-pixbuf/sys/versions.txt | 2 +- gio/src/auto/versions.txt | 2 +- gio/src/auto/zlib_compressor.rs | 43 +++++++ gio/sys/src/lib.rs | 6 + gio/sys/versions.txt | 2 +- glib/gobject-sys/versions.txt | 2 +- glib/src/auto/source.rs | 7 ++ glib/src/auto/versions.txt | 2 +- glib/sys/src/lib.rs | 3 + glib/sys/versions.txt | 2 +- graphene/src/auto/box_.rs | 42 ++++++- graphene/src/auto/euler.rs | 7 +- graphene/src/auto/frustum.rs | 22 +++- graphene/src/auto/matrix.rs | 51 +++++--- graphene/src/auto/plane.rs | 7 +- graphene/src/auto/point.rs | 22 +++- graphene/src/auto/point3_d.rs | 15 ++- graphene/src/auto/quad.rs | 7 +- graphene/src/auto/quaternion.rs | 7 +- graphene/src/auto/ray.rs | 28 ++++- graphene/src/auto/rect.rs | 25 +++- graphene/src/auto/size.rs | 7 +- graphene/src/auto/sphere.rs | 14 ++- graphene/src/auto/triangle.rs | 22 +++- graphene/src/auto/vec2.rs | 15 ++- graphene/src/auto/vec3.rs | 15 ++- graphene/src/auto/vec4.rs | 15 ++- graphene/src/auto/versions.txt | 2 +- graphene/sys/Cargo.toml | 4 + graphene/sys/src/lib.rs | 204 +++++++++++++++++++++++++++++++ graphene/sys/tests/abi.rs | 7 ++ graphene/sys/tests/layout.c | 1 + graphene/sys/versions.txt | 2 +- pango/src/auto/versions.txt | 2 +- pango/sys/versions.txt | 2 +- pangocairo/src/auto/versions.txt | 2 +- pangocairo/sys/versions.txt | 2 +- 38 files changed, 553 insertions(+), 69 deletions(-) diff --git a/gdk-pixbuf/src/auto/versions.txt b/gdk-pixbuf/src/auto/versions.txt index 25537964a793..fce0e9db0e63 100644 --- a/gdk-pixbuf/src/auto/versions.txt +++ b/gdk-pixbuf/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) -from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) +from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/gdk-pixbuf/sys/versions.txt b/gdk-pixbuf/sys/versions.txt index 25537964a793..fce0e9db0e63 100644 --- a/gdk-pixbuf/sys/versions.txt +++ b/gdk-pixbuf/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) -from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) +from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/gio/src/auto/versions.txt b/gio/src/auto/versions.txt index 25537964a793..fce0e9db0e63 100644 --- a/gio/src/auto/versions.txt +++ b/gio/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) -from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) +from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/gio/src/auto/zlib_compressor.rs b/gio/src/auto/zlib_compressor.rs index ebac20abd7f5..f4e722c8850e 100644 --- a/gio/src/auto/zlib_compressor.rs +++ b/gio/src/auto/zlib_compressor.rs @@ -32,6 +32,14 @@ impl ZlibCompressor { unsafe { from_glib_none(ffi::g_zlib_compressor_get_file_info(self.to_glib_none().0)) } } + #[cfg(feature = "v2_86")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))] + #[doc(alias = "g_zlib_compressor_get_os")] + #[doc(alias = "get_os")] + pub fn os(&self) -> i32 { + unsafe { ffi::g_zlib_compressor_get_os(self.to_glib_none().0) } + } + #[doc(alias = "g_zlib_compressor_set_file_info")] #[doc(alias = "file-info")] pub fn set_file_info(&self, file_info: Option<&FileInfo>) { @@ -40,6 +48,16 @@ impl ZlibCompressor { } } + #[cfg(feature = "v2_86")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))] + #[doc(alias = "g_zlib_compressor_set_os")] + #[doc(alias = "os")] + pub fn set_os(&self, os: i32) { + unsafe { + ffi::g_zlib_compressor_set_os(self.to_glib_none().0, os); + } + } + pub fn format(&self) -> ZlibCompressorFormat { ObjectExt::property(self, "format") } @@ -70,4 +88,29 @@ impl ZlibCompressor { ) } } + + #[cfg(feature = "v2_86")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))] + #[doc(alias = "os")] + pub fn connect_os_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_os_trampoline( + this: *mut ffi::GZlibCompressor, + _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::os".as_ptr() as *const _, + Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( + notify_os_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } } diff --git a/gio/sys/src/lib.rs b/gio/sys/src/lib.rs index 34ca7b92631a..9a7cf7a10660 100644 --- a/gio/sys/src/lib.rs +++ b/gio/sys/src/lib.rs @@ -15040,10 +15040,16 @@ extern "C" { level: c_int, ) -> *mut GZlibCompressor; pub fn g_zlib_compressor_get_file_info(compressor: *mut GZlibCompressor) -> *mut GFileInfo; + #[cfg(feature = "v2_86")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))] + pub fn g_zlib_compressor_get_os(compressor: *mut GZlibCompressor) -> c_int; pub fn g_zlib_compressor_set_file_info( compressor: *mut GZlibCompressor, file_info: *mut GFileInfo, ); + #[cfg(feature = "v2_86")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))] + pub fn g_zlib_compressor_set_os(compressor: *mut GZlibCompressor, os: c_int); //========================================================================= // GZlibDecompressor diff --git a/gio/sys/versions.txt b/gio/sys/versions.txt index 25537964a793..fce0e9db0e63 100644 --- a/gio/sys/versions.txt +++ b/gio/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) -from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) +from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/glib/gobject-sys/versions.txt b/glib/gobject-sys/versions.txt index 25537964a793..fce0e9db0e63 100644 --- a/glib/gobject-sys/versions.txt +++ b/glib/gobject-sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) -from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) +from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/glib/src/auto/source.rs b/glib/src/auto/source.rs index 62b8f64ab57c..efb80951ff44 100644 --- a/glib/src/auto/source.rs +++ b/glib/src/auto/source.rs @@ -45,6 +45,13 @@ impl Source { } } + #[cfg(feature = "v2_86")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))] + #[doc(alias = "g_source_dup_context")] + pub fn dup_context(&self) -> Option { + unsafe { from_glib_full(ffi::g_source_dup_context(self.to_glib_none().0)) } + } + #[doc(alias = "g_source_get_can_recurse")] #[doc(alias = "get_can_recurse")] pub fn can_recurse(&self) -> bool { diff --git a/glib/src/auto/versions.txt b/glib/src/auto/versions.txt index 25537964a793..fce0e9db0e63 100644 --- a/glib/src/auto/versions.txt +++ b/glib/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) -from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) +from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/glib/sys/src/lib.rs b/glib/sys/src/lib.rs index 2bf7a9b665f5..4cf6c049fa71 100644 --- a/glib/sys/src/lib.rs +++ b/glib/sys/src/lib.rs @@ -5147,6 +5147,9 @@ extern "C" { pub fn g_source_add_unix_fd(source: *mut GSource, fd: c_int, events: GIOCondition) -> gpointer; pub fn g_source_attach(source: *mut GSource, context: *mut GMainContext) -> c_uint; pub fn g_source_destroy(source: *mut GSource); + #[cfg(feature = "v2_86")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))] + pub fn g_source_dup_context(source: *mut GSource) -> *mut GMainContext; pub fn g_source_get_can_recurse(source: *mut GSource) -> gboolean; pub fn g_source_get_context(source: *mut GSource) -> *mut GMainContext; pub fn g_source_get_current_time(source: *mut GSource, timeval: *mut GTimeVal); diff --git a/glib/sys/versions.txt b/glib/sys/versions.txt index 25537964a793..fce0e9db0e63 100644 --- a/glib/sys/versions.txt +++ b/glib/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) -from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) +from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/graphene/src/auto/box_.rs b/graphene/src/auto/box_.rs index dd166c992a26..e81a3af5e55d 100644 --- a/graphene/src/auto/box_.rs +++ b/graphene/src/auto/box_.rs @@ -18,17 +18,32 @@ glib::wrapper! { impl Box { #[doc(alias = "graphene_box_contains_box")] pub fn contains_box(&self, b: &Box) -> bool { - unsafe { ffi::graphene_box_contains_box(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_box_contains_box( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_box_contains_point")] pub fn contains_point(&self, point: &Point3D) -> bool { - unsafe { ffi::graphene_box_contains_point(self.to_glib_none().0, point.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_box_contains_point( + self.to_glib_none().0, + point.to_glib_none().0, + )) + } } #[doc(alias = "graphene_box_equal")] fn equal(&self, b: &Box) -> bool { - unsafe { ffi::graphene_box_equal(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_box_equal( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_box_expand")] @@ -128,6 +143,23 @@ impl Box { } } + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + #[doc(alias = "graphene_box_get_minmax")] + #[doc(alias = "get_minmax")] + pub fn minmax(&self) -> (Point3D, Point3D) { + unsafe { + let mut min = Point3D::uninitialized(); + let mut max = Point3D::uninitialized(); + ffi::graphene_box_get_minmax( + self.to_glib_none().0, + min.to_glib_none_mut().0, + max.to_glib_none_mut().0, + ); + (min, max) + } + } + #[doc(alias = "graphene_box_get_size")] #[doc(alias = "get_size")] pub fn size(&self) -> Vec3 { @@ -148,11 +180,11 @@ impl Box { pub fn intersection(&self, b: &Box) -> Option { unsafe { let mut res = Box::uninitialized(); - let ret = ffi::graphene_box_intersection( + let ret = from_glib(ffi::graphene_box_intersection( self.to_glib_none().0, b.to_glib_none().0, res.to_glib_none_mut().0, - ); + )); if ret { Some(res) } else { diff --git a/graphene/src/auto/euler.rs b/graphene/src/auto/euler.rs index ae4210df7be8..3ee61bb6b073 100644 --- a/graphene/src/auto/euler.rs +++ b/graphene/src/auto/euler.rs @@ -18,7 +18,12 @@ glib::wrapper! { impl Euler { #[doc(alias = "graphene_euler_equal")] fn equal(&self, b: &Euler) -> bool { - unsafe { ffi::graphene_euler_equal(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_euler_equal( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_euler_get_alpha")] diff --git a/graphene/src/auto/frustum.rs b/graphene/src/auto/frustum.rs index 2bf2c8489290..88d7b57eeb42 100644 --- a/graphene/src/auto/frustum.rs +++ b/graphene/src/auto/frustum.rs @@ -19,26 +19,40 @@ impl Frustum { #[doc(alias = "graphene_frustum_contains_point")] pub fn contains_point(&self, point: &Point3D) -> bool { unsafe { - ffi::graphene_frustum_contains_point(self.to_glib_none().0, point.to_glib_none().0) + from_glib(ffi::graphene_frustum_contains_point( + self.to_glib_none().0, + point.to_glib_none().0, + )) } } #[doc(alias = "graphene_frustum_equal")] fn equal(&self, b: &Frustum) -> bool { - unsafe { ffi::graphene_frustum_equal(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_frustum_equal( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_frustum_intersects_box")] pub fn intersects_box(&self, box_: &Box) -> bool { unsafe { - ffi::graphene_frustum_intersects_box(self.to_glib_none().0, box_.to_glib_none().0) + from_glib(ffi::graphene_frustum_intersects_box( + self.to_glib_none().0, + box_.to_glib_none().0, + )) } } #[doc(alias = "graphene_frustum_intersects_sphere")] pub fn intersects_sphere(&self, sphere: &Sphere) -> bool { unsafe { - ffi::graphene_frustum_intersects_sphere(self.to_glib_none().0, sphere.to_glib_none().0) + from_glib(ffi::graphene_frustum_intersects_sphere( + self.to_glib_none().0, + sphere.to_glib_none().0, + )) } } } diff --git a/graphene/src/auto/matrix.rs b/graphene/src/auto/matrix.rs index 679e711b00bf..82233bf327b5 100644 --- a/graphene/src/auto/matrix.rs +++ b/graphene/src/auto/matrix.rs @@ -24,14 +24,14 @@ impl Matrix { let mut rotate = Quaternion::uninitialized(); let mut shear = Vec3::uninitialized(); let mut perspective = Vec4::uninitialized(); - let ret = ffi::graphene_matrix_decompose( + let ret = from_glib(ffi::graphene_matrix_decompose( self.to_glib_none().0, translate.to_glib_none_mut().0, scale.to_glib_none_mut().0, rotate.to_glib_none_mut().0, shear.to_glib_none_mut().0, perspective.to_glib_none_mut().0, - ); + )); if ret { Some((translate, scale, rotate, shear, perspective)) } else { @@ -47,12 +47,22 @@ impl Matrix { #[doc(alias = "graphene_matrix_equal")] fn equal(&self, b: &Matrix) -> bool { - unsafe { ffi::graphene_matrix_equal(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_matrix_equal( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_matrix_equal_fast")] pub fn equal_fast(&self, b: &Matrix) -> bool { - unsafe { ffi::graphene_matrix_equal_fast(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_matrix_equal_fast( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_matrix_get_row")] @@ -126,7 +136,10 @@ impl Matrix { pub fn inverse(&self) -> Option { unsafe { let mut res = Matrix::uninitialized(); - let ret = ffi::graphene_matrix_inverse(self.to_glib_none().0, res.to_glib_none_mut().0); + let ret = from_glib(ffi::graphene_matrix_inverse( + self.to_glib_none().0, + res.to_glib_none_mut().0, + )); if ret { Some(res) } else { @@ -137,22 +150,26 @@ impl Matrix { #[doc(alias = "graphene_matrix_is_2d")] pub fn is_2d(&self) -> bool { - unsafe { ffi::graphene_matrix_is_2d(self.to_glib_none().0) } + unsafe { from_glib(ffi::graphene_matrix_is_2d(self.to_glib_none().0)) } } #[doc(alias = "graphene_matrix_is_backface_visible")] pub fn is_backface_visible(&self) -> bool { - unsafe { ffi::graphene_matrix_is_backface_visible(self.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_matrix_is_backface_visible( + self.to_glib_none().0, + )) + } } #[doc(alias = "graphene_matrix_is_identity")] pub fn is_identity(&self) -> bool { - unsafe { ffi::graphene_matrix_is_identity(self.to_glib_none().0) } + unsafe { from_glib(ffi::graphene_matrix_is_identity(self.to_glib_none().0)) } } #[doc(alias = "graphene_matrix_is_singular")] pub fn is_singular(&self) -> bool { - unsafe { ffi::graphene_matrix_is_singular(self.to_glib_none().0) } + unsafe { from_glib(ffi::graphene_matrix_is_singular(self.to_glib_none().0)) } } #[doc(alias = "graphene_matrix_multiply")] @@ -171,7 +188,13 @@ impl Matrix { #[doc(alias = "graphene_matrix_near")] pub fn near(&self, b: &Matrix, epsilon: f32) -> bool { - unsafe { ffi::graphene_matrix_near(self.to_glib_none().0, b.to_glib_none().0, epsilon) } + unsafe { + from_glib(ffi::graphene_matrix_near( + self.to_glib_none().0, + b.to_glib_none().0, + epsilon, + )) + } } #[doc(alias = "graphene_matrix_normalize")] @@ -323,7 +346,7 @@ impl Matrix { let mut yy = std::mem::MaybeUninit::uninit(); let mut x_0 = std::mem::MaybeUninit::uninit(); let mut y_0 = std::mem::MaybeUninit::uninit(); - let ret = ffi::graphene_matrix_to_2d( + let ret = from_glib(ffi::graphene_matrix_to_2d( self.to_glib_none().0, xx.as_mut_ptr(), yx.as_mut_ptr(), @@ -331,7 +354,7 @@ impl Matrix { yy.as_mut_ptr(), x_0.as_mut_ptr(), y_0.as_mut_ptr(), - ); + )); if ret { Some(( xx.assume_init(), @@ -513,12 +536,12 @@ impl Matrix { pub fn untransform_point(&self, p: &Point, bounds: &Rect) -> Option { unsafe { let mut res = Point::uninitialized(); - let ret = ffi::graphene_matrix_untransform_point( + let ret = from_glib(ffi::graphene_matrix_untransform_point( self.to_glib_none().0, p.to_glib_none().0, bounds.to_glib_none().0, res.to_glib_none_mut().0, - ); + )); if ret { Some(res) } else { diff --git a/graphene/src/auto/plane.rs b/graphene/src/auto/plane.rs index 503989f5ef7e..147d444170e4 100644 --- a/graphene/src/auto/plane.rs +++ b/graphene/src/auto/plane.rs @@ -23,7 +23,12 @@ impl Plane { #[doc(alias = "graphene_plane_equal")] fn equal(&self, b: &Plane) -> bool { - unsafe { ffi::graphene_plane_equal(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_plane_equal( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_plane_get_constant")] diff --git a/graphene/src/auto/point.rs b/graphene/src/auto/point.rs index f9c3085af9f2..613d91b9b9b5 100644 --- a/graphene/src/auto/point.rs +++ b/graphene/src/auto/point.rs @@ -31,9 +31,21 @@ impl Point { } } + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + #[doc(alias = "graphene_point_distance_squared")] + pub fn distance_squared(&self, b: &Point) -> f32 { + unsafe { ffi::graphene_point_distance_squared(self.to_glib_none().0, b.to_glib_none().0) } + } + #[doc(alias = "graphene_point_equal")] fn equal(&self, b: &Point) -> bool { - unsafe { ffi::graphene_point_equal(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_point_equal( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_point_interpolate")] @@ -53,7 +65,13 @@ impl Point { #[doc(alias = "graphene_point_near")] pub fn near(&self, b: &Point, epsilon: f32) -> bool { - unsafe { ffi::graphene_point_near(self.to_glib_none().0, b.to_glib_none().0, epsilon) } + unsafe { + from_glib(ffi::graphene_point_near( + self.to_glib_none().0, + b.to_glib_none().0, + epsilon, + )) + } } #[doc(alias = "graphene_point_to_vec2")] diff --git a/graphene/src/auto/point3_d.rs b/graphene/src/auto/point3_d.rs index e29cf6af7926..5736aa7d1fb3 100644 --- a/graphene/src/auto/point3_d.rs +++ b/graphene/src/auto/point3_d.rs @@ -50,7 +50,12 @@ impl Point3D { #[doc(alias = "graphene_point3d_equal")] fn equal(&self, b: &Point3D) -> bool { - unsafe { ffi::graphene_point3d_equal(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_point3d_equal( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_point3d_interpolate")] @@ -75,7 +80,13 @@ impl Point3D { #[doc(alias = "graphene_point3d_near")] pub fn near(&self, b: &Point3D, epsilon: f32) -> bool { - unsafe { ffi::graphene_point3d_near(self.to_glib_none().0, b.to_glib_none().0, epsilon) } + unsafe { + from_glib(ffi::graphene_point3d_near( + self.to_glib_none().0, + b.to_glib_none().0, + epsilon, + )) + } } #[doc(alias = "graphene_point3d_normalize")] diff --git a/graphene/src/auto/quad.rs b/graphene/src/auto/quad.rs index b5400b765350..a4a8915710f0 100644 --- a/graphene/src/auto/quad.rs +++ b/graphene/src/auto/quad.rs @@ -27,6 +27,11 @@ impl Quad { #[doc(alias = "graphene_quad_contains")] pub fn contains(&self, p: &Point) -> bool { - unsafe { ffi::graphene_quad_contains(self.to_glib_none().0, p.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_quad_contains( + self.to_glib_none().0, + p.to_glib_none().0, + )) + } } } diff --git a/graphene/src/auto/quaternion.rs b/graphene/src/auto/quaternion.rs index bfe8634f97d4..1c8bd9f633ce 100644 --- a/graphene/src/auto/quaternion.rs +++ b/graphene/src/auto/quaternion.rs @@ -37,7 +37,12 @@ impl Quaternion { #[doc(alias = "graphene_quaternion_equal")] fn equal(&self, b: &Quaternion) -> bool { - unsafe { ffi::graphene_quaternion_equal(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_quaternion_equal( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_quaternion_invert")] diff --git a/graphene/src/auto/ray.rs b/graphene/src/auto/ray.rs index 1fa2acafb62f..b17b05f2568f 100644 --- a/graphene/src/auto/ray.rs +++ b/graphene/src/auto/ray.rs @@ -18,7 +18,12 @@ glib::wrapper! { impl Ray { #[doc(alias = "graphene_ray_equal")] fn equal(&self, b: &Ray) -> bool { - unsafe { ffi::graphene_ray_equal(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_ray_equal( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_ray_get_closest_point_to_point")] @@ -126,17 +131,32 @@ impl Ray { #[doc(alias = "graphene_ray_intersects_box")] pub fn intersects_box(&self, b: &Box) -> bool { - unsafe { ffi::graphene_ray_intersects_box(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_ray_intersects_box( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_ray_intersects_sphere")] pub fn intersects_sphere(&self, s: &Sphere) -> bool { - unsafe { ffi::graphene_ray_intersects_sphere(self.to_glib_none().0, s.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_ray_intersects_sphere( + self.to_glib_none().0, + s.to_glib_none().0, + )) + } } #[doc(alias = "graphene_ray_intersects_triangle")] pub fn intersects_triangle(&self, t: &Triangle) -> bool { - unsafe { ffi::graphene_ray_intersects_triangle(self.to_glib_none().0, t.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_ray_intersects_triangle( + self.to_glib_none().0, + t.to_glib_none().0, + )) + } } } diff --git a/graphene/src/auto/rect.rs b/graphene/src/auto/rect.rs index bb817263b163..c3749dc85699 100644 --- a/graphene/src/auto/rect.rs +++ b/graphene/src/auto/rect.rs @@ -18,17 +18,32 @@ glib::wrapper! { impl Rect { #[doc(alias = "graphene_rect_contains_point")] pub fn contains_point(&self, p: &Point) -> bool { - unsafe { ffi::graphene_rect_contains_point(self.to_glib_none().0, p.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_rect_contains_point( + self.to_glib_none().0, + p.to_glib_none().0, + )) + } } #[doc(alias = "graphene_rect_contains_rect")] pub fn contains_rect(&self, b: &Rect) -> bool { - unsafe { ffi::graphene_rect_contains_rect(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_rect_contains_rect( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_rect_equal")] fn equal(&self, b: &Rect) -> bool { - unsafe { ffi::graphene_rect_equal(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_rect_equal( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_rect_expand")] @@ -161,11 +176,11 @@ impl Rect { pub fn intersection(&self, b: &Rect) -> Option { unsafe { let mut res = Rect::uninitialized(); - let ret = ffi::graphene_rect_intersection( + let ret = from_glib(ffi::graphene_rect_intersection( self.to_glib_none().0, b.to_glib_none().0, res.to_glib_none_mut().0, - ); + )); if ret { Some(res) } else { diff --git a/graphene/src/auto/size.rs b/graphene/src/auto/size.rs index 44d9a5f7374f..254f9b2e45e4 100644 --- a/graphene/src/auto/size.rs +++ b/graphene/src/auto/size.rs @@ -18,7 +18,12 @@ glib::wrapper! { impl Size { #[doc(alias = "graphene_size_equal")] fn equal(&self, b: &Size) -> bool { - unsafe { ffi::graphene_size_equal(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_size_equal( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_size_interpolate")] diff --git a/graphene/src/auto/sphere.rs b/graphene/src/auto/sphere.rs index 68dd08245eef..a651fb027199 100644 --- a/graphene/src/auto/sphere.rs +++ b/graphene/src/auto/sphere.rs @@ -19,7 +19,10 @@ impl Sphere { #[doc(alias = "graphene_sphere_contains_point")] pub fn contains_point(&self, point: &Point3D) -> bool { unsafe { - ffi::graphene_sphere_contains_point(self.to_glib_none().0, point.to_glib_none().0) + from_glib(ffi::graphene_sphere_contains_point( + self.to_glib_none().0, + point.to_glib_none().0, + )) } } @@ -30,7 +33,12 @@ impl Sphere { #[doc(alias = "graphene_sphere_equal")] fn equal(&self, b: &Sphere) -> bool { - unsafe { ffi::graphene_sphere_equal(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_sphere_equal( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_sphere_get_bounding_box")] @@ -61,7 +69,7 @@ impl Sphere { #[doc(alias = "graphene_sphere_is_empty")] pub fn is_empty(&self) -> bool { - unsafe { ffi::graphene_sphere_is_empty(self.to_glib_none().0) } + unsafe { from_glib(ffi::graphene_sphere_is_empty(self.to_glib_none().0)) } } #[doc(alias = "graphene_sphere_translate")] diff --git a/graphene/src/auto/triangle.rs b/graphene/src/auto/triangle.rs index f5f4433d73ec..6064880cb126 100644 --- a/graphene/src/auto/triangle.rs +++ b/graphene/src/auto/triangle.rs @@ -18,12 +18,22 @@ glib::wrapper! { impl Triangle { #[doc(alias = "graphene_triangle_contains_point")] pub fn contains_point(&self, p: &Point3D) -> bool { - unsafe { ffi::graphene_triangle_contains_point(self.to_glib_none().0, p.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_triangle_contains_point( + self.to_glib_none().0, + p.to_glib_none().0, + )) + } } #[doc(alias = "graphene_triangle_equal")] fn equal(&self, b: &Triangle) -> bool { - unsafe { ffi::graphene_triangle_equal(self.to_glib_none().0, b.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_triangle_equal( + self.to_glib_none().0, + b.to_glib_none().0, + )) + } } #[doc(alias = "graphene_triangle_get_area")] @@ -37,11 +47,11 @@ impl Triangle { pub fn barycoords(&self, p: Option<&Point3D>) -> Option { unsafe { let mut res = Vec2::uninitialized(); - let ret = ffi::graphene_triangle_get_barycoords( + let ret = from_glib(ffi::graphene_triangle_get_barycoords( self.to_glib_none().0, p.to_glib_none().0, res.to_glib_none_mut().0, - ); + )); if ret { Some(res) } else { @@ -115,14 +125,14 @@ impl Triangle { pub fn uv(&self, p: Option<&Point3D>, uv_a: &Vec2, uv_b: &Vec2, uv_c: &Vec2) -> Option { unsafe { let mut res = Vec2::uninitialized(); - let ret = ffi::graphene_triangle_get_uv( + let ret = from_glib(ffi::graphene_triangle_get_uv( self.to_glib_none().0, p.to_glib_none().0, uv_a.to_glib_none().0, uv_b.to_glib_none().0, uv_c.to_glib_none().0, res.to_glib_none_mut().0, - ); + )); if ret { Some(res) } else { diff --git a/graphene/src/auto/vec2.rs b/graphene/src/auto/vec2.rs index c97ea099601e..51a912d54921 100644 --- a/graphene/src/auto/vec2.rs +++ b/graphene/src/auto/vec2.rs @@ -51,7 +51,12 @@ impl Vec2 { #[doc(alias = "graphene_vec2_equal")] fn equal(&self, v2: &Vec2) -> bool { - unsafe { ffi::graphene_vec2_equal(self.to_glib_none().0, v2.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_vec2_equal( + self.to_glib_none().0, + v2.to_glib_none().0, + )) + } } #[doc(alias = "graphene_vec2_get_x")] @@ -130,7 +135,13 @@ impl Vec2 { #[doc(alias = "graphene_vec2_near")] pub fn near(&self, v2: &Vec2, epsilon: f32) -> bool { - unsafe { ffi::graphene_vec2_near(self.to_glib_none().0, v2.to_glib_none().0, epsilon) } + unsafe { + from_glib(ffi::graphene_vec2_near( + self.to_glib_none().0, + v2.to_glib_none().0, + epsilon, + )) + } } #[doc(alias = "graphene_vec2_negate")] diff --git a/graphene/src/auto/vec3.rs b/graphene/src/auto/vec3.rs index 29443b50efe8..907be9f4534e 100644 --- a/graphene/src/auto/vec3.rs +++ b/graphene/src/auto/vec3.rs @@ -65,7 +65,12 @@ impl Vec3 { #[doc(alias = "graphene_vec3_equal")] fn equal(&self, v2: &Vec3) -> bool { - unsafe { ffi::graphene_vec3_equal(self.to_glib_none().0, v2.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_vec3_equal( + self.to_glib_none().0, + v2.to_glib_none().0, + )) + } } #[doc(alias = "graphene_vec3_get_x")] @@ -201,7 +206,13 @@ impl Vec3 { #[doc(alias = "graphene_vec3_near")] pub fn near(&self, v2: &Vec3, epsilon: f32) -> bool { - unsafe { ffi::graphene_vec3_near(self.to_glib_none().0, v2.to_glib_none().0, epsilon) } + unsafe { + from_glib(ffi::graphene_vec3_near( + self.to_glib_none().0, + v2.to_glib_none().0, + epsilon, + )) + } } #[doc(alias = "graphene_vec3_negate")] diff --git a/graphene/src/auto/vec4.rs b/graphene/src/auto/vec4.rs index 7f96dd6c14f9..749e064c3bc1 100644 --- a/graphene/src/auto/vec4.rs +++ b/graphene/src/auto/vec4.rs @@ -51,7 +51,12 @@ impl Vec4 { #[doc(alias = "graphene_vec4_equal")] fn equal(&self, v2: &Vec4) -> bool { - unsafe { ffi::graphene_vec4_equal(self.to_glib_none().0, v2.to_glib_none().0) } + unsafe { + from_glib(ffi::graphene_vec4_equal( + self.to_glib_none().0, + v2.to_glib_none().0, + )) + } } #[doc(alias = "graphene_vec4_get_w")] @@ -162,7 +167,13 @@ impl Vec4 { #[doc(alias = "graphene_vec4_near")] pub fn near(&self, v2: &Vec4, epsilon: f32) -> bool { - unsafe { ffi::graphene_vec4_near(self.to_glib_none().0, v2.to_glib_none().0, epsilon) } + unsafe { + from_glib(ffi::graphene_vec4_near( + self.to_glib_none().0, + v2.to_glib_none().0, + epsilon, + )) + } } #[doc(alias = "graphene_vec4_negate")] diff --git a/graphene/src/auto/versions.txt b/graphene/src/auto/versions.txt index 25537964a793..fce0e9db0e63 100644 --- a/graphene/src/auto/versions.txt +++ b/graphene/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) -from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) +from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/graphene/sys/Cargo.toml b/graphene/sys/Cargo.toml index b0b444ad9245..70135a2d00f5 100644 --- a/graphene/sys/Cargo.toml +++ b/graphene/sys/Cargo.toml @@ -49,9 +49,13 @@ workspace = true name = "graphene-gobject-1.0" version = "1.10" +[package.metadata.system-deps.graphene_gobject_1_0.v1_12] +version = "1.12" + [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] all-features = true [features] +v1_12 = [] diff --git a/graphene/sys/src/lib.rs b/graphene/sys/src/lib.rs index 9a4a9abe3b52..2b64ad7e78cc 100644 --- a/graphene/sys/src/lib.rs +++ b/graphene/sys/src/lib.rs @@ -71,6 +71,19 @@ pub const GRAPHENE_VEC3_LEN: c_int = 3; pub const GRAPHENE_VEC4_LEN: c_int = 4; // Records +#[derive(Copy, Clone)] +#[repr(C)] +pub struct graphene_box2d_t { + pub minmax: graphene_vec4_t, +} + +impl ::std::fmt::Debug for graphene_box2d_t { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("graphene_box2d_t @ {self:p}")) + .finish() + } +} + #[derive(Copy, Clone)] #[repr(C)] pub struct graphene_box_t { @@ -356,6 +369,184 @@ impl ::std::fmt::Debug for graphene_vec4_t { extern "C" { + //========================================================================= + // graphene_box2d_t + //========================================================================= + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_get_type() -> GType; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_alloc() -> *mut graphene_box2d_t; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_contains_box( + a: *const graphene_box2d_t, + b: *const graphene_box2d_t, + ) -> bool; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_contains_point( + box_: *const graphene_box2d_t, + point: *const graphene_point_t, + ) -> bool; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_contains_rect( + box_: *const graphene_box2d_t, + rect: *const graphene_rect_t, + ) -> bool; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_equal(a: *const graphene_box2d_t, b: *const graphene_box2d_t) -> bool; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_expand( + box_: *const graphene_box2d_t, + point: *const graphene_point_t, + res: *mut graphene_box2d_t, + ); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_expand_scalar( + box_: *const graphene_box2d_t, + scalar: c_float, + res: *mut graphene_box2d_t, + ); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_expand_vec2( + box_: *const graphene_box2d_t, + vec: *const graphene_vec2_t, + res: *mut graphene_box2d_t, + ); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_free(box_: *mut graphene_box2d_t); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_get_center(box_: *const graphene_box2d_t, center: *mut graphene_point_t); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_get_height(box_: *const graphene_box2d_t) -> c_float; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_get_max(box_: *const graphene_box2d_t, max: *mut graphene_point_t); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_get_min(box_: *const graphene_box2d_t, min: *mut graphene_point_t); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_get_minmax( + box_: *const graphene_box2d_t, + min: *mut graphene_point_t, + max: *mut graphene_point_t, + ); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_get_size(box_: *const graphene_box2d_t, size: *mut graphene_vec2_t); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_get_vertices( + box_: *const graphene_box2d_t, + vertices: *mut [graphene_vec2_t; 4], + ); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_get_width(box_: *const graphene_box2d_t) -> c_float; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_init( + box_: *mut graphene_box2d_t, + min: *const graphene_point_t, + max: *const graphene_point_t, + ) -> *mut graphene_box2d_t; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_init_from_box( + box_: *mut graphene_box2d_t, + src: *const graphene_box2d_t, + ) -> *mut graphene_box2d_t; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_init_from_points( + box_: *mut graphene_box2d_t, + n_points: c_uint, + points: *const graphene_point_t, + ) -> *mut graphene_box2d_t; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_init_from_rect( + box_: *mut graphene_box2d_t, + src: *const graphene_rect_t, + ) -> *mut graphene_box2d_t; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_init_from_vec2( + box_: *mut graphene_box2d_t, + min: *const graphene_vec2_t, + max: *const graphene_vec2_t, + ) -> *mut graphene_box2d_t; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_init_from_vectors( + box_: *mut graphene_box2d_t, + n_vectors: c_uint, + vectors: *const graphene_vec2_t, + ) -> *mut graphene_box2d_t; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_intersection( + a: *const graphene_box2d_t, + b: *const graphene_box2d_t, + res: *mut graphene_box2d_t, + ) -> bool; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_intersects( + a: *const graphene_box2d_t, + b: *const graphene_box2d_t, + ) -> bool; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_scale_offset( + box_: *const graphene_box2d_t, + scale: *const graphene_vec2_t, + offset: *const graphene_point_t, + res: *mut graphene_box2d_t, + ); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_to_float(box_: *const graphene_box2d_t, v: *mut [c_float; 4]); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_to_rect(box_: *const graphene_box2d_t, rect: *mut graphene_rect_t); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_union( + a: *const graphene_box2d_t, + b: *const graphene_box2d_t, + res: *mut graphene_box2d_t, + ); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_empty() -> *const graphene_box2d_t; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_infinite() -> *const graphene_box2d_t; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_minus_one() -> *const graphene_box2d_t; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_one() -> *const graphene_box2d_t; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_one_minus_one() -> *const graphene_box2d_t; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box2d_zero() -> *const graphene_box2d_t; + //========================================================================= // graphene_box_t //========================================================================= @@ -392,6 +583,13 @@ extern "C" { pub fn graphene_box_get_height(box_: *const graphene_box_t) -> c_float; pub fn graphene_box_get_max(box_: *const graphene_box_t, max: *mut graphene_point3d_t); pub fn graphene_box_get_min(box_: *const graphene_box_t, min: *mut graphene_point3d_t); + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_box_get_minmax( + box_: *const graphene_box_t, + min: *mut graphene_point3d_t, + max: *mut graphene_point3d_t, + ); pub fn graphene_box_get_size(box_: *const graphene_box_t, size: *mut graphene_vec3_t); pub fn graphene_box_get_vertices( box_: *const graphene_box_t, @@ -927,6 +1125,12 @@ extern "C" { d_x: *mut c_float, d_y: *mut c_float, ) -> c_float; + #[cfg(feature = "v1_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] + pub fn graphene_point_distance_squared( + a: *const graphene_point_t, + b: *const graphene_point_t, + ) -> c_float; pub fn graphene_point_equal(a: *const graphene_point_t, b: *const graphene_point_t) -> bool; pub fn graphene_point_free(p: *mut graphene_point_t); pub fn graphene_point_init( diff --git a/graphene/sys/tests/abi.rs b/graphene/sys/tests/abi.rs index 754bc592a282..82e22ed129d1 100644 --- a/graphene/sys/tests/abi.rs +++ b/graphene/sys/tests/abi.rs @@ -201,6 +201,13 @@ fn get_c_output(name: &str) -> Result> { } const RUST_LAYOUTS: &[(&str, Layout)] = &[ + ( + "graphene_box2d_t", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "graphene_box_t", Layout { diff --git a/graphene/sys/tests/layout.c b/graphene/sys/tests/layout.c index 108cb5b2c5bd..88126d5d998a 100644 --- a/graphene/sys/tests/layout.c +++ b/graphene/sys/tests/layout.c @@ -7,6 +7,7 @@ #include int main() { + printf("%s;%zu;%zu\n", "graphene_box2d_t", sizeof(graphene_box2d_t), alignof(graphene_box2d_t)); printf("%s;%zu;%zu\n", "graphene_box_t", sizeof(graphene_box_t), alignof(graphene_box_t)); printf("%s;%zu;%zu\n", "graphene_euler_order_t", sizeof(graphene_euler_order_t), alignof(graphene_euler_order_t)); printf("%s;%zu;%zu\n", "graphene_euler_t", sizeof(graphene_euler_t), alignof(graphene_euler_t)); diff --git a/graphene/sys/versions.txt b/graphene/sys/versions.txt index 25537964a793..fce0e9db0e63 100644 --- a/graphene/sys/versions.txt +++ b/graphene/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) -from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) +from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/pango/src/auto/versions.txt b/pango/src/auto/versions.txt index 25537964a793..fce0e9db0e63 100644 --- a/pango/src/auto/versions.txt +++ b/pango/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) -from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) +from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/pango/sys/versions.txt b/pango/sys/versions.txt index 25537964a793..fce0e9db0e63 100644 --- a/pango/sys/versions.txt +++ b/pango/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) -from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) +from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/pangocairo/src/auto/versions.txt b/pangocairo/src/auto/versions.txt index 25537964a793..fce0e9db0e63 100644 --- a/pangocairo/src/auto/versions.txt +++ b/pangocairo/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) -from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) +from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/pangocairo/sys/versions.txt b/pangocairo/sys/versions.txt index 25537964a793..fce0e9db0e63 100644 --- a/pangocairo/sys/versions.txt +++ b/pangocairo/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) -from gir-files (https://github.com/gtk-rs/gir-files @ be4559caec2b) +from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) From 5bb19c324d4ddcd7e3fa4281981fc8594cda06a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 21 May 2025 13:03:23 +0300 Subject: [PATCH 05/11] Update gir --- gir | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gir b/gir index 1364a207b03e..b2a1c6f9b362 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit 1364a207b03eb2014a7346b557088c2bfe8cc9af +Subproject commit b2a1c6f9b3622c45e67af75479eaf640a8af0081 From 51353ec727530a716131a27cda725e64718ec0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 21 May 2025 13:06:58 +0300 Subject: [PATCH 06/11] glib: Manually implement `Source::context()` This conditionally uses the safe `dup_context()` with GLib 2.86 and otherwise the racy `get_context()` as before. --- glib/Gir.toml | 11 +++++++++++ glib/src/source.rs | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/glib/Gir.toml b/glib/Gir.toml index 2c32f533b932..f9bdbd0e8a0c 100644 --- a/glib/Gir.toml +++ b/glib/Gir.toml @@ -837,6 +837,17 @@ concurrency = "send+sync" # parameter type ignore = true + [[object.function]] + name = "dup_context" + # implemented as the normal getter + manual = true + + [[object.function]] + name = "get_context" + # implemented conditionally around this or + # dup_context() (see above) + manual = true + [[object]] name = "GLib.ThreadPool" status = "manual" diff --git a/glib/src/source.rs b/glib/src/source.rs index 45adfb38340c..b7702fa8d45a 100644 --- a/glib/src/source.rs +++ b/glib/src/source.rs @@ -1270,4 +1270,18 @@ impl Source { )) } } + + #[doc(alias = "g_source_get_context")] + #[doc(alias = "get_context")] + #[doc(alias = "g_source_dup_context")] + pub fn context(&self) -> Option { + #[cfg(feature = "v2_86")] + unsafe { + from_glib_full(ffi::g_source_dup_context(self.to_glib_none().0)) + } + #[cfg(not(feature = "v2_86"))] + unsafe { + from_glib_none(ffi::g_source_get_context(self.to_glib_none().0)) + } + } } From ea5ddf93e90b5f2ccb05a6f69d63cb9a8944075f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 21 May 2025 13:07:47 +0300 Subject: [PATCH 07/11] Regenerate with latest gir --- gdk-pixbuf/src/auto/versions.txt | 2 +- gdk-pixbuf/sys/versions.txt | 2 +- gio/src/auto/versions.txt | 2 +- gio/sys/versions.txt | 2 +- glib/gobject-sys/versions.txt | 2 +- glib/src/auto/source.rs | 15 +--------- glib/src/auto/versions.txt | 2 +- glib/sys/versions.txt | 2 +- graphene/src/auto/box_.rs | 25 ++++------------ graphene/src/auto/euler.rs | 7 +---- graphene/src/auto/frustum.rs | 22 +++----------- graphene/src/auto/matrix.rs | 51 +++++++++----------------------- graphene/src/auto/plane.rs | 7 +---- graphene/src/auto/point.rs | 15 ++-------- graphene/src/auto/point3_d.rs | 15 ++-------- graphene/src/auto/quad.rs | 7 +---- graphene/src/auto/quaternion.rs | 7 +---- graphene/src/auto/ray.rs | 28 +++--------------- graphene/src/auto/rect.rs | 25 ++++------------ graphene/src/auto/size.rs | 7 +---- graphene/src/auto/sphere.rs | 14 ++------- graphene/src/auto/triangle.rs | 22 ++++---------- graphene/src/auto/vec2.rs | 15 ++-------- graphene/src/auto/vec3.rs | 15 ++-------- graphene/src/auto/vec4.rs | 15 ++-------- graphene/src/auto/versions.txt | 2 +- graphene/sys/versions.txt | 2 +- pango/src/auto/versions.txt | 2 +- pango/sys/versions.txt | 2 +- pangocairo/src/auto/versions.txt | 2 +- pangocairo/sys/versions.txt | 2 +- 31 files changed, 70 insertions(+), 268 deletions(-) diff --git a/gdk-pixbuf/src/auto/versions.txt b/gdk-pixbuf/src/auto/versions.txt index fce0e9db0e63..d37007d58839 100644 --- a/gdk-pixbuf/src/auto/versions.txt +++ b/gdk-pixbuf/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) +Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/gdk-pixbuf/sys/versions.txt b/gdk-pixbuf/sys/versions.txt index fce0e9db0e63..d37007d58839 100644 --- a/gdk-pixbuf/sys/versions.txt +++ b/gdk-pixbuf/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) +Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/gio/src/auto/versions.txt b/gio/src/auto/versions.txt index fce0e9db0e63..d37007d58839 100644 --- a/gio/src/auto/versions.txt +++ b/gio/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) +Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/gio/sys/versions.txt b/gio/sys/versions.txt index fce0e9db0e63..d37007d58839 100644 --- a/gio/sys/versions.txt +++ b/gio/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) +Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/glib/gobject-sys/versions.txt b/glib/gobject-sys/versions.txt index fce0e9db0e63..d37007d58839 100644 --- a/glib/gobject-sys/versions.txt +++ b/glib/gobject-sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) +Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/glib/src/auto/source.rs b/glib/src/auto/source.rs index efb80951ff44..0be5459ff079 100644 --- a/glib/src/auto/source.rs +++ b/glib/src/auto/source.rs @@ -2,7 +2,7 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use crate::{ffi, translate::*, MainContext}; +use crate::{ffi, translate::*}; crate::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -45,25 +45,12 @@ impl Source { } } - #[cfg(feature = "v2_86")] - #[cfg_attr(docsrs, doc(cfg(feature = "v2_86")))] - #[doc(alias = "g_source_dup_context")] - pub fn dup_context(&self) -> Option { - unsafe { from_glib_full(ffi::g_source_dup_context(self.to_glib_none().0)) } - } - #[doc(alias = "g_source_get_can_recurse")] #[doc(alias = "get_can_recurse")] pub fn can_recurse(&self) -> bool { unsafe { from_glib(ffi::g_source_get_can_recurse(self.to_glib_none().0)) } } - #[doc(alias = "g_source_get_context")] - #[doc(alias = "get_context")] - pub fn context(&self) -> Option { - unsafe { from_glib_none(ffi::g_source_get_context(self.to_glib_none().0)) } - } - #[doc(alias = "g_source_get_name")] #[doc(alias = "get_name")] pub fn name(&self) -> Option { diff --git a/glib/src/auto/versions.txt b/glib/src/auto/versions.txt index fce0e9db0e63..d37007d58839 100644 --- a/glib/src/auto/versions.txt +++ b/glib/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) +Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/glib/sys/versions.txt b/glib/sys/versions.txt index fce0e9db0e63..d37007d58839 100644 --- a/glib/sys/versions.txt +++ b/glib/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) +Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/graphene/src/auto/box_.rs b/graphene/src/auto/box_.rs index e81a3af5e55d..0a605aaae7d5 100644 --- a/graphene/src/auto/box_.rs +++ b/graphene/src/auto/box_.rs @@ -18,32 +18,17 @@ glib::wrapper! { impl Box { #[doc(alias = "graphene_box_contains_box")] pub fn contains_box(&self, b: &Box) -> bool { - unsafe { - from_glib(ffi::graphene_box_contains_box( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_box_contains_box(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_box_contains_point")] pub fn contains_point(&self, point: &Point3D) -> bool { - unsafe { - from_glib(ffi::graphene_box_contains_point( - self.to_glib_none().0, - point.to_glib_none().0, - )) - } + unsafe { ffi::graphene_box_contains_point(self.to_glib_none().0, point.to_glib_none().0) } } #[doc(alias = "graphene_box_equal")] fn equal(&self, b: &Box) -> bool { - unsafe { - from_glib(ffi::graphene_box_equal( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_box_equal(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_box_expand")] @@ -180,11 +165,11 @@ impl Box { pub fn intersection(&self, b: &Box) -> Option { unsafe { let mut res = Box::uninitialized(); - let ret = from_glib(ffi::graphene_box_intersection( + let ret = ffi::graphene_box_intersection( self.to_glib_none().0, b.to_glib_none().0, res.to_glib_none_mut().0, - )); + ); if ret { Some(res) } else { diff --git a/graphene/src/auto/euler.rs b/graphene/src/auto/euler.rs index 3ee61bb6b073..ae4210df7be8 100644 --- a/graphene/src/auto/euler.rs +++ b/graphene/src/auto/euler.rs @@ -18,12 +18,7 @@ glib::wrapper! { impl Euler { #[doc(alias = "graphene_euler_equal")] fn equal(&self, b: &Euler) -> bool { - unsafe { - from_glib(ffi::graphene_euler_equal( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_euler_equal(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_euler_get_alpha")] diff --git a/graphene/src/auto/frustum.rs b/graphene/src/auto/frustum.rs index 88d7b57eeb42..2bf2c8489290 100644 --- a/graphene/src/auto/frustum.rs +++ b/graphene/src/auto/frustum.rs @@ -19,40 +19,26 @@ impl Frustum { #[doc(alias = "graphene_frustum_contains_point")] pub fn contains_point(&self, point: &Point3D) -> bool { unsafe { - from_glib(ffi::graphene_frustum_contains_point( - self.to_glib_none().0, - point.to_glib_none().0, - )) + ffi::graphene_frustum_contains_point(self.to_glib_none().0, point.to_glib_none().0) } } #[doc(alias = "graphene_frustum_equal")] fn equal(&self, b: &Frustum) -> bool { - unsafe { - from_glib(ffi::graphene_frustum_equal( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_frustum_equal(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_frustum_intersects_box")] pub fn intersects_box(&self, box_: &Box) -> bool { unsafe { - from_glib(ffi::graphene_frustum_intersects_box( - self.to_glib_none().0, - box_.to_glib_none().0, - )) + ffi::graphene_frustum_intersects_box(self.to_glib_none().0, box_.to_glib_none().0) } } #[doc(alias = "graphene_frustum_intersects_sphere")] pub fn intersects_sphere(&self, sphere: &Sphere) -> bool { unsafe { - from_glib(ffi::graphene_frustum_intersects_sphere( - self.to_glib_none().0, - sphere.to_glib_none().0, - )) + ffi::graphene_frustum_intersects_sphere(self.to_glib_none().0, sphere.to_glib_none().0) } } } diff --git a/graphene/src/auto/matrix.rs b/graphene/src/auto/matrix.rs index 82233bf327b5..679e711b00bf 100644 --- a/graphene/src/auto/matrix.rs +++ b/graphene/src/auto/matrix.rs @@ -24,14 +24,14 @@ impl Matrix { let mut rotate = Quaternion::uninitialized(); let mut shear = Vec3::uninitialized(); let mut perspective = Vec4::uninitialized(); - let ret = from_glib(ffi::graphene_matrix_decompose( + let ret = ffi::graphene_matrix_decompose( self.to_glib_none().0, translate.to_glib_none_mut().0, scale.to_glib_none_mut().0, rotate.to_glib_none_mut().0, shear.to_glib_none_mut().0, perspective.to_glib_none_mut().0, - )); + ); if ret { Some((translate, scale, rotate, shear, perspective)) } else { @@ -47,22 +47,12 @@ impl Matrix { #[doc(alias = "graphene_matrix_equal")] fn equal(&self, b: &Matrix) -> bool { - unsafe { - from_glib(ffi::graphene_matrix_equal( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_matrix_equal(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_matrix_equal_fast")] pub fn equal_fast(&self, b: &Matrix) -> bool { - unsafe { - from_glib(ffi::graphene_matrix_equal_fast( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_matrix_equal_fast(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_matrix_get_row")] @@ -136,10 +126,7 @@ impl Matrix { pub fn inverse(&self) -> Option { unsafe { let mut res = Matrix::uninitialized(); - let ret = from_glib(ffi::graphene_matrix_inverse( - self.to_glib_none().0, - res.to_glib_none_mut().0, - )); + let ret = ffi::graphene_matrix_inverse(self.to_glib_none().0, res.to_glib_none_mut().0); if ret { Some(res) } else { @@ -150,26 +137,22 @@ impl Matrix { #[doc(alias = "graphene_matrix_is_2d")] pub fn is_2d(&self) -> bool { - unsafe { from_glib(ffi::graphene_matrix_is_2d(self.to_glib_none().0)) } + unsafe { ffi::graphene_matrix_is_2d(self.to_glib_none().0) } } #[doc(alias = "graphene_matrix_is_backface_visible")] pub fn is_backface_visible(&self) -> bool { - unsafe { - from_glib(ffi::graphene_matrix_is_backface_visible( - self.to_glib_none().0, - )) - } + unsafe { ffi::graphene_matrix_is_backface_visible(self.to_glib_none().0) } } #[doc(alias = "graphene_matrix_is_identity")] pub fn is_identity(&self) -> bool { - unsafe { from_glib(ffi::graphene_matrix_is_identity(self.to_glib_none().0)) } + unsafe { ffi::graphene_matrix_is_identity(self.to_glib_none().0) } } #[doc(alias = "graphene_matrix_is_singular")] pub fn is_singular(&self) -> bool { - unsafe { from_glib(ffi::graphene_matrix_is_singular(self.to_glib_none().0)) } + unsafe { ffi::graphene_matrix_is_singular(self.to_glib_none().0) } } #[doc(alias = "graphene_matrix_multiply")] @@ -188,13 +171,7 @@ impl Matrix { #[doc(alias = "graphene_matrix_near")] pub fn near(&self, b: &Matrix, epsilon: f32) -> bool { - unsafe { - from_glib(ffi::graphene_matrix_near( - self.to_glib_none().0, - b.to_glib_none().0, - epsilon, - )) - } + unsafe { ffi::graphene_matrix_near(self.to_glib_none().0, b.to_glib_none().0, epsilon) } } #[doc(alias = "graphene_matrix_normalize")] @@ -346,7 +323,7 @@ impl Matrix { let mut yy = std::mem::MaybeUninit::uninit(); let mut x_0 = std::mem::MaybeUninit::uninit(); let mut y_0 = std::mem::MaybeUninit::uninit(); - let ret = from_glib(ffi::graphene_matrix_to_2d( + let ret = ffi::graphene_matrix_to_2d( self.to_glib_none().0, xx.as_mut_ptr(), yx.as_mut_ptr(), @@ -354,7 +331,7 @@ impl Matrix { yy.as_mut_ptr(), x_0.as_mut_ptr(), y_0.as_mut_ptr(), - )); + ); if ret { Some(( xx.assume_init(), @@ -536,12 +513,12 @@ impl Matrix { pub fn untransform_point(&self, p: &Point, bounds: &Rect) -> Option { unsafe { let mut res = Point::uninitialized(); - let ret = from_glib(ffi::graphene_matrix_untransform_point( + let ret = ffi::graphene_matrix_untransform_point( self.to_glib_none().0, p.to_glib_none().0, bounds.to_glib_none().0, res.to_glib_none_mut().0, - )); + ); if ret { Some(res) } else { diff --git a/graphene/src/auto/plane.rs b/graphene/src/auto/plane.rs index 147d444170e4..503989f5ef7e 100644 --- a/graphene/src/auto/plane.rs +++ b/graphene/src/auto/plane.rs @@ -23,12 +23,7 @@ impl Plane { #[doc(alias = "graphene_plane_equal")] fn equal(&self, b: &Plane) -> bool { - unsafe { - from_glib(ffi::graphene_plane_equal( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_plane_equal(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_plane_get_constant")] diff --git a/graphene/src/auto/point.rs b/graphene/src/auto/point.rs index 613d91b9b9b5..cf8b5c50e83d 100644 --- a/graphene/src/auto/point.rs +++ b/graphene/src/auto/point.rs @@ -40,12 +40,7 @@ impl Point { #[doc(alias = "graphene_point_equal")] fn equal(&self, b: &Point) -> bool { - unsafe { - from_glib(ffi::graphene_point_equal( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_point_equal(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_point_interpolate")] @@ -65,13 +60,7 @@ impl Point { #[doc(alias = "graphene_point_near")] pub fn near(&self, b: &Point, epsilon: f32) -> bool { - unsafe { - from_glib(ffi::graphene_point_near( - self.to_glib_none().0, - b.to_glib_none().0, - epsilon, - )) - } + unsafe { ffi::graphene_point_near(self.to_glib_none().0, b.to_glib_none().0, epsilon) } } #[doc(alias = "graphene_point_to_vec2")] diff --git a/graphene/src/auto/point3_d.rs b/graphene/src/auto/point3_d.rs index 5736aa7d1fb3..e29cf6af7926 100644 --- a/graphene/src/auto/point3_d.rs +++ b/graphene/src/auto/point3_d.rs @@ -50,12 +50,7 @@ impl Point3D { #[doc(alias = "graphene_point3d_equal")] fn equal(&self, b: &Point3D) -> bool { - unsafe { - from_glib(ffi::graphene_point3d_equal( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_point3d_equal(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_point3d_interpolate")] @@ -80,13 +75,7 @@ impl Point3D { #[doc(alias = "graphene_point3d_near")] pub fn near(&self, b: &Point3D, epsilon: f32) -> bool { - unsafe { - from_glib(ffi::graphene_point3d_near( - self.to_glib_none().0, - b.to_glib_none().0, - epsilon, - )) - } + unsafe { ffi::graphene_point3d_near(self.to_glib_none().0, b.to_glib_none().0, epsilon) } } #[doc(alias = "graphene_point3d_normalize")] diff --git a/graphene/src/auto/quad.rs b/graphene/src/auto/quad.rs index a4a8915710f0..b5400b765350 100644 --- a/graphene/src/auto/quad.rs +++ b/graphene/src/auto/quad.rs @@ -27,11 +27,6 @@ impl Quad { #[doc(alias = "graphene_quad_contains")] pub fn contains(&self, p: &Point) -> bool { - unsafe { - from_glib(ffi::graphene_quad_contains( - self.to_glib_none().0, - p.to_glib_none().0, - )) - } + unsafe { ffi::graphene_quad_contains(self.to_glib_none().0, p.to_glib_none().0) } } } diff --git a/graphene/src/auto/quaternion.rs b/graphene/src/auto/quaternion.rs index 1c8bd9f633ce..bfe8634f97d4 100644 --- a/graphene/src/auto/quaternion.rs +++ b/graphene/src/auto/quaternion.rs @@ -37,12 +37,7 @@ impl Quaternion { #[doc(alias = "graphene_quaternion_equal")] fn equal(&self, b: &Quaternion) -> bool { - unsafe { - from_glib(ffi::graphene_quaternion_equal( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_quaternion_equal(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_quaternion_invert")] diff --git a/graphene/src/auto/ray.rs b/graphene/src/auto/ray.rs index b17b05f2568f..1fa2acafb62f 100644 --- a/graphene/src/auto/ray.rs +++ b/graphene/src/auto/ray.rs @@ -18,12 +18,7 @@ glib::wrapper! { impl Ray { #[doc(alias = "graphene_ray_equal")] fn equal(&self, b: &Ray) -> bool { - unsafe { - from_glib(ffi::graphene_ray_equal( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_ray_equal(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_ray_get_closest_point_to_point")] @@ -131,32 +126,17 @@ impl Ray { #[doc(alias = "graphene_ray_intersects_box")] pub fn intersects_box(&self, b: &Box) -> bool { - unsafe { - from_glib(ffi::graphene_ray_intersects_box( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_ray_intersects_box(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_ray_intersects_sphere")] pub fn intersects_sphere(&self, s: &Sphere) -> bool { - unsafe { - from_glib(ffi::graphene_ray_intersects_sphere( - self.to_glib_none().0, - s.to_glib_none().0, - )) - } + unsafe { ffi::graphene_ray_intersects_sphere(self.to_glib_none().0, s.to_glib_none().0) } } #[doc(alias = "graphene_ray_intersects_triangle")] pub fn intersects_triangle(&self, t: &Triangle) -> bool { - unsafe { - from_glib(ffi::graphene_ray_intersects_triangle( - self.to_glib_none().0, - t.to_glib_none().0, - )) - } + unsafe { ffi::graphene_ray_intersects_triangle(self.to_glib_none().0, t.to_glib_none().0) } } } diff --git a/graphene/src/auto/rect.rs b/graphene/src/auto/rect.rs index c3749dc85699..bb817263b163 100644 --- a/graphene/src/auto/rect.rs +++ b/graphene/src/auto/rect.rs @@ -18,32 +18,17 @@ glib::wrapper! { impl Rect { #[doc(alias = "graphene_rect_contains_point")] pub fn contains_point(&self, p: &Point) -> bool { - unsafe { - from_glib(ffi::graphene_rect_contains_point( - self.to_glib_none().0, - p.to_glib_none().0, - )) - } + unsafe { ffi::graphene_rect_contains_point(self.to_glib_none().0, p.to_glib_none().0) } } #[doc(alias = "graphene_rect_contains_rect")] pub fn contains_rect(&self, b: &Rect) -> bool { - unsafe { - from_glib(ffi::graphene_rect_contains_rect( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_rect_contains_rect(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_rect_equal")] fn equal(&self, b: &Rect) -> bool { - unsafe { - from_glib(ffi::graphene_rect_equal( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_rect_equal(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_rect_expand")] @@ -176,11 +161,11 @@ impl Rect { pub fn intersection(&self, b: &Rect) -> Option { unsafe { let mut res = Rect::uninitialized(); - let ret = from_glib(ffi::graphene_rect_intersection( + let ret = ffi::graphene_rect_intersection( self.to_glib_none().0, b.to_glib_none().0, res.to_glib_none_mut().0, - )); + ); if ret { Some(res) } else { diff --git a/graphene/src/auto/size.rs b/graphene/src/auto/size.rs index 254f9b2e45e4..44d9a5f7374f 100644 --- a/graphene/src/auto/size.rs +++ b/graphene/src/auto/size.rs @@ -18,12 +18,7 @@ glib::wrapper! { impl Size { #[doc(alias = "graphene_size_equal")] fn equal(&self, b: &Size) -> bool { - unsafe { - from_glib(ffi::graphene_size_equal( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_size_equal(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_size_interpolate")] diff --git a/graphene/src/auto/sphere.rs b/graphene/src/auto/sphere.rs index a651fb027199..68dd08245eef 100644 --- a/graphene/src/auto/sphere.rs +++ b/graphene/src/auto/sphere.rs @@ -19,10 +19,7 @@ impl Sphere { #[doc(alias = "graphene_sphere_contains_point")] pub fn contains_point(&self, point: &Point3D) -> bool { unsafe { - from_glib(ffi::graphene_sphere_contains_point( - self.to_glib_none().0, - point.to_glib_none().0, - )) + ffi::graphene_sphere_contains_point(self.to_glib_none().0, point.to_glib_none().0) } } @@ -33,12 +30,7 @@ impl Sphere { #[doc(alias = "graphene_sphere_equal")] fn equal(&self, b: &Sphere) -> bool { - unsafe { - from_glib(ffi::graphene_sphere_equal( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_sphere_equal(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_sphere_get_bounding_box")] @@ -69,7 +61,7 @@ impl Sphere { #[doc(alias = "graphene_sphere_is_empty")] pub fn is_empty(&self) -> bool { - unsafe { from_glib(ffi::graphene_sphere_is_empty(self.to_glib_none().0)) } + unsafe { ffi::graphene_sphere_is_empty(self.to_glib_none().0) } } #[doc(alias = "graphene_sphere_translate")] diff --git a/graphene/src/auto/triangle.rs b/graphene/src/auto/triangle.rs index 6064880cb126..f5f4433d73ec 100644 --- a/graphene/src/auto/triangle.rs +++ b/graphene/src/auto/triangle.rs @@ -18,22 +18,12 @@ glib::wrapper! { impl Triangle { #[doc(alias = "graphene_triangle_contains_point")] pub fn contains_point(&self, p: &Point3D) -> bool { - unsafe { - from_glib(ffi::graphene_triangle_contains_point( - self.to_glib_none().0, - p.to_glib_none().0, - )) - } + unsafe { ffi::graphene_triangle_contains_point(self.to_glib_none().0, p.to_glib_none().0) } } #[doc(alias = "graphene_triangle_equal")] fn equal(&self, b: &Triangle) -> bool { - unsafe { - from_glib(ffi::graphene_triangle_equal( - self.to_glib_none().0, - b.to_glib_none().0, - )) - } + unsafe { ffi::graphene_triangle_equal(self.to_glib_none().0, b.to_glib_none().0) } } #[doc(alias = "graphene_triangle_get_area")] @@ -47,11 +37,11 @@ impl Triangle { pub fn barycoords(&self, p: Option<&Point3D>) -> Option { unsafe { let mut res = Vec2::uninitialized(); - let ret = from_glib(ffi::graphene_triangle_get_barycoords( + let ret = ffi::graphene_triangle_get_barycoords( self.to_glib_none().0, p.to_glib_none().0, res.to_glib_none_mut().0, - )); + ); if ret { Some(res) } else { @@ -125,14 +115,14 @@ impl Triangle { pub fn uv(&self, p: Option<&Point3D>, uv_a: &Vec2, uv_b: &Vec2, uv_c: &Vec2) -> Option { unsafe { let mut res = Vec2::uninitialized(); - let ret = from_glib(ffi::graphene_triangle_get_uv( + let ret = ffi::graphene_triangle_get_uv( self.to_glib_none().0, p.to_glib_none().0, uv_a.to_glib_none().0, uv_b.to_glib_none().0, uv_c.to_glib_none().0, res.to_glib_none_mut().0, - )); + ); if ret { Some(res) } else { diff --git a/graphene/src/auto/vec2.rs b/graphene/src/auto/vec2.rs index 51a912d54921..c97ea099601e 100644 --- a/graphene/src/auto/vec2.rs +++ b/graphene/src/auto/vec2.rs @@ -51,12 +51,7 @@ impl Vec2 { #[doc(alias = "graphene_vec2_equal")] fn equal(&self, v2: &Vec2) -> bool { - unsafe { - from_glib(ffi::graphene_vec2_equal( - self.to_glib_none().0, - v2.to_glib_none().0, - )) - } + unsafe { ffi::graphene_vec2_equal(self.to_glib_none().0, v2.to_glib_none().0) } } #[doc(alias = "graphene_vec2_get_x")] @@ -135,13 +130,7 @@ impl Vec2 { #[doc(alias = "graphene_vec2_near")] pub fn near(&self, v2: &Vec2, epsilon: f32) -> bool { - unsafe { - from_glib(ffi::graphene_vec2_near( - self.to_glib_none().0, - v2.to_glib_none().0, - epsilon, - )) - } + unsafe { ffi::graphene_vec2_near(self.to_glib_none().0, v2.to_glib_none().0, epsilon) } } #[doc(alias = "graphene_vec2_negate")] diff --git a/graphene/src/auto/vec3.rs b/graphene/src/auto/vec3.rs index 907be9f4534e..29443b50efe8 100644 --- a/graphene/src/auto/vec3.rs +++ b/graphene/src/auto/vec3.rs @@ -65,12 +65,7 @@ impl Vec3 { #[doc(alias = "graphene_vec3_equal")] fn equal(&self, v2: &Vec3) -> bool { - unsafe { - from_glib(ffi::graphene_vec3_equal( - self.to_glib_none().0, - v2.to_glib_none().0, - )) - } + unsafe { ffi::graphene_vec3_equal(self.to_glib_none().0, v2.to_glib_none().0) } } #[doc(alias = "graphene_vec3_get_x")] @@ -206,13 +201,7 @@ impl Vec3 { #[doc(alias = "graphene_vec3_near")] pub fn near(&self, v2: &Vec3, epsilon: f32) -> bool { - unsafe { - from_glib(ffi::graphene_vec3_near( - self.to_glib_none().0, - v2.to_glib_none().0, - epsilon, - )) - } + unsafe { ffi::graphene_vec3_near(self.to_glib_none().0, v2.to_glib_none().0, epsilon) } } #[doc(alias = "graphene_vec3_negate")] diff --git a/graphene/src/auto/vec4.rs b/graphene/src/auto/vec4.rs index 749e064c3bc1..7f96dd6c14f9 100644 --- a/graphene/src/auto/vec4.rs +++ b/graphene/src/auto/vec4.rs @@ -51,12 +51,7 @@ impl Vec4 { #[doc(alias = "graphene_vec4_equal")] fn equal(&self, v2: &Vec4) -> bool { - unsafe { - from_glib(ffi::graphene_vec4_equal( - self.to_glib_none().0, - v2.to_glib_none().0, - )) - } + unsafe { ffi::graphene_vec4_equal(self.to_glib_none().0, v2.to_glib_none().0) } } #[doc(alias = "graphene_vec4_get_w")] @@ -167,13 +162,7 @@ impl Vec4 { #[doc(alias = "graphene_vec4_near")] pub fn near(&self, v2: &Vec4, epsilon: f32) -> bool { - unsafe { - from_glib(ffi::graphene_vec4_near( - self.to_glib_none().0, - v2.to_glib_none().0, - epsilon, - )) - } + unsafe { ffi::graphene_vec4_near(self.to_glib_none().0, v2.to_glib_none().0, epsilon) } } #[doc(alias = "graphene_vec4_negate")] diff --git a/graphene/src/auto/versions.txt b/graphene/src/auto/versions.txt index fce0e9db0e63..d37007d58839 100644 --- a/graphene/src/auto/versions.txt +++ b/graphene/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) +Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/graphene/sys/versions.txt b/graphene/sys/versions.txt index fce0e9db0e63..d37007d58839 100644 --- a/graphene/sys/versions.txt +++ b/graphene/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) +Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/pango/src/auto/versions.txt b/pango/src/auto/versions.txt index fce0e9db0e63..d37007d58839 100644 --- a/pango/src/auto/versions.txt +++ b/pango/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) +Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/pango/sys/versions.txt b/pango/sys/versions.txt index fce0e9db0e63..d37007d58839 100644 --- a/pango/sys/versions.txt +++ b/pango/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) +Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/pangocairo/src/auto/versions.txt b/pangocairo/src/auto/versions.txt index fce0e9db0e63..d37007d58839 100644 --- a/pangocairo/src/auto/versions.txt +++ b/pangocairo/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) +Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) diff --git a/pangocairo/sys/versions.txt b/pangocairo/sys/versions.txt index fce0e9db0e63..d37007d58839 100644 --- a/pangocairo/sys/versions.txt +++ b/pangocairo/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 1364a207b03e) +Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) from gir-files (https://github.com/gtk-rs/gir-files @ 5262e0fefdc7) From 532410d425e82ca6072cf805c9aae7064f82a032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 21 May 2025 13:10:33 +0300 Subject: [PATCH 08/11] graphene: Add `v1_12` feature --- graphene/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/graphene/Cargo.toml b/graphene/Cargo.toml index 23aa26b6ba42..a44d2024a35f 100644 --- a/graphene/Cargo.toml +++ b/graphene/Cargo.toml @@ -17,6 +17,7 @@ version.workspace = true name = "graphene" [features] +v1_12 = ["graphene-sys/v1_12"] [dependencies] graphene-sys.workspace = true From a18b9a776e9d7757a3b8b95dbc283b53c5a16924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 21 May 2025 13:11:54 +0300 Subject: [PATCH 09/11] graphene: Lower 1.12 version dependency to 1.11 --- graphene/sys/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphene/sys/Cargo.toml b/graphene/sys/Cargo.toml index 70135a2d00f5..801d7fe64c91 100644 --- a/graphene/sys/Cargo.toml +++ b/graphene/sys/Cargo.toml @@ -50,7 +50,7 @@ name = "graphene-gobject-1.0" version = "1.10" [package.metadata.system-deps.graphene_gobject_1_0.v1_12] -version = "1.12" +version = "1.11" [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] From 751306b36845b79b254dffa44a2a7e445b20031f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 21 May 2025 13:23:02 +0300 Subject: [PATCH 10/11] graphene: Add `Box2D` bindings --- graphene/Gir.toml | 40 ++++++ graphene/src/auto/box2_d.rs | 252 ++++++++++++++++++++++++++++++++++++ graphene/src/auto/mod.rs | 7 + graphene/src/box2_d.rs | 118 +++++++++++++++++ graphene/src/lib.rs | 3 + 5 files changed, 420 insertions(+) create mode 100644 graphene/src/auto/box2_d.rs create mode 100644 graphene/src/box2_d.rs diff --git a/graphene/Gir.toml b/graphene/Gir.toml index 3d4a793f412b..348249edf9f1 100644 --- a/graphene/Gir.toml +++ b/graphene/Gir.toml @@ -54,6 +54,46 @@ boxed_inline = true # float array manual = true +[[object]] +name = "Graphene.Box2D" +status = "generate" +boxed_inline = true + [[object.function]] + # contents undefined + name = "alloc" + ignore = true + [[object.function]] + name = "init_from_box" + ignore = true # Copy like constructor + [[object.function]] + name = "init" + manual = true # manual proper constructor + rename = "new" + [[object.function]] + name = "init_from_points" + manual = true # manual proper constructor + rename = "from_points" + [[object.function]] + name = "init_from_vec2" + manual = true # manual proper constructor + rename = "from_vec2" + [[object.function]] + name = "init_from_rect" + manual = true # manual proper constructor + rename = "from_rect" + [[object.function]] + name = "init_from_vectors" + manual = true # manual proper constructor + rename = "from_vectors" + [[object.function]] + name = "get_vertices" + # float array + manual = true + [[object.function]] + name = "to_float" + # float array + manual = true + [[object]] name = "Graphene.Euler" status = "generate" diff --git a/graphene/src/auto/box2_d.rs b/graphene/src/auto/box2_d.rs new file mode 100644 index 000000000000..d4df48a0ab57 --- /dev/null +++ b/graphene/src/auto/box2_d.rs @@ -0,0 +1,252 @@ +// 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 + +use crate::{ffi, Point, Rect, Vec2}; +use glib::translate::*; + +glib::wrapper! { + pub struct Box2D(BoxedInline); + + match fn { + copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::graphene_box2d_get_type(), ptr as *mut _) as *mut ffi::graphene_box2d_t, + free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::graphene_box2d_get_type(), ptr as *mut _), + type_ => || ffi::graphene_box2d_get_type(), + } +} + +impl Box2D { + #[doc(alias = "graphene_box2d_contains_box")] + pub fn contains_box(&self, b: &Box2D) -> bool { + unsafe { ffi::graphene_box2d_contains_box(self.to_glib_none().0, b.to_glib_none().0) } + } + + #[doc(alias = "graphene_box2d_contains_point")] + pub fn contains_point(&self, point: &Point) -> bool { + unsafe { ffi::graphene_box2d_contains_point(self.to_glib_none().0, point.to_glib_none().0) } + } + + #[doc(alias = "graphene_box2d_contains_rect")] + pub fn contains_rect(&self, rect: &Rect) -> bool { + unsafe { ffi::graphene_box2d_contains_rect(self.to_glib_none().0, rect.to_glib_none().0) } + } + + #[doc(alias = "graphene_box2d_equal")] + fn equal(&self, b: &Box2D) -> bool { + unsafe { ffi::graphene_box2d_equal(self.to_glib_none().0, b.to_glib_none().0) } + } + + #[doc(alias = "graphene_box2d_expand")] + #[must_use] + pub fn expand(&self, point: &Point) -> Box2D { + unsafe { + let mut res = Box2D::uninitialized(); + ffi::graphene_box2d_expand( + self.to_glib_none().0, + point.to_glib_none().0, + res.to_glib_none_mut().0, + ); + res + } + } + + #[doc(alias = "graphene_box2d_expand_scalar")] + #[must_use] + pub fn expand_scalar(&self, scalar: f32) -> Box2D { + unsafe { + let mut res = Box2D::uninitialized(); + ffi::graphene_box2d_expand_scalar( + self.to_glib_none().0, + scalar, + res.to_glib_none_mut().0, + ); + res + } + } + + #[doc(alias = "graphene_box2d_expand_vec2")] + #[must_use] + pub fn expand_vec2(&self, vec: &Vec2) -> Box2D { + unsafe { + let mut res = Box2D::uninitialized(); + ffi::graphene_box2d_expand_vec2( + self.to_glib_none().0, + vec.to_glib_none().0, + res.to_glib_none_mut().0, + ); + res + } + } + + #[doc(alias = "graphene_box2d_get_center")] + #[doc(alias = "get_center")] + pub fn center(&self) -> Point { + unsafe { + let mut center = Point::uninitialized(); + ffi::graphene_box2d_get_center(self.to_glib_none().0, center.to_glib_none_mut().0); + center + } + } + + #[doc(alias = "graphene_box2d_get_height")] + #[doc(alias = "get_height")] + pub fn height(&self) -> f32 { + unsafe { ffi::graphene_box2d_get_height(self.to_glib_none().0) } + } + + #[doc(alias = "graphene_box2d_get_max")] + #[doc(alias = "get_max")] + pub fn max(&self) -> Point { + unsafe { + let mut max = Point::uninitialized(); + ffi::graphene_box2d_get_max(self.to_glib_none().0, max.to_glib_none_mut().0); + max + } + } + + #[doc(alias = "graphene_box2d_get_min")] + #[doc(alias = "get_min")] + pub fn min(&self) -> Point { + unsafe { + let mut min = Point::uninitialized(); + ffi::graphene_box2d_get_min(self.to_glib_none().0, min.to_glib_none_mut().0); + min + } + } + + #[doc(alias = "graphene_box2d_get_minmax")] + #[doc(alias = "get_minmax")] + pub fn minmax(&self) -> (Point, Point) { + unsafe { + let mut min = Point::uninitialized(); + let mut max = Point::uninitialized(); + ffi::graphene_box2d_get_minmax( + self.to_glib_none().0, + min.to_glib_none_mut().0, + max.to_glib_none_mut().0, + ); + (min, max) + } + } + + #[doc(alias = "graphene_box2d_get_size")] + #[doc(alias = "get_size")] + pub fn size(&self) -> Vec2 { + unsafe { + let mut size = Vec2::uninitialized(); + ffi::graphene_box2d_get_size(self.to_glib_none().0, size.to_glib_none_mut().0); + size + } + } + + #[doc(alias = "graphene_box2d_get_width")] + #[doc(alias = "get_width")] + pub fn width(&self) -> f32 { + unsafe { ffi::graphene_box2d_get_width(self.to_glib_none().0) } + } + + #[doc(alias = "graphene_box2d_intersection")] + pub fn intersection(&self, b: &Box2D) -> Option { + unsafe { + let mut res = Box2D::uninitialized(); + let ret = ffi::graphene_box2d_intersection( + self.to_glib_none().0, + b.to_glib_none().0, + res.to_glib_none_mut().0, + ); + if ret { + Some(res) + } else { + None + } + } + } + + #[doc(alias = "graphene_box2d_intersects")] + pub fn intersects(&self, b: &Box2D) -> bool { + unsafe { ffi::graphene_box2d_intersects(self.to_glib_none().0, b.to_glib_none().0) } + } + + #[doc(alias = "graphene_box2d_scale_offset")] + #[must_use] + pub fn scale_offset(&self, scale: Option<&Vec2>, offset: Option<&Point>) -> Box2D { + unsafe { + let mut res = Box2D::uninitialized(); + ffi::graphene_box2d_scale_offset( + self.to_glib_none().0, + scale.to_glib_none().0, + offset.to_glib_none().0, + res.to_glib_none_mut().0, + ); + res + } + } + + #[doc(alias = "graphene_box2d_to_rect")] + pub fn to_rect(&self) -> Rect { + unsafe { + let mut rect = Rect::uninitialized(); + ffi::graphene_box2d_to_rect(self.to_glib_none().0, rect.to_glib_none_mut().0); + rect + } + } + + #[doc(alias = "graphene_box2d_union")] + #[must_use] + pub fn union(&self, b: &Box2D) -> Box2D { + unsafe { + let mut res = Box2D::uninitialized(); + ffi::graphene_box2d_union( + self.to_glib_none().0, + b.to_glib_none().0, + res.to_glib_none_mut().0, + ); + res + } + } + + #[doc(alias = "graphene_box2d_empty")] + pub fn empty() -> Box2D { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::graphene_box2d_empty()) } + } + + #[doc(alias = "graphene_box2d_infinite")] + pub fn infinite() -> Box2D { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::graphene_box2d_infinite()) } + } + + #[doc(alias = "graphene_box2d_minus_one")] + pub fn minus_one() -> Box2D { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::graphene_box2d_minus_one()) } + } + + #[doc(alias = "graphene_box2d_one")] + pub fn one() -> Box2D { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::graphene_box2d_one()) } + } + + #[doc(alias = "graphene_box2d_one_minus_one")] + pub fn one_minus_one() -> Box2D { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::graphene_box2d_one_minus_one()) } + } + + #[doc(alias = "graphene_box2d_zero")] + pub fn zero() -> Box2D { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::graphene_box2d_zero()) } + } +} + +impl PartialEq for Box2D { + #[inline] + fn eq(&self, other: &Self) -> bool { + self.equal(other) + } +} + +impl Eq for Box2D {} diff --git a/graphene/src/auto/mod.rs b/graphene/src/auto/mod.rs index 80a130dadfa9..39c0b5b0d535 100644 --- a/graphene/src/auto/mod.rs +++ b/graphene/src/auto/mod.rs @@ -5,6 +5,13 @@ mod box_; pub use self::box_::Box; +#[cfg(feature = "v1_12")] +#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] +mod box2_d; +#[cfg(feature = "v1_12")] +#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] +pub use self::box2_d::Box2D; + mod euler; pub use self::euler::Euler; diff --git a/graphene/src/box2_d.rs b/graphene/src/box2_d.rs new file mode 100644 index 000000000000..b48b9e74a170 --- /dev/null +++ b/graphene/src/box2_d.rs @@ -0,0 +1,118 @@ +// Take a look at the license at the top of the repository in the LICENSE file. + +use std::fmt; + +use glib::translate::*; + +use crate::{ffi, Box2D, Point, Rect, Vec2}; + +impl Box2D { + #[doc(alias = "graphene_box2d_get_vertices")] + #[doc(alias = "get_vertices")] + pub fn vertices(&self) -> &[Vec2; 4] { + unsafe { + let mut out: [ffi::graphene_vec2_t; 4] = std::mem::zeroed(); + ffi::graphene_box2d_get_vertices(self.to_glib_none().0, &mut out as *mut _); + &*(&out as *const [ffi::graphene_vec2_t; 4] as *const [Vec2; 4]) + } + } + + #[doc(alias = "graphene_box2d_to_float")] + pub fn to_float(&self) -> [f32; 4] { + unsafe { + let mut out = std::mem::MaybeUninit::uninit(); + ffi::graphene_box2d_to_float(self.to_glib_none().0, out.as_mut_ptr()); + out.assume_init() + } + } + + #[doc(alias = "graphene_box2d_init")] + pub fn new(min: Option<&Point>, max: Option<&Point>) -> Self { + assert_initialized_main_thread!(); + unsafe { + let mut b = Self::uninitialized(); + ffi::graphene_box2d_init( + b.to_glib_none_mut().0, + min.to_glib_none().0, + max.to_glib_none().0, + ); + b + } + } + + #[doc(alias = "graphene_box2d_init_from_points")] + #[doc(alias = "init_from_points")] + pub fn from_points(points: &[Point]) -> Self { + assert_initialized_main_thread!(); + + let n = points.len() as u32; + + unsafe { + let mut b = Self::uninitialized(); + ffi::graphene_box2d_init_from_points( + b.to_glib_none_mut().0, + n, + points.to_glib_none().0, + ); + b + } + } + + #[doc(alias = "graphene_box2d_init_from_vec2")] + #[doc(alias = "init_from_vec2")] + pub fn from_vec2(min: Option<&Vec2>, max: Option<&Vec2>) -> Self { + assert_initialized_main_thread!(); + unsafe { + let mut b = Self::uninitialized(); + ffi::graphene_box2d_init_from_vec2( + b.to_glib_none_mut().0, + min.to_glib_none().0, + max.to_glib_none().0, + ); + b + } + } + + #[doc(alias = "graphene_box2d_init_from_vectors")] + #[doc(alias = "init_from_vectors")] + pub fn from_vectors(vectors: &[Vec2]) -> Self { + assert_initialized_main_thread!(); + + let n = vectors.len() as u32; + + unsafe { + let mut b = Self::uninitialized(); + ffi::graphene_box2d_init_from_vectors( + b.to_glib_none_mut().0, + n, + vectors.to_glib_none().0, + ); + b + } + } + + #[doc(alias = "graphene_box2d_init_from_rect")] + pub fn init_from_rect(src: &Rect) -> Self { + assert_initialized_main_thread!(); + unsafe { + let mut b = Self::uninitialized(); + ffi::graphene_box2d_init_from_rect(b.to_glib_none_mut().0, src.to_glib_none().0); + b + } + } +} + +impl Default for Box2D { + fn default() -> Self { + Self::zero() + } +} + +impl fmt::Debug for Box2D { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Box2D") + .field("min", &self.min()) + .field("max", &self.max()) + .finish() + } +} diff --git a/graphene/src/lib.rs b/graphene/src/lib.rs index c425d3df9fec..398107d32ada 100644 --- a/graphene/src/lib.rs +++ b/graphene/src/lib.rs @@ -22,6 +22,9 @@ pub mod prelude; pub use crate::auto::*; +#[cfg(feature = "v1_12")] +#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] +mod box2_d; mod box_; mod euler; mod frustum; From 59d7a170167c80033777743e8304f210324f1fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 21 May 2025 13:36:43 +0300 Subject: [PATCH 11/11] ci: Enable v1_12 feature for graphene --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d6ec23465ee7..b9bd2cbb24d8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -24,7 +24,7 @@ jobs: - { name: "gdk-pixbuf", features: "v2_42", nightly: "--all-features", test_sys: true } - { name: "gio", features: "v2_84", nightly: "--all-features", test_sys: true } - { name: "glib", features: "v2_84,log", nightly: "--all-features", test_sys: true } - - { name: "graphene", features: "", nightly: "", test_sys: true } + - { name: "graphene", features: "v1_12", nightly: "", test_sys: true } - { name: "pango", features: "v1_56", nightly: "--all-features", test_sys: true } - { name: "pangocairo", features: "", nightly: "--all-features", test_sys: true } steps: