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