neovim-gtk/src/sys/pango/attr_iterator.rs

32 lines
671 B
Rust
Raw Normal View History

2017-09-11 15:00:51 +00:00
use std::ptr;
use std::mem;
use pango_sys;
use pango;
use glib_ffi;
use glib::translate::*;
glib_wrapper! {
pub struct AttrIterator(Boxed<pango_sys::PangoAttrIterator>);
match fn {
copy => |ptr| pango_sys::pango_attr_iterator_copy(ptr as *mut _),
free => |ptr| pango_sys::pango_attr_iterator_destroy(ptr),
}
}
pub trait AttrIteratorFactory {
fn get_iterator(&self) -> AttrIterator;
}
impl AttrIteratorFactory for pango::AttrList {
fn get_iterator(&self) -> AttrIterator {
unsafe {
from_glib_none(pango_sys::pango_attr_list_get_iterator(
self.to_glib_none().0,
))
}
}
}