webkit6 0.6.1

Rust bindings for WebKit 6.0
Documentation
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from webkit-gir-files
// DO NOT EDIT

use crate::ffi;
use glib::translate::*;

glib::wrapper! {
    #[doc(alias = "WebKitImage")]
    pub struct Image(Object<ffi::WebKitImage, ffi::WebKitImageClass>) @implements gio::Icon, gio::LoadableIcon;

    match fn {
        type_ => || ffi::webkit_image_get_type(),
    }
}

impl Image {
    #[doc(alias = "webkit_image_as_bytes")]
    pub fn as_bytes(&self) -> Option<glib::Bytes> {
        unsafe { from_glib_none(ffi::webkit_image_as_bytes(self.to_glib_none().0)) }
    }

    #[doc(alias = "webkit_image_get_height")]
    #[doc(alias = "get_height")]
    pub fn height(&self) -> i32 {
        unsafe { ffi::webkit_image_get_height(self.to_glib_none().0) }
    }

    #[doc(alias = "webkit_image_get_stride")]
    #[doc(alias = "get_stride")]
    pub fn stride(&self) -> u32 {
        unsafe { ffi::webkit_image_get_stride(self.to_glib_none().0) }
    }

    #[doc(alias = "webkit_image_get_width")]
    #[doc(alias = "get_width")]
    pub fn width(&self) -> i32 {
        unsafe { ffi::webkit_image_get_width(self.to_glib_none().0) }
    }
}