cairo.ffi: update to 1.8.10
parent
1e9afc927f
commit
2cb680539d
|
@ -1,16 +1,13 @@
|
||||||
! Copyright (c) 2007 Sampo Vuori
|
! Copyright (C) 2007 Sampo Vuori.
|
||||||
! Copyright (c) 2008 Matthew Willis
|
! Copyright (C) 2008 Matthew Willis.
|
||||||
!
|
! Copyright (C) 2010 Anton Gorenko.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
USING: alien alien.c-types alien.destructors alien.libraries
|
||||||
! Adapted from cairo.h, version 1.5.14
|
alien.syntax classes.struct combinators kernel system ;
|
||||||
! License: http://factorcode.org/license.txt
|
|
||||||
|
|
||||||
USING: system combinators alien alien.syntax alien.c-types
|
|
||||||
alien.destructors kernel accessors sequences arrays ui.gadgets
|
|
||||||
alien.libraries classes.struct ;
|
|
||||||
|
|
||||||
IN: cairo.ffi
|
IN: cairo.ffi
|
||||||
|
|
||||||
|
! Adapted from cairo.h, version 1.8.10
|
||||||
|
|
||||||
<< {
|
<< {
|
||||||
{ [ os winnt? ] [ "cairo" "libcairo-2.dll" cdecl add-library ] }
|
{ [ os winnt? ] [ "cairo" "libcairo-2.dll" cdecl add-library ] }
|
||||||
{ [ os macosx? ] [ "cairo" "/opt/local/lib/libcairo.dylib" cdecl add-library ] }
|
{ [ os macosx? ] [ "cairo" "/opt/local/lib/libcairo.dylib" cdecl add-library ] }
|
||||||
|
@ -38,9 +35,8 @@ STRUCT: cairo_matrix_t
|
||||||
|
|
||||||
TYPEDEF: void* cairo_pattern_t
|
TYPEDEF: void* cairo_pattern_t
|
||||||
|
|
||||||
TYPEDEF: void* cairo_destroy_func_t
|
CALLBACK: void
|
||||||
: cairo-destroy-func ( quot -- callback )
|
cairo_destroy_func_t ( void* data ) ;
|
||||||
[ void { pointer: void } cdecl ] dip alien-callback ; inline
|
|
||||||
|
|
||||||
! See cairo.h for details
|
! See cairo.h for details
|
||||||
STRUCT: cairo_user_data_key_t
|
STRUCT: cairo_user_data_key_t
|
||||||
|
@ -71,22 +67,28 @@ ENUM: cairo_status_t
|
||||||
CAIRO_STATUS_INVALID_INDEX
|
CAIRO_STATUS_INVALID_INDEX
|
||||||
CAIRO_STATUS_CLIP_NOT_REPRESENTABLE
|
CAIRO_STATUS_CLIP_NOT_REPRESENTABLE
|
||||||
CAIRO_STATUS_TEMP_FILE_ERROR
|
CAIRO_STATUS_TEMP_FILE_ERROR
|
||||||
CAIRO_STATUS_INVALID_STRIDE ;
|
CAIRO_STATUS_INVALID_STRIDE
|
||||||
|
CAIRO_STATUS_FONT_TYPE_MISMATCH
|
||||||
|
CAIRO_STATUS_USER_FONT_IMMUTABLE
|
||||||
|
CAIRO_STATUS_USER_FONT_ERROR
|
||||||
|
CAIRO_STATUS_NEGATIVE_COUNT
|
||||||
|
CAIRO_STATUS_INVALID_CLUSTERS
|
||||||
|
CAIRO_STATUS_INVALID_SLANT
|
||||||
|
CAIRO_STATUS_INVALID_WEIGHT ;
|
||||||
|
|
||||||
TYPEDEF: int cairo_content_t
|
ENUM: cairo_content_t
|
||||||
CONSTANT: CAIRO_CONTENT_COLOR HEX: 1000
|
{ CAIRO_CONTENT_COLOR HEX: 1000 }
|
||||||
CONSTANT: CAIRO_CONTENT_ALPHA HEX: 2000
|
{ CAIRO_CONTENT_ALPHA HEX: 2000 }
|
||||||
CONSTANT: CAIRO_CONTENT_COLOR_ALPHA HEX: 3000
|
{ CAIRO_CONTENT_COLOR_ALPHA HEX: 3000 } ;
|
||||||
|
|
||||||
TYPEDEF: void* cairo_write_func_t
|
CALLBACK: cairo_status_t
|
||||||
: cairo-write-func ( quot -- callback )
|
cairo_write_func_t ( void* closure, uchar* data, uint length ) ;
|
||||||
[ cairo_status_t { pointer: void c-string int } cdecl ] dip alien-callback ; inline
|
|
||||||
|
|
||||||
TYPEDEF: void* cairo_read_func_t
|
CALLBACK: cairo_status_t
|
||||||
: cairo-read-func ( quot -- callback )
|
cairo_read_func_t ( void* closure, uchar* data, uint length ) ;
|
||||||
[ cairo_status_t { pointer: void c-string int } cdecl ] dip alien-callback ; inline
|
|
||||||
|
|
||||||
! Functions for manipulating state objects
|
! Functions for manipulating state objects
|
||||||
|
|
||||||
FUNCTION: cairo_t*
|
FUNCTION: cairo_t*
|
||||||
cairo_create ( cairo_surface_t* target ) ;
|
cairo_create ( cairo_surface_t* target ) ;
|
||||||
|
|
||||||
|
@ -126,6 +128,7 @@ FUNCTION: void
|
||||||
cairo_pop_group_to_source ( cairo_t* cr ) ;
|
cairo_pop_group_to_source ( cairo_t* cr ) ;
|
||||||
|
|
||||||
! Modify state
|
! Modify state
|
||||||
|
|
||||||
ENUM: cairo_operator_t
|
ENUM: cairo_operator_t
|
||||||
CAIRO_OPERATOR_CLEAR
|
CAIRO_OPERATOR_CLEAR
|
||||||
|
|
||||||
|
@ -235,6 +238,7 @@ FUNCTION: void
|
||||||
cairo_device_to_user_distance ( cairo_t* cr, double* dx, double* dy ) ;
|
cairo_device_to_user_distance ( cairo_t* cr, double* dx, double* dy ) ;
|
||||||
|
|
||||||
! Path creation functions
|
! Path creation functions
|
||||||
|
|
||||||
FUNCTION: void
|
FUNCTION: void
|
||||||
cairo_new_path ( cairo_t* cr ) ;
|
cairo_new_path ( cairo_t* cr ) ;
|
||||||
|
|
||||||
|
@ -275,6 +279,7 @@ FUNCTION: void
|
||||||
cairo_path_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
|
cairo_path_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
|
||||||
|
|
||||||
! Painting functions
|
! Painting functions
|
||||||
|
|
||||||
FUNCTION: void
|
FUNCTION: void
|
||||||
cairo_paint ( cairo_t* cr ) ;
|
cairo_paint ( cairo_t* cr ) ;
|
||||||
|
|
||||||
|
@ -306,6 +311,7 @@ FUNCTION: void
|
||||||
cairo_show_page ( cairo_t* cr ) ;
|
cairo_show_page ( cairo_t* cr ) ;
|
||||||
|
|
||||||
! Insideness testing
|
! Insideness testing
|
||||||
|
|
||||||
FUNCTION: cairo_bool_t
|
FUNCTION: cairo_bool_t
|
||||||
cairo_in_stroke ( cairo_t* cr, double x, double y ) ;
|
cairo_in_stroke ( cairo_t* cr, double x, double y ) ;
|
||||||
|
|
||||||
|
@ -313,6 +319,7 @@ FUNCTION: cairo_bool_t
|
||||||
cairo_in_fill ( cairo_t* cr, double x, double y ) ;
|
cairo_in_fill ( cairo_t* cr, double x, double y ) ;
|
||||||
|
|
||||||
! Rectangular extents
|
! Rectangular extents
|
||||||
|
|
||||||
FUNCTION: void
|
FUNCTION: void
|
||||||
cairo_stroke_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
|
cairo_stroke_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
|
||||||
|
|
||||||
|
@ -320,6 +327,7 @@ FUNCTION: void
|
||||||
cairo_fill_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
|
cairo_fill_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
|
||||||
|
|
||||||
! Clipping
|
! Clipping
|
||||||
|
|
||||||
FUNCTION: void
|
FUNCTION: void
|
||||||
cairo_reset_clip ( cairo_t* cr ) ;
|
cairo_reset_clip ( cairo_t* cr ) ;
|
||||||
|
|
||||||
|
@ -360,6 +368,25 @@ STRUCT: cairo_glyph_t
|
||||||
{ x double }
|
{ x double }
|
||||||
{ y double } ;
|
{ y double } ;
|
||||||
|
|
||||||
|
FUNCTION: cairo_glyph_t*
|
||||||
|
cairo_glyph_allocate ( int num_glyphs ) ;
|
||||||
|
|
||||||
|
FUNCTION: void
|
||||||
|
cairo_glyph_free ( cairo_glyph_t* glyphs ) ;
|
||||||
|
|
||||||
|
STRUCT: cairo_text_cluster_t
|
||||||
|
{ num_bytes int }
|
||||||
|
{ num_glyphs int } ;
|
||||||
|
|
||||||
|
FUNCTION: cairo_text_cluster_t*
|
||||||
|
cairo_text_cluster_allocate ( int num_clusters ) ;
|
||||||
|
|
||||||
|
FUNCTION: void
|
||||||
|
cairo_text_cluster_free ( cairo_text_cluster_t* clusters ) ;
|
||||||
|
|
||||||
|
ENUM: cairo_text_cluster_flags_t
|
||||||
|
{ CAIRO_TEXT_CLUSTER_FLAG_BACKWARD HEX: 00000001 } ;
|
||||||
|
|
||||||
STRUCT: cairo_text_extents_t
|
STRUCT: cairo_text_extents_t
|
||||||
{ x_bearing double }
|
{ x_bearing double }
|
||||||
{ y_bearing double }
|
{ y_bearing double }
|
||||||
|
@ -489,6 +516,9 @@ cairo_show_text ( cairo_t* cr, c-string utf8 ) ;
|
||||||
FUNCTION: void
|
FUNCTION: void
|
||||||
cairo_show_glyphs ( cairo_t* cr, cairo_glyph_t* glyphs, int num_glyphs ) ;
|
cairo_show_glyphs ( cairo_t* cr, cairo_glyph_t* glyphs, int num_glyphs ) ;
|
||||||
|
|
||||||
|
FUNCTION: void
|
||||||
|
cairo_show_text_glyphs ( cairo_t* cr, c-string utf8, int utf8_len, cairo_glyph_t* glyphs, int num_glyphs, cairo_text_cluster_t* clusters, int num_clusters, cairo_text_cluster_flags_t cluster_flags ) ;
|
||||||
|
|
||||||
FUNCTION: void
|
FUNCTION: void
|
||||||
cairo_text_path ( cairo_t* cr, c-string utf8 ) ;
|
cairo_text_path ( cairo_t* cr, c-string utf8 ) ;
|
||||||
|
|
||||||
|
@ -522,7 +552,8 @@ ENUM: cairo_font_type_t
|
||||||
CAIRO_FONT_TYPE_TOY
|
CAIRO_FONT_TYPE_TOY
|
||||||
CAIRO_FONT_TYPE_FT
|
CAIRO_FONT_TYPE_FT
|
||||||
CAIRO_FONT_TYPE_WIN32
|
CAIRO_FONT_TYPE_WIN32
|
||||||
CAIRO_FONT_TYPE_QUARTZ ;
|
CAIRO_FONT_TYPE_QUARTZ
|
||||||
|
CAIRO_FONT_TYPE_USER ;
|
||||||
|
|
||||||
FUNCTION: cairo_font_type_t
|
FUNCTION: cairo_font_type_t
|
||||||
cairo_font_face_get_type ( cairo_font_face_t* font_face ) ;
|
cairo_font_face_get_type ( cairo_font_face_t* font_face ) ;
|
||||||
|
@ -568,6 +599,9 @@ cairo_scaled_font_text_extents ( cairo_scaled_font_t* scaled_font, c-string utf8
|
||||||
FUNCTION: void
|
FUNCTION: void
|
||||||
cairo_scaled_font_glyph_extents ( cairo_scaled_font_t* scaled_font, cairo_glyph_t* glyphs, int num_glyphs, cairo_text_extents_t* extents ) ;
|
cairo_scaled_font_glyph_extents ( cairo_scaled_font_t* scaled_font, cairo_glyph_t* glyphs, int num_glyphs, cairo_text_extents_t* extents ) ;
|
||||||
|
|
||||||
|
FUNCTION: cairo_status_t
|
||||||
|
cairo_scaled_font_text_to_glyphs ( cairo_scaled_font_t* scaled_font, double x, double y, c-string utf8, int utf8_len, cairo_glyph_t** glyphs, int* num_glyphs, cairo_text_cluster_t** clusters, int* num_clusters, cairo_text_cluster_flags_t* cluster_flags ) ;
|
||||||
|
|
||||||
FUNCTION: cairo_font_face_t*
|
FUNCTION: cairo_font_face_t*
|
||||||
cairo_scaled_font_get_font_face ( cairo_scaled_font_t* scaled_font ) ;
|
cairo_scaled_font_get_font_face ( cairo_scaled_font_t* scaled_font ) ;
|
||||||
|
|
||||||
|
@ -577,9 +611,73 @@ cairo_scaled_font_get_font_matrix ( cairo_scaled_font_t* scaled_font, cairo_matr
|
||||||
FUNCTION: void
|
FUNCTION: void
|
||||||
cairo_scaled_font_get_ctm ( cairo_scaled_font_t* scaled_font, cairo_matrix_t* ctm ) ;
|
cairo_scaled_font_get_ctm ( cairo_scaled_font_t* scaled_font, cairo_matrix_t* ctm ) ;
|
||||||
|
|
||||||
|
FUNCTION: void
|
||||||
|
cairo_scaled_font_get_scale_matrix ( cairo_scaled_font_t* scaled_font, cairo_matrix_t* scale_matrix ) ;
|
||||||
|
|
||||||
FUNCTION: void
|
FUNCTION: void
|
||||||
cairo_scaled_font_get_font_options ( cairo_scaled_font_t* scaled_font, cairo_font_options_t* options ) ;
|
cairo_scaled_font_get_font_options ( cairo_scaled_font_t* scaled_font, cairo_font_options_t* options ) ;
|
||||||
|
|
||||||
|
! Toy fonts
|
||||||
|
|
||||||
|
FUNCTION: cairo_font_face_t*
|
||||||
|
cairo_toy_font_face_create ( c-string family, cairo_font_slant_t slant, cairo_font_weight_t weight ) ;
|
||||||
|
|
||||||
|
FUNCTION: c-string
|
||||||
|
cairo_toy_font_face_get_family ( cairo_font_face_t* font_face ) ;
|
||||||
|
|
||||||
|
FUNCTION: cairo_font_slant_t
|
||||||
|
cairo_toy_font_face_get_slant ( cairo_font_face_t* font_face ) ;
|
||||||
|
|
||||||
|
FUNCTION: cairo_font_weight_t
|
||||||
|
cairo_toy_font_face_get_weight ( cairo_font_face_t* font_face ) ;
|
||||||
|
|
||||||
|
! User fonts
|
||||||
|
|
||||||
|
FUNCTION: cairo_font_face_t*
|
||||||
|
cairo_user_font_face_create ( ) ;
|
||||||
|
|
||||||
|
! User-font method signatures
|
||||||
|
|
||||||
|
CALLBACK: cairo_status_t
|
||||||
|
cairo_user_scaled_font_init_func_t ( cairo_scaled_font_t* scaled_font, cairo_t* cr, cairo_font_extents_t* extents ) ;
|
||||||
|
|
||||||
|
CALLBACK: cairo_status_t
|
||||||
|
cairo_user_scaled_font_render_glyph_func_t ( cairo_scaled_font_t* scaled_font, ulong glyph, cairo_t* cr, cairo_text_extents_t* extents ) ;
|
||||||
|
|
||||||
|
CALLBACK: cairo_status_t
|
||||||
|
cairo_user_scaled_font_text_to_glyphs_func_t ( cairo_scaled_font_t* scaled_font, char* utf8, int utf8_len, cairo_glyph_t** glyphs, int* num_glyphs, cairo_text_cluster_t** clusters, int* num_clusters, cairo_text_cluster_flags_t* cluster_flags ) ;
|
||||||
|
|
||||||
|
CALLBACK: cairo_status_t
|
||||||
|
cairo_user_scaled_font_unicode_to_glyph_func_t ( cairo_scaled_font_t* scaled_font, ulong unicode, ulong* glyph_index ) ;
|
||||||
|
|
||||||
|
! User-font method setters
|
||||||
|
|
||||||
|
FUNCTION: void
|
||||||
|
cairo_user_font_face_set_init_func ( cairo_font_face_t* font_face, cairo_user_scaled_font_init_func_t init_func ) ;
|
||||||
|
|
||||||
|
FUNCTION: void
|
||||||
|
cairo_user_font_face_set_render_glyph_func ( cairo_font_face_t* font_face, cairo_user_scaled_font_render_glyph_func_t render_glyph_func ) ;
|
||||||
|
|
||||||
|
FUNCTION: void
|
||||||
|
cairo_user_font_face_set_text_to_glyphs_func ( cairo_font_face_t* font_face, cairo_user_scaled_font_text_to_glyphs_func_t text_to_glyphs_func ) ;
|
||||||
|
|
||||||
|
FUNCTION: void
|
||||||
|
cairo_user_font_face_set_unicode_to_glyph_func ( cairo_font_face_t* font_face, cairo_user_scaled_font_unicode_to_glyph_func_t unicode_to_glyph_func ) ;
|
||||||
|
|
||||||
|
! User-font method getters
|
||||||
|
|
||||||
|
FUNCTION: cairo_user_scaled_font_init_func_t
|
||||||
|
cairo_user_font_face_get_init_func ( cairo_font_face_t* font_face ) ;
|
||||||
|
|
||||||
|
FUNCTION: cairo_user_scaled_font_render_glyph_func_t
|
||||||
|
cairo_user_font_face_get_render_glyph_func ( cairo_font_face_t* font_face ) ;
|
||||||
|
|
||||||
|
FUNCTION: cairo_user_scaled_font_text_to_glyphs_func_t
|
||||||
|
cairo_user_font_face_get_text_to_glyphs_func ( cairo_font_face_t* font_face ) ;
|
||||||
|
|
||||||
|
FUNCTION: cairo_user_scaled_font_unicode_to_glyph_func_t
|
||||||
|
cairo_user_font_face_get_unicode_to_glyph_func ( cairo_font_face_t* font_face ) ;
|
||||||
|
|
||||||
! Query functions
|
! Query functions
|
||||||
|
|
||||||
FUNCTION: cairo_operator_t
|
FUNCTION: cairo_operator_t
|
||||||
|
@ -751,20 +849,25 @@ cairo_surface_get_device_offset ( cairo_surface_t* surface, double* x_offset, do
|
||||||
FUNCTION: void
|
FUNCTION: void
|
||||||
cairo_surface_set_fallback_resolution ( cairo_surface_t* surface, double x_pixels_per_inch, double y_pixels_per_inch ) ;
|
cairo_surface_set_fallback_resolution ( cairo_surface_t* surface, double x_pixels_per_inch, double y_pixels_per_inch ) ;
|
||||||
|
|
||||||
|
FUNCTION: void
|
||||||
|
cairo_surface_get_fallback_resolution ( cairo_surface_t* surface, double* x_pixels_per_inch, double* y_pixels_per_inch ) ;
|
||||||
|
|
||||||
FUNCTION: void
|
FUNCTION: void
|
||||||
cairo_surface_copy_page ( cairo_surface_t* surface ) ;
|
cairo_surface_copy_page ( cairo_surface_t* surface ) ;
|
||||||
|
|
||||||
FUNCTION: void
|
FUNCTION: void
|
||||||
cairo_surface_show_page ( cairo_surface_t* surface ) ;
|
cairo_surface_show_page ( cairo_surface_t* surface ) ;
|
||||||
|
|
||||||
|
FUNCTION: cairo_bool_t
|
||||||
|
cairo_surface_has_show_text_glyphs ( cairo_surface_t* surface ) ;
|
||||||
|
|
||||||
! Image-surface functions
|
! Image-surface functions
|
||||||
|
|
||||||
ENUM: cairo_format_t
|
ENUM: cairo_format_t
|
||||||
CAIRO_FORMAT_ARGB32
|
CAIRO_FORMAT_ARGB32
|
||||||
CAIRO_FORMAT_RGB24
|
CAIRO_FORMAT_RGB24
|
||||||
CAIRO_FORMAT_A8
|
CAIRO_FORMAT_A8
|
||||||
CAIRO_FORMAT_A1
|
CAIRO_FORMAT_A1 ;
|
||||||
CAIRO_FORMAT_RGB16_565 ;
|
|
||||||
|
|
||||||
FUNCTION: cairo_surface_t*
|
FUNCTION: cairo_surface_t*
|
||||||
cairo_image_surface_create ( cairo_format_t format, int width, int height ) ;
|
cairo_image_surface_create ( cairo_format_t format, int width, int height ) ;
|
||||||
|
@ -835,7 +938,7 @@ ENUM: cairo_pattern_type_t
|
||||||
CAIRO_PATTERN_TYPE_SOLID
|
CAIRO_PATTERN_TYPE_SOLID
|
||||||
CAIRO_PATTERN_TYPE_SURFACE
|
CAIRO_PATTERN_TYPE_SURFACE
|
||||||
CAIRO_PATTERN_TYPE_LINEAR
|
CAIRO_PATTERN_TYPE_LINEAR
|
||||||
CAIRO_PATTERN_TYPE_RADIA ;
|
CAIRO_PATTERN_TYPE_RADIAL ;
|
||||||
|
|
||||||
FUNCTION: cairo_pattern_type_t
|
FUNCTION: cairo_pattern_type_t
|
||||||
cairo_pattern_get_type ( cairo_pattern_t* pattern ) ;
|
cairo_pattern_get_type ( cairo_pattern_t* pattern ) ;
|
||||||
|
|
Loading…
Reference in New Issue