diff --git a/libhandy/Gir.toml b/libhandy/Gir.toml index 3063bcc..d39cf94 100644 --- a/libhandy/Gir.toml +++ b/libhandy/Gir.toml @@ -124,6 +124,9 @@ generate_builder = true name = "Handy.Deck" status = "generate" generate_builder = true + [[object.child_prop]] + name = "name" + type = "utf8" [[object]] name = "Handy.ExpanderRow" diff --git a/libhandy/src/auto/deck.rs b/libhandy/src/auto/deck.rs index 3ebef20..0dd27bc 100644 --- a/libhandy/src/auto/deck.rs +++ b/libhandy/src/auto/deck.rs @@ -520,6 +520,10 @@ pub trait DeckExt: 'static { fn set_property_vhomogeneous(&self, vhomogeneous: bool); + fn get_child_name>(&self, item: &T) -> Option; + + fn set_child_name>(&self, item: &T, name: Option<&str>); + fn connect_property_can_swipe_back_notify( &self, f: F, @@ -784,6 +788,32 @@ impl> DeckExt for O { } } + fn get_child_name>(&self, item: &T) -> Option { + unsafe { + let mut value = Value::from_type(::static_type()); + gtk_sys::gtk_container_child_get_property( + self.to_glib_none().0 as *mut gtk_sys::GtkContainer, + item.to_glib_none().0 as *mut _, + b"name\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value + .get() + .expect("Return Value for property `name` getter") + } + } + + fn set_child_name>(&self, item: &T, name: Option<&str>) { + unsafe { + gtk_sys::gtk_container_child_set_property( + self.to_glib_none().0 as *mut gtk_sys::GtkContainer, + item.to_glib_none().0 as *mut _, + b"name\0".as_ptr() as *const _, + Value::from(name).to_glib_none().0, + ); + } + } + fn connect_property_can_swipe_back_notify( &self, f: F,