pangocairo 0.22.8

Rust bindings for the PangoCairo library
Documentation
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::ffi;
use glib::{prelude::*, translate::*};

#[doc(alias = "pango_cairo_context_get_resolution")]
pub fn context_get_resolution(context: &pango::Context) -> f64 {
    unsafe { ffi::pango_cairo_context_get_resolution(context.to_glib_none().0) }
}

//#[doc(alias = "pango_cairo_context_get_shape_renderer")]
//pub fn context_get_shape_renderer(context: &pango::Context, data: /*Unimplemented*/Option<Basic: Pointer>) -> /*Unimplemented*/Fn(&cairo::Context, /*Ignored*/pango::AttrShape, bool) {
//    unsafe { TODO: call ffi:pango_cairo_context_get_shape_renderer() }
//}

#[doc(alias = "pango_cairo_context_set_font_options")]
pub fn context_set_font_options(context: &pango::Context, options: Option<&cairo::FontOptions>) {
    unsafe {
        ffi::pango_cairo_context_set_font_options(
            context.to_glib_none().0,
            options.to_glib_none().0,
        );
    }
}

#[doc(alias = "pango_cairo_context_set_resolution")]
pub fn context_set_resolution(context: &pango::Context, dpi: f64) {
    unsafe {
        ffi::pango_cairo_context_set_resolution(context.to_glib_none().0, dpi);
    }
}

//#[doc(alias = "pango_cairo_context_set_shape_renderer")]
//pub fn context_set_shape_renderer(context: &pango::Context, func: /*Unimplemented*/Fn(&cairo::Context, /*Ignored*/pango::AttrShape, bool), data: /*Unimplemented*/Option<Basic: Pointer>) {
//    unsafe { TODO: call ffi:pango_cairo_context_set_shape_renderer() }
//}

#[doc(alias = "pango_cairo_create_context")]
pub fn create_context(cr: &cairo::Context) -> pango::Context {
    unsafe {
        from_glib_full(ffi::pango_cairo_create_context(mut_override(
            cr.to_glib_none().0,
        )))
    }
}

#[doc(alias = "pango_cairo_create_layout")]
pub fn create_layout(cr: &cairo::Context) -> pango::Layout {
    unsafe {
        from_glib_full(ffi::pango_cairo_create_layout(mut_override(
            cr.to_glib_none().0,
        )))
    }
}

#[doc(alias = "pango_cairo_error_underline_path")]
pub fn error_underline_path(cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64) {
    unsafe {
        ffi::pango_cairo_error_underline_path(
            mut_override(cr.to_glib_none().0),
            x,
            y,
            width,
            height,
        );
    }
}

#[doc(alias = "pango_cairo_glyph_string_path")]
pub fn glyph_string_path(
    cr: &cairo::Context,
    font: &impl IsA<pango::Font>,
    glyphs: &mut pango::GlyphString,
) {
    unsafe {
        ffi::pango_cairo_glyph_string_path(
            mut_override(cr.to_glib_none().0),
            font.as_ref().to_glib_none().0,
            glyphs.to_glib_none_mut().0,
        );
    }
}

#[doc(alias = "pango_cairo_layout_line_path")]
pub fn layout_line_path(cr: &cairo::Context, line: &pango::LayoutLine) {
    unsafe {
        ffi::pango_cairo_layout_line_path(mut_override(cr.to_glib_none().0), line.to_glib_none().0);
    }
}

#[doc(alias = "pango_cairo_layout_path")]
pub fn layout_path(cr: &cairo::Context, layout: &pango::Layout) {
    unsafe {
        ffi::pango_cairo_layout_path(mut_override(cr.to_glib_none().0), layout.to_glib_none().0);
    }
}

#[doc(alias = "pango_cairo_show_error_underline")]
pub fn show_error_underline(cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64) {
    unsafe {
        ffi::pango_cairo_show_error_underline(
            mut_override(cr.to_glib_none().0),
            x,
            y,
            width,
            height,
        );
    }
}

#[doc(alias = "pango_cairo_show_glyph_item")]
pub fn show_glyph_item(cr: &cairo::Context, text: &str, glyph_item: &mut pango::GlyphItem) {
    unsafe {
        ffi::pango_cairo_show_glyph_item(
            mut_override(cr.to_glib_none().0),
            text.to_glib_none().0,
            glyph_item.to_glib_none_mut().0,
        );
    }
}

#[doc(alias = "pango_cairo_show_glyph_string")]
pub fn show_glyph_string(
    cr: &cairo::Context,
    font: &impl IsA<pango::Font>,
    glyphs: &mut pango::GlyphString,
) {
    unsafe {
        ffi::pango_cairo_show_glyph_string(
            mut_override(cr.to_glib_none().0),
            font.as_ref().to_glib_none().0,
            glyphs.to_glib_none_mut().0,
        );
    }
}

#[doc(alias = "pango_cairo_show_layout")]
pub fn show_layout(cr: &cairo::Context, layout: &pango::Layout) {
    unsafe {
        ffi::pango_cairo_show_layout(mut_override(cr.to_glib_none().0), layout.to_glib_none().0);
    }
}

#[doc(alias = "pango_cairo_show_layout_line")]
pub fn show_layout_line(cr: &cairo::Context, line: &pango::LayoutLine) {
    unsafe {
        ffi::pango_cairo_show_layout_line(mut_override(cr.to_glib_none().0), line.to_glib_none().0);
    }
}

#[doc(alias = "pango_cairo_update_context")]
pub fn update_context(cr: &cairo::Context, context: &pango::Context) {
    unsafe {
        ffi::pango_cairo_update_context(
            mut_override(cr.to_glib_none().0),
            context.to_glib_none().0,
        );
    }
}

#[doc(alias = "pango_cairo_update_layout")]
pub fn update_layout(cr: &cairo::Context, layout: &pango::Layout) {
    unsafe {
        ffi::pango_cairo_update_layout(mut_override(cr.to_glib_none().0), layout.to_glib_none().0);
    }
}