1#![allow(non_camel_case_types)]
4#![allow(clippy::unreadable_literal)]
5#![allow(clippy::write_literal)]
6#![allow(clippy::upper_case_acronyms)]
7#![cfg_attr(docsrs, feature(doc_cfg))]
8
9#[cfg(all(windows, feature = "win32-surface"))]
10#[cfg_attr(docsrs, doc(cfg(all(windows, feature = "win32-surface"))))]
11pub mod windows {
12 pub use windows_sys::Win32::Graphics::Gdi::HDC;
13}
14
15#[cfg(all(docsrs, not(all(windows, feature = "win32-surface"))))]
16#[cfg_attr(
17 docsrs,
18 doc(cfg(all(docsrs, not(all(windows, feature = "win32-surface")))))
19)]
20pub mod windows {
21 use libc::c_void;
22
23 #[repr(C)]
24 pub struct HDC(c_void);
25}
26
27use libc::{c_char, c_double, c_int, c_uchar, c_uint, c_ulong, c_void};
28
29#[cfg(feature = "xlib")]
30use x11::xlib;
31
32pub type cairo_antialias_t = c_int;
33pub type cairo_content_t = c_int;
34pub type cairo_device_type_t = c_int;
35pub type cairo_extend_t = c_int;
36pub type cairo_fill_rule_t = c_int;
37pub type cairo_filter_t = c_int;
38pub type cairo_font_slant_t = c_int;
39pub type cairo_font_type_t = c_int;
40pub type cairo_font_weight_t = c_int;
41pub type cairo_format_t = c_int;
42pub type cairo_ft_synthesize_t = c_uint;
43pub type cairo_hint_metrics_t = c_int;
44pub type cairo_hint_style_t = c_int;
45pub type cairo_line_cap_t = c_int;
46pub type cairo_line_join_t = c_int;
47pub type cairo_operator_t = c_int;
48pub type cairo_pattern_type_t = c_int;
49pub type cairo_path_data_type_t = c_int;
50pub type cairo_region_overlap_t = c_int;
51#[cfg(feature = "script")]
52#[cfg_attr(docsrs, doc(cfg(feature = "script")))]
53pub type cairo_script_mode_t = c_int;
54pub type cairo_status_t = c_int;
55pub type cairo_subpixel_order_t = c_int;
56pub type cairo_surface_type_t = c_int;
57#[cfg(all(feature = "svg", feature = "v1_16"))]
58#[cfg_attr(docsrs, doc(cfg(all(feature = "svg", feature = "v1_16"))))]
59pub type cairo_svg_unit_t = c_int;
60pub type cairo_text_cluster_flags_t = c_int;
61
62#[cfg(all(feature = "pdf", feature = "v1_16"))]
63#[cfg_attr(docsrs, doc(cfg(all(feature = "pdf", feature = "v1_16"))))]
64pub type cairo_pdf_outline_flags_t = c_int;
65#[cfg(all(feature = "pdf", feature = "v1_16"))]
66#[cfg_attr(docsrs, doc(cfg(all(feature = "pdf", feature = "v1_16"))))]
67pub type cairo_pdf_metadata_t = c_int;
68#[cfg(feature = "pdf")]
69#[cfg_attr(docsrs, doc(cfg(feature = "pdf")))]
70pub type cairo_pdf_version_t = c_int;
71#[cfg(feature = "svg")]
72#[cfg_attr(docsrs, doc(cfg(feature = "svg")))]
73pub type cairo_svg_version_t = c_int;
74#[cfg(feature = "ps")]
75#[cfg_attr(docsrs, doc(cfg(feature = "ps")))]
76pub type cairo_ps_level_t = c_int;
77
78pub type cairo_mesh_corner_t = c_uint;
79
80macro_rules! opaque {
81 ($(#[$attr:meta])*
82 $name:ident) => {
83 $(#[$attr])*
85 #[repr(C)]
86 pub struct $name {
87 _data: [u8; 0],
88 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
89 }
90 $(#[$attr])*
91 impl ::std::fmt::Debug for $name {
92 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
93 write!(f, "{} @ {:?}", stringify!($name), self as *const _)
94 }
95 }
96 };
97}
98
99opaque!(cairo_t);
100opaque!(cairo_surface_t);
101opaque!(cairo_device_t);
102opaque!(cairo_pattern_t);
103
104opaque!(
105 #[cfg(feature = "xcb")]
106 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
107 xcb_connection_t
108);
109
110#[cfg(feature = "xcb")]
111#[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
112pub type xcb_drawable_t = u32;
113
114#[cfg(feature = "xcb")]
115#[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
116pub type xcb_pixmap_t = u32;
117
118opaque!(
119 #[cfg(feature = "xcb")]
120 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
121 xcb_visualtype_t );
123
124opaque!(
125 #[cfg(feature = "xcb")]
126 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
127 xcb_screen_t );
129
130opaque!(
131 #[cfg(feature = "xcb")]
132 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
133 xcb_render_pictforminfo_t );
135
136#[repr(C)]
137#[derive(Clone, Copy, Debug, PartialEq)]
138pub struct cairo_rectangle_t {
139 pub x: f64,
140 pub y: f64,
141 pub width: f64,
142 pub height: f64,
143}
144#[repr(C)]
145#[derive(Clone, Copy, Debug, Eq, PartialEq)]
146pub struct cairo_rectangle_int_t {
147 pub x: i32,
148 pub y: i32,
149 pub width: i32,
150 pub height: i32,
151}
152#[repr(C)]
153#[derive(Debug, Clone, Copy)]
154pub struct cairo_rectangle_list_t {
155 pub status: cairo_status_t,
156 pub rectangles: *mut cairo_rectangle_t,
157 pub num_rectangles: c_int,
158}
159#[repr(C)]
160#[derive(Debug, Clone, Copy)]
161pub struct cairo_path_t {
162 pub status: cairo_status_t,
163 pub data: *mut cairo_path_data,
164 pub num_data: c_int,
165}
166#[repr(C)]
167#[derive(Debug, Clone, Copy)]
168pub struct cairo_path_data_header {
169 pub data_type: cairo_path_data_type_t,
170 pub length: c_int,
171}
172#[repr(C)]
173#[derive(Clone, Copy)]
174pub union cairo_path_data {
175 pub header: cairo_path_data_header,
176 pub point: [f64; 2],
177}
178
179opaque!(cairo_region_t);
180opaque!(cairo_font_face_t);
181opaque!(cairo_scaled_font_t);
182opaque!(cairo_font_options_t);
183
184#[repr(C)]
185#[derive(Clone, Copy, Debug)]
186pub struct cairo_font_extents_t {
187 pub ascent: c_double,
188 pub descent: c_double,
189 pub height: c_double,
190 pub max_x_advance: c_double,
191 pub max_y_advance: c_double,
192}
193#[repr(C)]
194#[derive(Clone, Copy, Debug)]
195pub struct cairo_glyph_t {
196 pub index: c_ulong,
197 pub x: c_double,
198 pub y: c_double,
199}
200#[repr(C)]
201#[derive(Clone, Copy, Debug)]
202pub struct cairo_text_cluster_t {
203 pub num_bytes: c_int,
204 pub num_glyphs: c_int,
205}
206#[repr(C)]
207#[derive(Clone, Copy, Debug)]
208pub struct cairo_text_extents_t {
209 pub x_bearing: c_double,
210 pub y_bearing: c_double,
211 pub width: c_double,
212 pub height: c_double,
213 pub x_advance: c_double,
214 pub y_advance: c_double,
215}
216#[repr(C)]
217#[derive(Debug, Clone, Copy, PartialEq)]
218pub struct cairo_matrix_t {
219 pub xx: c_double,
220 pub yx: c_double,
221
222 pub xy: c_double,
223 pub yy: c_double,
224
225 pub x0: c_double,
226 pub y0: c_double,
227}
228
229impl ::std::fmt::Display for cairo_matrix_t {
230 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
231 write!(f, "Matrix")
232 }
233}
234
235#[repr(C)]
236#[derive(Clone, Copy, Default, Debug)]
237pub struct cairo_user_data_key_t {
238 pub unused: c_int,
239}
240#[repr(transparent)]
241#[derive(Debug, Clone, Copy)]
242pub struct cairo_bool_t {
243 value: c_int,
244}
245
246impl cairo_bool_t {
247 pub fn as_bool(self) -> bool {
248 self.value != 0
249 }
250}
251
252impl From<bool> for cairo_bool_t {
253 fn from(b: bool) -> cairo_bool_t {
254 let value = c_int::from(b);
255 cairo_bool_t { value }
256 }
257}
258
259pub type CGContextRef = *mut c_void;
260
261pub type cairo_destroy_func_t = Option<unsafe extern "C" fn(*mut c_void)>;
262pub type cairo_read_func_t =
263 Option<unsafe extern "C" fn(*mut c_void, *mut c_uchar, c_uint) -> cairo_status_t>;
264pub type cairo_write_func_t =
265 Option<unsafe extern "C" fn(*mut c_void, *mut c_uchar, c_uint) -> cairo_status_t>;
266
267#[cfg(feature = "freetype")]
268#[cfg_attr(docsrs, doc(cfg(feature = "freetype")))]
269pub type FT_Face = *mut c_void;
270#[cfg(feature = "freetype")]
271#[cfg_attr(docsrs, doc(cfg(feature = "freetype")))]
272pub type FcPattern = c_void;
273
274pub type cairo_user_scaled_font_init_func_t = Option<
275 unsafe extern "C" fn(
276 scaled_font: *mut cairo_scaled_font_t,
277 cr: *mut cairo_t,
278 extents: *mut cairo_font_extents_t,
279 ) -> cairo_status_t,
280>;
281pub type cairo_user_scaled_font_render_glyph_func_t = Option<
282 unsafe extern "C" fn(
283 scaled_font: *mut cairo_scaled_font_t,
284 glyph: c_ulong,
285 cr: *mut cairo_t,
286 extents: *mut cairo_text_extents_t,
287 ) -> cairo_status_t,
288>;
289pub type cairo_user_scaled_font_text_to_glyphs_func_t = Option<
290 unsafe extern "C" fn(
291 scaled_font: *mut cairo_scaled_font_t,
292 utf8: *const c_char,
293 utf8_len: c_int,
294 glyphs: *mut *mut cairo_glyph_t,
295 num_glyphs: *mut c_int,
296 clusters: *mut *mut cairo_text_cluster_t,
297 num_clusters: *mut c_int,
298 cluster_flags: *mut cairo_text_cluster_flags_t,
299 ) -> cairo_status_t,
300>;
301pub type cairo_user_scaled_font_unicode_to_glyph_func_t = Option<
302 unsafe extern "C" fn(
303 scaled_font: *mut cairo_scaled_font_t,
304 unicode: c_ulong,
305 glyph_index: *mut c_ulong,
306 ) -> cairo_status_t,
307>;
308
309extern "C" {
310 pub fn cairo_create(target: *mut cairo_surface_t) -> *mut cairo_t;
311 pub fn cairo_reference(cr: *mut cairo_t) -> *mut cairo_t;
312 pub fn cairo_destroy(cr: *mut cairo_t);
313 pub fn cairo_status(cr: *mut cairo_t) -> cairo_status_t;
314 pub fn cairo_save(cr: *mut cairo_t);
315 pub fn cairo_restore(cr: *mut cairo_t);
316 pub fn cairo_get_target(cr: *mut cairo_t) -> *mut cairo_surface_t;
317 pub fn cairo_push_group(cr: *mut cairo_t);
318 pub fn cairo_push_group_with_content(cr: *mut cairo_t, content: cairo_content_t);
319 pub fn cairo_pop_group(cr: *mut cairo_t) -> *mut cairo_pattern_t;
320 pub fn cairo_pop_group_to_source(cr: *mut cairo_t);
321 pub fn cairo_get_group_target(cr: *mut cairo_t) -> *mut cairo_surface_t;
322 pub fn cairo_set_source_rgb(cr: *mut cairo_t, red: c_double, green: c_double, blue: c_double);
323 pub fn cairo_set_source_rgba(
324 cr: *mut cairo_t,
325 red: c_double,
326 green: c_double,
327 blue: c_double,
328 alpha: c_double,
329 );
330 pub fn cairo_set_source(cr: *mut cairo_t, source: *mut cairo_pattern_t);
331 pub fn cairo_set_source_surface(
332 cr: *mut cairo_t,
333 surface: *mut cairo_surface_t,
334 x: c_double,
335 y: c_double,
336 );
337 pub fn cairo_get_source(cr: *mut cairo_t) -> *mut cairo_pattern_t;
338 pub fn cairo_set_antialias(cr: *mut cairo_t, antialias: cairo_antialias_t);
339 pub fn cairo_get_antialias(cr: *mut cairo_t) -> cairo_antialias_t;
340 pub fn cairo_set_dash(
341 cr: *mut cairo_t,
342 dashes: *const c_double,
343 num_dashes: c_int,
344 offset: c_double,
345 );
346 pub fn cairo_get_dash_count(cr: *mut cairo_t) -> c_int;
347 pub fn cairo_get_dash(cr: *mut cairo_t, dashes: *mut c_double, offset: *mut c_double);
348 pub fn cairo_set_fill_rule(cr: *mut cairo_t, fill_rule: cairo_fill_rule_t);
349 pub fn cairo_get_fill_rule(cr: *mut cairo_t) -> cairo_fill_rule_t;
350 pub fn cairo_set_line_cap(cr: *mut cairo_t, line_cap: cairo_line_cap_t);
351 pub fn cairo_get_line_cap(cr: *mut cairo_t) -> cairo_line_cap_t;
352 pub fn cairo_set_line_join(cr: *mut cairo_t, line_join: cairo_line_join_t);
353 pub fn cairo_get_line_join(cr: *mut cairo_t) -> cairo_line_join_t;
354 pub fn cairo_set_line_width(cr: *mut cairo_t, width: c_double);
355 pub fn cairo_get_line_width(cr: *mut cairo_t) -> c_double;
356 #[cfg(feature = "v1_18")]
357 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
358 pub fn cairo_set_hairline(cr: *mut cairo_t, set_hairline: cairo_bool_t);
359 #[cfg(feature = "v1_18")]
360 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
361 pub fn cairo_get_hairline(cr: *mut cairo_t) -> cairo_bool_t;
362 pub fn cairo_set_miter_limit(cr: *mut cairo_t, limit: c_double);
363 pub fn cairo_get_miter_limit(cr: *mut cairo_t) -> c_double;
364 pub fn cairo_set_operator(cr: *mut cairo_t, op: cairo_operator_t);
365 pub fn cairo_get_operator(cr: *mut cairo_t) -> cairo_operator_t;
366 pub fn cairo_set_tolerance(cr: *mut cairo_t, tolerance: c_double);
367 pub fn cairo_get_tolerance(cr: *mut cairo_t) -> c_double;
368 pub fn cairo_clip(cr: *mut cairo_t);
369 pub fn cairo_clip_preserve(cr: *mut cairo_t);
370 pub fn cairo_clip_extents(
371 cr: *mut cairo_t,
372 x1: *mut c_double,
373 y1: *mut c_double,
374 x2: *mut c_double,
375 y2: *mut c_double,
376 );
377 pub fn cairo_in_clip(cr: *mut cairo_t, x: c_double, y: c_double) -> cairo_bool_t;
378 pub fn cairo_reset_clip(cr: *mut cairo_t);
379 pub fn cairo_rectangle_list_destroy(rectangle_list: *mut cairo_rectangle_list_t);
380 pub fn cairo_copy_clip_rectangle_list(cr: *mut cairo_t) -> *mut cairo_rectangle_list_t;
381 pub fn cairo_fill(cr: *mut cairo_t);
382 pub fn cairo_fill_preserve(cr: *mut cairo_t);
383 pub fn cairo_fill_extents(
384 cr: *mut cairo_t,
385 x1: *mut c_double,
386 y1: *mut c_double,
387 x2: *mut c_double,
388 y2: *mut c_double,
389 );
390 pub fn cairo_in_fill(cr: *mut cairo_t, x: c_double, y: c_double) -> cairo_bool_t;
391 pub fn cairo_mask(cr: *mut cairo_t, pattern: *mut cairo_pattern_t);
392 pub fn cairo_mask_surface(
393 cr: *mut cairo_t,
394 surface: *mut cairo_surface_t,
395 surface_x: c_double,
396 surface_y: c_double,
397 );
398 pub fn cairo_paint(cr: *mut cairo_t);
399 pub fn cairo_paint_with_alpha(cr: *mut cairo_t, alpha: c_double);
400 pub fn cairo_stroke(cr: *mut cairo_t);
401 pub fn cairo_stroke_preserve(cr: *mut cairo_t);
402 pub fn cairo_stroke_extents(
403 cr: *mut cairo_t,
404 x1: *mut c_double,
405 y1: *mut c_double,
406 x2: *mut c_double,
407 y2: *mut c_double,
408 );
409 pub fn cairo_in_stroke(cr: *mut cairo_t, x: c_double, y: c_double) -> cairo_bool_t;
410 pub fn cairo_copy_page(cr: *mut cairo_t);
411 pub fn cairo_show_page(cr: *mut cairo_t);
412 pub fn cairo_get_reference_count(cr: *mut cairo_t) -> c_uint;
413 #[cfg(feature = "v1_16")]
414 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
415 pub fn cairo_tag_begin(cr: *mut cairo_t, tag_name: *const c_char, attributes: *const c_char);
416 #[cfg(feature = "v1_16")]
417 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
418 pub fn cairo_tag_end(cr: *mut cairo_t, tag_name: *const c_char);
419
420 pub fn cairo_status_to_string(status: cairo_status_t) -> *const c_char;
422 pub fn cairo_debug_reset_static_data();
423 pub fn cairo_version() -> c_int;
424 pub fn cairo_version_string() -> *const c_char;
425
426 pub fn cairo_copy_path(cr: *mut cairo_t) -> *mut cairo_path_t;
428 pub fn cairo_copy_path_flat(cr: *mut cairo_t) -> *mut cairo_path_t;
429 pub fn cairo_path_destroy(path: *mut cairo_path_t);
430 pub fn cairo_append_path(cr: *mut cairo_t, path: *mut cairo_path_t);
431 pub fn cairo_has_current_point(cr: *mut cairo_t) -> cairo_bool_t;
432 pub fn cairo_get_current_point(cr: *mut cairo_t, x: *mut c_double, y: *mut c_double);
433 pub fn cairo_new_path(cr: *mut cairo_t);
434 pub fn cairo_new_sub_path(cr: *mut cairo_t);
435 pub fn cairo_close_path(cr: *mut cairo_t);
436 pub fn cairo_arc(
437 cr: *mut cairo_t,
438 xc: c_double,
439 yc: c_double,
440 radius: c_double,
441 angle1: c_double,
442 angle2: c_double,
443 );
444 pub fn cairo_arc_negative(
445 cr: *mut cairo_t,
446 xc: c_double,
447 yc: c_double,
448 radius: c_double,
449 angle1: c_double,
450 angle2: c_double,
451 );
452 pub fn cairo_curve_to(
453 cr: *mut cairo_t,
454 x1: c_double,
455 y1: c_double,
456 x2: c_double,
457 y2: c_double,
458 x3: c_double,
459 y3: c_double,
460 );
461 pub fn cairo_line_to(cr: *mut cairo_t, x: c_double, y: c_double);
462 pub fn cairo_move_to(cr: *mut cairo_t, x: c_double, y: c_double);
463 pub fn cairo_rectangle(
464 cr: *mut cairo_t,
465 x: c_double,
466 y: c_double,
467 width: c_double,
468 height: c_double,
469 );
470 pub fn cairo_glyph_path(cr: *mut cairo_t, glyphs: *const cairo_glyph_t, num_glyphs: c_int);
471 pub fn cairo_text_path(cr: *mut cairo_t, utf8: *const c_char);
472 pub fn cairo_rel_curve_to(
473 cr: *mut cairo_t,
474 dx1: c_double,
475 dy1: c_double,
476 dx2: c_double,
477 dy2: c_double,
478 dx3: c_double,
479 dy3: c_double,
480 );
481 pub fn cairo_rel_line_to(cr: *mut cairo_t, dx: c_double, dy: c_double);
482 pub fn cairo_rel_move_to(cr: *mut cairo_t, dx: c_double, dy: c_double);
483 pub fn cairo_path_extents(
484 cr: *mut cairo_t,
485 x1: *mut c_double,
486 y1: *mut c_double,
487 x2: *mut c_double,
488 y2: *mut c_double,
489 );
490
491 pub fn cairo_translate(cr: *mut cairo_t, tx: c_double, ty: c_double);
493 pub fn cairo_scale(cr: *mut cairo_t, sx: c_double, sy: c_double);
494 pub fn cairo_rotate(cr: *mut cairo_t, angle: c_double);
495 pub fn cairo_transform(cr: *mut cairo_t, matrix: *const cairo_matrix_t);
496 pub fn cairo_set_matrix(cr: *mut cairo_t, matrix: *const cairo_matrix_t);
497 pub fn cairo_get_matrix(cr: *mut cairo_t, matrix: *mut cairo_matrix_t);
498 pub fn cairo_identity_matrix(cr: *mut cairo_t);
499 pub fn cairo_user_to_device(cr: *mut cairo_t, x: *mut c_double, y: *mut c_double);
500 pub fn cairo_user_to_device_distance(cr: *mut cairo_t, dx: *mut c_double, dy: *mut c_double);
501 pub fn cairo_device_to_user(cr: *mut cairo_t, x: *mut c_double, y: *mut c_double);
502 pub fn cairo_device_to_user_distance(cr: *mut cairo_t, dx: *mut c_double, dy: *mut c_double);
503
504 pub fn cairo_pattern_add_color_stop_rgb(
506 pattern: *mut cairo_pattern_t,
507 offset: c_double,
508 red: c_double,
509 green: c_double,
510 blue: c_double,
511 );
512 pub fn cairo_pattern_add_color_stop_rgba(
513 pattern: *mut cairo_pattern_t,
514 offset: c_double,
515 red: c_double,
516 green: c_double,
517 blue: c_double,
518 alpha: c_double,
519 );
520 pub fn cairo_pattern_get_color_stop_count(
521 pattern: *mut cairo_pattern_t,
522 count: *mut c_int,
523 ) -> cairo_status_t;
524 pub fn cairo_pattern_get_color_stop_rgba(
525 pattern: *mut cairo_pattern_t,
526 index: c_int,
527 offset: *mut c_double,
528 red: *mut c_double,
529 green: *mut c_double,
530 blue: *mut c_double,
531 alpha: *mut c_double,
532 ) -> cairo_status_t;
533 pub fn cairo_pattern_create_rgb(
534 red: c_double,
535 green: c_double,
536 blue: c_double,
537 ) -> *mut cairo_pattern_t;
538 pub fn cairo_pattern_create_rgba(
539 red: c_double,
540 green: c_double,
541 blue: c_double,
542 alpha: c_double,
543 ) -> *mut cairo_pattern_t;
544 pub fn cairo_pattern_get_rgba(
545 pattern: *mut cairo_pattern_t,
546 red: *mut c_double,
547 green: *mut c_double,
548 blue: *mut c_double,
549 alpha: *mut c_double,
550 ) -> cairo_status_t;
551 pub fn cairo_pattern_create_for_surface(surface: *mut cairo_surface_t) -> *mut cairo_pattern_t;
552 pub fn cairo_pattern_get_surface(
553 pattern: *mut cairo_pattern_t,
554 surface: *mut *mut cairo_surface_t,
555 ) -> cairo_status_t;
556 pub fn cairo_pattern_create_linear(
557 x0: c_double,
558 y0: c_double,
559 x1: c_double,
560 y1: c_double,
561 ) -> *mut cairo_pattern_t;
562 pub fn cairo_pattern_get_linear_points(
563 pattern: *mut cairo_pattern_t,
564 x0: *mut c_double,
565 y0: *mut c_double,
566 x1: *mut c_double,
567 y1: *mut c_double,
568 ) -> cairo_status_t;
569 pub fn cairo_pattern_create_radial(
570 cx0: c_double,
571 cy0: c_double,
572 radius0: c_double,
573 cx1: c_double,
574 cy1: c_double,
575 radius1: c_double,
576 ) -> *mut cairo_pattern_t;
577 pub fn cairo_pattern_get_radial_circles(
578 pattern: *mut cairo_pattern_t,
579 x0: *mut c_double,
580 y0: *mut c_double,
581 r0: *mut c_double,
582 x1: *mut c_double,
583 y1: *mut c_double,
584 r1: *mut c_double,
585 ) -> cairo_status_t;
586 pub fn cairo_pattern_create_mesh() -> *mut cairo_pattern_t;
587 pub fn cairo_mesh_pattern_begin_patch(pattern: *mut cairo_pattern_t);
588 pub fn cairo_mesh_pattern_end_patch(pattern: *mut cairo_pattern_t);
589 pub fn cairo_mesh_pattern_move_to(pattern: *mut cairo_pattern_t, x: c_double, y: c_double);
590 pub fn cairo_mesh_pattern_line_to(pattern: *mut cairo_pattern_t, x: c_double, y: c_double);
591 pub fn cairo_mesh_pattern_curve_to(
592 pattern: *mut cairo_pattern_t,
593 x1: c_double,
594 y1: c_double,
595 x2: c_double,
596 y2: c_double,
597 x3: c_double,
598 y3: c_double,
599 );
600 pub fn cairo_mesh_pattern_set_control_point(
601 pattern: *mut cairo_pattern_t,
602 point_num: cairo_mesh_corner_t,
603 x: c_double,
604 y: c_double,
605 );
606 pub fn cairo_mesh_pattern_set_corner_color_rgb(
607 pattern: *mut cairo_pattern_t,
608 corner_num: cairo_mesh_corner_t,
609 red: c_double,
610 green: c_double,
611 blue: c_double,
612 );
613 pub fn cairo_mesh_pattern_set_corner_color_rgba(
614 pattern: *mut cairo_pattern_t,
615 corner_num: cairo_mesh_corner_t,
616 red: c_double,
617 green: c_double,
618 blue: c_double,
619 alpha: c_double,
620 );
621 pub fn cairo_mesh_pattern_get_patch_count(
622 pattern: *mut cairo_pattern_t,
623 count: *mut c_uint,
624 ) -> cairo_status_t;
625 pub fn cairo_mesh_pattern_get_path(
626 pattern: *mut cairo_pattern_t,
627 patch_num: c_uint,
628 ) -> *mut cairo_path_t;
629 pub fn cairo_mesh_pattern_get_control_point(
630 pattern: *mut cairo_pattern_t,
631 patch_num: c_uint,
632 point_num: cairo_mesh_corner_t,
633 x: *mut c_double,
634 y: *mut c_double,
635 ) -> cairo_status_t;
636 pub fn cairo_mesh_pattern_get_corner_color_rgba(
637 pattern: *mut cairo_pattern_t,
638 patch_num: c_uint,
639 corner_num: cairo_mesh_corner_t,
640 red: *mut c_double,
641 green: *mut c_double,
642 blue: *mut c_double,
643 alpha: *mut c_double,
644 ) -> cairo_status_t;
645 pub fn cairo_pattern_reference(pattern: *mut cairo_pattern_t) -> *mut cairo_pattern_t;
646 pub fn cairo_pattern_destroy(pattern: *mut cairo_pattern_t);
647 pub fn cairo_pattern_status(pattern: *mut cairo_pattern_t) -> cairo_status_t;
648 pub fn cairo_pattern_set_extend(pattern: *mut cairo_pattern_t, extend: cairo_extend_t);
649 pub fn cairo_pattern_get_extend(pattern: *mut cairo_pattern_t) -> cairo_extend_t;
650 pub fn cairo_pattern_set_filter(pattern: *mut cairo_pattern_t, filter: cairo_filter_t);
651 pub fn cairo_pattern_get_filter(pattern: *mut cairo_pattern_t) -> cairo_filter_t;
652 pub fn cairo_pattern_set_matrix(pattern: *mut cairo_pattern_t, matrix: *const cairo_matrix_t);
653 pub fn cairo_pattern_get_matrix(pattern: *mut cairo_pattern_t, matrix: *mut cairo_matrix_t);
654 pub fn cairo_pattern_get_type(pattern: *mut cairo_pattern_t) -> cairo_pattern_type_t;
655 pub fn cairo_pattern_get_reference_count(pattern: *mut cairo_pattern_t) -> c_uint;
656 pub fn cairo_pattern_set_user_data(
657 pattern: *mut cairo_pattern_t,
658 key: *const cairo_user_data_key_t,
659 user_data: *mut c_void,
660 destroy: cairo_destroy_func_t,
661 ) -> cairo_status_t;
662 pub fn cairo_pattern_get_user_data(
663 pattern: *mut cairo_pattern_t,
664 key: *const cairo_user_data_key_t,
665 ) -> *mut c_void;
666
667 pub fn cairo_region_create() -> *mut cairo_region_t;
669 pub fn cairo_region_create_rectangle(
670 rectangle: *mut cairo_rectangle_int_t,
671 ) -> *mut cairo_region_t;
672 pub fn cairo_region_create_rectangles(
673 rects: *mut cairo_rectangle_int_t,
674 count: c_int,
675 ) -> *mut cairo_region_t;
676 pub fn cairo_region_copy(original: *mut cairo_region_t) -> *mut cairo_region_t;
677 pub fn cairo_region_reference(region: *mut cairo_region_t) -> *mut cairo_region_t;
678 pub fn cairo_region_destroy(region: *mut cairo_region_t);
679 pub fn cairo_region_status(region: *mut cairo_region_t) -> cairo_status_t;
680 pub fn cairo_region_get_extents(
681 region: *mut cairo_region_t,
682 extents: *mut cairo_rectangle_int_t,
683 );
684 pub fn cairo_region_num_rectangles(region: *mut cairo_region_t) -> c_int;
685 pub fn cairo_region_get_rectangle(
686 region: *mut cairo_region_t,
687 nth: c_int,
688 rectangle: *mut cairo_rectangle_int_t,
689 );
690 pub fn cairo_region_is_empty(region: *mut cairo_region_t) -> cairo_bool_t;
691 pub fn cairo_region_contains_point(
692 region: *mut cairo_region_t,
693 x: c_int,
694 y: c_int,
695 ) -> cairo_bool_t;
696 pub fn cairo_region_contains_rectangle(
697 region: *mut cairo_region_t,
698 rectangle: *mut cairo_rectangle_int_t,
699 ) -> cairo_region_overlap_t;
700 pub fn cairo_region_equal(a: *mut cairo_region_t, b: *mut cairo_region_t) -> cairo_bool_t;
701 pub fn cairo_region_translate(region: *mut cairo_region_t, dx: c_int, dy: c_int);
702 pub fn cairo_region_intersect(
703 dst: *mut cairo_region_t,
704 other: *mut cairo_region_t,
705 ) -> cairo_status_t;
706 pub fn cairo_region_intersect_rectangle(
707 dst: *mut cairo_region_t,
708 rectangle: *mut cairo_rectangle_int_t,
709 ) -> cairo_status_t;
710 pub fn cairo_region_subtract(
711 dst: *mut cairo_region_t,
712 other: *mut cairo_region_t,
713 ) -> cairo_status_t;
714 pub fn cairo_region_subtract_rectangle(
715 dst: *mut cairo_region_t,
716 rectangle: *mut cairo_rectangle_int_t,
717 ) -> cairo_status_t;
718 pub fn cairo_region_union(
719 dst: *mut cairo_region_t,
720 other: *mut cairo_region_t,
721 ) -> cairo_status_t;
722 pub fn cairo_region_union_rectangle(
723 dst: *mut cairo_region_t,
724 rectangle: *mut cairo_rectangle_int_t,
725 ) -> cairo_status_t;
726 pub fn cairo_region_xor(dst: *mut cairo_region_t, other: *mut cairo_region_t)
727 -> cairo_status_t;
728 pub fn cairo_region_xor_rectangle(
729 dst: *mut cairo_region_t,
730 rectangle: *mut cairo_rectangle_int_t,
731 ) -> cairo_status_t;
732
733 pub fn cairo_select_font_face(
735 cr: *mut cairo_t,
736 family: *const c_char,
737 slant: cairo_font_slant_t,
738 weight: cairo_font_weight_t,
739 );
740 pub fn cairo_set_font_size(cr: *mut cairo_t, size: c_double);
741 pub fn cairo_set_font_matrix(cr: *mut cairo_t, matrix: *const cairo_matrix_t);
742 pub fn cairo_get_font_matrix(cr: *mut cairo_t, matrix: *mut cairo_matrix_t);
743 pub fn cairo_set_font_options(cr: *mut cairo_t, options: *const cairo_font_options_t);
744 pub fn cairo_get_font_options(cr: *mut cairo_t, options: *mut cairo_font_options_t);
745 pub fn cairo_set_font_face(cr: *mut cairo_t, font_face: *mut cairo_font_face_t);
746 pub fn cairo_get_font_face(cr: *mut cairo_t) -> *mut cairo_font_face_t;
747 pub fn cairo_set_scaled_font(cr: *mut cairo_t, scaled_font: *mut cairo_scaled_font_t);
748 pub fn cairo_get_scaled_font(cr: *mut cairo_t) -> *mut cairo_scaled_font_t;
749 pub fn cairo_show_text(cr: *mut cairo_t, utf8: *const c_char);
750 pub fn cairo_show_glyphs(cr: *mut cairo_t, glyphs: *const cairo_glyph_t, num_glyphs: c_int);
751 pub fn cairo_show_text_glyphs(
752 cr: *mut cairo_t,
753 utf8: *const c_char,
754 utf8_len: c_int,
755 glyphs: *const cairo_glyph_t,
756 num_glyphs: c_int,
757 clusters: *const cairo_text_cluster_t,
758 num_clusters: c_int,
759 cluster_flags: cairo_text_cluster_flags_t,
760 );
761 pub fn cairo_font_extents(cr: *mut cairo_t, extents: *mut cairo_font_extents_t);
762 pub fn cairo_text_extents(
763 cr: *mut cairo_t,
764 utf8: *const c_char,
765 extents: *mut cairo_text_extents_t,
766 );
767 pub fn cairo_glyph_extents(
768 cr: *mut cairo_t,
769 glyphs: *const cairo_glyph_t,
770 num_glyphs: c_int,
771 extents: *mut cairo_text_extents_t,
772 );
773 pub fn cairo_toy_font_face_create(
774 family: *const c_char,
775 slant: cairo_font_slant_t,
776 weight: cairo_font_weight_t,
777 ) -> *mut cairo_font_face_t;
778 pub fn cairo_toy_font_face_get_family(font_face: *mut cairo_font_face_t) -> *const c_char;
779 pub fn cairo_toy_font_face_get_slant(font_face: *mut cairo_font_face_t) -> cairo_font_slant_t;
780 pub fn cairo_toy_font_face_get_weight(font_face: *mut cairo_font_face_t)
781 -> cairo_font_weight_t;
782 pub fn cairo_glyph_allocate(num_glyphs: c_int) -> *mut cairo_glyph_t;
783 pub fn cairo_glyph_free(glyphs: *mut cairo_glyph_t);
784 pub fn cairo_text_cluster_allocate(num_clusters: c_int) -> *mut cairo_text_cluster_t;
785 pub fn cairo_text_cluster_free(clusters: *mut cairo_text_cluster_t);
786
787 #[cfg(feature = "freetype")]
788 #[cfg_attr(docsrs, doc(cfg(feature = "freetype")))]
789 pub fn cairo_ft_font_face_create_for_ft_face(
790 face: FT_Face,
791 load_flags: c_int,
792 ) -> *mut cairo_font_face_t;
793 #[cfg(feature = "freetype")]
794 #[cfg_attr(docsrs, doc(cfg(feature = "freetype")))]
795 pub fn cairo_ft_font_face_create_for_pattern(pattern: *mut FcPattern)
796 -> *mut cairo_font_face_t;
797 #[cfg(feature = "freetype")]
798 #[cfg_attr(docsrs, doc(cfg(feature = "freetype")))]
799 pub fn cairo_ft_font_options_substitute(
800 options: *const cairo_font_options_t,
801 pattern: *mut FcPattern,
802 );
803 #[cfg(feature = "freetype")]
804 #[cfg_attr(docsrs, doc(cfg(feature = "freetype")))]
805 pub fn cairo_ft_scaled_font_lock_face(scaled_font: *mut cairo_scaled_font_t) -> FT_Face;
806 #[cfg(feature = "freetype")]
807 #[cfg_attr(docsrs, doc(cfg(feature = "freetype")))]
808 pub fn cairo_ft_scaled_font_unlock_face(scaled_font: *mut cairo_scaled_font_t);
809 #[cfg(feature = "freetype")]
810 #[cfg_attr(docsrs, doc(cfg(feature = "freetype")))]
811 pub fn cairo_ft_font_face_get_synthesize(
812 font_face: *mut cairo_font_face_t,
813 ) -> cairo_ft_synthesize_t;
814 #[cfg(feature = "freetype")]
815 #[cfg_attr(docsrs, doc(cfg(feature = "freetype")))]
816 pub fn cairo_ft_font_face_set_synthesize(
817 font_face: *mut cairo_font_face_t,
818 synth_flags: cairo_ft_synthesize_t,
819 );
820 #[cfg(feature = "freetype")]
821 #[cfg_attr(docsrs, doc(cfg(feature = "freetype")))]
822 pub fn cairo_ft_font_face_unset_synthesize(
823 font_face: *mut cairo_font_face_t,
824 synth_flags: cairo_ft_synthesize_t,
825 );
826
827 pub fn cairo_font_face_reference(font_face: *mut cairo_font_face_t) -> *mut cairo_font_face_t;
854 pub fn cairo_font_face_destroy(font_face: *mut cairo_font_face_t);
855 pub fn cairo_font_face_status(font_face: *mut cairo_font_face_t) -> cairo_status_t;
856 pub fn cairo_font_face_get_type(font_face: *mut cairo_font_face_t) -> cairo_font_type_t;
857 pub fn cairo_font_face_get_reference_count(font_face: *mut cairo_font_face_t) -> c_uint;
858 pub fn cairo_font_face_set_user_data(
859 font_face: *mut cairo_font_face_t,
860 key: *const cairo_user_data_key_t,
861 user_data: *mut c_void,
862 destroy: cairo_destroy_func_t,
863 ) -> cairo_status_t;
864 pub fn cairo_font_face_get_user_data(
865 font_face: *mut cairo_font_face_t,
866 key: *const cairo_user_data_key_t,
867 ) -> *mut c_void;
868
869 pub fn cairo_scaled_font_create(
871 font_face: *mut cairo_font_face_t,
872 font_matrix: *const cairo_matrix_t,
873 ctm: *const cairo_matrix_t,
874 options: *const cairo_font_options_t,
875 ) -> *mut cairo_scaled_font_t;
876 pub fn cairo_scaled_font_reference(
877 scaled_font: *mut cairo_scaled_font_t,
878 ) -> *mut cairo_scaled_font_t;
879 pub fn cairo_scaled_font_destroy(scaled_font: *mut cairo_scaled_font_t);
880 pub fn cairo_scaled_font_status(scaled_font: *mut cairo_scaled_font_t) -> cairo_status_t;
881 pub fn cairo_scaled_font_extents(
882 scaled_font: *mut cairo_scaled_font_t,
883 extents: *mut cairo_font_extents_t,
884 );
885 pub fn cairo_scaled_font_text_extents(
886 scaled_font: *mut cairo_scaled_font_t,
887 utf8: *const c_char,
888 extents: *mut cairo_text_extents_t,
889 );
890 pub fn cairo_scaled_font_glyph_extents(
891 scaled_font: *mut cairo_scaled_font_t,
892 glyphs: *const cairo_glyph_t,
893 num_glyphs: c_int,
894 extents: *mut cairo_text_extents_t,
895 );
896 pub fn cairo_scaled_font_text_to_glyphs(
897 scaled_font: *mut cairo_scaled_font_t,
898 x: c_double,
899 y: c_double,
900 utf8: *const c_char,
901 utf8_len: c_int,
902 glyphs: *mut *mut cairo_glyph_t,
903 num_glyphs: *mut c_int,
904 clusters: *mut *mut cairo_text_cluster_t,
905 num_clusters: *mut c_int,
906 cluster_flags: *mut cairo_text_cluster_flags_t,
907 ) -> cairo_status_t;
908 pub fn cairo_scaled_font_get_font_face(
909 scaled_font: *mut cairo_scaled_font_t,
910 ) -> *mut cairo_font_face_t;
911 pub fn cairo_scaled_font_get_font_options(
912 scaled_font: *mut cairo_scaled_font_t,
913 options: *mut cairo_font_options_t,
914 );
915 pub fn cairo_scaled_font_get_font_matrix(
916 scaled_font: *mut cairo_scaled_font_t,
917 font_matrix: *mut cairo_matrix_t,
918 );
919 pub fn cairo_scaled_font_get_ctm(
920 scaled_font: *mut cairo_scaled_font_t,
921 ctm: *mut cairo_matrix_t,
922 );
923 pub fn cairo_scaled_font_get_scale_matrix(
924 scaled_font: *mut cairo_scaled_font_t,
925 scale_matrix: *mut cairo_matrix_t,
926 );
927 pub fn cairo_scaled_font_get_type(scaled_font: *mut cairo_scaled_font_t) -> cairo_font_type_t;
928 pub fn cairo_scaled_font_get_reference_count(font_face: *mut cairo_scaled_font_t) -> c_uint;
929 pub fn cairo_scaled_font_set_user_data(
930 scaled_font: *mut cairo_scaled_font_t,
931 key: *const cairo_user_data_key_t,
932 user_data: *mut c_void,
933 destroy: cairo_destroy_func_t,
934 ) -> cairo_status_t;
935 pub fn cairo_scaled_font_get_user_data(
936 scaled_font: *mut cairo_scaled_font_t,
937 key: *const cairo_user_data_key_t,
938 ) -> *mut c_void;
939
940 pub fn cairo_font_options_create() -> *mut cairo_font_options_t;
942 pub fn cairo_font_options_copy(
943 original: *const cairo_font_options_t,
944 ) -> *mut cairo_font_options_t;
945 pub fn cairo_font_options_destroy(options: *mut cairo_font_options_t);
946 pub fn cairo_font_options_status(options: *mut cairo_font_options_t) -> cairo_status_t;
947 pub fn cairo_font_options_merge(
948 options: *mut cairo_font_options_t,
949 other: *const cairo_font_options_t,
950 );
951 pub fn cairo_font_options_hash(options: *const cairo_font_options_t) -> c_ulong;
952 pub fn cairo_font_options_equal(
953 options: *const cairo_font_options_t,
954 other: *const cairo_font_options_t,
955 ) -> cairo_bool_t;
956 pub fn cairo_font_options_set_antialias(
957 options: *mut cairo_font_options_t,
958 antialias: cairo_antialias_t,
959 );
960 pub fn cairo_font_options_get_antialias(
961 options: *const cairo_font_options_t,
962 ) -> cairo_antialias_t;
963 pub fn cairo_font_options_set_subpixel_order(
964 options: *mut cairo_font_options_t,
965 subpixel_order: cairo_subpixel_order_t,
966 );
967 pub fn cairo_font_options_get_subpixel_order(
968 options: *const cairo_font_options_t,
969 ) -> cairo_subpixel_order_t;
970 pub fn cairo_font_options_set_hint_style(
971 options: *mut cairo_font_options_t,
972 hint_style: cairo_hint_style_t,
973 );
974 pub fn cairo_font_options_get_hint_style(
975 options: *const cairo_font_options_t,
976 ) -> cairo_hint_style_t;
977 pub fn cairo_font_options_set_hint_metrics(
978 options: *mut cairo_font_options_t,
979 hint_metrics: cairo_hint_metrics_t,
980 );
981 pub fn cairo_font_options_get_hint_metrics(
982 options: *const cairo_font_options_t,
983 ) -> cairo_hint_metrics_t;
984 #[cfg(feature = "v1_16")]
985 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
986 pub fn cairo_font_options_get_variations(options: *mut cairo_font_options_t) -> *const c_char;
987 #[cfg(feature = "v1_16")]
988 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
989 pub fn cairo_font_options_set_variations(
990 options: *mut cairo_font_options_t,
991 variations: *const c_char,
992 );
993
994 pub fn cairo_matrix_multiply(
996 matrix: *mut cairo_matrix_t,
997 left: *const cairo_matrix_t,
998 right: *const cairo_matrix_t,
999 );
1000 pub fn cairo_matrix_init(
1001 matrix: *mut cairo_matrix_t,
1002 xx: f64,
1003 yx: f64,
1004 xy: f64,
1005 yy: f64,
1006 x0: f64,
1007 y0: f64,
1008 );
1009 pub fn cairo_matrix_init_identity(matrix: *mut cairo_matrix_t);
1010 pub fn cairo_matrix_translate(matrix: *mut cairo_matrix_t, tx: f64, ty: f64);
1011 pub fn cairo_matrix_scale(matrix: *mut cairo_matrix_t, sx: f64, sy: f64);
1012 pub fn cairo_matrix_rotate(matrix: *mut cairo_matrix_t, angle: f64);
1013 pub fn cairo_matrix_invert(matrix: *mut cairo_matrix_t) -> cairo_status_t;
1014 pub fn cairo_matrix_transform_distance(
1015 matrix: *const cairo_matrix_t,
1016 dx: *mut f64,
1017 dy: *mut f64,
1018 );
1019 pub fn cairo_matrix_transform_point(matrix: *const cairo_matrix_t, x: *mut f64, y: *mut f64);
1020
1021 pub fn cairo_surface_destroy(surface: *mut cairo_surface_t);
1023 pub fn cairo_surface_flush(surface: *mut cairo_surface_t);
1024 pub fn cairo_surface_finish(surface: *mut cairo_surface_t);
1025 pub fn cairo_surface_status(surface: *mut cairo_surface_t) -> cairo_status_t;
1026 pub fn cairo_surface_get_type(surface: *mut cairo_surface_t) -> cairo_surface_type_t;
1027 pub fn cairo_surface_get_content(surface: *mut cairo_surface_t) -> cairo_content_t;
1028 pub fn cairo_surface_reference(surface: *mut cairo_surface_t) -> *mut cairo_surface_t;
1029 pub fn cairo_surface_get_user_data(
1030 surface: *mut cairo_surface_t,
1031 key: *const cairo_user_data_key_t,
1032 ) -> *mut c_void;
1033 pub fn cairo_surface_set_user_data(
1034 surface: *mut cairo_surface_t,
1035 key: *const cairo_user_data_key_t,
1036 user_data: *mut c_void,
1037 destroy: cairo_destroy_func_t,
1038 ) -> cairo_status_t;
1039 pub fn cairo_surface_get_reference_count(surface: *mut cairo_surface_t) -> c_uint;
1040 pub fn cairo_surface_mark_dirty(surface: *mut cairo_surface_t);
1041 pub fn cairo_surface_mark_dirty_rectangle(
1042 surface: *mut cairo_surface_t,
1043 x: c_int,
1044 y: c_int,
1045 width: c_int,
1046 height: c_int,
1047 );
1048 pub fn cairo_surface_create_similar(
1049 surface: *mut cairo_surface_t,
1050 content: cairo_content_t,
1051 width: c_int,
1052 height: c_int,
1053 ) -> *mut cairo_surface_t;
1054 pub fn cairo_surface_create_for_rectangle(
1055 surface: *mut cairo_surface_t,
1056 x: c_double,
1057 y: c_double,
1058 width: c_double,
1059 height: c_double,
1060 ) -> *mut cairo_surface_t;
1061 pub fn cairo_surface_get_mime_data(
1062 surface: *mut cairo_surface_t,
1063 mime_type: *const c_char,
1064 data: *const *mut u8,
1065 length: *mut c_ulong,
1066 );
1067 pub fn cairo_surface_set_mime_data(
1068 surface: *mut cairo_surface_t,
1069 mime_type: *const c_char,
1070 data: *const u8,
1071 length: c_ulong,
1072 destroy: cairo_destroy_func_t,
1073 closure: *const u8,
1074 ) -> cairo_status_t;
1075 pub fn cairo_surface_supports_mime_type(
1076 surface: *mut cairo_surface_t,
1077 mime_type: *const c_char,
1078 ) -> cairo_bool_t;
1079 pub fn cairo_surface_get_device(surface: *mut cairo_surface_t) -> *mut cairo_device_t;
1080 pub fn cairo_surface_set_device_offset(
1081 surface: *mut cairo_surface_t,
1082 x_offset: c_double,
1083 y_offset: c_double,
1084 );
1085 pub fn cairo_surface_get_device_offset(
1086 surface: *mut cairo_surface_t,
1087 x_offset: *mut c_double,
1088 y_offset: *mut c_double,
1089 );
1090 pub fn cairo_surface_get_device_scale(
1091 surface: *mut cairo_surface_t,
1092 x_scale: *mut c_double,
1093 y_scale: *mut c_double,
1094 );
1095 pub fn cairo_surface_set_device_scale(
1096 surface: *mut cairo_surface_t,
1097 x_scale: c_double,
1098 y_scale: c_double,
1099 );
1100 pub fn cairo_surface_get_fallback_resolution(
1101 surface: *mut cairo_surface_t,
1102 x_pixels_per_inch: *mut c_double,
1103 y_pixels_per_inch: *mut c_double,
1104 );
1105 pub fn cairo_surface_set_fallback_resolution(
1106 surface: *mut cairo_surface_t,
1107 x_pixels_per_inch: c_double,
1108 x_pixels_per_inch: c_double,
1109 );
1110 pub fn cairo_recording_surface_get_extents(
1111 surface: *mut cairo_surface_t,
1112 extents: *mut cairo_rectangle_t,
1113 ) -> cairo_bool_t;
1114 pub fn cairo_recording_surface_create(
1115 content: cairo_content_t,
1116 extents: *const cairo_rectangle_t,
1117 ) -> *mut cairo_surface_t;
1118 pub fn cairo_recording_surface_ink_extents(
1119 surface: *mut cairo_surface_t,
1120 x0: *mut c_double,
1121 y0: *mut c_double,
1122 width: *mut c_double,
1123 height: *mut c_double,
1124 );
1125 pub fn cairo_surface_create_similar_image(
1126 other: *mut cairo_surface_t,
1127 format: cairo_format_t,
1128 width: c_int,
1129 height: c_int,
1130 ) -> *mut cairo_surface_t;
1131 pub fn cairo_surface_map_to_image(
1132 surface: *mut cairo_surface_t,
1133 extents: *const cairo_rectangle_int_t,
1134 ) -> *mut cairo_surface_t;
1135 pub fn cairo_surface_unmap_image(surface: *mut cairo_surface_t, image: *mut cairo_surface_t);
1136
1137 pub fn cairo_image_surface_create(
1139 format: cairo_format_t,
1140 width: c_int,
1141 height: c_int,
1142 ) -> *mut cairo_surface_t;
1143 pub fn cairo_image_surface_create_for_data(
1144 data: *mut u8,
1145 format: cairo_format_t,
1146 width: c_int,
1147 height: c_int,
1148 stride: c_int,
1149 ) -> *mut cairo_surface_t;
1150 pub fn cairo_image_surface_get_data(surface: *mut cairo_surface_t) -> *mut u8;
1151 pub fn cairo_image_surface_get_format(surface: *mut cairo_surface_t) -> cairo_format_t;
1152 pub fn cairo_image_surface_get_height(surface: *mut cairo_surface_t) -> c_int;
1153 pub fn cairo_image_surface_get_stride(surface: *mut cairo_surface_t) -> c_int;
1154 pub fn cairo_image_surface_get_width(surface: *mut cairo_surface_t) -> c_int;
1155 pub fn cairo_format_stride_for_width(format: cairo_format_t, width: c_int) -> c_int;
1156 #[cfg(feature = "png")]
1157 #[cfg_attr(docsrs, doc(cfg(feature = "png")))]
1158 pub fn cairo_image_surface_create_from_png_stream(
1159 read_func: cairo_read_func_t,
1160 closure: *mut c_void,
1161 ) -> *mut cairo_surface_t;
1162 #[cfg(feature = "png")]
1163 #[cfg_attr(docsrs, doc(cfg(feature = "png")))]
1164 pub fn cairo_surface_write_to_png_stream(
1165 surface: *mut cairo_surface_t,
1166 write_func: cairo_write_func_t,
1167 closure: *mut c_void,
1168 ) -> cairo_status_t;
1169
1170 #[cfg(feature = "pdf")]
1172 #[cfg_attr(docsrs, doc(cfg(feature = "pdf")))]
1173 pub fn cairo_pdf_surface_create(
1174 filename: *const c_char,
1175 width_in_points: c_double,
1176 height_in_points: c_double,
1177 ) -> *mut cairo_surface_t;
1178 #[cfg(feature = "pdf")]
1179 #[cfg_attr(docsrs, doc(cfg(feature = "pdf")))]
1180 pub fn cairo_pdf_surface_create_for_stream(
1181 write_func: cairo_write_func_t,
1182 closure: *mut c_void,
1183 width_in_points: c_double,
1184 height_in_points: c_double,
1185 ) -> *mut cairo_surface_t;
1186 #[cfg(feature = "pdf")]
1187 #[cfg_attr(docsrs, doc(cfg(feature = "pdf")))]
1188 pub fn cairo_pdf_surface_restrict_to_version(
1189 surface: *mut cairo_surface_t,
1190 version: cairo_pdf_version_t,
1191 );
1192 #[cfg(feature = "pdf")]
1193 #[cfg_attr(docsrs, doc(cfg(feature = "pdf")))]
1194 pub fn cairo_pdf_get_versions(
1195 versions: *mut *mut cairo_pdf_version_t,
1196 num_versions: *mut c_int,
1197 );
1198 #[cfg(feature = "pdf")]
1199 #[cfg_attr(docsrs, doc(cfg(feature = "pdf")))]
1200 pub fn cairo_pdf_version_to_string(version: cairo_pdf_version_t) -> *const c_char;
1201 #[cfg(feature = "pdf")]
1202 #[cfg_attr(docsrs, doc(cfg(feature = "pdf")))]
1203 pub fn cairo_pdf_surface_set_size(
1204 surface: *mut cairo_surface_t,
1205 width_in_points: f64,
1206 height_in_points: f64,
1207 );
1208 #[cfg(all(feature = "pdf", feature = "v1_16"))]
1209 #[cfg_attr(docsrs, doc(cfg(all(feature = "pdf", feature = "v1_16"))))]
1210 pub fn cairo_pdf_surface_add_outline(
1211 surface: *mut cairo_surface_t,
1212 parent_id: c_int,
1213 utf8: *const c_char,
1214 link_attribs: *const c_char,
1215 flags: cairo_pdf_outline_flags_t,
1216 ) -> c_int;
1217 #[cfg(all(feature = "pdf", feature = "v1_16"))]
1218 #[cfg_attr(docsrs, doc(cfg(all(feature = "pdf", feature = "v1_16"))))]
1219 pub fn cairo_pdf_surface_set_metadata(
1220 surface: *mut cairo_surface_t,
1221 metadata: cairo_pdf_metadata_t,
1222 utf8: *const c_char,
1223 );
1224 #[cfg(all(feature = "pdf", feature = "v1_18"))]
1225 #[cfg_attr(docsrs, doc(cfg(all(feature = "pdf", feature = "v1_18"))))]
1226 pub fn cairo_pdf_surface_set_custom_metadata(
1227 surface: *mut cairo_surface_t,
1228 name: *const c_char,
1229 value: *const c_char,
1230 );
1231 #[cfg(all(feature = "pdf", feature = "v1_16"))]
1232 #[cfg_attr(docsrs, doc(cfg(all(feature = "pdf", feature = "v1_16"))))]
1233 pub fn cairo_pdf_surface_set_page_label(surface: *mut cairo_surface_t, utf8: *const c_char);
1234 #[cfg(all(feature = "pdf", feature = "v1_16"))]
1235 #[cfg_attr(docsrs, doc(cfg(all(feature = "pdf", feature = "v1_16"))))]
1236 pub fn cairo_pdf_surface_set_thumbnail_size(
1237 surface: *mut cairo_surface_t,
1238 width: c_int,
1239 height: c_int,
1240 );
1241
1242 #[cfg(feature = "svg")]
1244 #[cfg_attr(docsrs, doc(cfg(feature = "svg")))]
1245 pub fn cairo_svg_surface_create(
1246 filename: *const c_char,
1247 width_in_points: c_double,
1248 height_in_points: c_double,
1249 ) -> *mut cairo_surface_t;
1250 #[cfg(feature = "svg")]
1251 #[cfg_attr(docsrs, doc(cfg(feature = "svg")))]
1252 pub fn cairo_svg_surface_create_for_stream(
1253 write_func: cairo_write_func_t,
1254 closure: *mut c_void,
1255 width_in_points: c_double,
1256 height_in_points: c_double,
1257 ) -> *mut cairo_surface_t;
1258 #[cfg(feature = "svg")]
1259 #[cfg_attr(docsrs, doc(cfg(feature = "svg")))]
1260 pub fn cairo_svg_surface_restrict_to_version(
1261 surface: *mut cairo_surface_t,
1262 version: cairo_svg_version_t,
1263 );
1264 #[cfg(all(feature = "svg", feature = "v1_16"))]
1265 #[cfg_attr(docsrs, doc(cfg(all(feature = "svg", feature = "v1_16"))))]
1266 pub fn cairo_svg_surface_get_document_unit(surface: *const cairo_surface_t)
1267 -> cairo_svg_unit_t;
1268 #[cfg(all(feature = "svg", feature = "v1_16"))]
1269 #[cfg_attr(docsrs, doc(cfg(all(feature = "svg", feature = "v1_16"))))]
1270 pub fn cairo_svg_surface_set_document_unit(
1271 surface: *mut cairo_surface_t,
1272 unit: cairo_svg_unit_t,
1273 );
1274 #[cfg(feature = "svg")]
1275 #[cfg_attr(docsrs, doc(cfg(feature = "svg")))]
1276 pub fn cairo_svg_get_versions(
1277 versions: *mut *mut cairo_svg_version_t,
1278 num_versions: *mut c_int,
1279 );
1280 #[cfg(feature = "svg")]
1281 #[cfg_attr(docsrs, doc(cfg(feature = "svg")))]
1282 pub fn cairo_svg_version_to_string(version: cairo_svg_version_t) -> *const c_char;
1283
1284 #[cfg(feature = "ps")]
1286 #[cfg_attr(docsrs, doc(cfg(feature = "ps")))]
1287 pub fn cairo_ps_surface_create(
1288 filename: *const c_char,
1289 width_in_points: c_double,
1290 height_in_points: c_double,
1291 ) -> *mut cairo_surface_t;
1292 #[cfg(feature = "ps")]
1293 #[cfg_attr(docsrs, doc(cfg(feature = "ps")))]
1294 pub fn cairo_ps_surface_create_for_stream(
1295 write_func: cairo_write_func_t,
1296 closure: *mut c_void,
1297 width_in_points: c_double,
1298 height_in_points: c_double,
1299 ) -> *mut cairo_surface_t;
1300 #[cfg(feature = "ps")]
1301 #[cfg_attr(docsrs, doc(cfg(feature = "ps")))]
1302 pub fn cairo_ps_surface_restrict_to_level(
1303 surface: *mut cairo_surface_t,
1304 version: cairo_ps_level_t,
1305 );
1306 #[cfg(feature = "ps")]
1307 #[cfg_attr(docsrs, doc(cfg(feature = "ps")))]
1308 pub fn cairo_ps_get_levels(levels: *mut *mut cairo_ps_level_t, num_levels: *mut c_int);
1309 #[cfg(feature = "ps")]
1310 #[cfg_attr(docsrs, doc(cfg(feature = "ps")))]
1311 pub fn cairo_ps_level_to_string(level: cairo_ps_level_t) -> *const c_char;
1312 #[cfg(feature = "ps")]
1313 #[cfg_attr(docsrs, doc(cfg(feature = "ps")))]
1314 pub fn cairo_ps_surface_set_eps(surface: *mut cairo_surface_t, eps: cairo_bool_t);
1315 #[cfg(feature = "ps")]
1316 #[cfg_attr(docsrs, doc(cfg(feature = "ps")))]
1317 pub fn cairo_ps_surface_get_eps(surface: *mut cairo_surface_t) -> cairo_bool_t;
1318 #[cfg(feature = "ps")]
1319 #[cfg_attr(docsrs, doc(cfg(feature = "ps")))]
1320 pub fn cairo_ps_surface_set_size(
1321 surface: *mut cairo_surface_t,
1322 width_in_points: f64,
1323 height_in_points: f64,
1324 );
1325 #[cfg(feature = "ps")]
1326 #[cfg_attr(docsrs, doc(cfg(feature = "ps")))]
1327 pub fn cairo_ps_surface_dsc_begin_setup(surface: *mut cairo_surface_t);
1328 #[cfg(feature = "ps")]
1329 #[cfg_attr(docsrs, doc(cfg(feature = "ps")))]
1330 pub fn cairo_ps_surface_dsc_begin_page_setup(surface: *mut cairo_surface_t);
1331 #[cfg(feature = "ps")]
1332 #[cfg_attr(docsrs, doc(cfg(feature = "ps")))]
1333 pub fn cairo_ps_surface_dsc_comment(surface: *mut cairo_surface_t, comment: *const c_char);
1334
1335 #[cfg(feature = "xcb")]
1337 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
1338 pub fn cairo_xcb_surface_create(
1339 connection: *mut xcb_connection_t,
1340 drawable: xcb_drawable_t,
1341 visual: *mut xcb_visualtype_t,
1342 width: c_int,
1343 height: c_int,
1344 ) -> *mut cairo_surface_t;
1345 #[cfg(feature = "xcb")]
1346 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
1347 pub fn cairo_xcb_surface_create_for_bitmap(
1348 connection: *mut xcb_connection_t,
1349 screen: *mut xcb_screen_t,
1350 bitmap: xcb_pixmap_t,
1351 width: c_int,
1352 height: c_int,
1353 ) -> *mut cairo_surface_t;
1354 #[cfg(feature = "xcb")]
1355 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
1356 pub fn cairo_xcb_surface_create_with_xrender_format(
1357 connection: *mut xcb_connection_t,
1358 screen: *mut xcb_screen_t,
1359 drawable: xcb_drawable_t,
1360 format: *mut xcb_render_pictforminfo_t,
1361 width: c_int,
1362 height: c_int,
1363 ) -> *mut cairo_surface_t;
1364 #[cfg(feature = "xcb")]
1365 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
1366 pub fn cairo_xcb_surface_set_size(surface: *mut cairo_surface_t, width: c_int, height: c_int);
1367 #[cfg(feature = "xcb")]
1368 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
1369 pub fn cairo_xcb_surface_set_drawable(
1370 surface: *mut cairo_surface_t,
1371 drawable: xcb_drawable_t,
1372 width: c_int,
1373 height: c_int,
1374 );
1375 #[cfg(feature = "xcb")]
1376 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
1377 pub fn cairo_xcb_device_get_connection(device: *mut cairo_device_t) -> *mut xcb_connection_t;
1378 #[cfg(feature = "xcb")]
1379 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
1380 pub fn cairo_xcb_device_debug_cap_xrender_version(
1381 device: *mut cairo_device_t,
1382 major_version: c_int,
1383 minor_version: c_int,
1384 );
1385 #[cfg(feature = "xcb")]
1386 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
1387 pub fn cairo_xcb_device_debug_cap_xshm_version(
1388 device: *mut cairo_device_t,
1389 major_version: c_int,
1390 minor_version: c_int,
1391 );
1392 #[cfg(feature = "xcb")]
1393 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
1394 pub fn cairo_xcb_device_debug_get_precision(device: *mut cairo_device_t) -> c_int;
1395 #[cfg(feature = "xcb")]
1396 #[cfg_attr(docsrs, doc(cfg(feature = "xcb")))]
1397 pub fn cairo_xcb_device_debug_set_precision(device: *mut cairo_device_t, precision: c_int);
1398
1399 #[cfg(feature = "xlib")]
1401 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1402 pub fn cairo_xlib_surface_create(
1403 dpy: *mut xlib::Display,
1404 drawable: xlib::Drawable,
1405 visual: *mut xlib::Visual,
1406 width: c_int,
1407 height: c_int,
1408 ) -> *mut cairo_surface_t;
1409 #[cfg(feature = "xlib")]
1410 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1411 pub fn cairo_xlib_surface_create_for_bitmap(
1412 dpy: *mut xlib::Display,
1413 bitmap: xlib::Pixmap,
1414 screen: *mut xlib::Screen,
1415 width: c_int,
1416 height: c_int,
1417 ) -> *mut cairo_surface_t;
1418 #[cfg(feature = "xlib")]
1419 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1420 pub fn cairo_xlib_surface_set_size(surface: *mut cairo_surface_t, width: c_int, height: c_int);
1421 #[cfg(feature = "xlib")]
1422 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1423 pub fn cairo_xlib_surface_set_drawable(
1424 surface: *mut cairo_surface_t,
1425 drawable: xlib::Drawable,
1426 width: c_int,
1427 height: c_int,
1428 );
1429 #[cfg(feature = "xlib")]
1430 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1431 pub fn cairo_xlib_surface_get_display(surface: *mut cairo_surface_t) -> *mut xlib::Display;
1432 #[cfg(feature = "xlib")]
1433 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1434 pub fn cairo_xlib_surface_get_drawable(surface: *mut cairo_surface_t) -> xlib::Drawable;
1435 #[cfg(feature = "xlib")]
1436 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1437 pub fn cairo_xlib_surface_get_screen(surface: *mut cairo_surface_t) -> *mut xlib::Screen;
1438 #[cfg(feature = "xlib")]
1439 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1440 pub fn cairo_xlib_surface_get_visual(surface: *mut cairo_surface_t) -> *mut xlib::Visual;
1441 #[cfg(feature = "xlib")]
1442 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1443 pub fn cairo_xlib_surface_get_depth(surface: *mut cairo_surface_t) -> c_int;
1444 #[cfg(feature = "xlib")]
1445 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1446 pub fn cairo_xlib_surface_get_width(surface: *mut cairo_surface_t) -> c_int;
1447 #[cfg(feature = "xlib")]
1448 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1449 pub fn cairo_xlib_surface_get_height(surface: *mut cairo_surface_t) -> c_int;
1450 #[cfg(feature = "xlib")]
1451 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1452 pub fn cairo_xlib_device_debug_cap_xrender_version(
1453 device: *mut cairo_device_t,
1454 major_version: c_int,
1455 minor_version: c_int,
1456 );
1457 #[cfg(feature = "xlib")]
1458 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1459 pub fn cairo_xlib_device_debug_get_precision(device: *mut cairo_device_t) -> c_int;
1460 #[cfg(feature = "xlib")]
1461 #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
1462 pub fn cairo_xlib_device_debug_set_precision(device: *mut cairo_device_t, precision: c_int);
1463
1464 #[cfg(all(windows, feature = "win32-surface"))]
1466 #[cfg_attr(docsrs, doc(cfg(all(windows, feature = "win32-surface"))))]
1467 pub fn cairo_win32_surface_create(hdc: windows::HDC) -> *mut cairo_surface_t;
1468 #[cfg(all(windows, feature = "win32-surface"))]
1469 #[cfg_attr(docsrs, doc(cfg(all(windows, feature = "win32-surface"))))]
1470 pub fn cairo_win32_surface_create_with_format(
1471 hdc: windows::HDC,
1472 format: cairo_format_t,
1473 ) -> *mut cairo_surface_t;
1474 #[cfg(all(windows, feature = "win32-surface"))]
1475 #[cfg_attr(docsrs, doc(cfg(all(windows, feature = "win32-surface"))))]
1476 pub fn cairo_win32_surface_create_with_dib(
1477 format: cairo_format_t,
1478 width: c_int,
1479 height: c_int,
1480 ) -> *mut cairo_surface_t;
1481 #[cfg(all(windows, feature = "win32-surface"))]
1482 #[cfg_attr(docsrs, doc(cfg(all(windows, feature = "win32-surface"))))]
1483 pub fn cairo_win32_surface_create_with_ddb(
1484 hdc: windows::HDC,
1485 format: cairo_format_t,
1486 width: c_int,
1487 height: c_int,
1488 ) -> *mut cairo_surface_t;
1489 #[cfg(all(windows, feature = "win32-surface"))]
1490 #[cfg_attr(docsrs, doc(cfg(all(windows, feature = "win32-surface"))))]
1491 pub fn cairo_win32_printing_surface_create(hdc: windows::HDC) -> *mut cairo_surface_t;
1492 #[cfg(all(windows, feature = "win32-surface"))]
1493 #[cfg_attr(docsrs, doc(cfg(all(windows, feature = "win32-surface"))))]
1494 pub fn cairo_win32_surface_get_dc(surface: *mut cairo_surface_t) -> windows::HDC;
1495 #[cfg(all(windows, feature = "win32-surface"))]
1496 #[cfg_attr(docsrs, doc(cfg(all(windows, feature = "win32-surface"))))]
1497 pub fn cairo_win32_surface_get_image(surface: *mut cairo_surface_t) -> *mut cairo_surface_t;
1498
1499 #[cfg(target_os = "macos")]
1500 #[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
1501 pub fn cairo_quartz_surface_create(
1502 format: cairo_format_t,
1503 width: c_uint,
1504 height: c_uint,
1505 ) -> *mut cairo_surface_t;
1506 #[cfg(target_os = "macos")]
1507 #[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
1508 pub fn cairo_quartz_surface_create_for_cg_context(
1509 cg_context: CGContextRef,
1510 width: c_uint,
1511 height: c_uint,
1512 ) -> *mut cairo_surface_t;
1513 #[cfg(target_os = "macos")]
1514 #[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
1515 pub fn cairo_quartz_surface_get_cg_context(surface: *mut cairo_surface_t) -> CGContextRef;
1516
1517 #[cfg(feature = "script")]
1519 #[cfg_attr(docsrs, doc(cfg(feature = "script")))]
1520 pub fn cairo_script_create(filename: *const c_char) -> *mut cairo_device_t;
1521 #[cfg(feature = "script")]
1522 #[cfg_attr(docsrs, doc(cfg(feature = "script")))]
1523 pub fn cairo_script_create_for_stream(
1524 write_func: cairo_write_func_t,
1525 closure: *mut c_void,
1526 ) -> cairo_status_t;
1527 #[cfg(feature = "script")]
1528 #[cfg_attr(docsrs, doc(cfg(feature = "script")))]
1529 pub fn cairo_script_from_recording_surface(
1530 script: *mut cairo_device_t,
1531 surface: *mut cairo_surface_t,
1532 ) -> cairo_status_t;
1533 #[cfg(feature = "script")]
1534 #[cfg_attr(docsrs, doc(cfg(feature = "script")))]
1535 pub fn cairo_script_get_mode(script: *mut cairo_device_t) -> cairo_script_mode_t;
1536 #[cfg(feature = "script")]
1537 #[cfg_attr(docsrs, doc(cfg(feature = "script")))]
1538 pub fn cairo_script_set_mode(script: *mut cairo_device_t, mode: cairo_script_mode_t);
1539 #[cfg(feature = "script")]
1540 #[cfg_attr(docsrs, doc(cfg(feature = "script")))]
1541 pub fn cairo_script_surface_create(
1542 script: *mut cairo_device_t,
1543 content: cairo_content_t,
1544 width: c_double,
1545 height: c_double,
1546 ) -> *mut cairo_surface_t;
1547 #[cfg(feature = "script")]
1548 #[cfg_attr(docsrs, doc(cfg(feature = "script")))]
1549 pub fn cairo_script_surface_create_for_target(
1550 script: *mut cairo_device_t,
1551 target: *mut cairo_surface_t,
1552 ) -> *mut cairo_surface_t;
1553 #[cfg(feature = "script")]
1554 #[cfg_attr(docsrs, doc(cfg(feature = "script")))]
1555 pub fn cairo_script_write_comment(
1556 script: *mut cairo_device_t,
1557 comment: *const c_char,
1558 len: c_int,
1559 );
1560 pub fn cairo_device_destroy(device: *mut cairo_device_t);
1561 pub fn cairo_device_status(device: *mut cairo_device_t) -> cairo_status_t;
1562 pub fn cairo_device_finish(device: *mut cairo_device_t);
1563 pub fn cairo_device_flush(device: *mut cairo_device_t);
1564 pub fn cairo_device_get_type(device: *mut cairo_device_t) -> cairo_device_type_t;
1565 pub fn cairo_device_reference(device: *mut cairo_device_t) -> *mut cairo_device_t;
1566 pub fn cairo_device_get_reference_count(device: *mut cairo_device_t) -> c_uint;
1567 pub fn cairo_device_set_user_data(
1568 device: *mut cairo_device_t,
1569 key: *const cairo_user_data_key_t,
1570 user_data: *mut c_void,
1571 destroy: cairo_destroy_func_t,
1572 ) -> cairo_status_t;
1573 pub fn cairo_device_get_user_data(
1574 device: *mut cairo_device_t,
1575 key: *const cairo_user_data_key_t,
1576 ) -> *mut c_void;
1577 pub fn cairo_device_acquire(device: *mut cairo_device_t) -> cairo_status_t;
1578 pub fn cairo_device_release(device: *mut cairo_device_t);
1579 pub fn cairo_device_observer_elapsed(device: *mut cairo_device_t) -> c_double;
1580 pub fn cairo_device_observer_fill_elapsed(device: *mut cairo_device_t) -> c_double;
1581 pub fn cairo_device_observer_glyphs_elapsed(device: *mut cairo_device_t) -> c_double;
1582 pub fn cairo_device_observer_mask_elapsed(device: *mut cairo_device_t) -> c_double;
1583 pub fn cairo_device_observer_paint_elapsed(device: *mut cairo_device_t) -> c_double;
1584 pub fn cairo_device_observer_stroke_elapsed(device: *mut cairo_device_t) -> c_double;
1585 pub fn cairo_device_observer_print(
1586 device: *mut cairo_device_t,
1587 write_func: cairo_write_func_t,
1588 closure: *mut c_void,
1589 ) -> cairo_status_t;
1590
1591 pub fn cairo_user_font_face_create() -> *mut cairo_font_face_t;
1592 pub fn cairo_user_font_face_set_init_func(
1593 font_face: *mut cairo_font_face_t,
1594 init_func: cairo_user_scaled_font_init_func_t,
1595 );
1596 pub fn cairo_user_font_face_get_init_func(
1597 font_face: *mut cairo_font_face_t,
1598 ) -> cairo_user_scaled_font_init_func_t;
1599 pub fn cairo_user_font_face_set_render_glyph_func(
1600 font_face: *mut cairo_font_face_t,
1601 render_glyph_func: cairo_user_scaled_font_render_glyph_func_t,
1602 );
1603 pub fn cairo_user_font_face_get_render_glyph_func(
1604 font_face: *mut cairo_font_face_t,
1605 ) -> cairo_user_scaled_font_render_glyph_func_t;
1606 pub fn cairo_user_font_face_set_render_color_glyph_func(
1607 font_face: *mut cairo_font_face_t,
1608 render_glyph_func: cairo_user_scaled_font_render_glyph_func_t,
1609 );
1610 pub fn cairo_user_font_face_get_render_color_glyph_func(
1611 font_face: *mut cairo_font_face_t,
1612 ) -> cairo_user_scaled_font_render_glyph_func_t;
1613 pub fn cairo_user_font_face_set_unicode_to_glyph_func(
1614 font_face: *mut cairo_font_face_t,
1615 unicode_to_glyph_func: cairo_user_scaled_font_unicode_to_glyph_func_t,
1616 );
1617 pub fn cairo_user_font_face_get_unicode_to_glyph_func(
1618 font_face: *mut cairo_font_face_t,
1619 ) -> cairo_user_scaled_font_unicode_to_glyph_func_t;
1620 pub fn cairo_user_font_face_set_text_to_glyphs_func(
1621 font_face: *mut cairo_font_face_t,
1622 text_to_glyphs_func: cairo_user_scaled_font_text_to_glyphs_func_t,
1623 );
1624 pub fn cairo_user_font_face_get_text_to_glyphs_func(
1625 font_face: *mut cairo_font_face_t,
1626 ) -> cairo_user_scaled_font_text_to_glyphs_func_t;
1627}
1628
1629#[cfg(feature = "use_glib")]
1630#[cfg_attr(docsrs, doc(cfg(feature = "use_glib")))]
1631pub mod gobject;
1632
1633pub const STATUS_SUCCESS: i32 = 0;
1634pub const STATUS_NO_MEMORY: i32 = 1;
1635pub const STATUS_INVALID_RESTORE: i32 = 2;
1636pub const STATUS_INVALID_POP_GROUP: i32 = 3;
1637pub const STATUS_NO_CURRENT_POINT: i32 = 4;
1638pub const STATUS_INVALID_MATRIX: i32 = 5;
1639pub const STATUS_INVALID_STATUS: i32 = 6;
1640pub const STATUS_NULL_POINTER: i32 = 7;
1641pub const STATUS_INVALID_STRING: i32 = 8;
1642pub const STATUS_INVALID_PATH_DATA: i32 = 9;
1643pub const STATUS_READ_ERROR: i32 = 10;
1644pub const STATUS_WRITE_ERROR: i32 = 11;
1645pub const STATUS_SURFACE_FINISHED: i32 = 12;
1646pub const STATUS_SURFACE_TYPE_MISMATCH: i32 = 13;
1647pub const STATUS_PATTERN_TYPE_MISMATCH: i32 = 14;
1648pub const STATUS_INVALID_CONTENT: i32 = 15;
1649pub const STATUS_INVALID_FORMAT: i32 = 16;
1650pub const STATUS_INVALID_VISUAL: i32 = 17;
1651pub const STATUS_FILE_NOT_FOUND: i32 = 18;
1652pub const STATUS_INVALID_DASH: i32 = 19;
1653pub const STATUS_INVALID_DSC_COMMENT: i32 = 20;
1654pub const STATUS_INVALID_INDEX: i32 = 21;
1655pub const STATUS_CLIP_NOT_REPRESENTABLE: i32 = 22;
1656pub const STATUS_TEMP_FILE_ERROR: i32 = 23;
1657pub const STATUS_INVALID_STRIDE: i32 = 24;
1658pub const STATUS_FONT_TYPE_MISMATCH: i32 = 25;
1659pub const STATUS_USER_FONT_IMMUTABLE: i32 = 26;
1660pub const STATUS_USER_FONT_ERROR: i32 = 27;
1661pub const STATUS_NEGATIVE_COUNT: i32 = 28;
1662pub const STATUS_INVALID_CLUSTERS: i32 = 29;
1663pub const STATUS_INVALID_SLANT: i32 = 30;
1664pub const STATUS_INVALID_WEIGHT: i32 = 31;
1665pub const STATUS_INVALID_SIZE: i32 = 32;
1666pub const STATUS_USER_FONT_NOT_IMPLEMENTED: i32 = 33;
1667pub const STATUS_DEVICE_TYPE_MISMATCH: i32 = 34;
1668pub const STATUS_DEVICE_ERROR: i32 = 35;
1669pub const STATUS_INVALID_MESH_CONSTRUCTION: i32 = 36;
1670pub const STATUS_DEVICE_FINISHED: i32 = 37;
1671pub const STATUS_J_BIG2_GLOBAL_MISSING: i32 = 38;
1672pub const STATUS_PNG_ERROR: i32 = 39;
1673pub const STATUS_FREETYPE_ERROR: i32 = 40;
1674pub const STATUS_WIN32_GDI_ERROR: i32 = 41;
1675pub const STATUS_TAG_ERROR: i32 = 42;
1676pub const STATUS_DWRITE_ERROR: i32 = 43;
1677pub const STATUS_LAST_STATUS: i32 = 44;
1678pub const ANTIALIAS_DEFAULT: i32 = 0;
1679pub const ANTIALIAS_NONE: i32 = 1;
1680pub const ANTIALIAS_GRAY: i32 = 2;
1681pub const ANTIALIAS_SUBPIXEL: i32 = 3;
1682pub const ANTIALIAS_FAST: i32 = 4;
1683pub const ANTIALIAS_GOOD: i32 = 5;
1684pub const ANTIALIAS_BEST: i32 = 6;
1685pub const FILL_RULE_WINDING: i32 = 0;
1686pub const FILL_RULE_EVEN_ODD: i32 = 1;
1687pub const LINE_CAP_BUTT: i32 = 0;
1688pub const LINE_CAP_ROUND: i32 = 1;
1689pub const LINE_CAP_SQUARE: i32 = 2;
1690pub const LINE_JOIN_MITER: i32 = 0;
1691pub const LINE_JOIN_ROUND: i32 = 1;
1692pub const LINE_JOIN_BEVEL: i32 = 2;
1693pub const OPERATOR_CLEAR: i32 = 0;
1694pub const OPERATOR_SOURCE: i32 = 1;
1695pub const OPERATOR_OVER: i32 = 2;
1696pub const OPERATOR_IN: i32 = 3;
1697pub const OPERATOR_OUT: i32 = 4;
1698pub const OPERATOR_ATOP: i32 = 5;
1699pub const OPERATOR_DEST: i32 = 6;
1700pub const OPERATOR_DEST_OVER: i32 = 7;
1701pub const OPERATOR_DEST_IN: i32 = 8;
1702pub const OPERATOR_DEST_OUT: i32 = 9;
1703pub const OPERATOR_DEST_ATOP: i32 = 10;
1704pub const OPERATOR_XOR: i32 = 11;
1705pub const OPERATOR_ADD: i32 = 12;
1706pub const OPERATOR_SATURATE: i32 = 13;
1707pub const OPERATOR_MULTIPLY: i32 = 14;
1708pub const OPERATOR_SCREEN: i32 = 15;
1709pub const OPERATOR_OVERLAY: i32 = 16;
1710pub const OPERATOR_DARKEN: i32 = 17;
1711pub const OPERATOR_LIGHTEN: i32 = 18;
1712pub const OPERATOR_COLOR_DODGE: i32 = 19;
1713pub const OPERATOR_COLOR_BURN: i32 = 20;
1714pub const OPERATOR_HARD_LIGHT: i32 = 21;
1715pub const OPERATOR_SOFT_LIGHT: i32 = 22;
1716pub const OPERATOR_DIFFERENCE: i32 = 23;
1717pub const OPERATOR_EXCLUSION: i32 = 24;
1718pub const OPERATOR_HSL_HUE: i32 = 25;
1719pub const OPERATOR_HSL_SATURATION: i32 = 26;
1720pub const OPERATOR_HSL_COLOR: i32 = 27;
1721pub const OPERATOR_HSL_LUMINOSITY: i32 = 28;
1722pub const PATH_DATA_TYPE_MOVE_TO: i32 = 0;
1723pub const PATH_DATA_TYPE_LINE_TO: i32 = 1;
1724pub const PATH_DATA_TYPE_CURVE_TO: i32 = 2;
1725pub const PATH_DATA_TYPE_CLOSE_PATH: i32 = 3;
1726pub const CONTENT_COLOR: i32 = 0x1000;
1727pub const CONTENT_ALPHA: i32 = 0x2000;
1728pub const CONTENT_COLOR_ALPHA: i32 = 0x3000;
1729pub const EXTEND_NONE: i32 = 0;
1730pub const EXTEND_REPEAT: i32 = 1;
1731pub const EXTEND_REFLECT: i32 = 2;
1732pub const EXTEND_PAD: i32 = 3;
1733pub const FILTER_FAST: i32 = 0;
1734pub const FILTER_GOOD: i32 = 1;
1735pub const FILTER_BEST: i32 = 2;
1736pub const FILTER_NEAREST: i32 = 3;
1737pub const FILTER_BILINEAR: i32 = 4;
1738pub const FILTER_GAUSSIAN: i32 = 5;
1739pub const PATTERN_TYPE_SOLID: i32 = 0;
1740pub const PATTERN_TYPE_SURFACE: i32 = 1;
1741pub const PATTERN_TYPE_LINEAR_GRADIENT: i32 = 2;
1742pub const PATTERN_TYPE_RADIAL_GRADIENT: i32 = 3;
1743pub const PATTERN_TYPE_MESH: i32 = 4;
1744pub const PATTERN_TYPE_RASTER_SOURCE: i32 = 5;
1745pub const FONT_SLANT_NORMAL: i32 = 0;
1746pub const FONT_SLANT_ITALIC: i32 = 1;
1747pub const FONT_SLANT_OBLIQUE: i32 = 2;
1748pub const FONT_WEIGHT_NORMAL: i32 = 0;
1749pub const FONT_WEIGHT_BOLD: i32 = 1;
1750pub const TEXT_CLUSTER_FLAGS_NONE: i32 = 0x00000000;
1751pub const TEXT_CLUSTER_FLAGS_BACKWARD: i32 = 0x00000001;
1752pub const FONT_TYPE_FONT_TYPE_TOY: i32 = 0;
1753pub const FONT_TYPE_FONT_TYPE_FT: i32 = 1;
1754pub const FONT_TYPE_FONT_TYPE_WIN32: i32 = 2;
1755pub const FONT_TYPE_FONT_TYPE_QUARTZ: i32 = 3;
1756pub const FONT_TYPE_FONT_TYPE_USER: i32 = 4;
1757pub const FONT_TYPE_FONT_TYPE_DWRITE: i32 = 5;
1758pub const SUBPIXEL_ORDER_DEFAULT: i32 = 0;
1759pub const SUBPIXEL_ORDER_RGB: i32 = 1;
1760pub const SUBPIXEL_ORDER_BGR: i32 = 2;
1761pub const SUBPIXEL_ORDER_VRGB: i32 = 3;
1762pub const SUBPIXEL_ORDER_VBGR: i32 = 4;
1763pub const HINT_STYLE_DEFAULT: i32 = 0;
1764pub const HINT_STYLE_NONE: i32 = 1;
1765pub const HINT_STYLE_SLIGHT: i32 = 2;
1766pub const HINT_STYLE_MEDIUM: i32 = 3;
1767pub const HINT_STYLE_FULL: i32 = 4;
1768pub const HINT_METRICS_DEFAULT: i32 = 0;
1769pub const HINT_METRICS_OFF: i32 = 1;
1770pub const HINT_METRICS_ON: i32 = 2;
1771pub const SURFACE_TYPE_IMAGE: i32 = 0;
1772pub const SURFACE_TYPE_PDF: i32 = 1;
1773pub const SURFACE_TYPE_PS: i32 = 2;
1774pub const SURFACE_TYPE_XLIB: i32 = 3;
1775pub const SURFACE_TYPE_XCB: i32 = 4;
1776pub const SURFACE_TYPE_GLITZ: i32 = 5;
1777pub const SURFACE_TYPE_QUARTZ: i32 = 6;
1778pub const SURFACE_TYPE_WIN32: i32 = 7;
1779pub const SURFACE_TYPE_BE_OS: i32 = 8;
1780pub const SURFACE_TYPE_DIRECT_FB: i32 = 9;
1781pub const SURFACE_TYPE_SVG: i32 = 10;
1782pub const SURFACE_TYPE_OS2: i32 = 11;
1783pub const SURFACE_TYPE_WIN32_PRINTING: i32 = 12;
1784pub const SURFACE_TYPE_QUARTZ_IMAGE: i32 = 13;
1785pub const SURFACE_TYPE_SCRIPT: i32 = 14;
1786pub const SURFACE_TYPE_QT: i32 = 15;
1787pub const SURFACE_TYPE_RECORDING: i32 = 16;
1788pub const SURFACE_TYPE_VG: i32 = 17;
1789pub const SURFACE_TYPE_GL: i32 = 18;
1790pub const SURFACE_TYPE_DRM: i32 = 19;
1791pub const SURFACE_TYPE_TEE: i32 = 20;
1792pub const SURFACE_TYPE_XML: i32 = 21;
1793pub const SURFACE_TYPE_SKIA: i32 = 22;
1794pub const SURFACE_TYPE_SUBSURFACE: i32 = 23;
1795pub const SURFACE_TYPE_COGL: i32 = 24;
1796pub const SVG_UNIT_USER: i32 = 0;
1797pub const SVG_UNIT_EM: i32 = 1;
1798pub const SVG_UNIT_EX: i32 = 2;
1799pub const SVG_UNIT_PX: i32 = 3;
1800pub const SVG_UNIT_IN: i32 = 4;
1801pub const SVG_UNIT_CM: i32 = 5;
1802pub const SVG_UNIT_MM: i32 = 6;
1803pub const SVG_UNIT_PT: i32 = 7;
1804pub const SVG_UNIT_PC: i32 = 8;
1805pub const SVG_UNIT_PERCENT: i32 = 9;
1806pub const FORMAT_INVALID: i32 = -1;
1807pub const FORMAT_A_RGB32: i32 = 0;
1808pub const FORMAT_RGB24: i32 = 1;
1809pub const FORMAT_A8: i32 = 2;
1810pub const FORMAT_A1: i32 = 3;
1811pub const FORMAT_RGB16_565: i32 = 4;
1812pub const FORMAT_RGB30: i32 = 5;
1813pub const REGION_OVERLAP_IN: i32 = 0;
1814pub const REGION_OVERLAP_OUT: i32 = 1;
1815pub const REGION_OVERLAP_PART: i32 = 2;
1816pub const PDF_OUTLINE_FLAG_OPEN: i32 = 0x1;
1817pub const PDF_OUTLINE_FLAG_BOLD: i32 = 0x2;
1818pub const PDF_OUTLINE_FLAG_ITALIC: i32 = 0x4;
1819pub const PDF_METADATA_TITLE: i32 = 0;
1820pub const PDF_METADATA_AUTHOR: i32 = 1;
1821pub const PDF_METADATA_SUBJECT: i32 = 2;
1822pub const PDF_METADATA_KEYWORDS: i32 = 3;
1823pub const PDF_METADATA_CREATOR: i32 = 4;
1824pub const PDF_METADATA_CREATE_DATE: i32 = 5;
1825pub const PDF_METADATA_MOD_DATE: i32 = 6;
1826pub const PDF_VERSION__1_4: i32 = 0;
1827pub const PDF_VERSION__1_5: i32 = 1;
1828pub const PDF_VERSION__1_6: i32 = 2;
1829pub const PDF_VERSION__1_7: i32 = 3;
1830pub const SVG_VERSION__1_1: i32 = 0;
1831pub const SVG_VERSION__1_2: i32 = 1;
1832pub const PS_LEVEL__2: i32 = 0;
1833pub const PS_LEVEL__3: i32 = 1;
1834pub const MESH_CORNER_MESH_CORNER0: u32 = 0;
1835pub const MESH_CORNER_MESH_CORNER1: u32 = 1;
1836pub const MESH_CORNER_MESH_CORNER2: u32 = 2;
1837pub const MESH_CORNER_MESH_CORNER3: u32 = 3;
1838pub const CAIRO_FT_SYNTHESIZE_BOLD: u32 = 1;
1839pub const CAIRO_FT_SYNTHESIZE_OBLIQUE: u32 = 2;
1840pub const CAIRO_SCRIPT_MODE_ASCII: i32 = 0;
1841pub const CAIRO_SCRIPT_MODE_BINARY: i32 = 1;
1842
1843pub const CAIRO_DEVICE_TYPE_DRM: i32 = 0;
1844pub const CAIRO_DEVICE_TYPE_GL: i32 = 1;
1845pub const CAIRO_DEVICE_TYPE_SCRIPT: i32 = 2;
1846pub const CAIRO_DEVICE_TYPE_XCB: i32 = 3;
1847pub const CAIRO_DEVICE_TYPE_XLIB: i32 = 4;
1848pub const CAIRO_DEVICE_TYPE_XML: i32 = 5;
1849pub const CAIRO_DEVICE_TYPE_COGL: i32 = 6;
1850pub const CAIRO_DEVICE_TYPE_WIN32: i32 = 7;
1851pub const CAIRO_DEVICE_TYPE_INVALID: i32 = -1;