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

use glib::{prelude::*, translate::*};
use std::fmt;

glib::wrapper! {
    #[doc(alias = "PangoCairoFont")]
    pub struct Font(Interface<ffi::PangoCairoFont>) @requires pango::Font;

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

impl Font {
    pub const NONE: Option<&'static Font> = None;
}

mod sealed {
    pub trait Sealed {}
    impl<T: super::IsA<super::Font>> Sealed for T {}
}

pub trait PangoCairoFontExt: IsA<Font> + sealed::Sealed + 'static {
    #[doc(alias = "pango_cairo_font_get_scaled_font")]
    #[doc(alias = "get_scaled_font")]
    fn scaled_font(&self) -> Option<cairo::ScaledFont> {
        unsafe {
            from_glib_none(ffi::pango_cairo_font_get_scaled_font(
                self.as_ref().to_glib_none().0,
            ))
        }
    }
}

impl<O: IsA<Font>> PangoCairoFontExt for O {}

impl fmt::Display for Font {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("Font")
    }
}
