]> gitweb.factorcode.org Git - factor.git/blob - basis/cairo/ffi/ffi.factor
Merge branch 'master' into experimental
[factor.git] / basis / cairo / ffi / ffi.factor
1 ! Copyright (c) 2007 Sampo Vuori
2 ! Copyright (c) 2008 Matthew Willis
3 !
4 ! Adapted from cairo.h, version 1.5.14
5 ! License: http://factorcode.org/license.txt
6
7 USING: system combinators alien alien.syntax alien.c-types
8 alien.destructors kernel accessors sequences arrays ui.gadgets ;
9
10 IN: cairo.ffi
11 << {
12     { [ os winnt? ] [ "cairo" "libcairo-2.dll" "cdecl" add-library ] }
13     { [ os macosx? ] [ "cairo" "/opt/local/lib/libcairo.dylib" "cdecl" add-library ] }
14     { [ os unix? ] [ ] }
15 } cond >>
16
17 LIBRARY: cairo
18
19 FUNCTION: int cairo_version ( ) ;
20 FUNCTION: char* cairo_version_string ( ) ;
21
22 TYPEDEF: int cairo_bool_t
23
24 ! I am leaving these and other void* types as opaque structures
25 TYPEDEF: void* cairo_t
26 TYPEDEF: void* cairo_surface_t
27
28 C-STRUCT: cairo_matrix_t
29     { "double" "xx" }
30     { "double" "yx" }
31     { "double" "xy" }
32     { "double" "yy" }
33     { "double" "x0" }
34     { "double" "y0" } ;
35
36 TYPEDEF: void* cairo_pattern_t
37
38 TYPEDEF: void* cairo_destroy_func_t
39 : cairo-destroy-func ( quot -- callback )
40     [ "void" { "void*" } "cdecl" ] dip alien-callback ; inline
41
42 ! See cairo.h for details
43 C-STRUCT: cairo_user_data_key_t
44     { "int" "unused" } ;
45
46 TYPEDEF: int cairo_status_t
47 C-ENUM:
48     CAIRO_STATUS_SUCCESS
49     CAIRO_STATUS_NO_MEMORY
50     CAIRO_STATUS_INVALID_RESTORE
51     CAIRO_STATUS_INVALID_POP_GROUP
52     CAIRO_STATUS_NO_CURRENT_POINT
53     CAIRO_STATUS_INVALID_MATRIX
54     CAIRO_STATUS_INVALID_STATUS
55     CAIRO_STATUS_NULL_POINTER
56     CAIRO_STATUS_INVALID_STRING
57     CAIRO_STATUS_INVALID_PATH_DATA
58     CAIRO_STATUS_READ_ERROR
59     CAIRO_STATUS_WRITE_ERROR
60     CAIRO_STATUS_SURFACE_FINISHED
61     CAIRO_STATUS_SURFACE_TYPE_MISMATCH
62     CAIRO_STATUS_PATTERN_TYPE_MISMATCH
63     CAIRO_STATUS_INVALID_CONTENT
64     CAIRO_STATUS_INVALID_FORMAT
65     CAIRO_STATUS_INVALID_VISUAL
66     CAIRO_STATUS_FILE_NOT_FOUND
67     CAIRO_STATUS_INVALID_DASH
68     CAIRO_STATUS_INVALID_DSC_COMMENT
69     CAIRO_STATUS_INVALID_INDEX
70     CAIRO_STATUS_CLIP_NOT_REPRESENTABLE
71     CAIRO_STATUS_TEMP_FILE_ERROR
72     CAIRO_STATUS_INVALID_STRIDE ;
73
74 TYPEDEF: int cairo_content_t
75 CONSTANT: CAIRO_CONTENT_COLOR HEX: 1000
76 CONSTANT: CAIRO_CONTENT_ALPHA HEX: 2000
77 CONSTANT: CAIRO_CONTENT_COLOR_ALPHA HEX: 3000
78
79 TYPEDEF: void* cairo_write_func_t
80 : cairo-write-func ( quot -- callback )
81     [ "cairo_status_t" { "void*" "uchar*" "int" } "cdecl" ] dip alien-callback ; inline
82                           
83 TYPEDEF: void* cairo_read_func_t
84 : cairo-read-func ( quot -- callback )
85     [ "cairo_status_t" { "void*" "uchar*" "int" } "cdecl" ] dip alien-callback ; inline
86
87 ! Functions for manipulating state objects
88 FUNCTION: cairo_t*
89 cairo_create ( cairo_surface_t* target ) ;
90
91 FUNCTION: cairo_t*
92 cairo_reference ( cairo_t* cr ) ;
93
94 FUNCTION: void
95 cairo_destroy ( cairo_t* cr ) ;
96
97 DESTRUCTOR: cairo_destroy
98
99 FUNCTION: uint
100 cairo_get_reference_count ( cairo_t* cr ) ;
101
102 FUNCTION: void*
103 cairo_get_user_data ( cairo_t* cr, cairo_user_data_key_t* key ) ;
104
105 FUNCTION: cairo_status_t
106 cairo_set_user_data ( cairo_t* cr, cairo_user_data_key_t* key, void* user_data, cairo_destroy_func_t destroy ) ;
107
108 FUNCTION: void
109 cairo_save ( cairo_t* cr ) ;
110
111 FUNCTION: void
112 cairo_restore ( cairo_t* cr ) ;
113
114 FUNCTION: void
115 cairo_push_group ( cairo_t* cr ) ;
116
117 FUNCTION: void
118 cairo_push_group_with_content  ( cairo_t* cr, cairo_content_t content ) ;
119
120 FUNCTION: cairo_pattern_t*
121 cairo_pop_group ( cairo_t* cr ) ;
122
123 FUNCTION: void
124 cairo_pop_group_to_source ( cairo_t* cr ) ;
125
126 ! Modify state
127 TYPEDEF: int cairo_operator_t
128 C-ENUM:
129     CAIRO_OPERATOR_CLEAR
130
131     CAIRO_OPERATOR_SOURCE
132     CAIRO_OPERATOR_OVER
133     CAIRO_OPERATOR_IN
134     CAIRO_OPERATOR_OUT
135     CAIRO_OPERATOR_ATOP
136
137     CAIRO_OPERATOR_DEST
138     CAIRO_OPERATOR_DEST_OVER
139     CAIRO_OPERATOR_DEST_IN
140     CAIRO_OPERATOR_DEST_OUT
141     CAIRO_OPERATOR_DEST_ATOP
142
143     CAIRO_OPERATOR_XOR
144     CAIRO_OPERATOR_ADD
145     CAIRO_OPERATOR_SATURATE ;
146
147 FUNCTION: void
148 cairo_set_operator ( cairo_t* cr, cairo_operator_t op ) ;
149
150 FUNCTION: void
151 cairo_set_source ( cairo_t* cr, cairo_pattern_t* source ) ;
152
153 FUNCTION: void
154 cairo_set_source_rgb ( cairo_t* cr, double red, double green, double blue ) ;
155
156 FUNCTION: void
157 cairo_set_source_rgba ( cairo_t* cr, double red, double green, double blue, double alpha ) ;
158
159 FUNCTION: void
160 cairo_set_source_surface ( cairo_t* cr, cairo_surface_t* surface, double x, double y ) ;
161
162 FUNCTION: void
163 cairo_set_tolerance ( cairo_t* cr, double tolerance ) ;
164
165 TYPEDEF: int cairo_antialias_t
166 C-ENUM:
167     CAIRO_ANTIALIAS_DEFAULT
168     CAIRO_ANTIALIAS_NONE
169     CAIRO_ANTIALIAS_GRAY
170     CAIRO_ANTIALIAS_SUBPIXEL ;
171
172 FUNCTION: void
173 cairo_set_antialias ( cairo_t* cr, cairo_antialias_t antialias ) ;
174
175 TYPEDEF: int cairo_fill_rule_t
176 C-ENUM:
177     CAIRO_FILL_RULE_WINDING
178     CAIRO_FILL_RULE_EVEN_ODD ;
179
180 FUNCTION: void
181 cairo_set_fill_rule ( cairo_t* cr, cairo_fill_rule_t fill_rule ) ;
182
183 FUNCTION: void
184 cairo_set_line_width ( cairo_t* cr, double width ) ;
185
186 TYPEDEF: int cairo_line_cap_t
187 C-ENUM:
188     CAIRO_LINE_CAP_BUTT
189     CAIRO_LINE_CAP_ROUND
190     CAIRO_LINE_CAP_SQUARE ;
191
192 FUNCTION: void
193 cairo_set_line_cap ( cairo_t* cr, cairo_line_cap_t line_cap ) ;
194
195 TYPEDEF: int cairo_line_join_t
196 C-ENUM:
197     CAIRO_LINE_JOIN_MITER
198     CAIRO_LINE_JOIN_ROUND
199     CAIRO_LINE_JOIN_BEVEL ;
200
201 FUNCTION: void
202 cairo_set_line_join ( cairo_t* cr, cairo_line_join_t line_join ) ;
203
204 FUNCTION: void
205 cairo_set_dash ( cairo_t* cr, double* dashes, int num_dashes, double offset ) ;
206
207 FUNCTION: void
208 cairo_set_miter_limit ( cairo_t* cr, double limit ) ;
209
210 FUNCTION: void
211 cairo_translate ( cairo_t* cr, double tx, double ty ) ;
212
213 FUNCTION: void
214 cairo_scale ( cairo_t* cr, double sx, double sy ) ;
215
216 FUNCTION: void
217 cairo_rotate ( cairo_t* cr, double angle ) ;
218
219 FUNCTION: void
220 cairo_transform ( cairo_t* cr, cairo_matrix_t* matrix ) ;
221
222 FUNCTION: void
223 cairo_set_matrix ( cairo_t* cr, cairo_matrix_t* matrix ) ;
224
225 FUNCTION: void
226 cairo_identity_matrix ( cairo_t* cr ) ;
227
228 FUNCTION: void
229 cairo_user_to_device ( cairo_t* cr, double* x, double* y ) ;
230
231 FUNCTION: void
232 cairo_user_to_device_distance ( cairo_t* cr, double* dx, double* dy ) ;
233
234 FUNCTION: void
235 cairo_device_to_user ( cairo_t* cr, double* x, double* y ) ;
236
237 FUNCTION: void
238 cairo_device_to_user_distance ( cairo_t* cr, double* dx, double* dy ) ;
239
240 ! Path creation functions
241 FUNCTION: void
242 cairo_new_path ( cairo_t* cr ) ;
243
244 FUNCTION: void
245 cairo_move_to ( cairo_t* cr, double x, double y ) ;
246
247 FUNCTION: void
248 cairo_new_sub_path ( cairo_t* cr ) ;
249
250 FUNCTION: void
251 cairo_line_to ( cairo_t* cr, double x, double y ) ;
252
253 FUNCTION: void
254 cairo_curve_to ( cairo_t* cr, double x1, double y1, double x2, double y2, double x3, double y3 ) ;
255
256 FUNCTION: void
257 cairo_arc ( cairo_t* cr, double xc, double yc, double radius, double angle1, double angle2 ) ;
258
259 FUNCTION: void
260 cairo_arc_negative ( cairo_t* cr, double xc, double yc, double radius, double angle1, double angle2 ) ;
261
262 FUNCTION: void
263 cairo_rel_move_to ( cairo_t* cr, double dx, double dy ) ;
264
265 FUNCTION: void
266 cairo_rel_line_to ( cairo_t* cr, double dx, double dy ) ;
267
268 FUNCTION: void
269 cairo_rel_curve_to ( cairo_t* cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3 ) ;
270
271 FUNCTION: void
272 cairo_rectangle ( cairo_t* cr, double x, double y, double width, double height ) ;
273
274 FUNCTION: void
275 cairo_close_path ( cairo_t* cr ) ;
276
277 FUNCTION: void
278 cairo_path_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
279
280 ! Painting functions
281 FUNCTION: void
282 cairo_paint ( cairo_t* cr ) ;
283
284 FUNCTION: void
285 cairo_paint_with_alpha ( cairo_t* cr, double alpha ) ;
286
287 FUNCTION: void
288 cairo_mask ( cairo_t* cr, cairo_pattern_t* pattern ) ;
289
290 FUNCTION: void
291 cairo_mask_surface ( cairo_t* cr, cairo_surface_t* surface, double surface_x, double surface_y ) ;
292
293 FUNCTION: void
294 cairo_stroke ( cairo_t* cr ) ;
295
296 FUNCTION: void
297 cairo_stroke_preserve ( cairo_t* cr ) ;
298
299 FUNCTION: void
300 cairo_fill ( cairo_t* cr ) ;
301
302 FUNCTION: void
303 cairo_fill_preserve ( cairo_t* cr ) ;
304
305 FUNCTION: void
306 cairo_copy_page ( cairo_t* cr ) ;
307
308 FUNCTION: void
309 cairo_show_page ( cairo_t* cr ) ;
310
311 ! Insideness testing
312 FUNCTION: cairo_bool_t
313 cairo_in_stroke ( cairo_t* cr, double x, double y ) ;
314
315 FUNCTION: cairo_bool_t
316 cairo_in_fill ( cairo_t* cr, double x, double y ) ;
317
318 ! Rectangular extents
319 FUNCTION: void
320 cairo_stroke_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
321
322 FUNCTION: void
323 cairo_fill_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
324
325 ! Clipping
326 FUNCTION: void
327 cairo_reset_clip ( cairo_t* cr ) ;
328
329 FUNCTION: void
330 cairo_clip ( cairo_t* cr ) ;
331
332 FUNCTION: void
333 cairo_clip_preserve ( cairo_t* cr ) ;
334
335 FUNCTION: void
336 cairo_clip_extents ( cairo_t* cr, double* x1, double* y1, double* x2, double* y2 ) ;
337
338 C-STRUCT: cairo_rectangle_t
339     { "double" "x" }
340     { "double" "y" }
341     { "double" "width" }
342     { "double" "height" } ;
343     
344 C-STRUCT: cairo_rectangle_list_t
345     { "cairo_status_t"     "status" }
346     { "cairo_rectangle_t*" "rectangles" }
347     { "int"                "num_rectangles" } ;
348
349 FUNCTION: cairo_rectangle_list_t*
350 cairo_copy_clip_rectangle_list ( cairo_t* cr ) ;
351
352 FUNCTION: void
353 cairo_rectangle_list_destroy ( cairo_rectangle_list_t* rectangle_list ) ;
354
355 ! Font/Text functions
356
357 TYPEDEF: void* cairo_scaled_font_t
358
359 TYPEDEF: void* cairo_font_face_t
360
361 C-STRUCT: cairo_glyph_t
362   { "ulong"     "index" }
363   { "double"    "x" }
364   { "double"    "y" } ;
365
366 C-STRUCT: cairo_text_extents_t
367     { "double" "x_bearing" }
368     { "double" "y_bearing" }
369     { "double" "width" }
370     { "double" "height" }
371     { "double" "x_advance" }
372     { "double" "y_advance" } ;
373
374 C-STRUCT: cairo_font_extents_t
375     { "double" "ascent" }
376     { "double" "descent" }
377     { "double" "height" }
378     { "double" "max_x_advance" }
379     { "double" "max_y_advance" } ;
380
381 TYPEDEF: int cairo_font_slant_t
382 C-ENUM:
383     CAIRO_FONT_SLANT_NORMAL
384     CAIRO_FONT_SLANT_ITALIC
385     CAIRO_FONT_SLANT_OBLIQUE ;
386
387 TYPEDEF: int cairo_font_weight_t
388 C-ENUM:
389     CAIRO_FONT_WEIGHT_NORMAL
390     CAIRO_FONT_WEIGHT_BOLD ;
391
392 TYPEDEF: int cairo_subpixel_order_t
393 C-ENUM:
394     CAIRO_SUBPIXEL_ORDER_DEFAULT
395     CAIRO_SUBPIXEL_ORDER_RGB
396     CAIRO_SUBPIXEL_ORDER_BGR
397     CAIRO_SUBPIXEL_ORDER_VRGB
398     CAIRO_SUBPIXEL_ORDER_VBGR ;
399
400 TYPEDEF: int cairo_hint_style_t
401 C-ENUM:
402     CAIRO_HINT_STYLE_DEFAULT
403     CAIRO_HINT_STYLE_NONE
404     CAIRO_HINT_STYLE_SLIGHT
405     CAIRO_HINT_STYLE_MEDIUM
406     CAIRO_HINT_STYLE_FULL ;
407
408 TYPEDEF: int cairo_hint_metrics_t
409 C-ENUM:
410     CAIRO_HINT_METRICS_DEFAULT
411     CAIRO_HINT_METRICS_OFF
412     CAIRO_HINT_METRICS_ON ;
413
414 TYPEDEF: void* cairo_font_options_t
415
416 FUNCTION: cairo_font_options_t*
417 cairo_font_options_create ( ) ;
418
419 FUNCTION: cairo_font_options_t*
420 cairo_font_options_copy ( cairo_font_options_t* original ) ;
421
422 FUNCTION: void
423 cairo_font_options_destroy ( cairo_font_options_t* options ) ;
424
425 FUNCTION: cairo_status_t
426 cairo_font_options_status ( cairo_font_options_t* options ) ;
427
428 FUNCTION: void
429 cairo_font_options_merge ( cairo_font_options_t* options, cairo_font_options_t* other ) ;
430
431 FUNCTION: cairo_bool_t
432 cairo_font_options_equal ( cairo_font_options_t* options, cairo_font_options_t* other ) ;
433
434 FUNCTION: ulong
435 cairo_font_options_hash ( cairo_font_options_t* options ) ;
436
437 FUNCTION: void
438 cairo_font_options_set_antialias ( cairo_font_options_t* options, cairo_antialias_t antialias ) ;
439
440 FUNCTION: cairo_antialias_t
441 cairo_font_options_get_antialias ( cairo_font_options_t* options ) ;
442
443 FUNCTION: void
444 cairo_font_options_set_subpixel_order ( cairo_font_options_t* options, cairo_subpixel_order_t subpixel_order ) ;
445
446 FUNCTION: cairo_subpixel_order_t
447 cairo_font_options_get_subpixel_order ( cairo_font_options_t* options ) ;
448
449 FUNCTION: void
450 cairo_font_options_set_hint_style ( cairo_font_options_t* options, cairo_hint_style_t hint_style ) ;
451
452 FUNCTION: cairo_hint_style_t
453 cairo_font_options_get_hint_style ( cairo_font_options_t* options ) ;
454
455 FUNCTION: void
456 cairo_font_options_set_hint_metrics ( cairo_font_options_t* options, cairo_hint_metrics_t hint_metrics ) ;
457
458 FUNCTION: cairo_hint_metrics_t
459 cairo_font_options_get_hint_metrics ( cairo_font_options_t* options ) ;
460
461 ! This interface is for dealing with text as text, not caring about the
462 !  font object inside the the cairo_t.
463
464 FUNCTION: void
465 cairo_select_font_face ( cairo_t* cr, char* family, cairo_font_slant_t slant, cairo_font_weight_t weight ) ;
466
467 FUNCTION: void
468 cairo_set_font_size ( cairo_t* cr, double size ) ;
469
470 FUNCTION: void
471 cairo_set_font_matrix ( cairo_t* cr, cairo_matrix_t* matrix ) ;
472
473 FUNCTION: void
474 cairo_get_font_matrix ( cairo_t* cr, cairo_matrix_t* matrix ) ;
475
476 FUNCTION: void
477 cairo_set_font_options ( cairo_t* cr, cairo_font_options_t* options ) ;
478
479 FUNCTION: void
480 cairo_get_font_options ( cairo_t* cr, cairo_font_options_t* options ) ;
481
482 FUNCTION: void
483 cairo_set_font_face ( cairo_t* cr, cairo_font_face_t* font_face ) ;
484
485 FUNCTION: cairo_font_face_t*
486 cairo_get_font_face ( cairo_t* cr ) ;
487
488 FUNCTION: void
489 cairo_set_scaled_font ( cairo_t* cr, cairo_scaled_font_t* scaled_font ) ;
490
491 FUNCTION: cairo_scaled_font_t*
492 cairo_get_scaled_font ( cairo_t* cr ) ;
493
494 FUNCTION: void
495 cairo_show_text ( cairo_t* cr, char* utf8 ) ;
496
497 FUNCTION: void
498 cairo_show_glyphs ( cairo_t* cr, cairo_glyph_t* glyphs, int num_glyphs ) ;
499
500 FUNCTION: void
501 cairo_text_path  ( cairo_t* cr, char* utf8 ) ;
502
503 FUNCTION: void
504 cairo_glyph_path ( cairo_t* cr, cairo_glyph_t* glyphs, int num_glyphs ) ;
505
506 FUNCTION: void
507 cairo_text_extents ( cairo_t* cr, char* utf8, cairo_text_extents_t* extents ) ;
508
509 FUNCTION: void
510 cairo_glyph_extents ( cairo_t* cr, cairo_glyph_t* glyphs, int num_glyphs, cairo_text_extents_t* extents ) ;
511
512 FUNCTION: void
513 cairo_font_extents ( cairo_t* cr, cairo_font_extents_t* extents ) ;
514
515 ! Generic identifier for a font style
516
517 FUNCTION: cairo_font_face_t*
518 cairo_font_face_reference ( cairo_font_face_t* font_face ) ;
519
520 FUNCTION: void
521 cairo_font_face_destroy ( cairo_font_face_t* font_face ) ;
522
523 FUNCTION: uint
524 cairo_font_face_get_reference_count ( cairo_font_face_t* font_face ) ;
525
526 FUNCTION: cairo_status_t
527 cairo_font_face_status ( cairo_font_face_t* font_face ) ;
528
529 TYPEDEF: int cairo_font_type_t
530 C-ENUM:
531     CAIRO_FONT_TYPE_TOY
532     CAIRO_FONT_TYPE_FT
533     CAIRO_FONT_TYPE_WIN32
534     CAIRO_FONT_TYPE_QUARTZ ;
535
536 FUNCTION: cairo_font_type_t
537 cairo_font_face_get_type ( cairo_font_face_t* font_face ) ;
538
539 FUNCTION: void* 
540 cairo_font_face_get_user_data ( cairo_font_face_t* font_face, cairo_user_data_key_t* key ) ;
541
542 FUNCTION: cairo_status_t
543 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 ) ;
544
545 ! Portable interface to general font features.
546
547 FUNCTION: cairo_scaled_font_t*
548 cairo_scaled_font_create ( cairo_font_face_t* font_face, cairo_matrix_t* font_matrix, cairo_matrix_t* ctm, cairo_font_options_t* options ) ;
549
550 FUNCTION: cairo_scaled_font_t*
551 cairo_scaled_font_reference ( cairo_scaled_font_t* scaled_font ) ;
552
553 FUNCTION: void
554 cairo_scaled_font_destroy ( cairo_scaled_font_t* scaled_font ) ;
555
556 FUNCTION: uint
557 cairo_scaled_font_get_reference_count ( cairo_scaled_font_t* scaled_font ) ;
558
559 FUNCTION: cairo_status_t
560 cairo_scaled_font_status ( cairo_scaled_font_t* scaled_font ) ;
561
562 FUNCTION: cairo_font_type_t
563 cairo_scaled_font_get_type ( cairo_scaled_font_t* scaled_font ) ;
564
565 FUNCTION: void* 
566 cairo_scaled_font_get_user_data ( cairo_scaled_font_t* scaled_font, cairo_user_data_key_t* key ) ;
567
568 FUNCTION: cairo_status_t
569 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 ) ;
570
571 FUNCTION: void
572 cairo_scaled_font_extents ( cairo_scaled_font_t* scaled_font, cairo_font_extents_t* extents ) ;
573
574 FUNCTION: void
575 cairo_scaled_font_text_extents ( cairo_scaled_font_t* scaled_font, char* utf8, cairo_text_extents_t* extents ) ;
576
577 FUNCTION: void
578 cairo_scaled_font_glyph_extents ( cairo_scaled_font_t* scaled_font, cairo_glyph_t* glyphs, int num_glyphs, cairo_text_extents_t* extents ) ;
579
580 FUNCTION: cairo_font_face_t*
581 cairo_scaled_font_get_font_face ( cairo_scaled_font_t* scaled_font ) ;
582
583 FUNCTION: void
584 cairo_scaled_font_get_font_matrix ( cairo_scaled_font_t* scaled_font, cairo_matrix_t* font_matrix ) ;
585
586 FUNCTION: void
587 cairo_scaled_font_get_ctm ( cairo_scaled_font_t* scaled_font, cairo_matrix_t* ctm ) ;
588
589 FUNCTION: void
590 cairo_scaled_font_get_font_options ( cairo_scaled_font_t* scaled_font, cairo_font_options_t* options ) ;
591
592 ! Query functions
593
594 FUNCTION: cairo_operator_t
595 cairo_get_operator ( cairo_t* cr ) ;
596
597 FUNCTION: cairo_pattern_t*
598 cairo_get_source ( cairo_t* cr ) ;
599
600 FUNCTION: double
601 cairo_get_tolerance ( cairo_t* cr ) ;
602
603 FUNCTION: cairo_antialias_t
604 cairo_get_antialias ( cairo_t* cr ) ;
605
606 FUNCTION: cairo_bool_t
607 cairo_has_current_point ( cairo_t* cr ) ;
608
609 FUNCTION: void
610 cairo_get_current_point ( cairo_t* cr, double* x, double* y ) ;
611
612 FUNCTION: cairo_fill_rule_t
613 cairo_get_fill_rule ( cairo_t* cr ) ;
614
615 FUNCTION: double
616 cairo_get_line_width ( cairo_t* cr ) ;
617
618 FUNCTION: cairo_line_cap_t
619 cairo_get_line_cap ( cairo_t* cr ) ;
620
621 FUNCTION: cairo_line_join_t
622 cairo_get_line_join ( cairo_t* cr ) ;
623
624 FUNCTION: double
625 cairo_get_miter_limit ( cairo_t* cr ) ;
626
627 FUNCTION: int
628 cairo_get_dash_count ( cairo_t* cr ) ;
629
630 FUNCTION: void
631 cairo_get_dash ( cairo_t* cr, double* dashes, double* offset ) ;
632
633 FUNCTION: void
634 cairo_get_matrix ( cairo_t* cr, cairo_matrix_t* matrix ) ;
635
636 FUNCTION: cairo_surface_t*
637 cairo_get_target ( cairo_t* cr ) ;
638
639 FUNCTION: cairo_surface_t*
640 cairo_get_group_target ( cairo_t* cr ) ;
641
642 TYPEDEF: int cairo_path_data_type_t
643 C-ENUM:
644     CAIRO_PATH_MOVE_TO
645     CAIRO_PATH_LINE_TO
646     CAIRO_PATH_CURVE_TO
647     CAIRO_PATH_CLOSE_PATH ;
648
649 ! NEED TO DO UNION HERE
650 C-STRUCT: cairo_path_data_t-point
651     { "double" "x" }
652     { "double" "y" } ;
653
654 C-STRUCT: cairo_path_data_t-header
655     { "cairo_path_data_type_t" "type" }
656     { "int" "length" } ;
657
658 C-UNION: cairo_path_data_t "cairo_path_data_t-point" "cairo_path_data_t-header" ;
659
660 C-STRUCT: cairo_path_t
661     { "cairo_status_t"      "status" }
662     { "cairo_path_data_t*"  "data" }
663     { "int"                 "num_data" } ;
664
665 FUNCTION: cairo_path_t*
666 cairo_copy_path ( cairo_t* cr ) ;
667
668 FUNCTION: cairo_path_t*
669 cairo_copy_path_flat ( cairo_t* cr ) ;
670
671 FUNCTION: void
672 cairo_append_path ( cairo_t* cr, cairo_path_t* path ) ;
673
674 FUNCTION: void
675 cairo_path_destroy ( cairo_path_t* path ) ;
676
677 ! Error status queries
678
679 FUNCTION: cairo_status_t
680 cairo_status ( cairo_t* cr ) ;
681
682 FUNCTION: char* 
683 cairo_status_to_string ( cairo_status_t status ) ;
684
685 ! Surface manipulation
686
687 FUNCTION: cairo_surface_t*
688 cairo_surface_create_similar ( cairo_surface_t* other, cairo_content_t content, int width, int height ) ;
689
690 FUNCTION: cairo_surface_t*
691 cairo_surface_reference ( cairo_surface_t* surface ) ;
692
693 FUNCTION: void
694 cairo_surface_finish ( cairo_surface_t* surface ) ;
695
696 FUNCTION: void
697 cairo_surface_destroy ( cairo_surface_t* surface ) ;
698
699 DESTRUCTOR: cairo_surface_destroy
700
701 FUNCTION: uint
702 cairo_surface_get_reference_count ( cairo_surface_t* surface ) ;
703
704 FUNCTION: cairo_status_t
705 cairo_surface_status ( cairo_surface_t* surface ) ;
706
707 TYPEDEF: int cairo_surface_type_t
708 C-ENUM:
709     CAIRO_SURFACE_TYPE_IMAGE
710     CAIRO_SURFACE_TYPE_PDF
711     CAIRO_SURFACE_TYPE_PS
712     CAIRO_SURFACE_TYPE_XLIB
713     CAIRO_SURFACE_TYPE_XCB
714     CAIRO_SURFACE_TYPE_GLITZ
715     CAIRO_SURFACE_TYPE_QUARTZ
716     CAIRO_SURFACE_TYPE_WIN32
717     CAIRO_SURFACE_TYPE_BEOS
718     CAIRO_SURFACE_TYPE_DIRECTFB
719     CAIRO_SURFACE_TYPE_SVG
720     CAIRO_SURFACE_TYPE_OS2
721     CAIRO_SURFACE_TYPE_WIN32_PRINTING
722     CAIRO_SURFACE_TYPE_QUARTZ_IMAGE ;
723
724 FUNCTION: cairo_surface_type_t
725 cairo_surface_get_type ( cairo_surface_t* surface ) ;
726
727 FUNCTION: cairo_content_t
728 cairo_surface_get_content ( cairo_surface_t* surface ) ;
729
730 FUNCTION: cairo_status_t
731 cairo_surface_write_to_png ( cairo_surface_t* surface, char* filename ) ;
732
733 FUNCTION: cairo_status_t
734 cairo_surface_write_to_png_stream ( cairo_surface_t* surface, cairo_write_func_t write_func, void* closure ) ;
735
736 FUNCTION: void* 
737 cairo_surface_get_user_data ( cairo_surface_t* surface, cairo_user_data_key_t* key ) ;
738
739 FUNCTION: cairo_status_t
740 cairo_surface_set_user_data ( cairo_surface_t* surface, cairo_user_data_key_t* key, void* user_data, cairo_destroy_func_t destroy ) ;
741
742 FUNCTION: void
743 cairo_surface_get_font_options ( cairo_surface_t* surface, cairo_font_options_t* options ) ;
744
745 FUNCTION: void
746 cairo_surface_flush ( cairo_surface_t* surface ) ;
747
748 FUNCTION: void
749 cairo_surface_mark_dirty ( cairo_surface_t* surface ) ;
750
751 FUNCTION: void
752 cairo_surface_mark_dirty_rectangle ( cairo_surface_t* surface, int x, int y, int width, int height ) ;
753
754 FUNCTION: void
755 cairo_surface_set_device_offset ( cairo_surface_t* surface, double x_offset, double y_offset ) ;
756
757 FUNCTION: void
758 cairo_surface_get_device_offset ( cairo_surface_t* surface, double* x_offset, double* y_offset ) ;
759
760 FUNCTION: void
761 cairo_surface_set_fallback_resolution ( cairo_surface_t* surface, double x_pixels_per_inch, double y_pixels_per_inch ) ;
762
763 FUNCTION: void
764 cairo_surface_copy_page ( cairo_surface_t* surface ) ;
765
766 FUNCTION: void
767 cairo_surface_show_page ( cairo_surface_t* surface ) ;
768
769 ! Image-surface functions
770
771 TYPEDEF: int cairo_format_t
772 C-ENUM:
773     CAIRO_FORMAT_ARGB32
774     CAIRO_FORMAT_RGB24
775     CAIRO_FORMAT_A8
776     CAIRO_FORMAT_A1
777     CAIRO_FORMAT_RGB16_565 ;
778
779 FUNCTION: cairo_surface_t*
780 cairo_image_surface_create ( cairo_format_t format, int width, int height ) ;
781
782 FUNCTION: int
783 cairo_format_stride_for_width ( cairo_format_t format, int width ) ;
784
785 FUNCTION: cairo_surface_t*
786 cairo_image_surface_create_for_data ( uchar* data, cairo_format_t format, int width, int height, int stride ) ;
787
788 FUNCTION: uchar*
789 cairo_image_surface_get_data ( cairo_surface_t* surface ) ;
790
791 FUNCTION: cairo_format_t
792 cairo_image_surface_get_format ( cairo_surface_t* surface ) ;
793
794 FUNCTION: int
795 cairo_image_surface_get_width ( cairo_surface_t* surface ) ;
796
797 FUNCTION: int
798 cairo_image_surface_get_height ( cairo_surface_t* surface ) ;
799
800 FUNCTION: int
801 cairo_image_surface_get_stride ( cairo_surface_t* surface ) ;
802
803 FUNCTION: cairo_surface_t*
804 cairo_image_surface_create_from_png ( char* filename ) ;
805
806 FUNCTION: cairo_surface_t*
807 cairo_image_surface_create_from_png_stream ( cairo_read_func_t read_func, void* closure ) ;
808
809 ! Pattern creation functions
810
811 FUNCTION: cairo_pattern_t*
812 cairo_pattern_create_rgb ( double red, double green, double blue ) ;
813
814 FUNCTION: cairo_pattern_t*
815 cairo_pattern_create_rgba ( double red, double green, double blue, double alpha ) ;
816
817 FUNCTION: cairo_pattern_t*
818 cairo_pattern_create_for_surface ( cairo_surface_t* surface ) ;
819
820 FUNCTION: cairo_pattern_t*
821 cairo_pattern_create_linear ( double x0, double y0, double x1, double y1 ) ;
822
823 FUNCTION: cairo_pattern_t*
824 cairo_pattern_create_radial ( double cx0, double cy0, double radius0, double cx1, double cy1, double radius1 ) ;
825
826 FUNCTION: cairo_pattern_t*
827 cairo_pattern_reference ( cairo_pattern_t* pattern ) ;
828
829 FUNCTION: void
830 cairo_pattern_destroy ( cairo_pattern_t* pattern ) ;
831
832 FUNCTION: uint
833 cairo_pattern_get_reference_count ( cairo_pattern_t* pattern ) ;
834
835 FUNCTION: cairo_status_t
836 cairo_pattern_status ( cairo_pattern_t* pattern ) ;
837
838 FUNCTION: void*
839 cairo_pattern_get_user_data ( cairo_pattern_t* pattern, cairo_user_data_key_t* key ) ;
840
841 FUNCTION: cairo_status_t
842 cairo_pattern_set_user_data ( cairo_pattern_t* pattern, cairo_user_data_key_t* key, void* user_data, cairo_destroy_func_t destroy ) ;
843
844 TYPEDEF: int cairo_pattern_type_t
845 C-ENUM:
846     CAIRO_PATTERN_TYPE_SOLID
847     CAIRO_PATTERN_TYPE_SURFACE
848     CAIRO_PATTERN_TYPE_LINEAR
849     CAIRO_PATTERN_TYPE_RADIA ;
850
851 FUNCTION: cairo_pattern_type_t
852 cairo_pattern_get_type ( cairo_pattern_t* pattern ) ;
853
854 FUNCTION: void
855 cairo_pattern_add_color_stop_rgb ( cairo_pattern_t* pattern, double offset, double red, double green, double blue ) ;
856
857 FUNCTION: void
858 cairo_pattern_add_color_stop_rgba ( cairo_pattern_t* pattern, double offset, double red, double green, double blue, double alpha ) ;
859
860 FUNCTION: void
861 cairo_pattern_set_matrix ( cairo_pattern_t* pattern, cairo_matrix_t* matrix ) ;
862
863 FUNCTION: void
864 cairo_pattern_get_matrix ( cairo_pattern_t* pattern, cairo_matrix_t* matrix ) ;
865
866 TYPEDEF: int cairo_extend_t
867 C-ENUM:
868     CAIRO_EXTEND_NONE
869     CAIRO_EXTEND_REPEAT
870     CAIRO_EXTEND_REFLECT
871     CAIRO_EXTEND_PAD ;
872
873 FUNCTION: void
874 cairo_pattern_set_extend ( cairo_pattern_t* pattern, cairo_extend_t extend ) ;
875
876 FUNCTION: cairo_extend_t
877 cairo_pattern_get_extend ( cairo_pattern_t* pattern ) ;
878
879 TYPEDEF: int cairo_filter_t
880 C-ENUM:
881     CAIRO_FILTER_FAST
882     CAIRO_FILTER_GOOD
883     CAIRO_FILTER_BEST
884     CAIRO_FILTER_NEAREST
885     CAIRO_FILTER_BILINEAR
886     CAIRO_FILTER_GAUSSIAN ;
887
888 FUNCTION: void
889 cairo_pattern_set_filter ( cairo_pattern_t* pattern, cairo_filter_t filter ) ;
890
891 FUNCTION: cairo_filter_t
892 cairo_pattern_get_filter ( cairo_pattern_t* pattern ) ;
893
894 FUNCTION: cairo_status_t
895 cairo_pattern_get_rgba ( cairo_pattern_t* pattern, double* red, double* green, double* blue, double* alpha ) ;
896
897 FUNCTION: cairo_status_t
898 cairo_pattern_get_surface ( cairo_pattern_t* pattern, cairo_surface_t* *surface ) ;
899
900 FUNCTION: cairo_status_t
901 cairo_pattern_get_color_stop_rgba ( cairo_pattern_t* pattern, int index, double* offset, double* red, double* green, double* blue, double* alpha ) ;
902
903 FUNCTION: cairo_status_t
904 cairo_pattern_get_color_stop_count ( cairo_pattern_t* pattern, int* count ) ;
905
906 FUNCTION: cairo_status_t
907 cairo_pattern_get_linear_points ( cairo_pattern_t* pattern, double* x0, double* y0, double* x1, double* y1 ) ;
908
909 FUNCTION: cairo_status_t
910 cairo_pattern_get_radial_circles ( cairo_pattern_t* pattern, double* x0, double* y0, double* r0, double* x1, double* y1, double* r1 ) ;
911
912 ! Matrix functions
913
914 FUNCTION: void
915 cairo_matrix_init ( cairo_matrix_t* matrix, double  xx, double  yx, double  xy, double  yy, double  x0, double  y0 ) ;
916
917 FUNCTION: void
918 cairo_matrix_init_identity ( cairo_matrix_t* matrix ) ;
919
920 FUNCTION: void
921 cairo_matrix_init_translate ( cairo_matrix_t* matrix, double tx, double ty ) ;
922
923 FUNCTION: void
924 cairo_matrix_init_scale ( cairo_matrix_t* matrix, double sx, double sy ) ;
925
926 FUNCTION: void
927 cairo_matrix_init_rotate ( cairo_matrix_t* matrix, double radians ) ;
928
929 FUNCTION: void
930 cairo_matrix_translate ( cairo_matrix_t* matrix, double tx, double ty ) ;
931
932 FUNCTION: void
933 cairo_matrix_scale ( cairo_matrix_t* matrix, double sx, double sy ) ;
934
935 FUNCTION: void
936 cairo_matrix_rotate ( cairo_matrix_t* matrix, double radians ) ;
937
938 FUNCTION: cairo_status_t
939 cairo_matrix_invert ( cairo_matrix_t* matrix ) ;
940
941 FUNCTION: void
942 cairo_matrix_multiply ( cairo_matrix_t* result, cairo_matrix_t* a, cairo_matrix_t* b ) ;
943
944 FUNCTION: void
945 cairo_matrix_transform_distance ( cairo_matrix_t* matrix, double* dx, double* dy ) ;
946
947 FUNCTION: void
948 cairo_matrix_transform_point ( cairo_matrix_t* matrix, double* x, double* y ) ;
949
950 ! Functions to be used while debugging (not intended for use in production code)
951 FUNCTION: void
952 cairo_debug_reset_static_data ( ) ;