1 // This file was generated by gir (https://github.com/gtk-rs/gir)
2 // from gir-files (https://github.com/gtk-rs/gir-files)
3 // DO NOT EDIT
4 
5 use glib::object::IsA;
6 use glib::translate::*;
7 use std::fmt;
8 
9 glib::wrapper! {
10     #[doc(alias = "PangoCairoFontMap")]
11     pub struct FontMap(Interface<ffi::PangoCairoFontMap>) @requires pango::FontMap;
12 
13     match fn {
14         type_ => || ffi::pango_cairo_font_map_get_type(),
15     }
16 }
17 
18 impl FontMap {
19     #[doc(alias = "pango_cairo_font_map_get_default")]
20     #[doc(alias = "get_default")]
default() -> Option<pango::FontMap>21     pub fn default() -> Option<pango::FontMap> {
22         unsafe { from_glib_none(ffi::pango_cairo_font_map_get_default()) }
23     }
24 }
25 
26 pub const NONE_FONT_MAP: Option<&FontMap> = None;
27 
28 pub trait FontMapExt: 'static {
29     #[doc(alias = "pango_cairo_font_map_get_resolution")]
30     #[doc(alias = "get_resolution")]
resolution(&self) -> f6431     fn resolution(&self) -> f64;
32 
33     #[doc(alias = "pango_cairo_font_map_set_resolution")]
set_resolution(&self, dpi: f64)34     fn set_resolution(&self, dpi: f64);
35 }
36 
37 impl<O: IsA<FontMap>> FontMapExt for O {
resolution(&self) -> f6438     fn resolution(&self) -> f64 {
39         unsafe { ffi::pango_cairo_font_map_get_resolution(self.as_ref().to_glib_none().0) }
40     }
41 
set_resolution(&self, dpi: f64)42     fn set_resolution(&self, dpi: f64) {
43         unsafe {
44             ffi::pango_cairo_font_map_set_resolution(self.as_ref().to_glib_none().0, dpi);
45         }
46     }
47 }
48 
49 impl fmt::Display for FontMap {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result50     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
51         f.write_str("FontMap")
52     }
53 }
54