pango/auto/
glyph_item.rs

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
5use glib::translate::*;
6use pango_sys;
7use AttrList;
8
9glib_wrapper! {
10    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
11    pub struct GlyphItem(Boxed<pango_sys::PangoGlyphItem>);
12
13    match fn {
14        copy => |ptr| pango_sys::pango_glyph_item_copy(mut_override(ptr)),
15        free => |ptr| pango_sys::pango_glyph_item_free(ptr),
16        get_type => || pango_sys::pango_glyph_item_get_type(),
17    }
18}
19
20impl GlyphItem {
21    pub fn apply_attrs(&mut self, text: &str, list: &AttrList) -> Vec<GlyphItem> {
22        unsafe {
23            FromGlibPtrContainer::from_glib_full(pango_sys::pango_glyph_item_apply_attrs(
24                self.to_glib_none_mut().0,
25                text.to_glib_none().0,
26                list.to_glib_none().0,
27            ))
28        }
29    }
30
31    //pub fn get_logical_widths(&mut self, text: &str, logical_widths: &[i32]) {
32    //    unsafe { TODO: call pango_sys:pango_glyph_item_get_logical_widths() }
33    //}
34
35    //pub fn letter_space(&mut self, text: &str, log_attrs: /*Ignored*/&[&LogAttr], letter_spacing: i32) {
36    //    unsafe { TODO: call pango_sys:pango_glyph_item_letter_space() }
37    //}
38
39    pub fn split(&mut self, text: &str, split_index: i32) -> Option<GlyphItem> {
40        unsafe {
41            from_glib_full(pango_sys::pango_glyph_item_split(
42                self.to_glib_none_mut().0,
43                text.to_glib_none().0,
44                split_index,
45            ))
46        }
47    }
48}