Skip to content

Commit

Permalink
gsk: Adapt to changed Path.foreach
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui committed Aug 27, 2023
1 parent 2e3f126 commit a4f7435
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gsk4/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@ use glib::translate::*;

impl Path {
#[doc(alias = "gsk_path_foreach")]
pub fn foreach<P: FnMut(&PathOperation, &graphene::Point, usize) -> bool>(
pub fn foreach<P: FnMut(&PathOperation, &graphene::Point, usize, f32) -> bool>(
&self,
flags: PathForeachFlags,
func: P,
) -> bool {
let func_data: P = func;
unsafe extern "C" fn func_func<
P: FnMut(&PathOperation, &graphene::Point, usize) -> bool,
P: FnMut(&PathOperation, &graphene::Point, usize, f32) -> bool,
>(
op: ffi::GskPathOperation,
pts: *const graphene::ffi::graphene_point_t,
n_pts: libc::size_t,
weight: libc::c_float,
user_data: glib::ffi::gpointer,
) -> glib::ffi::gboolean {
let op = from_glib(op);
let pts = from_glib_borrow(pts);
let callback: *mut P = user_data as *const _ as usize as *mut P;
(*callback)(&op, &pts, n_pts).into_glib()
(*callback)(&op, &pts, n_pts, weight).into_glib()
}
let func = Some(func_func::<P> as _);
let super_callback0: &P = &func_data;
Expand Down

0 comments on commit a4f7435

Please sign in to comment.