From 19ccb5ccaef8ed42f69d4c0d2f1c3cd5403cb0b6 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sun, 4 Feb 2024 09:14:08 +0100 Subject: [PATCH] Regenerate with latest gir-files --- gdk4-wayland/src/auto/versions.txt | 2 +- gdk4-wayland/sys/versions.txt | 2 +- gdk4-win32/src/auto/versions.txt | 2 +- gdk4-win32/sys/versions.txt | 2 +- gdk4-x11/src/auto/versions.txt | 2 +- gdk4-x11/sys/versions.txt | 2 +- gdk4/src/auto/monitor.rs | 33 ++++++++++++++++++++++++++++++ gdk4/src/auto/versions.txt | 2 +- gdk4/sys/src/lib.rs | 3 +++ gdk4/sys/versions.txt | 2 +- gsk4/src/auto/versions.txt | 2 +- gsk4/sys/versions.txt | 2 +- gtk4/src/auto/versions.txt | 2 +- gtk4/sys/versions.txt | 2 +- 14 files changed, 48 insertions(+), 12 deletions(-) diff --git a/gdk4-wayland/src/auto/versions.txt b/gdk4-wayland/src/auto/versions.txt index 9eb061d0eb53..7159eca962d1 100644 --- a/gdk4-wayland/src/auto/versions.txt +++ b/gdk4-wayland/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4) +from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b) diff --git a/gdk4-wayland/sys/versions.txt b/gdk4-wayland/sys/versions.txt index 9eb061d0eb53..7159eca962d1 100644 --- a/gdk4-wayland/sys/versions.txt +++ b/gdk4-wayland/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4) +from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b) diff --git a/gdk4-win32/src/auto/versions.txt b/gdk4-win32/src/auto/versions.txt index 9eb061d0eb53..7159eca962d1 100644 --- a/gdk4-win32/src/auto/versions.txt +++ b/gdk4-win32/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4) +from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b) diff --git a/gdk4-win32/sys/versions.txt b/gdk4-win32/sys/versions.txt index 9eb061d0eb53..7159eca962d1 100644 --- a/gdk4-win32/sys/versions.txt +++ b/gdk4-win32/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4) +from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b) diff --git a/gdk4-x11/src/auto/versions.txt b/gdk4-x11/src/auto/versions.txt index 9eb061d0eb53..7159eca962d1 100644 --- a/gdk4-x11/src/auto/versions.txt +++ b/gdk4-x11/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4) +from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b) diff --git a/gdk4-x11/sys/versions.txt b/gdk4-x11/sys/versions.txt index 9eb061d0eb53..7159eca962d1 100644 --- a/gdk4-x11/sys/versions.txt +++ b/gdk4-x11/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4) +from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b) diff --git a/gdk4/src/auto/monitor.rs b/gdk4/src/auto/monitor.rs index de5f777a3ffa..55e51d3457de 100644 --- a/gdk4/src/auto/monitor.rs +++ b/gdk4/src/auto/monitor.rs @@ -98,6 +98,14 @@ pub trait MonitorExt: IsA + sealed::Sealed + 'static { unsafe { ffi::gdk_monitor_get_refresh_rate(self.as_ref().to_glib_none().0) } } + #[cfg(feature = "v4_14")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] + #[doc(alias = "gdk_monitor_get_scale")] + #[doc(alias = "get_scale")] + fn scale(&self) -> f64 { + unsafe { ffi::gdk_monitor_get_scale(self.as_ref().to_glib_none().0) } + } + #[doc(alias = "gdk_monitor_get_scale_factor")] #[doc(alias = "get_scale_factor")] fn scale_factor(&self) -> i32 { @@ -316,6 +324,31 @@ pub trait MonitorExt: IsA + sealed::Sealed + 'static { } } + #[cfg(feature = "v4_14")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] + #[doc(alias = "scale")] + fn connect_scale_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_scale_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::GdkMonitor, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(Monitor::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::scale\0".as_ptr() as *const _, + Some(std::mem::transmute::<_, unsafe extern "C" fn()>( + notify_scale_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + #[doc(alias = "scale-factor")] fn connect_scale_factor_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_scale_factor_trampoline< diff --git a/gdk4/src/auto/versions.txt b/gdk4/src/auto/versions.txt index 9eb061d0eb53..7159eca962d1 100644 --- a/gdk4/src/auto/versions.txt +++ b/gdk4/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4) +from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b) diff --git a/gdk4/sys/src/lib.rs b/gdk4/sys/src/lib.rs index 4075f4be34da..21424462718d 100644 --- a/gdk4/sys/src/lib.rs +++ b/gdk4/sys/src/lib.rs @@ -5059,6 +5059,9 @@ extern "C" { pub fn gdk_monitor_get_manufacturer(monitor: *mut GdkMonitor) -> *const c_char; pub fn gdk_monitor_get_model(monitor: *mut GdkMonitor) -> *const c_char; pub fn gdk_monitor_get_refresh_rate(monitor: *mut GdkMonitor) -> c_int; + #[cfg(feature = "v4_14")] + #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] + pub fn gdk_monitor_get_scale(monitor: *mut GdkMonitor) -> c_double; pub fn gdk_monitor_get_scale_factor(monitor: *mut GdkMonitor) -> c_int; pub fn gdk_monitor_get_subpixel_layout(monitor: *mut GdkMonitor) -> GdkSubpixelLayout; pub fn gdk_monitor_get_width_mm(monitor: *mut GdkMonitor) -> c_int; diff --git a/gdk4/sys/versions.txt b/gdk4/sys/versions.txt index 9eb061d0eb53..7159eca962d1 100644 --- a/gdk4/sys/versions.txt +++ b/gdk4/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4) +from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b) diff --git a/gsk4/src/auto/versions.txt b/gsk4/src/auto/versions.txt index 9eb061d0eb53..7159eca962d1 100644 --- a/gsk4/src/auto/versions.txt +++ b/gsk4/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4) +from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b) diff --git a/gsk4/sys/versions.txt b/gsk4/sys/versions.txt index 9eb061d0eb53..7159eca962d1 100644 --- a/gsk4/sys/versions.txt +++ b/gsk4/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4) +from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b) diff --git a/gtk4/src/auto/versions.txt b/gtk4/src/auto/versions.txt index 9eb061d0eb53..7159eca962d1 100644 --- a/gtk4/src/auto/versions.txt +++ b/gtk4/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4) +from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b) diff --git a/gtk4/sys/versions.txt b/gtk4/sys/versions.txt index 9eb061d0eb53..7159eca962d1 100644 --- a/gtk4/sys/versions.txt +++ b/gtk4/sys/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d83970797d4) +from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b)