use glib::translate::*;
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PixelFormat(Boxed<ffi::VncPixelFormat>);
match fn {
copy => |ptr| ffi::vnc_pixel_format_copy(mut_override(ptr)),
free => |ptr| ffi::vnc_pixel_format_free(ptr),
type_ => || ffi::vnc_pixel_format_get_type(),
}
}
impl PixelFormat {
#[doc(alias = "vnc_pixel_format_new")]
pub fn new() -> PixelFormat {
assert_initialized_main_thread!();
unsafe { from_glib_full(ffi::vnc_pixel_format_new()) }
}
#[doc(alias = "vnc_pixel_format_match")]
#[doc(alias = "match")]
pub fn match_(&self, other: &PixelFormat) -> bool {
unsafe {
from_glib(ffi::vnc_pixel_format_match(
self.to_glib_none().0,
other.to_glib_none().0,
))
}
}
}
impl Default for PixelFormat {
fn default() -> Self {
Self::new()
}
}