~ubuntu-branches/ubuntu/hardy/vala/hardy

« back to all changes in this revision

Viewing changes to vapi/cairo.vapi

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge, Marc-Andre Lureau, Sebastian Dröge
  • Date: 2007-10-15 14:37:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071015143751-zy7hqcyjutdyfkg3
Tags: 0.1.4-1
[ Marc-Andre Lureau ]
* New Upstream Version
* debian/patches:
  + Remove patch no longer needed in 0.1.4
* debian/rules
  + Add xsltproc build dependency for the Vala manual.
  + Add libenchant-dev build dependency for enchant test case.
* debian/control, debian/vala-doc.install:
  + Add a "vala-doc" documentation package.

[ Sebastian Dröge ]
* debian/control:
  + Let vala-doc suggest valac/devhelp and don't depend on libvala0.
* debian/libvala-dev.install:
  + Add the new vapicheck utility.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* cairo.vala
 
2
 *
 
3
 * Copyright (C) 2006-2007  Jürg Billeter
 
4
 *
 
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.
 
9
 
 
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.
 
14
 
 
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
 
18
 *
 
19
 * Author:
 
20
 *      Jürg Billeter <j@bitron.ch>
 
21
 */
 
22
 
 
23
[CCode (cheader_filename = "cairo.h")]
 
24
namespace Cairo {
 
25
        [CCode (ref_function = "cairo_reference", unref_function = "cairo_destroy", cname = "cairo_t", cprefix = "cairo_", cheader_filename = "cairo.h")]
 
26
        public class Context {
 
27
                [CCode (cname = "cairo_create")]
 
28
                public Context (Surface target);
 
29
                public Status status ();
 
30
                public void save ();
 
31
                public void restore ();
 
32
                
 
33
                public weak Surface get_target ();
 
34
                public void push_group ();
 
35
                public void push_group_with_content (Content content);
 
36
                public Pattern pop_group ();
 
37
                public void pop_group_to_source ();
 
38
                public weak Surface get_group_target ();
 
39
                
 
40
                public void set_source_rgb (double red, double green, double blue);
 
41
                public void set_source_rgba (double red, double green, double blue, double alpha);
 
42
                public void set_source (Pattern source);
 
43
                public void set_source_surface (Surface surface, double x, double y);
 
44
                public weak Pattern get_source ();
 
45
 
 
46
                public void set_matrix (Matrix matrix);
 
47
                public void get_matrix (Matrix matrix);
 
48
 
 
49
                public void set_antialias (Antialias antialias);
 
50
                public Antialias get_antialias ();
 
51
                
 
52
                [NoArrayLength ()]
 
53
                public void set_dash (double[] dashes, int num_dashes, double offset);
 
54
                
 
55
                public void set_fill_rule (FillRule fill_rule);
 
56
                public FillRule get_fill_rule ();
 
57
                
 
58
                public void set_line_cap (LineCap line_cap);
 
59
                public LineCap get_line_cap ();
 
60
                
 
61
                public void set_line_join (LineJoin line_join);
 
62
                public LineJoin get_line_join ();
 
63
                
 
64
                public void set_line_width (double width);
 
65
                public double get_line_width ();
 
66
                
 
67
                public void set_miter_limit (double limit);
 
68
                public double get_miter_limit ();
 
69
                
 
70
                public void set_operator (Operator op);
 
71
                public Operator get_operator ();
 
72
                
 
73
                public void set_tolerance (double tolerance);
 
74
                public double get_tolerance ();
 
75
                
 
76
                public void clip ();
 
77
                public void clip_preserve ();
 
78
                public void reset_clip ();
 
79
 
 
80
                public void fill ();
 
81
                public void fill_preserve ();
 
82
                public void fill_extents (ref double x1, ref double y1, ref double x2, ref double y2);
 
83
                public bool in_fill (double x, double y);
 
84
 
 
85
                public void mask (Pattern pattern);
 
86
                public void mask_surface (Surface surface, double surface_x, double surface_y);
 
87
                
 
88
                public void paint ();
 
89
                public void paint_with_alpha (double alpha);
 
90
 
 
91
                public void stroke ();
 
92
                public void stroke_preserve ();
 
93
                public void stroke_extents (ref double x1, ref double y1, ref double x2, ref double y2);
 
94
                public bool in_stroke (double x, double y);
 
95
 
 
96
                public void copy_page ();
 
97
                public void show_page ();
 
98
                
 
99
                public Path copy_path ();
 
100
                public Path copy_path_flat ();
 
101
                
 
102
                public void append_path (Path path);
 
103
                
 
104
                public void get_current_point (ref double x, ref double y);
 
105
                
 
106
                public void new_path ();
 
107
                public void new_sub_path ();
 
108
                public void close_path ();
 
109
                
 
110
                public void arc (double xc, double yc, double radius, double angle1, double angle2);
 
111
                public void arc_negative (double xc, double yc, double radius, double angle1, double angle2);
 
112
 
 
113
                public void curve_to (double x1, double y1, double x2, double y2, double x3, double y3);
 
114
                public void line_to (double x, double y);
 
115
                public void move_to (double x, double y);
 
116
                
 
117
                public void rectangle (double x, double y, double width, double height);
 
118
                
 
119
                [NoArrayLength ()]
 
120
                public void glyph_path (Glyph[] glyphs, int num_glyphs);
 
121
                public void text_path (string! utf8);
 
122
                
 
123
                public void rel_curve_to (double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
 
124
                public void rel_line_to (double dx, double dy);
 
125
                public void rel_move_to (double dx, double dy);
 
126
                
 
127
                public void translate (double tx, double ty);
 
128
                public void scale (double sx, double sy);
 
129
                public void rotate (double angle);
 
130
                public void transform (Matrix matrix);
 
131
                public void identity_matrix ();
 
132
                
 
133
                public void user_to_device (ref double x, ref double y);
 
134
                public void user_to_device_distance (ref double dx, ref double dy);
 
135
                public void device_to_user (ref double x, ref double y);
 
136
                public void device_to_user_distance (ref double dx, ref double dy);
 
137
                
 
138
                public void select_font_face (string! family, FontSlant slant, FontWeight weight);
 
139
                public void set_font_size (double size);
 
140
                public void set_font_matrix (Matrix! matrix);
 
141
                public void get_font_matrix (Matrix matrix);
 
142
                public void set_font_options (ref FontOptions! options);
 
143
                public void get_font_options (ref FontOptions options);
 
144
                
 
145
                public void show_text (string! utf8);
 
146
                [NoArrayLength ()]
 
147
                public void show_glyphs (Glyph[] glyphs, int num_glyphs);
 
148
                
 
149
                public weak FontFace get_font_face ();
 
150
                public void font_extents (ref FontExtents extents);
 
151
                public void set_font_face (FontFace font_face);
 
152
                public void set_scaled_font (ScaledFont! font);
 
153
                public void text_extents (string! utf8, ref TextExtents extents);
 
154
                [NoArrayLength ()]
 
155
                public void glyph_extents (Glyph[] glyphs, int num_glyphs, ref TextExtents extents);
 
156
        }
 
157
        
 
158
        public enum Antialias {
 
159
                DEFAULT,
 
160
                NONE,
 
161
                GRAY,
 
162
                SUBPIXEL
 
163
        }
 
164
        
 
165
        public enum FillRule {
 
166
                WINDING,
 
167
                EVEN_ODD
 
168
        }
 
169
        
 
170
        public enum LineCap {
 
171
                BUTT,
 
172
                ROUND,
 
173
                SQUARE
 
174
        }
 
175
        
 
176
        public enum LineJoin {
 
177
                MITER,
 
178
                ROUND,
 
179
                BEVEL
 
180
        }
 
181
        
 
182
        public enum Operator {
 
183
                CLEAR,
 
184
                SOURCE,
 
185
                OVER,
 
186
                IN,
 
187
                OUT,
 
188
                ATOP,
 
189
                DEST,
 
190
                DEST_OVER,
 
191
                DEST_IN,
 
192
                DEST_OUT,
 
193
                DEST_ATOP,
 
194
                XOR,
 
195
                ADD,
 
196
                SATURATE
 
197
        }
 
198
        
 
199
        [CCode (free_function = "cairo_path_destroy", cname = "cairo_path_t")]
 
200
        public class Path {
 
201
                public Status status;
 
202
                [NoArrayLength ()]
 
203
                public PathData[] data;
 
204
                public int num_data;
 
205
        }
 
206
        
 
207
        [CCode (cname = "cairo_path_data_t")]
 
208
        public struct PathData {
 
209
                public PathDataHeader header;
 
210
                public PathDataPoint point;
 
211
        }
 
212
        
 
213
        public struct PathDataHeader {
 
214
                public PathDataType type;
 
215
                public int length;
 
216
        }
 
217
        
 
218
        public struct PathDataPoint {
 
219
                public double x;
 
220
                public double y;
 
221
        }
 
222
        
 
223
        [CCode (cprefix = "CAIRO_PATH_")]
 
224
        public enum PathDataType {
 
225
                MOVE_TO,
 
226
                LINE_TO,
 
227
                CURVE_TO,
 
228
                CLOSE_PATH
 
229
        }
 
230
        
 
231
        [CCode (ref_function = "cairo_pattern_reference", unref_function = "cairo_pattern_destroy", cname = "cairo_pattern_t")]
 
232
        public class Pattern {
 
233
                public void add_color_stop_rgb (double offset, double red, double green, double blue);
 
234
                public void add_color_stop_rgba (double offset, double red, double green, double blue, double alpha);
 
235
 
 
236
                [CCode (cname = "cairo_pattern_create_rgb")]
 
237
                public Pattern.rgb (double red, double green, double blue);
 
238
                [CCode (cname = "cairo_pattern_create_rgba")]
 
239
                public Pattern.rgba (double red, double green, double blue, double alpha);
 
240
                [CCode (cname = "cairo_pattern_create_for_surface")]
 
241
                public Pattern.for_surface (Surface! surface);
 
242
                [CCode (cname = "cairo_pattern_create_linear")]
 
243
                public Pattern.linear (double x0, double y0, double x1, double y1);
 
244
                [CCode (cname = "cairo_pattern_create_radial")]
 
245
                public Pattern.radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1);
 
246
                
 
247
                public Status status ();
 
248
                
 
249
                public void set_extend (Extend extend);
 
250
                public Extend get_extend ();
 
251
                
 
252
                public void set_filter (Filter filter);
 
253
                public Filter get_filter ();
 
254
                
 
255
                public void set_matrix (Matrix matrix);
 
256
                public void get_matrix (Matrix matrix);
 
257
                
 
258
                public PatternType get_type ();
 
259
        }
 
260
        
 
261
        [CCode (cname = "cairo_extend_t")]
 
262
        public enum Extend {
 
263
                NONE,
 
264
                REPEAT,
 
265
                REFLECT,
 
266
                PAD
 
267
        }
 
268
        
 
269
        [CCode (cname = "cairo_filter_t")]
 
270
        public enum Filter {
 
271
                FAST,
 
272
                GOOD,
 
273
                BEST,
 
274
                NEAREST,
 
275
                BILINEAR,
 
276
                GAUSSIAN
 
277
        }
 
278
        
 
279
        [CCode (cname = "cairo_pattern_type_t")]
 
280
        public enum PatternType {
 
281
                SOLID,
 
282
                SURFACE,
 
283
                LINEAR,
 
284
                RADIAL
 
285
        }
 
286
        
 
287
        [CCode (cname = "cairo_glyph_t")]
 
288
        public class Glyph {
 
289
        }
 
290
        
 
291
        [CCode (cname = "cairo_font_slant_t")]
 
292
        public enum FontSlant {
 
293
                NORMAL,
 
294
                ITALIC,
 
295
                OBLIQUE
 
296
        }
 
297
        
 
298
        [CCode (cname = "cairo_font_weight_t")]
 
299
        public enum FontWeight {
 
300
                NORMAL,
 
301
                BOLD
 
302
        }
 
303
        
 
304
        [CCode (ref_function = "cairo_font_face_reference", unref_function = "cairo_font_face_destroy", cname = "cairo_font_face_t")]
 
305
        public class FontFace {
 
306
                public Status status ();
 
307
                public FontType get_type ();
 
308
        }
 
309
        
 
310
        [CCode (cname = "cairo_font_type_t")]
 
311
        public enum FontType {
 
312
                TOY,
 
313
                FT,
 
314
                WIN32,
 
315
                ATSUI
 
316
        }
 
317
        
 
318
        [CCode (ref_function = "cairo_scaled_font_reference", unref_function = "cairo_scaled_font_destroy", cname = "cairo_scaled_font_t")]
 
319
        public class ScaledFont {
 
320
                [CCode (cname = "cairo_scaled_font_create")]
 
321
                public ScaledFont (Matrix font_matrix, Matrix ctm, ref FontOptions options);
 
322
                public Status status ();
 
323
                public void extents (ref FontExtents extents);
 
324
                public void text_extents (string! utf8, ref TextExtents extents);
 
325
                [NoArrayLength ()]
 
326
                public void glyph_extents (Glyph[] glyphs, int num_glyphs, ref TextExtents extents);
 
327
                public weak FontFace get_font_face ();
 
328
                public void get_font_options (ref FontOptions options);
 
329
                public void get_font_matrix (Matrix font_matrix);
 
330
                public void get_ctm (Matrix ctm);
 
331
                public FontType get_type ();
 
332
        }
 
333
        
 
334
        [CCode (cname = "cairo_font_extents_t")]
 
335
        public struct FontExtents {
 
336
                public double ascent;
 
337
                public double descent;
 
338
                public double height;
 
339
                public double max_x_advance;
 
340
                public double max_y_advance;
 
341
        }
 
342
        
 
343
        [CCode (cname = "cairo_text_extents_t")]
 
344
        public struct TextExtents {
 
345
                public double x_bearing;
 
346
                public double y_bearing;
 
347
                public double width;
 
348
                public double height;
 
349
                public double x_advance;
 
350
                public double y_advance;
 
351
        }
 
352
        
 
353
        [CCode (copy_function = "cairo_font_options_copy", free_function = "cairo_font_options_destroy", cname = "cairo_font_options_t")]
 
354
        public class FontOptions {
 
355
                [CCode (cname = "cairo_font_options_create")]
 
356
                public FontOptions ();
 
357
                public Status status ();
 
358
                public void merge (FontOptions other);
 
359
                public ulong hash ();
 
360
                public bool equal (FontOptions other);
 
361
                public void set_antialias (Antialias antialias);
 
362
                public Antialias get_antialias ();
 
363
                public void set_subpixel_order (SubpixelOrder subpixel_order);
 
364
                public SubpixelOrder get_subpixel_order ();
 
365
                public void set_hint_style (HintStyle hint_style);
 
366
                public HintStyle get_hint_style ();
 
367
                public void set_hint_metrics (HintMetrics hint_metrics);
 
368
                public HintMetrics get_hint_metrics ();
 
369
        }
 
370
        
 
371
        [CCode (cname = "cairo_subpixel_order_t")]
 
372
        public enum SubpixelOrder {
 
373
                DEFAULT,
 
374
                RGB,
 
375
                BGR,
 
376
                VRGB,
 
377
                VBGR
 
378
        }
 
379
        
 
380
        [CCode (cname = "cairo_hint_style_t")]
 
381
        public enum HintStyle {
 
382
                DEFAULT,
 
383
                NONE,
 
384
                SLIGHT,
 
385
                MEDIUM,
 
386
                FULL
 
387
        }
 
388
        
 
389
        [CCode (cname = "cairo_hint_metrics_t")]
 
390
        public enum HintMetrics {
 
391
                DEFAULT,
 
392
                OFF,
 
393
                ON
 
394
        }
 
395
        
 
396
        [CCode (ref_function = "cairo_surface_reference", unref_function = "cairo_surface_destroy", cname = "cairo_surface_t", cheader_filename = "cairo.h")]
 
397
        public class Surface {
 
398
                [CCode (cname = "cairo_surface_create_similar")]
 
399
                public Surface.similar (Surface! other, Content content, int width, int height);
 
400
                public void finish ();
 
401
                public void flush ();
 
402
                public void get_font_options (ref FontOptions options);
 
403
                public Content get_content ();
 
404
                public void mark_dirty ();
 
405
                public void mark_dirty_rectangle (int x, int y, int width, int height);
 
406
                public void set_device_offset (double x_offset, double y_offset);
 
407
                public void get_device_offset (ref double x_offset, ref double y_offset);
 
408
                public void set_fallback_resolution (double x_pixels_per_inch, double y_pixels_per_inch);
 
409
                public Status status ();
 
410
                public SurfaceType get_type ();
 
411
 
 
412
                public Status write_to_png (string! filename);
 
413
                public Status write_to_png_stream (WriteFunc write_func, pointer closure);
 
414
        }
 
415
        
 
416
        public enum Content {
 
417
                COLOR,
 
418
                ALPHA,
 
419
                COLOR_ALPHA
 
420
        }
 
421
        
 
422
        public enum SurfaceType {
 
423
                IMAGE,
 
424
                PDF,
 
425
                PS,
 
426
                XLIB,
 
427
                XCB,
 
428
                GLITZ,
 
429
                QUARTZ,
 
430
                WIN32,
 
431
                BEOS,
 
432
                DIRECTFB,
 
433
                SVG
 
434
        }
 
435
        
 
436
        public enum Format {
 
437
                ARGB32,
 
438
                RGB24,
 
439
                A8,
 
440
                A1,
 
441
                RGB16_565
 
442
        }
 
443
        
 
444
        [CCode (cname = "cairo_surface_t")]
 
445
        public class ImageSurface : Surface {
 
446
                [CCode (cname = "cairo_image_surface_create")]
 
447
                public ImageSurface (Format format, int width, int height);
 
448
                [CCode (cname = "cairo_image_surface_create_for_data")]
 
449
                [NoArrayLength ()]
 
450
                public ImageSurface.for_data (uchar[] data, Format format, int width, int height, int stride);
 
451
                public uchar[] get_data ();
 
452
                public Format get_format ();
 
453
                public int get_width ();
 
454
                public int get_height ();
 
455
                public int get_stride ();
 
456
 
 
457
                [CCode (cname = "cairo_image_surface_create_from_png")]
 
458
                public ImageSurface.from_png (string! filename);
 
459
                [CCode (cname = "cairo_image_surface_create_from_png_stream")]
 
460
                public ImageSurface.from_png_stream (ReadFunc read_func, pointer closure);
 
461
        }
 
462
        
 
463
        [CCode (cname = "cairo_surface_t", cheader_filename = "cairo-pdf.h")]
 
464
        public class PdfSurface : Surface {
 
465
                [CCode (cname = "cairo_pdf_surface_create")]
 
466
                public PdfSurface (string! filename, double width_in_points, double height_in_points);
 
467
                [CCode (cname = "cairo_pdf_surface_create_for_stream")]
 
468
                public PdfSurface.for_stream (WriteFunc write_func, pointer closure, double width_in_points, double height_in_points);
 
469
                public void set_size (double width_in_points, double height_in_points);
 
470
        }
 
471
        
 
472
        [NoArrayLength ()]
 
473
        public static delegate Status ReadFunc (pointer closure, uchar[] data, uint length);
 
474
        [NoArrayLength ()]
 
475
        public static delegate Status WriteFunc (pointer closure, uchar[] data, uint length);
 
476
        
 
477
        [CCode (cname = "cairo_surface_t", cheader_filename = "cairo-ps.h")]
 
478
        public class PsSurface : Surface {
 
479
                [CCode (cname = "cairo_ps_surface_create")]
 
480
                public PsSurface (string! filename, double width_in_points, double height_in_points);
 
481
                [CCode (cname = "cairo_ps_surface_create_for_stream")]
 
482
                public PsSurface.for_stream (WriteFunc write_func, pointer closure, double width_in_points, double height_in_points);
 
483
                public void set_size (double width_in_points, double height_in_points);
 
484
                public void dsc_begin_setup ();
 
485
                public void dsc_begin_page_setup ();
 
486
                public void dsc_comment (string! comment);
 
487
        }
 
488
        
 
489
        [CCode (cname = "cairo_surface_t", cheader_filename = "cairo-svg.h")]
 
490
        public class SvgSurface : Surface {
 
491
                [CCode (cname = "cairo_svg_surface_create")]
 
492
                public SvgSurface (string! filename, double width_in_points, double height_in_points);
 
493
                [CCode (cname = "cairo_svg_surface_create_for_stream")]
 
494
                public SvgSurface.for_stream (WriteFunc write_func, pointer closure, double width_in_points, double height_in_points);
 
495
                public void restrict_to_version (SvgVersion version);
 
496
                [NoArrayLength ()]
 
497
                public static void get_versions (out SvgVersion[] versions, ref int num_versions);
 
498
        }
 
499
        
 
500
        [CCode (cname = "cairo_svg_version_t", cprefix = "CAIRO_SVG_")]
 
501
        public enum SvgVersion {
 
502
                VERSION_1_1,
 
503
                VERSION_1_2
 
504
        }
 
505
        
 
506
        [CCode (cname = "cairo_surface_t", cheader_filename = "cairo-xlib.h")]
 
507
        public class XlibSurface : Surface {
 
508
                [CCode (cname = "cairo_xlib_surface_create")]
 
509
                public XlibSurface (pointer dpy, int drawable, pointer visual, int width, int height);
 
510
                [CCode (cname = "cairo_xlib_surface_create_for_bitmap")]
 
511
                public XlibSurface.for_bitmap (pointer dpy, int bitmap, pointer screen, int width, int height);
 
512
                public void set_size (int width, int height);
 
513
                public pointer get_display ();
 
514
                public pointer get_screen ();
 
515
                public void set_drawable (int drawable, int width, int height);
 
516
                public int get_drawable ();
 
517
                public pointer get_visual ();
 
518
                public int get_width ();
 
519
                public int get_height ();
 
520
                public int get_depth ();
 
521
        }
 
522
        
 
523
        [CCode (free_function = "g_free", cname = "cairo_matrix_t")]
 
524
        public class Matrix {
 
525
                public void init (double xx, double yx, double xy, double yy, double x0, double y0);
 
526
                public void init_identity ();
 
527
                public void init_translate (double tx, double ty);
 
528
                public void init_scale (double sx, double sy);
 
529
                public void init_rotate (double radians);
 
530
                public void translate (double tx, double ty);
 
531
                public void scale (double sx, double sy);
 
532
                public void rotate (double radians);
 
533
                public Status invert ();
 
534
                public void multiply (Matrix a, Matrix b);
 
535
                public void transform_distance (ref double dx, ref double dy);
 
536
                public void transform_point (ref double x, ref double y);
 
537
        }
 
538
        
 
539
        public enum Status {
 
540
                SUCCESS,
 
541
                NO_MEMORY,
 
542
                INVALID_RESTORE,
 
543
                INVALID_POP_GROUP,
 
544
                NO_CURRENT_POINT,
 
545
                INVALID_MATRIX,
 
546
                INVALID_STATUS,
 
547
                NULL_POINTER,
 
548
                INVALID_STRING,
 
549
                INVALID_PATH_DATA,
 
550
                READ_ERROR,
 
551
                WRITE_ERROR,
 
552
                SURFACE_FINISHED,
 
553
                SURFACE_TYPE_MISMATCH,
 
554
                PATTERN_TYPE_MISMATCH,
 
555
                INVALID_CONTENT,
 
556
                INVALID_FORMAT,
 
557
                INVALID_VISUAL,
 
558
                FILE_NOT_FOUND,
 
559
                INVALID_DASH,
 
560
                INVALID_DSC_COMMENT
 
561
        }
 
562
        
 
563
        public int version ();
 
564
        public weak string! version_string ();
 
565
}