2017-08-24 14:41:20 +00:00
|
|
|
pub mod item;
|
2017-08-20 18:09:57 +00:00
|
|
|
mod analysis;
|
2017-08-18 15:35:33 +00:00
|
|
|
|
|
|
|
use std::ptr;
|
|
|
|
use std::ffi::CStr;
|
|
|
|
|
|
|
|
use pango;
|
|
|
|
use pango_sys;
|
|
|
|
|
|
|
|
use glib::translate::*;
|
|
|
|
|
|
|
|
pub fn pango_itemize(
|
|
|
|
context: &pango::Context,
|
2017-08-24 14:41:20 +00:00
|
|
|
text: &String,
|
|
|
|
attrs: &pango::AttrList
|
2017-08-18 15:35:33 +00:00
|
|
|
) -> Vec<item::Item> {
|
|
|
|
unsafe {
|
|
|
|
FromGlibPtrContainer::from_glib_container(pango_sys::pango_itemize(
|
|
|
|
context.to_glib_none().0,
|
2017-08-24 14:41:20 +00:00
|
|
|
text.as_ptr() as *const i8,
|
|
|
|
0,
|
|
|
|
text.len() as i32,
|
2017-08-18 15:35:33 +00:00
|
|
|
attrs.to_glib_none().0,
|
|
|
|
ptr::null_mut(),
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn pango_shape(
|
2017-08-24 14:41:20 +00:00
|
|
|
text: &String,
|
2017-08-20 18:09:57 +00:00
|
|
|
analysis: &analysis::Analysis,
|
2017-08-18 15:35:33 +00:00
|
|
|
glyphs: &mut pango::GlyphString,
|
|
|
|
) {
|
|
|
|
unsafe {
|
|
|
|
pango_sys::pango_shape(
|
2017-08-24 14:41:20 +00:00
|
|
|
text.as_ptr() as *const i8,
|
|
|
|
text.len() as i32,
|
2017-08-20 18:09:57 +00:00
|
|
|
analysis.to_glib_ptr(),
|
2017-08-18 15:35:33 +00:00
|
|
|
glyphs.to_glib_none_mut().0,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2017-08-20 18:09:57 +00:00
|
|
|
|