pango/item.rs
1// Copyright 2018, The Gtk-rs Project Developers.
2// See the COPYRIGHT file at the top-level directory of this distribution.
3// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
4
5use glib::translate::ToGlibPtr;
6
7use Analysis;
8use Item;
9
10impl Item {
11 pub fn offset(&self) -> i32 {
12 unsafe { (*self.to_glib_none().0).offset }
13 }
14
15 pub fn length(&self) -> i32 {
16 unsafe { (*self.to_glib_none().0).length }
17 }
18
19 pub fn num_chars(&self) -> i32 {
20 unsafe { (*self.to_glib_none().0).num_chars }
21 }
22
23 pub fn analysis(&self) -> &Analysis {
24 unsafe { &*(&((*self.to_glib_none().0).analysis) as *const _ as *const Analysis) }
25 }
26}