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