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::translate::*; 6 use pango_sys; 7 8 glib_wrapper! { 9 #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] 10 pub struct FontMetrics(Shared<pango_sys::PangoFontMetrics>); 11 12 match fn { 13 ref => |ptr| pango_sys::pango_font_metrics_ref(ptr), 14 unref => |ptr| pango_sys::pango_font_metrics_unref(ptr), 15 get_type => || pango_sys::pango_font_metrics_get_type(), 16 } 17 } 18 19 impl FontMetrics { new() -> FontMetrics20 pub fn new() -> FontMetrics { 21 unsafe { from_glib_full(pango_sys::pango_font_metrics_new()) } 22 } 23 get_approximate_char_width(&self) -> i3224 pub fn get_approximate_char_width(&self) -> i32 { 25 unsafe { pango_sys::pango_font_metrics_get_approximate_char_width(self.to_glib_none().0) } 26 } 27 get_approximate_digit_width(&self) -> i3228 pub fn get_approximate_digit_width(&self) -> i32 { 29 unsafe { pango_sys::pango_font_metrics_get_approximate_digit_width(self.to_glib_none().0) } 30 } 31 get_ascent(&self) -> i3232 pub fn get_ascent(&self) -> i32 { 33 unsafe { pango_sys::pango_font_metrics_get_ascent(self.to_glib_none().0) } 34 } 35 get_descent(&self) -> i3236 pub fn get_descent(&self) -> i32 { 37 unsafe { pango_sys::pango_font_metrics_get_descent(self.to_glib_none().0) } 38 } 39 get_strikethrough_position(&self) -> i3240 pub fn get_strikethrough_position(&self) -> i32 { 41 unsafe { pango_sys::pango_font_metrics_get_strikethrough_position(self.to_glib_none().0) } 42 } 43 get_strikethrough_thickness(&self) -> i3244 pub fn get_strikethrough_thickness(&self) -> i32 { 45 unsafe { pango_sys::pango_font_metrics_get_strikethrough_thickness(self.to_glib_none().0) } 46 } 47 get_underline_position(&self) -> i3248 pub fn get_underline_position(&self) -> i32 { 49 unsafe { pango_sys::pango_font_metrics_get_underline_position(self.to_glib_none().0) } 50 } 51 get_underline_thickness(&self) -> i3252 pub fn get_underline_thickness(&self) -> i32 { 53 unsafe { pango_sys::pango_font_metrics_get_underline_thickness(self.to_glib_none().0) } 54 } 55 } 56 57 impl Default for FontMetrics { default() -> Self58 fn default() -> Self { 59 Self::new() 60 } 61 } 62