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