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 #[cfg(any(feature = "v1_44", feature = "dox"))]
6 #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_44")))]
7 use crate::AttrIterator;
8 use glib::translate::*;
9 
10 glib::wrapper! {
11     #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
12     pub struct Item(Boxed<ffi::PangoItem>);
13 
14     match fn {
15         copy => |ptr| ffi::pango_item_copy(mut_override(ptr)),
16         free => |ptr| ffi::pango_item_free(ptr),
17         type_ => || ffi::pango_item_get_type(),
18     }
19 }
20 
21 impl Item {
22     #[doc(alias = "pango_item_new")]
new() -> Item23     pub fn new() -> Item {
24         unsafe { from_glib_full(ffi::pango_item_new()) }
25     }
26 
27     #[cfg(any(feature = "v1_44", feature = "dox"))]
28     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_44")))]
29     #[doc(alias = "pango_item_apply_attrs")]
apply_attrs(&mut self, iter: &mut AttrIterator)30     pub fn apply_attrs(&mut self, iter: &mut AttrIterator) {
31         unsafe {
32             ffi::pango_item_apply_attrs(self.to_glib_none_mut().0, iter.to_glib_none_mut().0);
33         }
34     }
35 
36     #[doc(alias = "pango_item_split")]
split(&mut self, split_index: i32, split_offset: i32) -> Option<Item>37     pub fn split(&mut self, split_index: i32, split_offset: i32) -> Option<Item> {
38         unsafe {
39             from_glib_full(ffi::pango_item_split(
40                 self.to_glib_none_mut().0,
41                 split_index,
42                 split_offset,
43             ))
44         }
45     }
46 }
47 
48 impl Default for Item {
default() -> Self49     fn default() -> Self {
50         Self::new()
51     }
52 }
53