pango/auto/
glyph_item_iter.rs1use glib::translate::*;
6use pango_sys;
7use GlyphItem;
8
9glib_wrapper! {
10 #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
11 pub struct GlyphItemIter(Boxed<pango_sys::PangoGlyphItemIter>);
12
13 match fn {
14 copy => |ptr| pango_sys::pango_glyph_item_iter_copy(mut_override(ptr)),
15 free => |ptr| pango_sys::pango_glyph_item_iter_free(ptr),
16 get_type => || pango_sys::pango_glyph_item_iter_get_type(),
17 }
18}
19
20impl GlyphItemIter {
21 pub fn init_end(&mut self, glyph_item: &mut GlyphItem, text: &str) -> bool {
22 unsafe {
23 from_glib(pango_sys::pango_glyph_item_iter_init_end(
24 self.to_glib_none_mut().0,
25 glyph_item.to_glib_none_mut().0,
26 text.to_glib_none().0,
27 ))
28 }
29 }
30
31 pub fn init_start(&mut self, glyph_item: &mut GlyphItem, text: &str) -> bool {
32 unsafe {
33 from_glib(pango_sys::pango_glyph_item_iter_init_start(
34 self.to_glib_none_mut().0,
35 glyph_item.to_glib_none_mut().0,
36 text.to_glib_none().0,
37 ))
38 }
39 }
40
41 pub fn next_cluster(&mut self) -> bool {
42 unsafe {
43 from_glib(pango_sys::pango_glyph_item_iter_next_cluster(
44 self.to_glib_none_mut().0,
45 ))
46 }
47 }
48
49 pub fn prev_cluster(&mut self) -> bool {
50 unsafe {
51 from_glib(pango_sys::pango_glyph_item_iter_prev_cluster(
52 self.to_glib_none_mut().0,
53 ))
54 }
55 }
56}