1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// This file was generated by gir (4b09025) from gir-files (71d73f0)
// DO NOT EDIT

use Font;
use FontMetrics;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use gobject_ffi;

glib_wrapper! {
    pub struct Fontset(Object<ffi::PangoFontset>);

    match fn {
        get_type => || ffi::pango_fontset_get_type(),
    }
}

pub trait FontsetExt {
    //fn foreach<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/FontsetForeachFunc, data: P);

    fn get_font(&self, wc: u32) -> Option<Font>;

    fn get_metrics(&self) -> Option<FontMetrics>;
}

impl<O: IsA<Fontset>> FontsetExt for O {
    //fn foreach<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/FontsetForeachFunc, data: P) {
    //    unsafe { TODO: call ffi::pango_fontset_foreach() }
    //}

    fn get_font(&self, wc: u32) -> Option<Font> {
        unsafe {
            from_glib_full(ffi::pango_fontset_get_font(self.to_glib_none().0, wc))
        }
    }

    fn get_metrics(&self) -> Option<FontMetrics> {
        unsafe {
            from_glib_full(ffi::pango_fontset_get_metrics(self.to_glib_none().0))
        }
    }
}