pango_cairo_sys/
lib.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
6#![allow(
7    clippy::approx_constant,
8    clippy::type_complexity,
9    clippy::unreadable_literal,
10    clippy::upper_case_acronyms
11)]
12#![cfg_attr(docsrs, feature(doc_cfg))]
13
14use cairo_sys as cairo;
15use glib_sys as glib;
16use pango_sys as pango;
17
18#[cfg(unix)]
19#[allow(unused_imports)]
20use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t};
21#[allow(unused_imports)]
22use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE};
23#[allow(unused_imports)]
24use std::ffi::{
25    c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
26};
27
28#[allow(unused_imports)]
29use glib::{gboolean, gconstpointer, gpointer, GType};
30
31// Callbacks
32pub type PangoCairoShapeRendererFunc = Option<
33    unsafe extern "C" fn(*mut cairo::cairo_t, *mut pango::PangoAttrShape, gboolean, gpointer),
34>;
35
36// Interfaces
37#[repr(C)]
38#[allow(dead_code)]
39pub struct PangoCairoFont {
40    _data: [u8; 0],
41    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
42}
43
44impl ::std::fmt::Debug for PangoCairoFont {
45    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
46        write!(f, "PangoCairoFont @ {self:p}")
47    }
48}
49
50#[repr(C)]
51#[allow(dead_code)]
52pub struct PangoCairoFontMap {
53    _data: [u8; 0],
54    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
55}
56
57impl ::std::fmt::Debug for PangoCairoFontMap {
58    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
59        write!(f, "PangoCairoFontMap @ {self:p}")
60    }
61}
62
63extern "C" {
64
65    //=========================================================================
66    // PangoCairoFont
67    //=========================================================================
68    pub fn pango_cairo_font_get_type() -> GType;
69    pub fn pango_cairo_font_get_scaled_font(
70        font: *mut PangoCairoFont,
71    ) -> *mut cairo::cairo_scaled_font_t;
72
73    //=========================================================================
74    // PangoCairoFontMap
75    //=========================================================================
76    pub fn pango_cairo_font_map_get_type() -> GType;
77    pub fn pango_cairo_font_map_get_default() -> *mut pango::PangoFontMap;
78    pub fn pango_cairo_font_map_new() -> *mut pango::PangoFontMap;
79    pub fn pango_cairo_font_map_new_for_font_type(
80        fonttype: cairo::cairo_font_type_t,
81    ) -> *mut pango::PangoFontMap;
82    pub fn pango_cairo_font_map_create_context(
83        fontmap: *mut PangoCairoFontMap,
84    ) -> *mut pango::PangoContext;
85    pub fn pango_cairo_font_map_get_font_type(
86        fontmap: *mut PangoCairoFontMap,
87    ) -> cairo::cairo_font_type_t;
88    pub fn pango_cairo_font_map_get_resolution(fontmap: *mut PangoCairoFontMap) -> c_double;
89    pub fn pango_cairo_font_map_set_default(fontmap: *mut PangoCairoFontMap);
90    pub fn pango_cairo_font_map_set_resolution(fontmap: *mut PangoCairoFontMap, dpi: c_double);
91
92    //=========================================================================
93    // Other functions
94    //=========================================================================
95    pub fn pango_cairo_context_get_font_options(
96        context: *mut pango::PangoContext,
97    ) -> *const cairo::cairo_font_options_t;
98    pub fn pango_cairo_context_get_resolution(context: *mut pango::PangoContext) -> c_double;
99    pub fn pango_cairo_context_get_shape_renderer(
100        context: *mut pango::PangoContext,
101        data: *mut gpointer,
102    ) -> PangoCairoShapeRendererFunc;
103    pub fn pango_cairo_context_set_font_options(
104        context: *mut pango::PangoContext,
105        options: *const cairo::cairo_font_options_t,
106    );
107    pub fn pango_cairo_context_set_resolution(context: *mut pango::PangoContext, dpi: c_double);
108    pub fn pango_cairo_context_set_shape_renderer(
109        context: *mut pango::PangoContext,
110        func: PangoCairoShapeRendererFunc,
111        data: gpointer,
112        dnotify: glib::GDestroyNotify,
113    );
114    pub fn pango_cairo_create_context(cr: *mut cairo::cairo_t) -> *mut pango::PangoContext;
115    pub fn pango_cairo_create_layout(cr: *mut cairo::cairo_t) -> *mut pango::PangoLayout;
116    pub fn pango_cairo_error_underline_path(
117        cr: *mut cairo::cairo_t,
118        x: c_double,
119        y: c_double,
120        width: c_double,
121        height: c_double,
122    );
123    pub fn pango_cairo_glyph_string_path(
124        cr: *mut cairo::cairo_t,
125        font: *mut pango::PangoFont,
126        glyphs: *mut pango::PangoGlyphString,
127    );
128    pub fn pango_cairo_layout_line_path(cr: *mut cairo::cairo_t, line: *mut pango::PangoLayoutLine);
129    pub fn pango_cairo_layout_path(cr: *mut cairo::cairo_t, layout: *mut pango::PangoLayout);
130    pub fn pango_cairo_show_error_underline(
131        cr: *mut cairo::cairo_t,
132        x: c_double,
133        y: c_double,
134        width: c_double,
135        height: c_double,
136    );
137    pub fn pango_cairo_show_glyph_item(
138        cr: *mut cairo::cairo_t,
139        text: *const c_char,
140        glyph_item: *mut pango::PangoGlyphItem,
141    );
142    pub fn pango_cairo_show_glyph_string(
143        cr: *mut cairo::cairo_t,
144        font: *mut pango::PangoFont,
145        glyphs: *mut pango::PangoGlyphString,
146    );
147    pub fn pango_cairo_show_layout(cr: *mut cairo::cairo_t, layout: *mut pango::PangoLayout);
148    pub fn pango_cairo_show_layout_line(cr: *mut cairo::cairo_t, line: *mut pango::PangoLayoutLine);
149    pub fn pango_cairo_update_context(cr: *mut cairo::cairo_t, context: *mut pango::PangoContext);
150    pub fn pango_cairo_update_layout(cr: *mut cairo::cairo_t, layout: *mut pango::PangoLayout);
151
152}