Skip to content

Commit 7d55b28

Browse files
gtk: Generate new Snapshot APIs
1 parent 61dca09 commit 7d55b28

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

gtk4/Gir.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,17 @@ manual = [
350350
"Gsk.BlendMode",
351351
"Gsk.CairoNode", # docs only
352352
"Gsk.ColorStop",
353+
"Gsk.FillRule",
353354
"Gsk.GLShaderNode", # docs only
354355
"Gsk.MaskMode",
355356
"Gsk.MaskNode",
357+
"Gsk.Path",
356358
"Gsk.Renderer",
357359
"Gsk.RenderNode",
358360
"Gsk.RoundedRect",
359361
"Gsk.ScalingFilter",
360362
"Gsk.Shadow",
363+
"Gsk.Stroke",
361364
"Gsk.Transform",
362365
"Gtk.Align", # as we need to handle baseline_fill = baseline for gtk >= 4.11
363366
"Gtk.BitsetIter",

gtk4/src/auto/snapshot.rs

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,18 @@ pub trait SnapshotExt: IsA<Snapshot> + sealed::Sealed + 'static {
333333
}
334334
}
335335

336-
//#[cfg(feature = "v4_14")]
337-
//#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
338-
//#[doc(alias = "gtk_snapshot_push_fill")]
339-
//fn push_fill(&self, path: /*Ignored*/&gsk::Path, fill_rule: /*Ignored*/gsk::FillRule) {
340-
// unsafe { TODO: call ffi:gtk_snapshot_push_fill() }
341-
//}
336+
#[cfg(feature = "v4_14")]
337+
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
338+
#[doc(alias = "gtk_snapshot_push_fill")]
339+
fn push_fill(&self, path: &gsk::Path, fill_rule: gsk::FillRule) {
340+
unsafe {
341+
ffi::gtk_snapshot_push_fill(
342+
self.as_ref().to_glib_none().0,
343+
path.to_glib_none().0,
344+
fill_rule.into_glib(),
345+
);
346+
}
347+
}
342348

343349
#[doc(alias = "gtk_snapshot_push_gl_shader")]
344350
fn push_gl_shader(
@@ -406,12 +412,18 @@ pub trait SnapshotExt: IsA<Snapshot> + sealed::Sealed + 'static {
406412
}
407413
}
408414

409-
//#[cfg(feature = "v4_14")]
410-
//#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
411-
//#[doc(alias = "gtk_snapshot_push_stroke")]
412-
//fn push_stroke(&self, path: /*Ignored*/&gsk::Path, stroke: /*Ignored*/&gsk::Stroke) {
413-
// unsafe { TODO: call ffi:gtk_snapshot_push_stroke() }
414-
//}
415+
#[cfg(feature = "v4_14")]
416+
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
417+
#[doc(alias = "gtk_snapshot_push_stroke")]
418+
fn push_stroke(&self, path: &gsk::Path, stroke: &gsk::Stroke) {
419+
unsafe {
420+
ffi::gtk_snapshot_push_stroke(
421+
self.as_ref().to_glib_none().0,
422+
path.to_glib_none().0,
423+
stroke.to_glib_none().0,
424+
);
425+
}
426+
}
415427

416428
#[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
417429
#[allow(deprecated)]

0 commit comments

Comments
 (0)