diff --git a/gsk4/Gir.toml b/gsk4/Gir.toml index ba95fc4c25ee..e15c7d5dfbab 100644 --- a/gsk4/Gir.toml +++ b/gsk4/Gir.toml @@ -107,6 +107,9 @@ status = "generate" [[object.function]] name = "new" manual = true + [[object.function]] + name = "get_child" + manual = true # assert that idx < n_children [[object]] name = "Gsk.GLShader" @@ -138,6 +141,9 @@ status = "generate" [[object.function]] name = "new" manual = true + [[object.function]] + name = "get_child" + manual = true # assert that idx < n_children [[object]] name = "Gsk.LinearGradientNode" diff --git a/gsk4/src/auto/container_node.rs b/gsk4/src/auto/container_node.rs index 0744765dcf04..57c91d4f3cc3 100644 --- a/gsk4/src/auto/container_node.rs +++ b/gsk4/src/auto/container_node.rs @@ -18,17 +18,6 @@ glib::wrapper! { } impl ContainerNode { - #[doc(alias = "gsk_container_node_get_child")] - #[doc(alias = "get_child")] - pub fn child(&self, idx: u32) -> Option { - unsafe { - from_glib_none(ffi::gsk_container_node_get_child( - self.to_glib_none().0, - idx, - )) - } - } - #[doc(alias = "gsk_container_node_get_n_children")] #[doc(alias = "get_n_children")] pub fn n_children(&self) -> u32 { diff --git a/gsk4/src/auto/gl_shader_node.rs b/gsk4/src/auto/gl_shader_node.rs index abce6dc40c33..600bbc2a2922 100644 --- a/gsk4/src/auto/gl_shader_node.rs +++ b/gsk4/src/auto/gl_shader_node.rs @@ -25,17 +25,6 @@ impl GLShaderNode { unsafe { from_glib_none(ffi::gsk_gl_shader_node_get_args(self.to_glib_none().0)) } } - #[doc(alias = "gsk_gl_shader_node_get_child")] - #[doc(alias = "get_child")] - pub fn child(&self, idx: u32) -> Option { - unsafe { - from_glib_none(ffi::gsk_gl_shader_node_get_child( - self.to_glib_none().0, - idx, - )) - } - } - #[doc(alias = "gsk_gl_shader_node_get_n_children")] #[doc(alias = "get_n_children")] pub fn n_children(&self) -> u32 { diff --git a/gsk4/src/container_node.rs b/gsk4/src/container_node.rs index 54107180c9b3..e87d838a5124 100644 --- a/gsk4/src/container_node.rs +++ b/gsk4/src/container_node.rs @@ -21,4 +21,16 @@ impl ContainerNode { )) } } + + #[doc(alias = "gsk_container_node_get_child")] + #[doc(alias = "get_child")] + pub fn child(&self, idx: u32) -> Option { + assert!(idx < self.n_children()); + unsafe { + from_glib_none(ffi::gsk_container_node_get_child( + self.to_glib_none().0, + idx, + )) + } + } } diff --git a/gsk4/src/gl_shader_node.rs b/gsk4/src/gl_shader_node.rs index 6d5d3a4e2ce9..6961ff29967f 100644 --- a/gsk4/src/gl_shader_node.rs +++ b/gsk4/src/gl_shader_node.rs @@ -30,4 +30,16 @@ impl GLShaderNode { )) } } + + #[doc(alias = "gsk_gl_shader_node_get_child")] + #[doc(alias = "get_child")] + pub fn child(&self, idx: u32) -> Option { + assert!(idx < self.n_children()); + unsafe { + from_glib_none(ffi::gsk_gl_shader_node_get_child( + self.to_glib_none().0, + idx, + )) + } + } }