diff --git a/gsk4/Gir.toml b/gsk4/Gir.toml index acae6ba4ceae..7d53698b5e5b 100644 --- a/gsk4/Gir.toml +++ b/gsk4/Gir.toml @@ -46,7 +46,6 @@ generate = [ "Gsk.RoundedClipNode", "Gsk.ScalingFilter", "Gsk.SerializationError", - "Gsk.Stroke", "Gsk.StrokeNode", "Gsk.TextureNode", "Gsk.TextureScaleNode", @@ -234,6 +233,25 @@ status = "generate" name = "get_shadow" manual = true # assert that i < n_shadows +[[object]] +name = "Gsk.Stroke" +status = "generate" + [[object.function]] + name = "to_cairo" + [[object.function.parameter]] + name = "cr" + const = true + [[object.function]] + pattern = "set_(dash|dash_offset|line_cap|line_join|line_width|miter_limit)" + [[object.function.parameter]] + name = "self" + const = true + [[object.function]] + name = "equal" + [[object.function.parameter]] + name = "stroke2" + nullable = false + [[object]] name = "Gsk.TextNode" status = "generate" diff --git a/gsk4/src/auto/stroke.rs b/gsk4/src/auto/stroke.rs index d10135a462c7..abf03713b4f2 100644 --- a/gsk4/src/auto/stroke.rs +++ b/gsk4/src/auto/stroke.rs @@ -68,57 +68,64 @@ impl Stroke { } #[doc(alias = "gsk_stroke_set_dash")] - pub fn set_dash(&mut self, dash: &[f32]) { + pub fn set_dash(&self, dash: &[f32]) { let n_dash = dash.len() as _; unsafe { - ffi::gsk_stroke_set_dash(self.to_glib_none_mut().0, dash.to_glib_none().0, n_dash); + ffi::gsk_stroke_set_dash( + mut_override(self.to_glib_none().0), + dash.to_glib_none().0, + n_dash, + ); } } #[doc(alias = "gsk_stroke_set_dash_offset")] - pub fn set_dash_offset(&mut self, offset: f32) { + pub fn set_dash_offset(&self, offset: f32) { unsafe { - ffi::gsk_stroke_set_dash_offset(self.to_glib_none_mut().0, offset); + ffi::gsk_stroke_set_dash_offset(mut_override(self.to_glib_none().0), offset); } } #[doc(alias = "gsk_stroke_set_line_cap")] - pub fn set_line_cap(&mut self, line_cap: LineCap) { + pub fn set_line_cap(&self, line_cap: LineCap) { unsafe { - ffi::gsk_stroke_set_line_cap(self.to_glib_none_mut().0, line_cap.into_glib()); + ffi::gsk_stroke_set_line_cap(mut_override(self.to_glib_none().0), line_cap.into_glib()); } } #[doc(alias = "gsk_stroke_set_line_join")] - pub fn set_line_join(&mut self, line_join: LineJoin) { + pub fn set_line_join(&self, line_join: LineJoin) { unsafe { - ffi::gsk_stroke_set_line_join(self.to_glib_none_mut().0, line_join.into_glib()); + ffi::gsk_stroke_set_line_join( + mut_override(self.to_glib_none().0), + line_join.into_glib(), + ); } } #[doc(alias = "gsk_stroke_set_line_width")] - pub fn set_line_width(&mut self, line_width: f32) { + pub fn set_line_width(&self, line_width: f32) { unsafe { - ffi::gsk_stroke_set_line_width(self.to_glib_none_mut().0, line_width); + ffi::gsk_stroke_set_line_width(mut_override(self.to_glib_none().0), line_width); } } #[doc(alias = "gsk_stroke_set_miter_limit")] - pub fn set_miter_limit(&mut self, limit: f32) { + pub fn set_miter_limit(&self, limit: f32) { unsafe { - ffi::gsk_stroke_set_miter_limit(self.to_glib_none_mut().0, limit); + ffi::gsk_stroke_set_miter_limit(mut_override(self.to_glib_none().0), limit); } } #[doc(alias = "gsk_stroke_to_cairo")] - pub fn to_cairo(&self, cr: &mut cairo::Context) { + pub fn to_cairo(&self, cr: &cairo::Context) { unsafe { - ffi::gsk_stroke_to_cairo(self.to_glib_none().0, cr.to_glib_none_mut().0); + ffi::gsk_stroke_to_cairo(self.to_glib_none().0, mut_override(cr.to_glib_none().0)); } } #[doc(alias = "gsk_stroke_equal")] - fn equal(&self, stroke2: Option<&Stroke>) -> bool { + fn equal(&self, stroke2: &Stroke) -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gsk_stroke_equal(