diff --git a/gdk-pixbuf/src/auto/versions.txt b/gdk-pixbuf/src/auto/versions.txt index aa3eac387cc7..cc86a5b5b40c 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 @ c88b69265102) +Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) from gir-files (https://github.com/gtk-rs/gir-files @ c23f21f51d54) diff --git a/gdk-pixbuf/sys/versions.txt b/gdk-pixbuf/sys/versions.txt index aa3eac387cc7..cc86a5b5b40c 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 @ c88b69265102) +Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) from gir-files (https://github.com/gtk-rs/gir-files @ c23f21f51d54) diff --git a/gio/src/auto/settings.rs b/gio/src/auto/settings.rs index 163aab44ba54..9666819ef93a 100644 --- a/gio/src/auto/settings.rs +++ b/gio/src/auto/settings.rs @@ -515,13 +515,13 @@ pub trait SettingsExt: IsA + sealed::Sealed + 'static { } #[doc(alias = "writable-change-event")] - fn connect_writable_change_event glib::ControlFlow + 'static>( + fn connect_writable_change_event glib::Propagation + 'static>( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn writable_change_event_trampoline< P: IsA, - F: Fn(&P, u32) -> glib::ControlFlow + 'static, + F: Fn(&P, u32) -> glib::Propagation + 'static, >( this: *mut ffi::GSettings, key: libc::c_uint, diff --git a/gio/src/auto/versions.txt b/gio/src/auto/versions.txt index aa3eac387cc7..cc86a5b5b40c 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 @ c88b69265102) +Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) from gir-files (https://github.com/gtk-rs/gir-files @ c23f21f51d54) diff --git a/gio/sys/versions.txt b/gio/sys/versions.txt index aa3eac387cc7..cc86a5b5b40c 100644 --- a/gio/sys/versions.txt +++ b/gio/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ c88b69265102) +Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) from gir-files (https://github.com/gtk-rs/gir-files @ c23f21f51d54) diff --git a/gir b/gir index c88b69265102..ef087c070d5b 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit c88b69265102826142882880bab0425c16822b6a +Subproject commit ef087c070d5beaa53ef97568e638679952bc1f96 diff --git a/glib/gobject-sys/versions.txt b/glib/gobject-sys/versions.txt index aa3eac387cc7..cc86a5b5b40c 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 @ c88b69265102) +Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) from gir-files (https://github.com/gtk-rs/gir-files @ c23f21f51d54) diff --git a/glib/src/auto/versions.txt b/glib/src/auto/versions.txt index aa3eac387cc7..cc86a5b5b40c 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 @ c88b69265102) +Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) from gir-files (https://github.com/gtk-rs/gir-files @ c23f21f51d54) diff --git a/glib/src/lib.rs b/glib/src/lib.rs index b4ac3c8029d3..0374fdbe1ee7 100644 --- a/glib/src/lib.rs +++ b/glib/src/lib.rs @@ -29,7 +29,7 @@ pub use self::{ }, signal::{ signal_handler_block, signal_handler_disconnect, signal_handler_unblock, - signal_stop_emission_by_name, SignalHandlerId, + signal_stop_emission_by_name, Propagation, SignalHandlerId, }, types::{ILong, Pointer, StaticType, StaticTypeExt, Type, ULong}, value::{BoxedValue, SendValue, ToSendValue, ToValue, Value}, diff --git a/glib/src/signal.rs b/glib/src/signal.rs index 0b2f14ae9213..75d986e09d93 100644 --- a/glib/src/signal.rs +++ b/glib/src/signal.rs @@ -146,3 +146,81 @@ pub fn signal_has_handler_pending( )) } } + +// rustdoc-stripper-ignore-next +/// Whether to invoke the other event handlers. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub enum Propagation { + // Stop other handlers from being invoked for the event. + Stop, + // Propagate the event further. + Proceed, +} + +impl Propagation { + // rustdoc-stripper-ignore-next + /// Returns `true` if this is a `Stop` variant. + pub fn is_stop(&self) -> bool { + matches!(self, Self::Stop) + } + + // rustdoc-stripper-ignore-next + /// Returns `true` if this is a `Proceed` variant. + pub fn is_proceed(&self) -> bool { + matches!(self, Self::Proceed) + } +} + +impl From for Propagation { + fn from(value: bool) -> Self { + if value { + Self::Stop + } else { + Self::Proceed + } + } +} + +impl From for bool { + fn from(c: Propagation) -> Self { + match c { + Propagation::Stop => true, + Propagation::Proceed => false, + } + } +} + +#[doc(hidden)] +impl IntoGlib for Propagation { + type GlibType = ffi::gboolean; + + #[inline] + fn into_glib(self) -> ffi::gboolean { + bool::from(self).into_glib() + } +} + +#[doc(hidden)] +impl FromGlib for Propagation { + #[inline] + unsafe fn from_glib(value: ffi::gboolean) -> Self { + bool::from_glib(value).into() + } +} + +impl crate::ToValue for Propagation { + fn to_value(&self) -> crate::Value { + bool::from(*self).to_value() + } + + fn value_type(&self) -> crate::Type { + ::static_type() + } +} + +impl From for crate::Value { + #[inline] + fn from(v: Propagation) -> Self { + bool::from(v).into() + } +} diff --git a/glib/sys/versions.txt b/glib/sys/versions.txt index aa3eac387cc7..cc86a5b5b40c 100644 --- a/glib/sys/versions.txt +++ b/glib/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ c88b69265102) +Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) from gir-files (https://github.com/gtk-rs/gir-files @ c23f21f51d54) diff --git a/graphene/src/auto/versions.txt b/graphene/src/auto/versions.txt index aa3eac387cc7..cc86a5b5b40c 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 @ c88b69265102) +Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) from gir-files (https://github.com/gtk-rs/gir-files @ c23f21f51d54) diff --git a/graphene/sys/versions.txt b/graphene/sys/versions.txt index aa3eac387cc7..cc86a5b5b40c 100644 --- a/graphene/sys/versions.txt +++ b/graphene/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ c88b69265102) +Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) from gir-files (https://github.com/gtk-rs/gir-files @ c23f21f51d54) diff --git a/pango/src/auto/versions.txt b/pango/src/auto/versions.txt index aa3eac387cc7..cc86a5b5b40c 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 @ c88b69265102) +Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) from gir-files (https://github.com/gtk-rs/gir-files @ c23f21f51d54) diff --git a/pango/sys/versions.txt b/pango/sys/versions.txt index aa3eac387cc7..cc86a5b5b40c 100644 --- a/pango/sys/versions.txt +++ b/pango/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ c88b69265102) +Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) from gir-files (https://github.com/gtk-rs/gir-files @ c23f21f51d54) diff --git a/pangocairo/src/auto/versions.txt b/pangocairo/src/auto/versions.txt index aa3eac387cc7..cc86a5b5b40c 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 @ c88b69265102) +Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) from gir-files (https://github.com/gtk-rs/gir-files @ c23f21f51d54) diff --git a/pangocairo/sys/versions.txt b/pangocairo/sys/versions.txt index aa3eac387cc7..cc86a5b5b40c 100644 --- a/pangocairo/sys/versions.txt +++ b/pangocairo/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ c88b69265102) +Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) from gir-files (https://github.com/gtk-rs/gir-files @ c23f21f51d54)