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