1 ! Copyright (c) 2007 Sampo Vuori
2 ! Copyright (c) 2008 Matthew Willis
4 ! Adapted from cairo.h, version 1.5.14
5 ! License: http://factorcode.org/license.txt
7 USING: system combinators alien alien.syntax alien.c-types
8 alien.destructors kernel accessors sequences arrays ui.gadgets
13 { [ os winnt? ] [ "cairo" "libcairo-2.dll" "cdecl" add-library ] }
14 { [ os macosx? ] [ "cairo" "/opt/local/lib/libcairo.dylib" "cdecl" add-library ] }
20 FUNCTION: int cairo_version ( ) ;
21 FUNCTION: char* cairo_version_string ( ) ;
23 TYPEDEF: int cairo_bool_t
25 ! I am leaving these and other void* types as opaque structures
26 TYPEDEF: void* cairo_t
27 TYPEDEF: void* cairo_surface_t
29 C-STRUCT: cairo_matrix_t
37 TYPEDEF: void* cairo_pattern_t
39 TYPEDEF: void* cairo_destroy_func_t
40 : cairo-destroy-func ( quot -- callback )
41 [ "void" { "void*" } "cdecl" ] dip alien-callback ; inline
43 ! See cairo.h for details
44 C-STRUCT: cairo_user_data_key_t
47 TYPEDEF: int cairo_status_t
50 CAIRO_STATUS_NO_MEMORY
51 CAIRO_STATUS_INVALID_RESTORE
52 CAIRO_STATUS_INVALID_POP_GROUP
53 CAIRO_STATUS_NO_CURRENT_POINT
54 CAIRO_STATUS_INVALID_MATRIX
55 CAIRO_STATUS_INVALID_STATUS
56 CAIRO_STATUS_NULL_POINTER
57 CAIRO_STATUS_INVALID_STRING
58 CAIRO_STATUS_INVALID_PATH_DATA
59 CAIRO_STATUS_READ_ERROR
60 CAIRO_STATUS_WRITE_ERROR
61 CAIRO_STATUS_SURFACE_FINISHED
62 CAIRO_STATUS_SURFACE_TYPE_MISMATCH
63 CAIRO_STATUS_PATTERN_TYPE_MISMATCH
64 CAIRO_STATUS_INVALID_CONTENT
65 CAIRO_STATUS_INVALID_FORMAT
66 CAIRO_STATUS_INVALID_VISUAL
67 CAIRO_STATUS_FILE_NOT_FOUND
68 CAIRO_STATUS_INVALID_DASH
69 CAIRO_STATUS_INVALID_DSC_COMMENT
70 CAIRO_STATUS_INVALID_INDEX
71 CAIRO_STATUS_CLIP_NOT_REPRESENTABLE
72 CAIRO_STATUS_TEMP_FILE_ERROR
73 CAIRO_STATUS_INVALID_STRIDE ;
75 TYPEDEF: int cairo_content_t
76 CONSTANT: CAIRO_CONTENT_COLOR HEX: 1000
77 CONSTANT: CAIRO_CONTENT_ALPHA HEX: 2000
78 CONSTANT: CAIRO_CONTENT_COLOR_ALPHA HEX: 3000
80 TYPEDEF: void* cairo_write_func_t
81 : cairo-write-func ( quot -- callback )
82 [ "cairo_status_t" { "void*" "uchar*" "int" } "cdecl" ] dip alien-callback ; inline
84 TYPEDEF: void* cairo_read_func_t
85 : cairo-read-func ( quot -- callback )
86 [ "cairo_status_t" { "void*" "uchar*" "int" } "cdecl" ] dip alien-callback ; inline
88 ! Functions for manipulating state objects
90 cairo_create ( cairo_surface_t* target ) ;
93 cairo_reference ( cairo_t* cr ) ;
96 cairo_destroy ( cairo_t* cr ) ;
98 DESTRUCTOR: cairo_destroy
101 cairo_get_reference_count ( cairo_t* cr ) ;
104 cairo_get_user_data ( cairo_t* cr, cairo_user_data_key_t* key ) ;
106 FUNCTION: cairo_status_t
107 cairo_set_user_data ( cairo_t* cr, cairo_user_data_key_t* key, void* user_data, cairo_destroy_func_t destroy ) ;
110 cairo_save ( cairo_t* cr ) ;
113 cairo_restore ( cairo_t* cr ) ;
116 cairo_push_group ( cairo_t* cr ) ;
119 cairo_push_group_with_content ( cairo_t* cr, cairo_content_t content ) ;
121 FUNCTION: cairo_pattern_t*
122 cairo_pop_group ( cairo_t* cr ) ;
125 cairo_pop_group_to_source ( cairo_t* cr ) ;
128 TYPEDEF: int cairo_operator_t
132 CAIRO_OPERATOR_SOURCE
139 CAIRO_OPERATOR_DEST_OVER
140 CAIRO_OPERATOR_DEST_IN
141 CAIRO_OPERATOR_DEST_OUT
142 CAIRO_OPERATOR_DEST_ATOP
146 CAIRO_OPERATOR_SATURATE ;
149 cairo_set_operator ( cairo_t* cr, cairo_operator_t op ) ;
152 cairo_set_source ( cairo_t* cr, cairo_pattern_t* source ) ;
155 cairo_set_source_rgb ( cairo_t* cr, double red, double green, double blue ) ;
158 cairo_set_source_rgba ( cairo_t* cr, double red, double green, double blue, double alpha ) ;
161 cairo_set_source_surface ( cairo_t* cr, cairo_surface_t* surface, double x, double y ) ;
164 cairo_set_tolerance ( cairo_t* cr, double tolerance ) ;
166 TYPEDEF: int cairo_antialias_t
168 CAIRO_ANTIALIAS_DEFAULT
171 CAIRO_ANTIALIAS_SUBPIXEL ;
174 cairo_set_antialias ( cairo_t* cr, cairo_antialias_t antialias ) ;
176 TYPEDEF: int cairo_fill_rule_t
178 CAIRO_FILL_RULE_WINDING
179 CAIRO_FILL_RULE_EVEN_ODD ;
182 cairo_set_fill_rule ( cairo_t* cr, cairo_fill_rule_t fill_rule ) ;
185 cairo_set_line_width ( cairo_t* cr, double width ) ;
187 TYPEDEF: int cairo_line_cap_t
191 CAIRO_LINE_CAP_SQUARE ;
194 cairo_set_line_cap ( cairo_t* cr, cairo_line_cap_t line_cap ) ;
196 TYPEDEF: int cairo_line_join_t
198 CAIRO_LINE_JOIN_MITER
199 CAIRO_LINE_JOIN_ROUND
200 CAIRO_LINE_JOIN_BEVEL ;
203 cairo_set_line_join ( cairo_t* cr, cairo_line_join_t line_join ) ;
206 cairo_set_dash ( cairo_t* cr, double* dashes, int num_dashes, double offset ) ;
209 cairo_set_miter_limit ( cairo_t* cr, double limit ) ;
212 cairo_translate ( cairo_t* cr, double tx, double ty ) ;
215 cairo_scale ( cairo_t* cr, double sx, double sy ) ;
218 cairo_rotate ( cairo_t* cr, double angle ) ;
221 cairo_transform ( cairo_t* cr, cairo_matrix_t* matrix ) ;
224 cairo_set_matrix ( cairo_t* cr, cairo_matrix_t* matrix ) ;
227 cairo_identity_matrix ( cairo_t* cr ) ;
230 cairo_user_to_device ( cairo_t* cr, double* x, double* y ) ;
233 cairo_user_to_device_distance ( cairo_t* cr, double* dx, double* dy ) ;
236 cairo_device_to_user ( cairo_t* cr, double* x, double* y ) ;
239 cairo_device_to_user_distance ( cairo_t* cr, double* dx, double* dy ) ;
241 ! Path creation functions
243 cairo_new_path ( cairo_t* cr ) ;
246 cairo_move_to ( cairo_t* cr, double x, double y ) ;
249 cairo_new_sub_path ( cairo_t* cr ) ;
252 cairo_line_to ( cairo_t* cr, double x, double y ) ;
255 cairo_curve_to ( cairo_t* cr, double x1, double y1, double x2, double y2, double x3, double y3 ) ;
258 cairo_arc ( cairo_t* cr, double xc, double yc, double radius, double angle1, double angle2 ) ;
261 cairo_arc_negative ( cairo_t* cr, double xc, double yc, double radius, double angle1, double angle2 ) ;
264 cairo_rel_move_to ( cairo_t* cr, double dx, double dy ) ;
267 cairo_rel_line_to ( cairo_t* cr, double dx, double dy ) ;
270 cairo_rel_curve_to ( cairo_t* cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3 ) ;
273 cairo_rectangle ( cairo_t* cr, double x, double y, double width, double height ) ;
276 cairo_close_path ( cairo_t* cr ) ;
279 cairo_path_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
283 cairo_paint ( cairo_t* cr ) ;
286 cairo_paint_with_alpha ( cairo_t* cr, double alpha ) ;
289 cairo_mask ( cairo_t* cr, cairo_pattern_t* pattern ) ;
292 cairo_mask_surface ( cairo_t* cr, cairo_surface_t* surface, double surface_x, double surface_y ) ;
295 cairo_stroke ( cairo_t* cr ) ;
298 cairo_stroke_preserve ( cairo_t* cr ) ;
301 cairo_fill ( cairo_t* cr ) ;
304 cairo_fill_preserve ( cairo_t* cr ) ;
307 cairo_copy_page ( cairo_t* cr ) ;
310 cairo_show_page ( cairo_t* cr ) ;
313 FUNCTION: cairo_bool_t
314 cairo_in_stroke ( cairo_t* cr, double x, double y ) ;
316 FUNCTION: cairo_bool_t
317 cairo_in_fill ( cairo_t* cr, double x, double y ) ;
319 ! Rectangular extents
321 cairo_stroke_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
324 cairo_fill_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
328 cairo_reset_clip ( cairo_t* cr ) ;
331 cairo_clip ( cairo_t* cr ) ;
334 cairo_clip_preserve ( cairo_t* cr ) ;
337 cairo_clip_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
339 C-STRUCT: cairo_rectangle_t
343 { "double" "height" } ;
345 C-STRUCT: cairo_rectangle_list_t
346 { "cairo_status_t" "status" }
347 { "cairo_rectangle_t*" "rectangles" }
348 { "int" "num_rectangles" } ;
350 FUNCTION: cairo_rectangle_list_t*
351 cairo_copy_clip_rectangle_list ( cairo_t* cr ) ;
354 cairo_rectangle_list_destroy ( cairo_rectangle_list_t* rectangle_list ) ;
356 ! Font/Text functions
358 TYPEDEF: void* cairo_scaled_font_t
360 TYPEDEF: void* cairo_font_face_t
362 C-STRUCT: cairo_glyph_t
367 C-STRUCT: cairo_text_extents_t
368 { "double" "x_bearing" }
369 { "double" "y_bearing" }
371 { "double" "height" }
372 { "double" "x_advance" }
373 { "double" "y_advance" } ;
375 C-STRUCT: cairo_font_extents_t
376 { "double" "ascent" }
377 { "double" "descent" }
378 { "double" "height" }
379 { "double" "max_x_advance" }
380 { "double" "max_y_advance" } ;
382 TYPEDEF: int cairo_font_slant_t
384 CAIRO_FONT_SLANT_NORMAL
385 CAIRO_FONT_SLANT_ITALIC
386 CAIRO_FONT_SLANT_OBLIQUE ;
388 TYPEDEF: int cairo_font_weight_t
390 CAIRO_FONT_WEIGHT_NORMAL
391 CAIRO_FONT_WEIGHT_BOLD ;
393 TYPEDEF: int cairo_subpixel_order_t
395 CAIRO_SUBPIXEL_ORDER_DEFAULT
396 CAIRO_SUBPIXEL_ORDER_RGB
397 CAIRO_SUBPIXEL_ORDER_BGR
398 CAIRO_SUBPIXEL_ORDER_VRGB
399 CAIRO_SUBPIXEL_ORDER_VBGR ;
401 TYPEDEF: int cairo_hint_style_t
403 CAIRO_HINT_STYLE_DEFAULT
404 CAIRO_HINT_STYLE_NONE
405 CAIRO_HINT_STYLE_SLIGHT
406 CAIRO_HINT_STYLE_MEDIUM
407 CAIRO_HINT_STYLE_FULL ;
409 TYPEDEF: int cairo_hint_metrics_t
411 CAIRO_HINT_METRICS_DEFAULT
412 CAIRO_HINT_METRICS_OFF
413 CAIRO_HINT_METRICS_ON ;
415 TYPEDEF: void* cairo_font_options_t
417 FUNCTION: cairo_font_options_t*
418 cairo_font_options_create ( ) ;
420 FUNCTION: cairo_font_options_t*
421 cairo_font_options_copy ( cairo_font_options_t* original ) ;
424 cairo_font_options_destroy ( cairo_font_options_t* options ) ;
426 FUNCTION: cairo_status_t
427 cairo_font_options_status ( cairo_font_options_t* options ) ;
430 cairo_font_options_merge ( cairo_font_options_t* options, cairo_font_options_t* other ) ;
432 FUNCTION: cairo_bool_t
433 cairo_font_options_equal ( cairo_font_options_t* options, cairo_font_options_t* other ) ;
436 cairo_font_options_hash ( cairo_font_options_t* options ) ;
439 cairo_font_options_set_antialias ( cairo_font_options_t* options, cairo_antialias_t antialias ) ;
441 FUNCTION: cairo_antialias_t
442 cairo_font_options_get_antialias ( cairo_font_options_t* options ) ;
445 cairo_font_options_set_subpixel_order ( cairo_font_options_t* options, cairo_subpixel_order_t subpixel_order ) ;
447 FUNCTION: cairo_subpixel_order_t
448 cairo_font_options_get_subpixel_order ( cairo_font_options_t* options ) ;
451 cairo_font_options_set_hint_style ( cairo_font_options_t* options, cairo_hint_style_t hint_style ) ;
453 FUNCTION: cairo_hint_style_t
454 cairo_font_options_get_hint_style ( cairo_font_options_t* options ) ;
457 cairo_font_options_set_hint_metrics ( cairo_font_options_t* options, cairo_hint_metrics_t hint_metrics ) ;
459 FUNCTION: cairo_hint_metrics_t
460 cairo_font_options_get_hint_metrics ( cairo_font_options_t* options ) ;
462 ! This interface is for dealing with text as text, not caring about the
463 ! font object inside the the cairo_t.
466 cairo_select_font_face ( cairo_t* cr, char* family, cairo_font_slant_t slant, cairo_font_weight_t weight ) ;
469 cairo_set_font_size ( cairo_t* cr, double size ) ;
472 cairo_set_font_matrix ( cairo_t* cr, cairo_matrix_t* matrix ) ;
475 cairo_get_font_matrix ( cairo_t* cr, cairo_matrix_t* matrix ) ;
478 cairo_set_font_options ( cairo_t* cr, cairo_font_options_t* options ) ;
481 cairo_get_font_options ( cairo_t* cr, cairo_font_options_t* options ) ;
484 cairo_set_font_face ( cairo_t* cr, cairo_font_face_t* font_face ) ;
486 FUNCTION: cairo_font_face_t*
487 cairo_get_font_face ( cairo_t* cr ) ;
490 cairo_set_scaled_font ( cairo_t* cr, cairo_scaled_font_t* scaled_font ) ;
492 FUNCTION: cairo_scaled_font_t*
493 cairo_get_scaled_font ( cairo_t* cr ) ;
496 cairo_show_text ( cairo_t* cr, char* utf8 ) ;
499 cairo_show_glyphs ( cairo_t* cr, cairo_glyph_t* glyphs, int num_glyphs ) ;
502 cairo_text_path ( cairo_t* cr, char* utf8 ) ;
505 cairo_glyph_path ( cairo_t* cr, cairo_glyph_t* glyphs, int num_glyphs ) ;
508 cairo_text_extents ( cairo_t* cr, char* utf8, cairo_text_extents_t* extents ) ;
511 cairo_glyph_extents ( cairo_t* cr, cairo_glyph_t* glyphs, int num_glyphs, cairo_text_extents_t* extents ) ;
514 cairo_font_extents ( cairo_t* cr, cairo_font_extents_t* extents ) ;
516 ! Generic identifier for a font style
518 FUNCTION: cairo_font_face_t*
519 cairo_font_face_reference ( cairo_font_face_t* font_face ) ;
522 cairo_font_face_destroy ( cairo_font_face_t* font_face ) ;
525 cairo_font_face_get_reference_count ( cairo_font_face_t* font_face ) ;
527 FUNCTION: cairo_status_t
528 cairo_font_face_status ( cairo_font_face_t* font_face ) ;
530 TYPEDEF: int cairo_font_type_t
534 CAIRO_FONT_TYPE_WIN32
535 CAIRO_FONT_TYPE_QUARTZ ;
537 FUNCTION: cairo_font_type_t
538 cairo_font_face_get_type ( cairo_font_face_t* font_face ) ;
541 cairo_font_face_get_user_data ( cairo_font_face_t* font_face, cairo_user_data_key_t* key ) ;
543 FUNCTION: cairo_status_t
544 cairo_font_face_set_user_data ( cairo_font_face_t* font_face, cairo_user_data_key_t* key, void* user_data, cairo_destroy_func_t destroy ) ;
546 ! Portable interface to general font features.
548 FUNCTION: cairo_scaled_font_t*
549 cairo_scaled_font_create ( cairo_font_face_t* font_face, cairo_matrix_t* font_matrix, cairo_matrix_t* ctm, cairo_font_options_t* options ) ;
551 FUNCTION: cairo_scaled_font_t*
552 cairo_scaled_font_reference ( cairo_scaled_font_t* scaled_font ) ;
555 cairo_scaled_font_destroy ( cairo_scaled_font_t* scaled_font ) ;
558 cairo_scaled_font_get_reference_count ( cairo_scaled_font_t* scaled_font ) ;
560 FUNCTION: cairo_status_t
561 cairo_scaled_font_status ( cairo_scaled_font_t* scaled_font ) ;
563 FUNCTION: cairo_font_type_t
564 cairo_scaled_font_get_type ( cairo_scaled_font_t* scaled_font ) ;
567 cairo_scaled_font_get_user_data ( cairo_scaled_font_t* scaled_font, cairo_user_data_key_t* key ) ;
569 FUNCTION: cairo_status_t
570 cairo_scaled_font_set_user_data ( cairo_scaled_font_t* scaled_font, cairo_user_data_key_t* key, void* user_data, cairo_destroy_func_t destroy ) ;
573 cairo_scaled_font_extents ( cairo_scaled_font_t* scaled_font, cairo_font_extents_t* extents ) ;
576 cairo_scaled_font_text_extents ( cairo_scaled_font_t* scaled_font, char* utf8, cairo_text_extents_t* extents ) ;
579 cairo_scaled_font_glyph_extents ( cairo_scaled_font_t* scaled_font, cairo_glyph_t* glyphs, int num_glyphs, cairo_text_extents_t* extents ) ;
581 FUNCTION: cairo_font_face_t*
582 cairo_scaled_font_get_font_face ( cairo_scaled_font_t* scaled_font ) ;
585 cairo_scaled_font_get_font_matrix ( cairo_scaled_font_t* scaled_font, cairo_matrix_t* font_matrix ) ;
588 cairo_scaled_font_get_ctm ( cairo_scaled_font_t* scaled_font, cairo_matrix_t* ctm ) ;
591 cairo_scaled_font_get_font_options ( cairo_scaled_font_t* scaled_font, cairo_font_options_t* options ) ;
595 FUNCTION: cairo_operator_t
596 cairo_get_operator ( cairo_t* cr ) ;
598 FUNCTION: cairo_pattern_t*
599 cairo_get_source ( cairo_t* cr ) ;
602 cairo_get_tolerance ( cairo_t* cr ) ;
604 FUNCTION: cairo_antialias_t
605 cairo_get_antialias ( cairo_t* cr ) ;
607 FUNCTION: cairo_bool_t
608 cairo_has_current_point ( cairo_t* cr ) ;
611 cairo_get_current_point ( cairo_t* cr, double* x, double* y ) ;
613 FUNCTION: cairo_fill_rule_t
614 cairo_get_fill_rule ( cairo_t* cr ) ;
617 cairo_get_line_width ( cairo_t* cr ) ;
619 FUNCTION: cairo_line_cap_t
620 cairo_get_line_cap ( cairo_t* cr ) ;
622 FUNCTION: cairo_line_join_t
623 cairo_get_line_join ( cairo_t* cr ) ;
626 cairo_get_miter_limit ( cairo_t* cr ) ;
629 cairo_get_dash_count ( cairo_t* cr ) ;
632 cairo_get_dash ( cairo_t* cr, double* dashes, double* offset ) ;
635 cairo_get_matrix ( cairo_t* cr, cairo_matrix_t* matrix ) ;
637 FUNCTION: cairo_surface_t*
638 cairo_get_target ( cairo_t* cr ) ;
640 FUNCTION: cairo_surface_t*
641 cairo_get_group_target ( cairo_t* cr ) ;
643 TYPEDEF: int cairo_path_data_type_t
648 CAIRO_PATH_CLOSE_PATH ;
650 ! NEED TO DO UNION HERE
651 C-STRUCT: cairo_path_data_t-point
655 C-STRUCT: cairo_path_data_t-header
656 { "cairo_path_data_type_t" "type" }
659 C-UNION: cairo_path_data_t "cairo_path_data_t-point" "cairo_path_data_t-header" ;
661 C-STRUCT: cairo_path_t
662 { "cairo_status_t" "status" }
663 { "cairo_path_data_t*" "data" }
664 { "int" "num_data" } ;
666 FUNCTION: cairo_path_t*
667 cairo_copy_path ( cairo_t* cr ) ;
669 FUNCTION: cairo_path_t*
670 cairo_copy_path_flat ( cairo_t* cr ) ;
673 cairo_append_path ( cairo_t* cr, cairo_path_t* path ) ;
676 cairo_path_destroy ( cairo_path_t* path ) ;
678 ! Error status queries
680 FUNCTION: cairo_status_t
681 cairo_status ( cairo_t* cr ) ;
684 cairo_status_to_string ( cairo_status_t status ) ;
686 ! Surface manipulation
688 FUNCTION: cairo_surface_t*
689 cairo_surface_create_similar ( cairo_surface_t* other, cairo_content_t content, int width, int height ) ;
691 FUNCTION: cairo_surface_t*
692 cairo_surface_reference ( cairo_surface_t* surface ) ;
695 cairo_surface_finish ( cairo_surface_t* surface ) ;
698 cairo_surface_destroy ( cairo_surface_t* surface ) ;
700 DESTRUCTOR: cairo_surface_destroy
703 cairo_surface_get_reference_count ( cairo_surface_t* surface ) ;
705 FUNCTION: cairo_status_t
706 cairo_surface_status ( cairo_surface_t* surface ) ;
708 TYPEDEF: int cairo_surface_type_t
710 CAIRO_SURFACE_TYPE_IMAGE
711 CAIRO_SURFACE_TYPE_PDF
712 CAIRO_SURFACE_TYPE_PS
713 CAIRO_SURFACE_TYPE_XLIB
714 CAIRO_SURFACE_TYPE_XCB
715 CAIRO_SURFACE_TYPE_GLITZ
716 CAIRO_SURFACE_TYPE_QUARTZ
717 CAIRO_SURFACE_TYPE_WIN32
718 CAIRO_SURFACE_TYPE_BEOS
719 CAIRO_SURFACE_TYPE_DIRECTFB
720 CAIRO_SURFACE_TYPE_SVG
721 CAIRO_SURFACE_TYPE_OS2
722 CAIRO_SURFACE_TYPE_WIN32_PRINTING
723 CAIRO_SURFACE_TYPE_QUARTZ_IMAGE ;
725 FUNCTION: cairo_surface_type_t
726 cairo_surface_get_type ( cairo_surface_t* surface ) ;
728 FUNCTION: cairo_content_t
729 cairo_surface_get_content ( cairo_surface_t* surface ) ;
731 FUNCTION: cairo_status_t
732 cairo_surface_write_to_png ( cairo_surface_t* surface, char* filename ) ;
734 FUNCTION: cairo_status_t
735 cairo_surface_write_to_png_stream ( cairo_surface_t* surface, cairo_write_func_t write_func, void* closure ) ;
738 cairo_surface_get_user_data ( cairo_surface_t* surface, cairo_user_data_key_t* key ) ;
740 FUNCTION: cairo_status_t
741 cairo_surface_set_user_data ( cairo_surface_t* surface, cairo_user_data_key_t* key, void* user_data, cairo_destroy_func_t destroy ) ;
744 cairo_surface_get_font_options ( cairo_surface_t* surface, cairo_font_options_t* options ) ;
747 cairo_surface_flush ( cairo_surface_t* surface ) ;
750 cairo_surface_mark_dirty ( cairo_surface_t* surface ) ;
753 cairo_surface_mark_dirty_rectangle ( cairo_surface_t* surface, int x, int y, int width, int height ) ;
756 cairo_surface_set_device_offset ( cairo_surface_t* surface, double x_offset, double y_offset ) ;
759 cairo_surface_get_device_offset ( cairo_surface_t* surface, double* x_offset, double* y_offset ) ;
762 cairo_surface_set_fallback_resolution ( cairo_surface_t* surface, double x_pixels_per_inch, double y_pixels_per_inch ) ;
765 cairo_surface_copy_page ( cairo_surface_t* surface ) ;
768 cairo_surface_show_page ( cairo_surface_t* surface ) ;
770 ! Image-surface functions
772 TYPEDEF: int cairo_format_t
778 CAIRO_FORMAT_RGB16_565 ;
780 FUNCTION: cairo_surface_t*
781 cairo_image_surface_create ( cairo_format_t format, int width, int height ) ;
784 cairo_format_stride_for_width ( cairo_format_t format, int width ) ;
786 FUNCTION: cairo_surface_t*
787 cairo_image_surface_create_for_data ( uchar* data, cairo_format_t format, int width, int height, int stride ) ;
790 cairo_image_surface_get_data ( cairo_surface_t* surface ) ;
792 FUNCTION: cairo_format_t
793 cairo_image_surface_get_format ( cairo_surface_t* surface ) ;
796 cairo_image_surface_get_width ( cairo_surface_t* surface ) ;
799 cairo_image_surface_get_height ( cairo_surface_t* surface ) ;
802 cairo_image_surface_get_stride ( cairo_surface_t* surface ) ;
804 FUNCTION: cairo_surface_t*
805 cairo_image_surface_create_from_png ( char* filename ) ;
807 FUNCTION: cairo_surface_t*
808 cairo_image_surface_create_from_png_stream ( cairo_read_func_t read_func, void* closure ) ;
810 ! Pattern creation functions
812 FUNCTION: cairo_pattern_t*
813 cairo_pattern_create_rgb ( double red, double green, double blue ) ;
815 FUNCTION: cairo_pattern_t*
816 cairo_pattern_create_rgba ( double red, double green, double blue, double alpha ) ;
818 FUNCTION: cairo_pattern_t*
819 cairo_pattern_create_for_surface ( cairo_surface_t* surface ) ;
821 FUNCTION: cairo_pattern_t*
822 cairo_pattern_create_linear ( double x0, double y0, double x1, double y1 ) ;
824 FUNCTION: cairo_pattern_t*
825 cairo_pattern_create_radial ( double cx0, double cy0, double radius0, double cx1, double cy1, double radius1 ) ;
827 FUNCTION: cairo_pattern_t*
828 cairo_pattern_reference ( cairo_pattern_t* pattern ) ;
831 cairo_pattern_destroy ( cairo_pattern_t* pattern ) ;
834 cairo_pattern_get_reference_count ( cairo_pattern_t* pattern ) ;
836 FUNCTION: cairo_status_t
837 cairo_pattern_status ( cairo_pattern_t* pattern ) ;
840 cairo_pattern_get_user_data ( cairo_pattern_t* pattern, cairo_user_data_key_t* key ) ;
842 FUNCTION: cairo_status_t
843 cairo_pattern_set_user_data ( cairo_pattern_t* pattern, cairo_user_data_key_t* key, void* user_data, cairo_destroy_func_t destroy ) ;
845 TYPEDEF: int cairo_pattern_type_t
847 CAIRO_PATTERN_TYPE_SOLID
848 CAIRO_PATTERN_TYPE_SURFACE
849 CAIRO_PATTERN_TYPE_LINEAR
850 CAIRO_PATTERN_TYPE_RADIA ;
852 FUNCTION: cairo_pattern_type_t
853 cairo_pattern_get_type ( cairo_pattern_t* pattern ) ;
856 cairo_pattern_add_color_stop_rgb ( cairo_pattern_t* pattern, double offset, double red, double green, double blue ) ;
859 cairo_pattern_add_color_stop_rgba ( cairo_pattern_t* pattern, double offset, double red, double green, double blue, double alpha ) ;
862 cairo_pattern_set_matrix ( cairo_pattern_t* pattern, cairo_matrix_t* matrix ) ;
865 cairo_pattern_get_matrix ( cairo_pattern_t* pattern, cairo_matrix_t* matrix ) ;
867 TYPEDEF: int cairo_extend_t
875 cairo_pattern_set_extend ( cairo_pattern_t* pattern, cairo_extend_t extend ) ;
877 FUNCTION: cairo_extend_t
878 cairo_pattern_get_extend ( cairo_pattern_t* pattern ) ;
880 TYPEDEF: int cairo_filter_t
886 CAIRO_FILTER_BILINEAR
887 CAIRO_FILTER_GAUSSIAN ;
890 cairo_pattern_set_filter ( cairo_pattern_t* pattern, cairo_filter_t filter ) ;
892 FUNCTION: cairo_filter_t
893 cairo_pattern_get_filter ( cairo_pattern_t* pattern ) ;
895 FUNCTION: cairo_status_t
896 cairo_pattern_get_rgba ( cairo_pattern_t* pattern, double* red, double* green, double* blue, double* alpha ) ;
898 FUNCTION: cairo_status_t
899 cairo_pattern_get_surface ( cairo_pattern_t* pattern, cairo_surface_t* *surface ) ;
901 FUNCTION: cairo_status_t
902 cairo_pattern_get_color_stop_rgba ( cairo_pattern_t* pattern, int index, double* offset, double* red, double* green, double* blue, double* alpha ) ;
904 FUNCTION: cairo_status_t
905 cairo_pattern_get_color_stop_count ( cairo_pattern_t* pattern, int* count ) ;
907 FUNCTION: cairo_status_t
908 cairo_pattern_get_linear_points ( cairo_pattern_t* pattern, double* x0, double* y0, double* x1, double* y1 ) ;
910 FUNCTION: cairo_status_t
911 cairo_pattern_get_radial_circles ( cairo_pattern_t* pattern, double* x0, double* y0, double* r0, double* x1, double* y1, double* r1 ) ;
916 cairo_matrix_init ( cairo_matrix_t* matrix, double xx, double yx, double xy, double yy, double x0, double y0 ) ;
919 cairo_matrix_init_identity ( cairo_matrix_t* matrix ) ;
922 cairo_matrix_init_translate ( cairo_matrix_t* matrix, double tx, double ty ) ;
925 cairo_matrix_init_scale ( cairo_matrix_t* matrix, double sx, double sy ) ;
928 cairo_matrix_init_rotate ( cairo_matrix_t* matrix, double radians ) ;
931 cairo_matrix_translate ( cairo_matrix_t* matrix, double tx, double ty ) ;
934 cairo_matrix_scale ( cairo_matrix_t* matrix, double sx, double sy ) ;
937 cairo_matrix_rotate ( cairo_matrix_t* matrix, double radians ) ;
939 FUNCTION: cairo_status_t
940 cairo_matrix_invert ( cairo_matrix_t* matrix ) ;
943 cairo_matrix_multiply ( cairo_matrix_t* result, cairo_matrix_t* a, cairo_matrix_t* b ) ;
946 cairo_matrix_transform_distance ( cairo_matrix_t* matrix, double* dx, double* dy ) ;
949 cairo_matrix_transform_point ( cairo_matrix_t* matrix, double* x, double* y ) ;
951 ! Functions to be used while debugging (not intended for use in production code)
953 cairo_debug_reset_static_data ( ) ;