3 * Copyright (C) 2006-2009 Jürg Billeter
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Jürg Billeter <j@bitron.ch>
23 [CCode (cheader_filename = "cairo.h", gir_namespace = "cairo", gir_version = "1.0")]
25 [CCode (lower_case_cprefix = "CAIRO_MIME_TYPE_")]
27 public const string JBIG2;
28 public const string JBIG2_GLOBAL;
29 public const string JBIG2_GLOBAL_ID;
30 public const string JP2;
31 public const string JPEG;
32 public const string PNG;
33 public const string UNIQUE_ID;
34 public const string URI;
36 [CCode (cname = "cairo_t", cprefix = "cairo_", ref_function = "cairo_reference", unref_function = "cairo_destroy")]
38 public class Context {
39 [CCode (cname = "cairo_create")]
40 public Context (Cairo.Surface target);
41 public void append_path (Cairo.Path path);
42 public void arc (double xc, double yc, double radius, double angle1, double angle2);
43 public void arc_negative (double xc, double yc, double radius, double angle1, double angle2);
45 public void clip_extents (out double x1, out double y1, out double x2, out double y2);
46 public void clip_preserve ();
47 public void close_path ();
48 public Cairo.RectangleList copy_clip_rectangle_list ();
49 public void copy_page ();
50 public Cairo.Path copy_path ();
51 public Cairo.Path copy_path_flat ();
52 public void curve_to (double x1, double y1, double x2, double y2, double x3, double y3);
53 public void device_to_user (ref double x, ref double y);
54 public void device_to_user_distance (ref double dx, ref double dy);
56 public void fill_extents (out double x1, out double y1, out double x2, out double y2);
57 public void fill_preserve ();
58 public void font_extents (out Cairo.FontExtents extents);
59 public Cairo.Antialias get_antialias ();
60 public void get_current_point (out double x, out double y);
61 public void get_dash (double[]? dashes, double[]? offset);
62 public int get_dash_count ();
63 public Cairo.FillRule get_fill_rule ();
64 public unowned Cairo.FontFace get_font_face ();
65 public void get_font_matrix (out Cairo.Matrix matrix);
66 public void get_font_options (out Cairo.FontOptions options);
67 public unowned Cairo.Surface get_group_target ();
68 public Cairo.LineCap get_line_cap ();
69 public Cairo.LineJoin get_line_join ();
70 public double get_line_width ();
71 public Cairo.Matrix get_matrix ();
72 public double get_miter_limit ();
73 public Cairo.Operator get_operator ();
74 public uint get_reference_count ();
75 public unowned Cairo.ScaledFont get_scaled_font ();
76 public unowned Cairo.Pattern get_source ();
77 public unowned Cairo.Surface get_target ();
78 public double get_tolerance ();
79 [CCode (simple_generics = true)]
80 public unowned G? get_user_data<G> (Cairo.UserDataKey? key);
81 public void glyph_extents (Cairo.Glyph[] glyphs, out Cairo.TextExtents extents);
82 public void glyph_path (Cairo.Glyph[] glyphs);
83 public bool has_current_point ();
84 public void identity_matrix ();
85 public bool in_clip (double x, double y);
86 public bool in_fill (double x, double y);
87 public bool in_stroke (double x, double y);
88 public void line_to (double x, double y);
89 public void mask (Cairo.Pattern pattern);
90 public void mask_surface (Cairo.Surface surface, double surface_x, double surface_y);
91 public void move_to (double x, double y);
92 public void new_path ();
93 public void new_sub_path ();
95 public void paint_with_alpha (double alpha);
96 public void path_extents (out double x1, out double y1, out double x2, out double y2);
97 public Cairo.Pattern pop_group ();
98 public void pop_group_to_source ();
99 public void push_group ();
100 public void push_group_with_content (Cairo.Content content);
101 public void rectangle (double x, double y, double width, double height);
102 public void rel_curve_to (double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
103 public void rel_line_to (double dx, double dy);
104 public void rel_move_to (double dx, double dy);
105 public void reset_clip ();
106 public void restore ();
107 public void rotate (double angle);
109 public void scale (double sx, double sy);
110 public void select_font_face (string family, Cairo.FontSlant slant, Cairo.FontWeight weight);
111 public void set_antialias (Cairo.Antialias antialias);
112 public void set_dash (double[]? dashes, double offset);
113 public void set_fill_rule (Cairo.FillRule fill_rule);
114 public void set_font_face (Cairo.FontFace font_face);
115 public void set_font_matrix (Cairo.Matrix matrix);
116 public void set_font_options (Cairo.FontOptions options);
117 public void set_font_size (double size);
118 public void set_line_cap (Cairo.LineCap line_cap);
119 public void set_line_join (Cairo.LineJoin line_join);
120 public void set_line_width (double width);
121 public void set_matrix (Cairo.Matrix matrix);
122 public void set_miter_limit (double limit);
123 public void set_operator (Cairo.Operator op);
124 public void set_scaled_font (Cairo.ScaledFont font);
125 public void set_source (Cairo.Pattern source);
126 public void set_source_rgb (double red, double green, double blue);
127 public void set_source_rgba (double red, double green, double blue, double alpha);
128 public void set_source_surface (Cairo.Surface surface, double x, double y);
129 public void set_tolerance (double tolerance);
130 [CCode (simple_generics = true)]
131 public Cairo.Status set_user_data<G> (Cairo.UserDataKey? key, owned G? data);
132 public void show_glyphs (Cairo.Glyph[] glyphs);
133 public void show_page ();
134 public void show_text (string utf8);
135 public Cairo.Status show_text_glyphs (string utf8, int utf8_len, Cairo.Glyph[] glyphs, Cairo.TextCluster[] clusters, out Cairo.TextClusterFlags cluster_flags);
136 public Cairo.Status status ();
137 public void stroke ();
138 public void stroke_extents (out double x1, out double y1, out double x2, out double y2);
139 public void stroke_preserve ();
140 public void text_extents (string utf8, out Cairo.TextExtents extents);
141 public void text_path (string utf8);
142 public void transform (Cairo.Matrix matrix);
143 public void translate (double tx, double ty);
144 public void user_to_device (ref double x, ref double y);
145 public void user_to_device_distance (ref double dx, ref double dy);
147 [CCode (cname = "cairo_device_t", ref_function = "cairo_device_reference", unref_function = "cairo_device_destroy")]
149 public class Device {
150 public Cairo.Status acquire ();
151 public void finish ();
152 public void flush ();
153 public uint get_reference_count ();
154 public Cairo.DeviceType get_type ();
155 [CCode (simple_generics = true)]
156 public unowned G? get_user_data<G> (Cairo.UserDataKey? key);
157 public void release ();
158 [CCode (simple_generics = true)]
159 public Cairo.Status set_user_data<G> (Cairo.UserDataKey? key, owned G? data);
160 public Cairo.Status status ();
162 [CCode (cname = "cairo_device_t", ref_function = "cairo_device_reference", unref_function = "cairo_device_destroy")]
164 public class DeviceObserver {
165 protected DeviceObserver ();
166 public double elapsed ();
167 public double fill_elapsed ();
168 public double glyphs_elapsed ();
169 public double mask_elapsed ();
170 public double paint_elapsed ();
171 public Cairo.Status print (Cairo.WriteFunc write_func);
172 public double stroke_elapsed ();
174 [CCode (cname = "cairo_font_face_t", ref_function = "cairo_font_face_reference", unref_function = "cairo_font_face_destroy")]
176 public class FontFace {
177 public uint get_reference_count ();
178 public Cairo.FontType get_type ();
179 [CCode (simple_generics = true)]
180 public unowned G? get_user_data<G> (Cairo.UserDataKey? key);
181 [CCode (simple_generics = true)]
182 public Cairo.Status set_user_data<G> (Cairo.UserDataKey? key, owned G? data);
183 public Cairo.Status status ();
185 [CCode (cname = "cairo_font_options_t", copy_function = "cairo_font_options_copy", free_function = "cairo_font_options_destroy")]
187 public class FontOptions {
188 [CCode (cname = "cairo_font_options_create")]
189 public FontOptions ();
190 public bool equal (Cairo.FontOptions other);
191 public Cairo.Antialias get_antialias ();
192 public Cairo.HintMetrics get_hint_metrics ();
193 public Cairo.HintStyle get_hint_style ();
194 public Cairo.SubpixelOrder get_subpixel_order ();
195 public ulong hash ();
196 public void merge (Cairo.FontOptions other);
197 public void set_antialias (Cairo.Antialias antialias);
198 public void set_hint_metrics (Cairo.HintMetrics hint_metrics);
199 public void set_hint_style (Cairo.HintStyle hint_style);
200 public void set_subpixel_order (Cairo.SubpixelOrder subpixel_order);
201 public Cairo.Status status ();
203 [CCode (cname = "cairo_surface_t")]
205 public class ImageSurface : Cairo.Surface {
206 [CCode (cname = "cairo_image_surface_create")]
207 public ImageSurface (Cairo.Format format, int width, int height);
208 [CCode (cname = "cairo_image_surface_create_for_data")]
209 public ImageSurface.for_data ([CCode (array_length = false)] uchar[] data, Cairo.Format format, int width, int height, int stride);
210 [CCode (cname = "cairo_image_surface_create_from_png")]
211 public ImageSurface.from_png (string filename);
212 [CCode (cname = "cairo_image_surface_create_from_png_stream")]
213 public ImageSurface.from_png_stream (Cairo.ReadFunc read_func);
214 [CCode (array_length = false)]
215 public unowned uchar[] get_data ();
216 public Cairo.Format get_format ();
217 public int get_height ();
218 public int get_stride ();
219 public int get_width ();
221 [CCode (cname = "cairo_pattern_t", ref_function = "cairo_pattern_reference", unref_function = "cairo_pattern_destroy")]
223 public class MeshPattern : Cairo.Pattern {
224 [CCode (cname = "cairo_pattern_create_mesh")]
225 public MeshPattern ();
226 public void begin_patch ();
227 public void curve_to (double x1, double y1, double x2, double y2, double x3, double y3);
228 public void end_patch ();
229 public Cairo.Status get_control_point (uint patch_num, uint point_num, out double x, out double y);
230 public Cairo.Status get_corner_color_rgba (uint patch_num, uint corner_num, out double red, out double green, out double blue, out double alpha);
231 public Cairo.Status get_patch_count (out uint count);
232 public Cairo.Path get_path (uint patch_num);
233 public void line_to (double x, double y);
234 public void move_to (double x, double y);
235 public void set_control_point (uint point_num, double x, double y);
236 public void set_corner_color_rgb (uint corner_num, double red, double green, double blue);
237 public void set_corner_color_rgba (uint corner_num, double red, double green, double blue, double alpha);
239 [CCode (cname = "cairo_path_t", free_function = "cairo_path_destroy")]
242 [CCode (array_length = false)]
243 public Cairo.PathData[] data;
245 public Cairo.Status status;
247 [CCode (cname = "cairo_pattern_t", ref_function = "cairo_pattern_reference", unref_function = "cairo_pattern_destroy")]
249 public class Pattern {
250 public void add_color_stop_rgb (double offset, double red, double green, double blue);
251 public void add_color_stop_rgba (double offset, double red, double green, double blue, double alpha);
252 [CCode (cname = "cairo_pattern_create_for_surface")]
253 public Pattern.for_surface (Cairo.Surface surface);
254 public Cairo.Status get_color_stop_count (out int count);
255 public Cairo.Status get_color_stop_rgba (int index, out double offset, out double red, out double green, out double blue, out double alpha);
256 public Cairo.Extend get_extend ();
257 public Cairo.Filter get_filter ();
258 public Cairo.Status get_linear_points (out double x0, out double y0, out double x1, out double y1);
259 public void get_matrix (out Cairo.Matrix matrix);
260 public Cairo.Status get_surface (out unowned Cairo.Surface surface);
261 public Cairo.PatternType get_type ();
262 [CCode (simple_generics = true)]
263 public unowned G? get_user_data<G> (Cairo.UserDataKey? key);
264 [CCode (cname = "cairo_pattern_create_linear")]
265 public Pattern.linear (double x0, double y0, double x1, double y1);
266 [CCode (cname = "cairo_pattern_create_radial")]
267 public Pattern.radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1);
268 [CCode (cname = "cairo_pattern_create_rgb")]
269 public Pattern.rgb (double red, double green, double blue);
270 [CCode (cname = "cairo_pattern_create_rgba")]
271 public Pattern.rgba (double red, double green, double blue, double alpha);
272 public void set_extend (Cairo.Extend extend);
273 public void set_filter (Cairo.Filter filter);
274 public void set_matrix (Cairo.Matrix matrix);
275 [CCode (simple_generics = true)]
276 public Cairo.Status set_user_data<G> (Cairo.UserDataKey? key, owned G? data);
277 public Cairo.Status status ();
279 [CCode (cheader_filename = "cairo-pdf.h", cname = "cairo_surface_t")]
281 public class PdfSurface : Cairo.Surface {
282 [CCode (cname = "cairo_pdf_surface_create")]
283 public PdfSurface (string? filename, double width_in_points, double height_in_points);
284 [CCode (cname = "cairo_pdf_surface_create_for_stream")]
285 public PdfSurface.for_stream (Cairo.WriteFunc write_func, double width_in_points, double height_in_points);
286 public void restrict_to_version (Cairo.PdfVersion version);
287 public void set_size (double width_in_points, double height_in_points);
289 [CCode (cheader_filename = "cairo-ps.h", cname = "cairo_surface_t")]
291 public class PsSurface : Cairo.Surface {
292 [CCode (cname = "cairo_ps_surface_create")]
293 public PsSurface (string filename, double width_in_points, double height_in_points);
294 public void dsc_begin_page_setup ();
295 public void dsc_begin_setup ();
296 public void dsc_comment (string comment);
297 [CCode (cname = "cairo_ps_surface_create_for_stream")]
298 public PsSurface.for_stream (Cairo.WriteFunc write_func, double width_in_points, double height_in_points);
299 public bool get_eps ();
300 public static void get_levels (out unowned Cairo.PsLevel[] levels);
301 public void restrict_to_level (Cairo.PsLevel level);
302 public void set_eps (bool eps);
303 public void set_size (double width_in_points, double height_in_points);
305 [CCode (cname = "cairo_pattern_t", ref_function = "cairo_pattern_reference", unref_function = "cairo_pattern_destroy")]
307 public class RasterSourcePattern : Cairo.Pattern {
308 [CCode (cname = "cairo_pattern_create_raster_source")]
309 public RasterSourcePattern ();
310 public void get_acquire (out Cairo.RasterSourceAcquireFunc acquire, out Cairo.RasterSourceReleaseFunc release);
311 public void* get_callback_data ();
312 public Cairo.RasterSourceCopyFunc get_copy ();
313 public Cairo.RasterSourceFinishFunc get_finish ();
314 public Cairo.RasterSourceSnapshotFunc get_snapshot ();
315 public void set_acquire (Cairo.RasterSourceAcquireFunc acquire, Cairo.RasterSourceReleaseFunc release);
316 public void set_callback_data (void* data);
317 public void set_copy (Cairo.RasterSourceCopyFunc copy);
318 public void set_finish (Cairo.RasterSourceFinishFunc finish);
319 public void set_snapshot (Cairo.RasterSourceSnapshotFunc snapshot);
321 [CCode (cname = "cairo_surface_t")]
323 public class RecordingSurface : Cairo.Surface {
324 [CCode (cname = "cairo_recording_surface_create")]
325 public RecordingSurface (Cairo.Content content, Cairo.Rectangle? extents = null);
326 public bool get_extents (out Cairo.Rectangle extents);
327 public void ink_extents (out double x0, out double y0, out double width, out double height);
329 [CCode (cname = "cairo_rectangle_list_t", free_function = "cairo_rectangle_list_destroy")]
331 public class RectangleList {
332 [CCode (array_length_cname = "num_rectangles")]
333 public Cairo.Rectangle[] rectangles;
334 public Cairo.Status status;
336 [CCode (cname = "cairo_region_t", ref_function = "cairo_region_reference", unref_function = "cairo_region_destroy")]
338 public class Region {
339 [CCode (cname = "cairo_region_create")]
341 public bool contains_point (int x, int y);
342 public Cairo.RegionOverlap contains_rectangle (Cairo.RectangleInt rectangle);
343 public Cairo.Region copy ();
344 public bool equal (Cairo.Region other);
345 public Cairo.RectangleInt get_extents ();
346 public Cairo.RectangleInt get_rectangle (int nth);
347 public Cairo.Status intersect (Cairo.Region other);
348 public Cairo.Status intersect_rectangle (Cairo.RectangleInt rectangle);
349 public bool is_empty ();
350 public int num_rectangles ();
351 [CCode (cname = "cairo_region_create_rectangle")]
352 public Region.rectangle (Cairo.RectangleInt rectangle);
353 [CCode (cname = "cairo_region_create_rectangles")]
354 public Region.rectangles (Cairo.RectangleInt[] rects);
355 public Cairo.Status status ();
356 public Cairo.Status subtract (Cairo.Region other);
357 public Cairo.Status subtract_rectangle (Cairo.RectangleInt rectangle);
358 public void translate (int dx, int dy);
359 public Cairo.Status union (Cairo.Region other);
360 public Cairo.Status union_rectangle (Cairo.RectangleInt rectangle);
361 public Cairo.Status xor (Cairo.Region other);
362 public Cairo.Status xor_rectangle (Cairo.RectangleInt rectangle);
364 [CCode (cname = "cairo_scaled_font_t", ref_function = "cairo_scaled_font_reference", unref_function = "cairo_scaled_font_destroy")]
366 public class ScaledFont {
367 [CCode (cname = "cairo_scaled_font_create")]
368 public ScaledFont (Cairo.FontFace font_face, Cairo.Matrix font_matrix, Cairo.Matrix ctm, Cairo.FontOptions options);
369 public void extents (out Cairo.FontExtents extents);
370 public void get_ctm (out Cairo.Matrix ctm);
371 public unowned Cairo.FontFace get_font_face ();
372 public void get_font_matrix (out Cairo.Matrix font_matrix);
373 public void get_font_options (out Cairo.FontOptions options);
374 public uint get_reference_count ();
375 public void get_scale_matrix (out Cairo.Matrix scale_matrix);
376 public Cairo.FontType get_type ();
377 [CCode (simple_generics = true)]
378 public unowned G? get_user_data<G> (Cairo.UserDataKey? key);
379 public void glyph_extents (Cairo.Glyph[] glyphs, out Cairo.TextExtents extents);
380 [CCode (simple_generics = true)]
381 public Cairo.Status set_user_data<G> (Cairo.UserDataKey? key, owned G? data);
382 public Cairo.Status status ();
383 public void text_extents (string utf8, out Cairo.TextExtents extents);
384 public Cairo.Status text_to_glyphs (double x, double y, string utf8, int utf8_len, out Cairo.Glyph[] glyphs, out Cairo.TextCluster[] clusters, out Cairo.TextClusterFlags cluster_flags);
385 [CCode (cname = "cairo_win32_scaled_font_get_device_to_logical")]
386 public Cairo.Matrix win32_get_device_to_logical ();
387 [CCode (cname = "cairo_win32_scaled_font_get_logical_to_device")]
388 public Cairo.Matrix win32_get_logical_to_device ();
390 [CCode (cname = "cairo_device_t", ref_function = "cairo_device_reference", unref_function = "cairo_device_destroy")]
392 public class Script : Cairo.Device {
393 [CCode (cname = "cairo_script_create")]
394 public Script (string filename);
395 [CCode (cname = "cairo_script_create_for_stream")]
396 public Script.for_stream (Cairo.WriteFunc write_func);
397 [CCode (cname = "cairo_script_from_recording_surface")]
398 public Script.from_recording_surface ([CCode (type = "cairo_surface_t")] Cairo.RecordingSurface recording_surface);
399 public Cairo.ScriptMode get_mode ();
400 public void set_mode (Cairo.ScriptMode mode);
401 public void write_comment (string comment, int len = -1);
403 [CCode (cheader_filename = "cairo-svg.h", cname = "cairo_surface_t")]
405 public class ScriptSurface : Cairo.Surface {
406 [CCode (cname = "cairo_script_surface_create")]
407 public ScriptSurface (Cairo.Script script, Cairo.Content content, double width, double height);
408 [CCode (cname = "cairo_script_surface_create_for_target")]
409 public ScriptSurface.for_target (Cairo.Script script, Cairo.Surface target);
411 [CCode (cname = "cairo_surface_t", ref_function = "cairo_surface_reference", unref_function = "cairo_surface_destroy")]
413 public class Surface {
414 public void copy_page ();
415 public void finish ();
416 public void flush ();
417 [CCode (cname = "cairo_surface_create_for_rectangle")]
418 public Surface.for_rectangle (Cairo.Surface target, double x, double y, double width, double height);
419 public Cairo.Content get_content ();
420 public Cairo.Device get_device ();
421 public void get_device_offset (out double x_offset, out double y_offset);
422 public void get_device_scale (out double x_scale, out double y_scale);
423 public void get_fallback_resolution (out double x_pixels_per_inch, out double y_pixels_per_inch);
424 public void get_font_options (out Cairo.FontOptions options);
425 public uint get_reference_count ();
426 public Cairo.SurfaceType get_type ();
427 [CCode (simple_generics = true)]
428 public unowned G? get_user_data<G> (Cairo.UserDataKey? key);
429 public bool has_show_text_glyphs ();
430 public Cairo.Surface map_to_image (Cairo.RectangleInt extents);
431 public void mark_dirty ();
432 public void mark_dirty_rectangle (int x, int y, int width, int height);
433 public void set_device_offset (double x_offset, double y_offset);
434 public void set_device_scale (double x_scale, double y_scale);
435 public void set_fallback_resolution (double x_pixels_per_inch, double y_pixels_per_inch);
436 [CCode (simple_generics = true)]
437 public Cairo.Status set_user_data<G> (Cairo.UserDataKey? key, owned G? data);
438 public void show_page ();
439 [CCode (cname = "cairo_surface_create_similar")]
440 public Surface.similar (Cairo.Surface other, Cairo.Content content, int width, int height);
441 [CCode (cname = "cairo_surface_create_similar_image")]
442 public Surface.similar_image (Cairo.Surface other, Cairo.Format format, int width, int height);
443 public Cairo.Status status ();
444 public bool supports_mime_type (string mime_type);
445 public void unmap_image (Cairo.Surface image);
446 [CCode (cname = "cairo_win32_surface_get_image")]
447 public Cairo.Surface? win32_get_image ();
448 public Cairo.Status write_to_png (string filename);
449 public Cairo.Status write_to_png_stream (Cairo.WriteFunc write_func);
451 [CCode (cname = "cairo_surface_t", ref_function = "cairo_surface_reference", unref_function = "cairo_surface_destroy")]
453 public class SurfaceObserver {
454 [CCode (cname = "cairo_surface_create_observer")]
455 public SurfaceObserver (Cairo.Surface target, Cairo.SurfaceObserverMode mode);
456 public Cairo.Status add_fill_callback (Cairo.SurfaceObserverCallback func);
457 public Cairo.Status add_finish_callback (Cairo.SurfaceObserverCallback func);
458 public Cairo.Status add_flush_callback (Cairo.SurfaceObserverCallback func);
459 public Cairo.Status add_glyphs_callback (Cairo.SurfaceObserverCallback func);
460 public Cairo.Status add_mask_callback (Cairo.SurfaceObserverCallback func);
461 public Cairo.Status add_paint_callback (Cairo.SurfaceObserverCallback func);
462 public Cairo.Status add_stroke_callback (Cairo.SurfaceObserverCallback func);
463 public double elapsed ();
464 public Cairo.Status print (Cairo.WriteFunc write_func);
466 [CCode (cheader_filename = "cairo-svg.h", cname = "cairo_surface_t")]
468 public class SvgSurface : Cairo.Surface {
469 [CCode (cname = "cairo_svg_surface_create")]
470 public SvgSurface (string filename, double width_in_points, double height_in_points);
471 [CCode (cname = "cairo_svg_surface_create_for_stream")]
472 public SvgSurface.for_stream (Cairo.WriteFunc write_func, double width_in_points, double height_in_points);
473 public void restrict_to_version (Cairo.SvgVersion version);
475 [CCode (cname = "cairo_font_face_t", ref_function = "cairo_font_face_reference", unref_function = "cairo_font_face_destroy")]
477 public class ToyFontFace : Cairo.FontFace {
478 [CCode (cname = "cairo_toy_font_face_create")]
479 public ToyFontFace (string family, Cairo.FontSlant slant, Cairo.FontWeight weight);
480 public unowned string get_family ();
481 public Cairo.FontSlant get_slant ();
482 public Cairo.FontWeight get_weight ();
484 [CCode (cname = "cairo_font_face_t", ref_function = "cairo_font_face_reference", unref_function = "cairo_font_face_destroy")]
486 public class UserFontFace : Cairo.FontFace {
487 [CCode (cname = "cairo_user_font_face_create")]
488 public UserFontFace ();
489 public Cairo.UserScaledFontInitFunc get_init_func ();
490 public Cairo.UserScaledFontRenderGlyphFunc get_render_glyph_func ();
491 public Cairo.UserScaledFontTextToGlyphsFunc get_text_to_glyphs_func ();
492 public Cairo.UserScaledFontUnicodeToGlyphFunc get_unicode_to_glyph_func ();
493 public void set_init_func (Cairo.UserScaledFontInitFunc init_func);
494 public void set_render_glyph_func (Cairo.UserScaledFontRenderGlyphFunc render_glyph_func);
495 public void set_text_to_glyphs_func (Cairo.UserScaledFontTextToGlyphsFunc text_to_glyphs_func);
496 public void set_unicode_to_glyph_func (Cairo.UserScaledFontUnicodeToGlyphFunc unicode_to_glyph_func);
498 [CCode (cname = "cairo_scaled_font_t", ref_function = "cairo_scaled_font_reference", unref_function = "cairo_scaled_font_destroy")]
500 public class UserScaledFont {
502 [CCode (cheader_filename = "cairo-xlib.h", cname = "cairo_surface_t")]
504 public class XlibSurface : Cairo.Surface {
505 [CCode (cname = "cairo_xlib_surface_create")]
506 public XlibSurface (void* dpy, int drawable, void* visual, int width, int height);
507 [CCode (cname = "cairo_xlib_surface_create_for_bitmap")]
508 public XlibSurface.for_bitmap (void* dpy, int bitmap, void* screen, int width, int height);
509 public int get_depth ();
510 public void* get_display ();
511 public int get_drawable ();
512 public int get_height ();
513 public void* get_screen ();
514 public void* get_visual ();
515 public int get_width ();
516 public void set_drawable (int drawable, int width, int height);
517 public void set_size (int width, int height);
519 [CCode (cname = "cairo_font_extents_t", has_type_id = false)]
520 public struct FontExtents {
521 public double ascent;
522 public double descent;
523 public double height;
524 public double max_x_advance;
525 public double max_y_advance;
527 [CCode (cname = "cairo_glyph_t", has_type_id = false)]
528 public struct Glyph {
533 [CCode (cname = "cairo_matrix_t", has_type_id = false)]
534 public struct Matrix {
541 [CCode (cname = "cairo_matrix_init")]
542 public Matrix (double xx, double yx, double xy, double yy, double x0, double y0);
543 [CCode (cname = "cairo_matrix_init_identity")]
544 public Matrix.identity ();
545 public Cairo.Status invert ();
546 public void multiply (Cairo.Matrix a, Cairo.Matrix b);
547 public void rotate (double radians);
548 public void scale (double sx, double sy);
549 public void transform_distance (ref double dx, ref double dy);
550 public void transform_point (ref double x, ref double y);
551 public void translate (double tx, double ty);
553 [CCode (cname = "cairo_path_data_t", has_type_id = false)]
554 public struct PathData {
555 public Cairo.PathDataHeader header;
556 public Cairo.PathDataPoint point;
558 [CCode (cname = "struct { cairo_path_data_type_t type; int length; }", has_type_id = false)]
559 public struct PathDataHeader {
560 public Cairo.PathDataType type;
563 [CCode (cname = "struct { double x, y; }", has_type_id = false)]
564 public struct PathDataPoint {
568 [CCode (cname = "cairo_rectangle_t", has_type_id = false)]
569 public struct Rectangle {
573 public double height;
575 [CCode (cname = "cairo_rectangle_int_t", has_type_id = false)]
576 public struct RectangleInt {
582 [CCode (cname = "cairo_text_cluster_t", has_type_id = false)]
583 public struct TextCluster {
584 public int num_bytes;
585 public int num_glyphs;
587 [CCode (cname = "cairo_text_extents_t", has_type_id = false)]
588 public struct TextExtents {
589 public double x_bearing;
590 public double y_bearing;
592 public double height;
593 public double x_advance;
594 public double y_advance;
596 [CCode (cname = "cairo_user_data_key_t", has_copy_function = false, has_destroy_function = false, has_type_id = false, lvalue_access = false)]
597 public struct UserDataKey {
599 [CCode (cname = "cairo_antialias_t", has_type_id = false)]
600 public enum Antialias {
609 [CCode (cname = "cairo_content_t", has_type_id = false)]
610 public enum Content {
615 [CCode (cname = "cairo_device_type_t", has_type_id = false)]
616 public enum DeviceType {
626 [CCode (cname = "cairo_extend_t", has_type_id = false)]
633 [CCode (cname = "cairo_fill_rule_t", has_type_id = false)]
634 public enum FillRule {
638 [CCode (cname = "cairo_filter_t", has_type_id = false)]
647 [CCode (cname = "cairo_font_slant_t", has_type_id = false)]
648 public enum FontSlant {
653 [CCode (cname = "cairo_font_type_t", has_type_id = false)]
654 public enum FontType {
661 [CCode (cname = "cairo_font_weight_t", has_type_id = false)]
662 public enum FontWeight {
666 [CCode (cname = "cairo_format_t", has_type_id = false)]
674 public int stride_for_width (int width);
676 [CCode (cname = "cairo_hint_metrics_t", has_type_id = false)]
677 public enum HintMetrics {
682 [CCode (cname = "cairo_hint_style_t", has_type_id = false)]
683 public enum HintStyle {
690 [CCode (cname = "cairo_line_cap_t", has_type_id = false)]
691 public enum LineCap {
696 [CCode (cname = "cairo_line_join_t", has_type_id = false)]
697 public enum LineJoin {
702 [CCode (cname = "cairo_operator_t", has_type_id = false)]
703 public enum Operator {
734 [CCode (cname = "cairo_path_data_type_t", cprefix = "CAIRO_PATH_", has_type_id = false)]
735 public enum PathDataType {
741 [CCode (cname = "cairo_pattern_type_t", has_type_id = false)]
742 public enum PatternType {
750 [CCode (cname = "cairo_pdf_version_t", cprefix = "CAIRO_PDF_", has_type_id = false)]
751 public enum PdfVersion {
754 [CCode (cname = "cairo_pdf_version_to_string")]
755 public unowned string to_string ();
756 [CCode (cname = "cairo_pdf_get_versions")]
757 public static void get_versions (out unowned Cairo.PdfVersion[] versions);
759 [CCode (cname = "cairo_ps_level_t", cprefix = "CAIRO_PS_", has_type_id = false)]
760 public enum PsLevel {
763 [CCode (cname = "cairo_ps_level_to_string")]
764 public unowned string to_string ();
765 [CCode (cname = "cairo_ps_get_levels")]
766 public static void get_levels (out unowned Cairo.PsLevel[] levels);
768 [CCode (cname = "cairo_region_overlap_t", has_type_id = false)]
769 public enum RegionOverlap {
774 [CCode (cname = "cairo_script_mode_t", has_type_id = false)]
775 public enum ScriptMode {
779 [CCode (cname = "cairo_status_t", has_type_id = false)]
794 SURFACE_TYPE_MISMATCH,
795 PATTERN_TYPE_MISMATCH,
803 CLIP_NOT_REPRESENTABLE,
814 USER_FONT_NOT_IMPLEMENTED,
815 DEVICE_TYPE_MISMATCH,
817 INVALID_MESH_CONSTRUCTION,
819 JBIG2_GLOBAL_MISSING,
823 [CCode (cname = "cairo_status_to_string")]
824 public unowned string to_string ();
826 [CCode (cname = "cairo_subpixel_order_t", has_type_id = false)]
827 public enum SubpixelOrder {
834 [CCode (cname = "cairo_surface_observer_mode_t", has_type_id = false)]
835 public enum SurfaceObserverMode {
839 [CCode (cname = "cairo_surface_type_t", has_type_id = false)]
840 public enum SurfaceType {
867 [CCode (cname = "cairo_svg_version_t", cprefix = "CAIRO_SVG_", has_type_id = false)]
868 public enum SvgVersion {
871 [CCode (cname = "cairo_svg_version_to_string")]
872 public unowned string to_string ();
873 [CCode (cname = "cairo_svg_get_versions")]
874 public static void get_versions (out unowned Cairo.SvgVersion[] versions);
876 [CCode (cname = "cairo_text_cluster_flags_t", cprefix = "CAIRO_TEXT_CLUSTER_FLAG_", has_type_id = false)]
877 public enum TextClusterFlags {
880 [CCode (cname = "cairo_raster_source_acquire_func_t", has_target = false)]
881 public delegate Cairo.Surface RasterSourceAcquireFunc (Cairo.Pattern pattern, void* callback_data, Cairo.Surface target, Cairo.RectangleInt? extents);
882 [CCode (cname = "cairo_raster_source_copy_func_t", has_target = false)]
883 public delegate Cairo.Status RasterSourceCopyFunc (Cairo.Pattern pattern, void* callback_data, Cairo.Pattern other_pattern);
884 [CCode (cname = "cairo_raster_source_finish_func_t", has_target = false)]
885 public delegate void RasterSourceFinishFunc (Cairo.Pattern pattern, void* callback_data);
886 [CCode (cname = "cairo_raster_source_release_func_t", has_target = false)]
887 public delegate void RasterSourceReleaseFunc (Cairo.Pattern pattern, void* callback_data, Cairo.Surface surface);
888 [CCode (cname = "cairo_raster_source_snapshot_func_t", has_target = false)]
889 public delegate Cairo.Status RasterSourceSnapshotFunc (Cairo.Pattern pattern, void* callback_data);
890 [CCode (cname = "cairo_read_func_t", instance_pos = 0)]
891 public delegate Cairo.Status ReadFunc (uchar[] data);
892 [CCode (cname = "cairo_surface_observer_callback_t", instance_pos = 2.9)]
893 public delegate void SurfaceObserverCallback (Cairo.SurfaceObserver observer, Cairo.Surface target);
894 [CCode (cname = "cairo_user_scaled_font_init_func_t", has_target = false)]
895 public delegate Cairo.Status UserScaledFontInitFunc (Cairo.UserScaledFont scaled_font, Cairo.Context cr, Cairo.FontExtents extents);
896 [CCode (cname = "cairo_user_scaled_font_render_glyph_func_t", has_target = false)]
897 public delegate Cairo.Status UserScaledFontRenderGlyphFunc (Cairo.UserScaledFont scaled_font, ulong glyph, Cairo.Context cr, out Cairo.TextExtents extents);
898 [CCode (cname = "cairo_user_font_face_get_text_to_glyphs_func", has_target = false)]
899 public delegate Cairo.Status UserScaledFontTextToGlyphsFunc (Cairo.UserScaledFont scaled_font, string utf8, int utf8_len, out Cairo.Glyph[] glyphs, out Cairo.TextCluster[] clusters, out Cairo.TextClusterFlags cluster_flags);
900 [CCode (cname = "cairo_user_scaled_font_unicode_to_glyph_func_t", has_target = false)]
901 public delegate Cairo.Status UserScaledFontUnicodeToGlyphFunc (Cairo.UserScaledFont scaled_font, ulong unicode, out ulong glyph_index);
902 [CCode (cname = "cairo_write_func_t", instance_pos = 0)]
903 public delegate Cairo.Status WriteFunc (uchar[] data);
904 public static int version ();
905 public static unowned string version_string ();