diff --git a/atk/Cargo.toml b/atk/Cargo.toml index 685cba1f644..c80401af721 100644 --- a/atk/Cargo.toml +++ b/atk/Cargo.toml @@ -22,6 +22,8 @@ v2_30 = ["ffi/v2_30"] v2_32 = ["v2_30", "ffi/v2_32"] v2_34 = ["v2_32", "ffi/v2_34"] v2_38 = ["v2_34", "ffi/v2_38"] +v2_46 = ["v2_38", "ffi/v2_46"] +v2_50 = ["v2_46", "ffi/v2_50"] [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] diff --git a/atk/Gir.toml b/atk/Gir.toml index 0ade7bc4171..c5052294f4e 100644 --- a/atk/Gir.toml +++ b/atk/Gir.toml @@ -87,6 +87,11 @@ name = "Atk.Image" status = "generate" trait_name = "AtkImageExt" # duplicate with gtk +[[object]] +name = "Atk.Live" +status = "generate" +version = "2.50" + [[object]] name = "Atk.Misc" status = "generate" diff --git a/atk/src/auto/enums.rs b/atk/src/auto/enums.rs index 75bd164fd07..65ea4617fcc 100644 --- a/atk/src/auto/enums.rs +++ b/atk/src/auto/enums.rs @@ -258,6 +258,140 @@ impl From for glib::Value { } } +#[cfg(feature = "v2_50")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[non_exhaustive] +#[doc(alias = "AtkLive")] +pub enum Live { + #[doc(alias = "ATK_LIVE_NONE")] + None, + #[doc(alias = "ATK_LIVE_POLITE")] + Polite, + #[doc(alias = "ATK_LIVE_ASSERTIVE")] + Assertive, + #[doc(hidden)] + __Unknown(i32), +} + +#[cfg(feature = "v2_50")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] +impl fmt::Display for Live { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!( + f, + "Live::{}", + match *self { + Self::None => "None", + Self::Polite => "Polite", + Self::Assertive => "Assertive", + _ => "Unknown", + } + ) + } +} + +#[cfg(feature = "v2_50")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] +#[doc(hidden)] +impl IntoGlib for Live { + type GlibType = ffi::AtkLive; + + #[inline] + fn into_glib(self) -> ffi::AtkLive { + match self { + Self::None => ffi::ATK_LIVE_NONE, + Self::Polite => ffi::ATK_LIVE_POLITE, + Self::Assertive => ffi::ATK_LIVE_ASSERTIVE, + Self::__Unknown(value) => value, + } + } +} + +#[cfg(feature = "v2_50")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] +#[doc(hidden)] +impl FromGlib for Live { + #[inline] + unsafe fn from_glib(value: ffi::AtkLive) -> Self { + skip_assert_initialized!(); + + match value { + ffi::ATK_LIVE_NONE => Self::None, + ffi::ATK_LIVE_POLITE => Self::Polite, + ffi::ATK_LIVE_ASSERTIVE => Self::Assertive, + value => Self::__Unknown(value), + } + } +} + +#[cfg(feature = "v2_50")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] +impl StaticType for Live { + #[inline] + fn static_type() -> glib::Type { + unsafe { from_glib(ffi::atk_live_get_type()) } + } +} + +#[cfg(feature = "v2_50")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] +impl glib::HasParamSpec for Live { + type ParamSpec = glib::ParamSpecEnum; + type SetValue = Self; + type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + |name, default_value| Self::ParamSpec::builder_with_default(name, default_value) + } +} + +#[cfg(feature = "v2_50")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] +impl glib::value::ValueType for Live { + type Type = Self; +} + +#[cfg(feature = "v2_50")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] +unsafe impl<'a> glib::value::FromValue<'a> for Live { + type Checker = glib::value::GenericValueTypeChecker; + + #[inline] + unsafe fn from_value(value: &'a glib::Value) -> Self { + skip_assert_initialized!(); + from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +#[cfg(feature = "v2_50")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] +impl ToValue for Live { + #[inline] + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + #[inline] + fn value_type(&self) -> glib::Type { + Self::static_type() + } +} + +#[cfg(feature = "v2_50")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] +impl From for glib::Value { + #[inline] + fn from(v: Live) -> Self { + skip_assert_initialized!(); + ToValue::to_value(&v) + } +} + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "AtkRelationType")] diff --git a/atk/src/auto/mod.rs b/atk/src/auto/mod.rs index 3e587cb558e..ab88855d071 100644 --- a/atk/src/auto/mod.rs +++ b/atk/src/auto/mod.rs @@ -98,6 +98,9 @@ pub use self::text_range::TextRange; mod enums; pub use self::enums::CoordType; pub use self::enums::Layer; +#[cfg(feature = "v2_50")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] +pub use self::enums::Live; pub use self::enums::RelationType; pub use self::enums::Role; #[cfg(feature = "v2_30")] diff --git a/atk/src/auto/object.rs b/atk/src/auto/object.rs index 39a7c8ca81e..62867a821ce 100644 --- a/atk/src/auto/object.rs +++ b/atk/src/auto/object.rs @@ -507,6 +507,39 @@ pub trait AtkObjectExt: IsA + sealed::Sealed + 'static { } } + #[cfg(feature = "v2_50")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] + #[doc(alias = "notification")] + fn connect_notification(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notification_trampoline< + P: IsA, + F: Fn(&P, &str, i32) + 'static, + >( + this: *mut ffi::AtkObject, + arg1: *mut libc::c_char, + arg2: libc::c_int, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f( + Object::from_glib_borrow(this).unsafe_cast_ref(), + &glib::GString::from_glib_borrow(arg1), + arg2, + ) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notification\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notification_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + //#[doc(alias = "property-change")] //fn connect_property_change(&self, detail: Option<&str>, f: F) -> SignalHandlerId { // Ignored arg1: Atk.PropertyValues diff --git a/atk/src/auto/state_set.rs b/atk/src/auto/state_set.rs index b62748d6719..c995da37ef2 100644 --- a/atk/src/auto/state_set.rs +++ b/atk/src/auto/state_set.rs @@ -48,7 +48,7 @@ pub trait StateSetExt: IsA + sealed::Sealed + 'static { } //#[doc(alias = "atk_state_set_add_states")] - //fn add_states(&self, types: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 68 }) { + //fn add_states(&self, types: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 69 }) { // unsafe { TODO: call ffi:atk_state_set_add_states() } //} @@ -81,7 +81,7 @@ pub trait StateSetExt: IsA + sealed::Sealed + 'static { } //#[doc(alias = "atk_state_set_contains_states")] - //fn contains_states(&self, types: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 68 }) -> bool { + //fn contains_states(&self, types: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 69 }) -> bool { // unsafe { TODO: call ffi:atk_state_set_contains_states() } //} diff --git a/atk/src/auto/versions.txt b/atk/src/auto/versions.txt index dd6ac754e17..17a2d3ead99 100644 --- a/atk/src/auto/versions.txt +++ b/atk/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) -from gir-files (https://github.com/gtk-rs/gir-files @ 1dc6c3826666) +Generated by gir (https://github.com/gtk-rs/gir @ 76bbe9b90aaa) +from gir-files (https://github.com/gtk-rs/gir-files @ 307566e1ab58) diff --git a/atk/sys/Cargo.toml b/atk/sys/Cargo.toml index 6c357364ade..3602a16765a 100644 --- a/atk/sys/Cargo.toml +++ b/atk/sys/Cargo.toml @@ -26,6 +26,7 @@ v2_32 = ["v2_30"] v2_34 = ["v2_32"] v2_38 = ["v2_34"] v2_46 = ["v2_38"] +v2_50 = ["v2_46"] [lib] name = "atk_sys" @@ -47,6 +48,7 @@ rust-version = "1.70" [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] features = [] +rustc-args = ["--cfg", "docsrs"] [package.metadata.system-deps.atk] name = "atk" @@ -66,3 +68,6 @@ version = "2.38" [package.metadata.system-deps.atk.v2_46] version = "2.46" + +[package.metadata.system-deps.atk.v2_50] +version = "2.50" diff --git a/atk/sys/Gir.toml b/atk/sys/Gir.toml index 8160952a0d8..f803c4f9481 100644 --- a/atk/sys/Gir.toml +++ b/atk/sys/Gir.toml @@ -24,6 +24,11 @@ extra_versions = [ "2.38" ] +[[object]] +name = "Atk.Live" +status = "generate" +version = "2.50" + [[object]] name = "Atk.StateType" status = "generate" diff --git a/atk/sys/src/lib.rs b/atk/sys/src/lib.rs index 07effca623d..acfe373c211 100644 --- a/atk/sys/src/lib.rs +++ b/atk/sys/src/lib.rs @@ -45,6 +45,11 @@ pub const ATK_LAYER_POPUP: AtkLayer = 5; pub const ATK_LAYER_OVERLAY: AtkLayer = 6; pub const ATK_LAYER_WINDOW: AtkLayer = 7; +pub type AtkLive = c_int; +pub const ATK_LIVE_NONE: AtkLive = 0; +pub const ATK_LIVE_POLITE: AtkLive = 1; +pub const ATK_LIVE_ASSERTIVE: AtkLive = 2; + pub type AtkRelationType = c_int; pub const ATK_RELATION_NULL: AtkRelationType = 0; pub const ATK_RELATION_CONTROLLED_BY: AtkRelationType = 1; @@ -1819,6 +1824,13 @@ extern "C" { //========================================================================= pub fn atk_layer_get_type() -> GType; + //========================================================================= + // AtkLive + //========================================================================= + #[cfg(feature = "v2_50")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))] + pub fn atk_live_get_type() -> GType; + //========================================================================= // AtkRelationType //========================================================================= diff --git a/atk/sys/tests/abi.rs b/atk/sys/tests/abi.rs index 9032f3cd84f..a25b9251d17 100644 --- a/atk/sys/tests/abi.rs +++ b/atk/sys/tests/abi.rs @@ -323,6 +323,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "AtkLive", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "AtkMisc", Layout { @@ -653,6 +660,9 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) ATK_LAYER_POPUP", "5"), ("(gint) ATK_LAYER_WIDGET", "3"), ("(gint) ATK_LAYER_WINDOW", "7"), + ("(gint) ATK_LIVE_ASSERTIVE", "2"), + ("(gint) ATK_LIVE_NONE", "0"), + ("(gint) ATK_LIVE_POLITE", "1"), ("(gint) ATK_RELATION_CONTROLLED_BY", "1"), ("(gint) ATK_RELATION_CONTROLLER_FOR", "2"), ("(gint) ATK_RELATION_DESCRIBED_BY", "14"), diff --git a/atk/sys/tests/constant.c b/atk/sys/tests/constant.c index 9e3f92f2d1c..aa108865365 100644 --- a/atk/sys/tests/constant.c +++ b/atk/sys/tests/constant.c @@ -40,6 +40,9 @@ int main() { PRINT_CONSTANT((gint) ATK_LAYER_POPUP); PRINT_CONSTANT((gint) ATK_LAYER_WIDGET); PRINT_CONSTANT((gint) ATK_LAYER_WINDOW); + PRINT_CONSTANT((gint) ATK_LIVE_ASSERTIVE); + PRINT_CONSTANT((gint) ATK_LIVE_NONE); + PRINT_CONSTANT((gint) ATK_LIVE_POLITE); PRINT_CONSTANT((gint) ATK_RELATION_CONTROLLED_BY); PRINT_CONSTANT((gint) ATK_RELATION_CONTROLLER_FOR); PRINT_CONSTANT((gint) ATK_RELATION_DESCRIBED_BY); diff --git a/atk/sys/tests/layout.c b/atk/sys/tests/layout.c index 49d85c8d69e..675fd4e2318 100644 --- a/atk/sys/tests/layout.c +++ b/atk/sys/tests/layout.c @@ -25,6 +25,7 @@ int main() { printf("%s;%zu;%zu\n", "AtkKeyEventStruct", sizeof(AtkKeyEventStruct), alignof(AtkKeyEventStruct)); printf("%s;%zu;%zu\n", "AtkKeyEventType", sizeof(AtkKeyEventType), alignof(AtkKeyEventType)); printf("%s;%zu;%zu\n", "AtkLayer", sizeof(AtkLayer), alignof(AtkLayer)); + printf("%s;%zu;%zu\n", "AtkLive", sizeof(AtkLive), alignof(AtkLive)); printf("%s;%zu;%zu\n", "AtkMisc", sizeof(AtkMisc), alignof(AtkMisc)); printf("%s;%zu;%zu\n", "AtkMiscClass", sizeof(AtkMiscClass), alignof(AtkMiscClass)); printf("%s;%zu;%zu\n", "AtkNoOpObject", sizeof(AtkNoOpObject), alignof(AtkNoOpObject)); diff --git a/atk/sys/versions.txt b/atk/sys/versions.txt index dd6ac754e17..17a2d3ead99 100644 --- a/atk/sys/versions.txt +++ b/atk/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) -from gir-files (https://github.com/gtk-rs/gir-files @ 1dc6c3826666) +Generated by gir (https://github.com/gtk-rs/gir @ 76bbe9b90aaa) +from gir-files (https://github.com/gtk-rs/gir-files @ 307566e1ab58) diff --git a/gdk/src/auto/versions.txt b/gdk/src/auto/versions.txt index dd6ac754e17..17a2d3ead99 100644 --- a/gdk/src/auto/versions.txt +++ b/gdk/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) -from gir-files (https://github.com/gtk-rs/gir-files @ 1dc6c3826666) +Generated by gir (https://github.com/gtk-rs/gir @ 76bbe9b90aaa) +from gir-files (https://github.com/gtk-rs/gir-files @ 307566e1ab58) diff --git a/gdk/sys/Cargo.toml b/gdk/sys/Cargo.toml index 851b1d9f6d7..19a512c6dc5 100644 --- a/gdk/sys/Cargo.toml +++ b/gdk/sys/Cargo.toml @@ -68,6 +68,7 @@ rust-version = "1.70" [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] features = [] +rustc-args = ["--cfg", "docsrs"] [package.metadata.system-deps.gdk_3_0] name = "gdk-3.0" diff --git a/gdk/sys/versions.txt b/gdk/sys/versions.txt index dd6ac754e17..17a2d3ead99 100644 --- a/gdk/sys/versions.txt +++ b/gdk/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) -from gir-files (https://github.com/gtk-rs/gir-files @ 1dc6c3826666) +Generated by gir (https://github.com/gtk-rs/gir @ 76bbe9b90aaa) +from gir-files (https://github.com/gtk-rs/gir-files @ 307566e1ab58) diff --git a/gdkx11/src/auto/versions.txt b/gdkx11/src/auto/versions.txt index dd6ac754e17..17a2d3ead99 100644 --- a/gdkx11/src/auto/versions.txt +++ b/gdkx11/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) -from gir-files (https://github.com/gtk-rs/gir-files @ 1dc6c3826666) +Generated by gir (https://github.com/gtk-rs/gir @ 76bbe9b90aaa) +from gir-files (https://github.com/gtk-rs/gir-files @ 307566e1ab58) diff --git a/gdkx11/sys/Cargo.toml b/gdkx11/sys/Cargo.toml index 2045649d02c..c29d577c08f 100644 --- a/gdkx11/sys/Cargo.toml +++ b/gdkx11/sys/Cargo.toml @@ -14,6 +14,7 @@ rust-version = "1.70" [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] features = [] +rustc-args = ["--cfg", "docsrs"] [package.metadata.system-deps.gdk_x11_3_0] name = "gdk-x11-3.0" diff --git a/gdkx11/sys/versions.txt b/gdkx11/sys/versions.txt index dd6ac754e17..17a2d3ead99 100644 --- a/gdkx11/sys/versions.txt +++ b/gdkx11/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) -from gir-files (https://github.com/gtk-rs/gir-files @ 1dc6c3826666) +Generated by gir (https://github.com/gtk-rs/gir @ 76bbe9b90aaa) +from gir-files (https://github.com/gtk-rs/gir-files @ 307566e1ab58) diff --git a/gir b/gir index ef087c070d5..76bbe9b90aa 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit ef087c070d5beaa53ef97568e638679952bc1f96 +Subproject commit 76bbe9b90aaa741770b3698afd33c499000bebc9 diff --git a/gir-files b/gir-files index 1dc6c382666..307566e1ab5 160000 --- a/gir-files +++ b/gir-files @@ -1 +1 @@ -Subproject commit 1dc6c38266669e491bcabdc807172414ad1037da +Subproject commit 307566e1ab58641c174e3674973e9b3f0f803fb3 diff --git a/gtk/src/auto/versions.txt b/gtk/src/auto/versions.txt index dd6ac754e17..17a2d3ead99 100644 --- a/gtk/src/auto/versions.txt +++ b/gtk/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) -from gir-files (https://github.com/gtk-rs/gir-files @ 1dc6c3826666) +Generated by gir (https://github.com/gtk-rs/gir @ 76bbe9b90aaa) +from gir-files (https://github.com/gtk-rs/gir-files @ 307566e1ab58) diff --git a/gtk/sys/Cargo.toml b/gtk/sys/Cargo.toml index a3db654adf7..5463d4056e0 100644 --- a/gtk/sys/Cargo.toml +++ b/gtk/sys/Cargo.toml @@ -15,6 +15,7 @@ rust-version = "1.70" [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] features = [] +rustc-args = ["--cfg", "docsrs"] [package.metadata.system-deps."gtk+_3_0"] name = "gtk+-3.0" diff --git a/gtk/sys/versions.txt b/gtk/sys/versions.txt index dd6ac754e17..17a2d3ead99 100644 --- a/gtk/sys/versions.txt +++ b/gtk/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ ef087c070d5b) -from gir-files (https://github.com/gtk-rs/gir-files @ 1dc6c3826666) +Generated by gir (https://github.com/gtk-rs/gir @ 76bbe9b90aaa) +from gir-files (https://github.com/gtk-rs/gir-files @ 307566e1ab58)