pango/item.rs
1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::{Analysis, Item};
4
5impl Item {
6 pub fn offset(&self) -> i32 {
7 unsafe { (*self.as_ptr()).offset }
8 }
9
10 pub fn length(&self) -> i32 {
11 unsafe { (*self.as_ptr()).length }
12 }
13
14 pub fn num_chars(&self) -> i32 {
15 unsafe { (*self.as_ptr()).num_chars }
16 }
17
18 pub fn analysis(&self) -> &Analysis {
19 unsafe { &*(&((*self.as_ptr()).analysis) as *const _ as *const Analysis) }
20 }
21}