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