// This file was generated by gir (https://github.com/gtk-rs/gir)
// from ../gir-files
// from ../pps-girs
// DO NOT EDIT

use crate::{Point, ffi};
use glib::translate::*;

glib::wrapper! {
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct Path(Boxed<ffi::PpsPath>);

    match fn {
        copy => |ptr| ffi::pps_path_copy(ptr),
        free => |ptr| ffi::pps_path_free(ptr),
        type_ => || ffi::pps_path_get_type(),
    }
}

impl Path {
    #[doc(alias = "pps_path_copy_array")]
    pub fn copy_array(&mut self) -> Vec<Point> {
        unsafe {
            let mut n_points = std::mem::MaybeUninit::uninit();
            let ret = FromGlibContainer::from_glib_full_num(
                ffi::pps_path_copy_array(self.to_glib_none_mut().0, n_points.as_mut_ptr()),
                n_points.assume_init() as _,
            );
            ret
        }
    }
}
