tests: Add various regression "codegen" tests to increase coverage
[vala-gnome.git] / vapi / pixman-1.vapi
blob66437e02de614551b754b365697509349dc930c4
1 [CCode (cheader_filename = "pixman.h")]
2 namespace Pixman {
3         namespace Version {
4                 public const int MAJOR;
5                 public const int MINOR;
6                 public const int MICRO;
7                 public const string STRING;
8                 [CCode (cname = "PIXMAN_VERSION")]
9                 public const int INT;
11                 public static int encode (int major, int minor, int micro);
12                 [CCode (cname = "pixman_version")]
13                 public static int library_int ();
14                 [CCode (cname = "pixman_string")]
15                 public static unowned string library_string ();
16         }
18         [SimpleType, IntegerType (rank = 6), CCode (cname = "pixman_fixed_16_16_t", has_type_id = false)]
19         public struct Fixed1616 : int32 {
20         }
22         [SimpleType, IntegerType (rank = 6), CCode (cname = "pixman_fixed_t", has_type_id = false)]
23         public struct Fixed : Fixed1616 {
24                 [CCode (cname = "pixman_double_to_fixed")]
25                 public Fixed.double (double val);
26                 [CCode (cname = "pixman_int_to_fixed")]
27                 public Fixed.int (int val);
28                 public int to_int ();
29                 public double to_double ();
30                 public Fixed frac ();
31                 public Fixed floor ();
32                 public Fixed ceil ();
33                 public Fixed fraction ();
34                 public Fixed mod_2 ();
35                 public Fixed sample_ceil_y (int bpp);
36                 public Fixed sample_floor_y (int bpp);
37         }
39         [CCode (cname = "struct pixman_color", has_type_id = false)]
40         public struct Color {
41                 public uint16 red;
42                 public uint16 green;
43                 public uint16 blue;
44                 public uint16 alpha;
45         }
47         [CCode (cname = "struct pixman_point_fixed", has_type_id = false)]
48         public struct PointFixed {
49                 public Pixman.Fixed x;
50                 public Pixman.Fixed y;
51         }
53         [CCode (cname = "struct pixman_line_fixed", has_type_id = false)]
54         public struct LineFixed {
55                 public Pixman.PointFixed p1;
56                 public Pixman.PointFixed p2;
57         }
59         [CCode (cname = "struct pixman_vector", has_type_id = false)]
60         public struct Vector {
61                 public Pixman.Fixed vector[3];
62         }
64         [CCode (cname = "struct pixman_transform", has_type_id = false)]
65         public struct Transform {
66                 public Pixman.Fixed matrix[9];
68                 [CCode (cname = "pixman_transform_init_identity")]
69                 public Transform.identity ();
70                 public bool point_3d (Pixman.Vector vector);
71                 public bool point ();
72                 public bool multiply (Pixman.Transform l, Pixman.Transform r);
73                 [CCode (cname = "pixman_transform_init_scale")]
74                 public Transform.init_scale (Pixman.Fixed sx, Pixman.Fixed sy);
75                 public bool scale (Pixman.Transform reverse, Pixman.Fixed sx, Pixman.Fixed sy);
76                 [CCode (cname = "pixman_transform_init_rotate")]
77                 public Transform.init_rotate (Pixman.Fixed cos, Pixman.Fixed sin);
78                 public bool rotate (Pixman.Transform reverse, Pixman.Fixed c, Pixman.Fixed s);
79                 [CCode (cname = "pixman_transform_rotate")]
80                 public Transform.init_translate (Pixman.Fixed tx, Pixman.Fixed ty);
81                 public bool translate (Pixman.Transform reverse, Pixman.Fixed tx, Pixman.Fixed ty);
82                 public bool bounds (Pixman.Box16 b);
83                 public bool is_identity ();
84                 public bool is_scale ();
85                 public bool is_int_translate ();
86                 public bool is_inverse (Pixman.Transform b);
87         }
89         [CCode (cprefix = "PIXMAN_REGION_", has_type_id = false)]
90         public enum RegionOverlap {
91                 OUT,
92                 IN,
93                 PART
94         }
96         [CCode (cname = "pixman_region16_t", has_type_id = false, cprefix = "pixman_region_", destroy_function = "pixman_region_fini")]
97         public struct Region16 {
98                 Pixman.Box16 extents;
100                 public Region16 ();
101                 public Region16.rect (int x, int y, uint width, uint height);
102                 public Region16.rects (Pixman.Box16[] boxes);
103                 public Region16.with_extents (Pixman.Box16 extents);
105                 public void translate (int x, int y);
106                 public bool copy (out Pixman.Region16 region);
107                 [CCode (instance_pos = 1.1)]
108                 public bool intersect (out Pixman.Region16 new_reg, Pixman.Region16 reg2);
109                 [CCode (instance_pos = 1.1)]
110                 public bool union (out Pixman.Region16 new_reg, Pixman.Region16 reg2);
111                 [CCode (instance_pos = 1.1)]
112                 public bool union_rect (out Pixman.Region16 dest, int x, int y, uint width, uint height);
113                 [CCode (instance_pos = 1.1)]
114                 public bool subtract (out Pixman.Region16 reg_d, Pixman.Region16 reg_s);
115                 [CCode (instance_pos = 1.1)]
116                 public bool inverse (out Pixman.Region16 new_reg, Pixman.Box16 inv_rect);
117                 public bool contains_point (int x, int y, Pixman.Box16 box);
118                 public Pixman.RegionOverlap contains_rectangle (Pixman.Box16 prect);
119                 public bool not_empty ();
120                 [CCode (cname = "pixman_region_extents")]
121                 public unowned Pixman.Box16? get_extents ();
122                 public int n_rects ();
123                 public unowned Pixman.Box16[] rectangles ();
124                 public bool equal (Pixman.Region16 region2);
125                 public bool selfcheck ();
126                 public void reset (Pixman.Box16 box);
127         }
129         [CCode (cname = "pixman_box16_t", has_type_id = false)]
130         public struct Box16 {
131                 public int16 x1;
132                 public int16 y1;
133                 public int16 x2;
134                 public int16 y2;
135         }
137         [CCode (cname = "pixman_rectangle16_t", has_type_id = false)]
138         public struct Rectangle16 {
139                 public Pixman.Box16 extents;
140         }
142         [CCode (cname = "pixman_region32_t", has_type_id = false, destroy_function = "pixman_region32_fini")]
143         public struct Region32 {
144                 public Pixman.Box32 extents;
146                 public Region32 ();
147                 public Region32.rect (int x, int y, uint width, uint height);
148                 public Region32.rects (Pixman.Box32[] boxes);
149                 public Region32.with_extents (Pixman.Box32 extents);
151                 public void translate (int x, int y);
152                 public bool copy (out Pixman.Region32 region);
153                 [CCode (instance_pos = 1.1)]
154                 public bool intersect (out Pixman.Region32 new_reg, Pixman.Region32 reg2);
155                 [CCode (instance_pos = 1.1)]
156                 public bool union (out Pixman.Region32 new_reg, Pixman.Region32 reg2);
157                 [CCode (instance_pos = 1.1)]
158                 public bool union_rect (out Pixman.Region32 dest, int x, int y, uint width, uint height);
159                 [CCode (instance_pos = 1.1)]
160                 public bool subtract (out Pixman.Region32 reg_d, Pixman.Region32 reg_s);
161                 [CCode (instance_pos = 1.1)]
162                 public bool inverse (out Pixman.Region32 new_reg, Pixman.Box32 inv_rect);
163                 public bool contains_point (int x, int y, Pixman.Box32 box);
164                 public Pixman.RegionOverlap contains_rectangle (Pixman.Box32 prect);
165                 public bool not_empty ();
166                 [CCode (cname = "pixman_region32_extents")]
167                 public unowned Pixman.Box32? get_extents ();
168                 public int n_rects ();
169                 public unowned Pixman.Box32[] rectangles ();
170                 public bool equal (Pixman.Region32 region2);
171                 public bool selfcheck ();
172                 public void reset (Pixman.Box32 box);
173         }
175         [CCode (cname = "pixman_box32_t", has_type_id = false)]
176         public struct Box32 {
177                 public int32 x1;
178                 public int32 y1;
179                 public int32 x2;
180                 public int32 y2;
181         }
183         [CCode (cname = "pixman_rectangle32_t", has_type_id = false)]
184         public struct Rectangle32 {
185                 public Pixman.Box32 extents;
186         }
188         public static bool blt ([CCode (array_length = false, type = "uint32_t*")] uint8[] src_bits, [CCode (array_length = false, type = "uint32_t*")] uint8[] dst_bits, int src_stride, int dst_stride, int src_bpp, int dst_bpp, int src_x, int src_y, int dst_x, int dst_y, int width, int height);
189         public static bool fill ([CCode (array_length = false, type = "uint32_t*")] uint8[] bits, int stride, int bpp, int x, int y, int width, int height, uint32 _xor);
191         [CCode (cname = "pixman_read_memory_func_t", has_target = false)]
192         public delegate int32 ReadMemoryFunc ([CCode (type = "void*")] uint8[] src);
193         [CCode (cname = "pixman_write_memory_func_t", has_target = false)]
194         public delegate void WriteMemoryFunc ([CCode (type = "void*", array_length = false)] uint8[] dst, uint32 value, int size);
196         [CCode (cname = "struct pixman_gradient_stop", has_type_id = false)]
197         public struct GradientStop {
198                 public Pixman.Fixed x;
199                 public Pixman.Color color;
200         }
202         [CCode (cname = "struct pixman_indexed", has_type_id = false)]
203         public struct Indexed {
204                 public bool color;
205                 public uint32 rgba[256];
206                 public uint8 ent[32768];
207         }
209         [CCode (cname = "enum pixman_repeat_t", has_type_id = false)]
210         public enum Repeat {
211                 NONE,
212                 NORMAL,
213                 PAD,
214                 REFLECT
215         }
217         [CCode (cname = "enum pixman_filter_t", has_type_id = false)]
218         public enum Filter {
219                 FAST,
220                 GOOD,
221                 BEST,
222                 NEAREST,
223                 BILINEAR,
224                 CONVOLUTION
225         }
227         [CCode (cname = "enum pixman_op_t", has_type_id = false, cprefix = "PIXMAN_OP_")]
228         public enum Operation {
229                 CLEAR,
230                 SRC,
231                 DST,
232                 OVER,
233                 OVER_REVERSE,
234                 IN,
235                 IN_REVERSE,
236                 OUT,
237                 OUT_REVERSE,
238                 ATOP,
239                 ATOP_REVERSE,
240                 XOR,
241                 ADD,
242                 SATURATE,
244                 DISJOINT_CLEAR,
245                 DISJOINT_SRC,
246                 DISJOINT_DST,
247                 DISJOINT_OVER,
248                 DISJOINT_OVER_REVERSE,
249                 DISJOINT_IN,
250                 DISJOINT_IN_REVERSE,
251                 DISJOINT_OUT,
252                 DISJOINT_OUT_REVERSE,
253                 DISJOINT_ATOP,
254                 DISJOINT_ATOP_REVERSE,
255                 DISJOINT_XOR,
257                 CONJOINT_CLEAR,
258                 CONJOINT_SRC,
259                 CONJOINT_DST,
260                 CONJOINT_OVER,
261                 CONJOINT_OVER_REVERSE,
262                 CONJOINT_IN,
263                 CONJOINT_IN_REVERSE,
264                 CONJOINT_OUT,
265                 CONJOINT_OUT_REVERSE,
266                 CONJOINT_ATOP,
267                 CONJOINT_ATOP_REVERSE,
268                 CONJOINT_XOR,
270                 MULTIPLY,
271                 SCREEN,
272                 OVERLAY,
273                 DARKEN,
274                 LIGHTEN,
275                 COLOR_DODGE,
276                 COLOR_BURN,
277                 HARD_LIGHT,
278                 SOFT_LIGHT,
279                 DIFFERENCE,
280                 EXCLUSION,
281                 HSL_HUE,
282                 HSL_SATURATION,
283                 HSL_COLOR,
284                 HSL_LUMINOSITY
285         }
287         [CCode (cname = "int", cprefix = "PIXMAN_TYPE_", has_type_id = false)]
288         public enum FormatType {
289                 OTHER,
290                 A,
291                 ARGB,
292                 ABGR,
293                 COLOR,
294                 GRAY,
295                 YUV2,
296                 YV12,
297                 BGRA;
299                 [CCode (cname = "PIXMAN_FORMAT_COLOR")]
300                 public bool is_color ();
301         }
303         [CCode (cname = "pixman_format_code_t", has_type_id = false, cprefix = "PIXMAN_")]
304         public enum Format {
305                 [CCode (cname = "PIXMAN_a8r8g8b8")]
306                 A8R8G8B8,
307                 [CCode (cname = "PIXMAN_x8r8g8b8")]
308                 X8R8G8B8,
309                 [CCode (cname = "PIXMAN_a8b8g8r8")]
310                 A8B8G8R8,
311                 [CCode (cname = "PIXMAN_x8b8g8r8")]
312                 X8B8G8R8,
313                 [CCode (cname = "PIXMAN_b8g8r8a8")]
314                 B8G8R8A8,
315                 [CCode (cname = "PIXMAN_b8g8r8x8")]
316                 B8G8R8X8,
317                 [CCode (cname = "PIXMAN_x14r6g6b6")]
318                 X14R6G6B6,
319                 [CCode (cname = "PIXMAN_x2r10g10b10")]
320                 X2R10G10B10,
321                 [CCode (cname = "PIXMAN_a2r10g10b10")]
322                 A2R10G10B10,
323                 [CCode (cname = "PIXMAN_x2b10g10r10")]
324                 X2B10G10R10,
325                 [CCode (cname = "PIXMAN_a2b10g10r10")]
326                 A2B10G10R10,
327                 [CCode (cname = "PIXMAN_r8g8b8")]
328                 R8G8B8,
329                 [CCode (cname = "PIXMAN_b8g8r8")]
330                 B8G8R8,
331                 [CCode (cname = "PIXMAN_r5g6b5")]
332                 R5G6B5,
333                 [CCode (cname = "PIXMAN_b5g6r5")]
334                 B5G6R5,
335                 [CCode (cname = "PIXMAN_a1r5g5b5")]
336                 A1R5G5B5,
337                 [CCode (cname = "PIXMAN_x1r5g5b5")]
338                 X1R5G5B5,
339                 [CCode (cname = "PIXMAN_a1b5g5r5")]
340                 A1B5G5R5,
341                 [CCode (cname = "PIXMAN_x1b5g5r5")]
342                 X1B5G5R5,
343                 [CCode (cname = "PIXMAN_a4r4g4b4")]
344                 A4R4G4B4,
345                 [CCode (cname = "PIXMAN_x4r4g4b4")]
346                 X4R4G4B4,
347                 [CCode (cname = "PIXMAN_a4b4g4r4")]
348                 A4B4G4R4,
349                 [CCode (cname = "PIXMAN_x4b4g4r4")]
350                 X4B4G4R4,
351                 /* 8bpp formats */
352                 [CCode (cname = "PIXMAN_a8")]
353                 A8,
354                 [CCode (cname = "PIXMAN_r3g3b2")]
355                 R3G3B2,
356                 [CCode (cname = "PIXMAN_b2g3r3")]
357                 B2G3R3,
358                 [CCode (cname = "PIXMAN_a2r2g2b2")]
359                 A2R2G2B2,
360                 [CCode (cname = "PIXMAN_a2b2g2r2")]
361                 A2B2G2R2,
362                 [CCode (cname = "PIXMAN_c8")]
363                 C8,
364                 [CCode (cname = "PIXMAN_g8")]
365                 G8,
366                 [CCode (cname = "PIXMAN_x4a4")]
367                 X4A4,
368                 [CCode (cname = "PIXMAN_x4c4")]
369                 X4C4,
370                 [CCode (cname = "PIXMAN_x4g4")]
371                 X4G4,
372                 /* 4bpp formats */
373                 [CCode (cname = "PIXMAN_a4")]
374                 A4,
375                 [CCode (cname = "PIXMAN_r1g2b1")]
376                 R1G2B1,
377                 [CCode (cname = "PIXMAN_b1g2r1")]
378                 B1G2R1,
379                 [CCode (cname = "PIXMAN_a1r1g1b1")]
380                 A1R1G1B1,
381                 [CCode (cname = "PIXMAN_a1b1g1r1")]
382                 A1B1G1R1,
383                 [CCode (cname = "PIXMAN_c4")]
384                 C4,
385                 [CCode (cname = "PIXMAN_g4")]
386                 G4,
387                 /* 1bpp formats */
388                 [CCode (cname = "PIXMAN_a1")]
389                 A1,
390                 [CCode (cname = "PIXMAN_g1")]
391                 G1,
392                 /* YUV formats */
393                 [CCode (cname = "PIXMAN_yuy2")]
394                 YUY2,
395                 [CCode (cname = "PIXMAN_yv12")]
396                 YV12;
398                 [CCode (cname = "PIXMAN_FORMAT")]
399                 public static Pixman.Format create (int bpp, Pixman.FormatType type, int a, int r, int g, int b);
400                 [CCode (cname = "pixman_format_supported_destination")]
401                 public bool supported_destination ();
402                 [CCode (cname = "pixman_format_supported_source")]
403                 public bool supported_source ();
404         }
406         [CCode (cname = "pixman_image_t", cprefix = "pixman_image_", ref_function = "pixman_image_ref", unref_function = "pixman_image_unref", has_type_id = false)]
407         public class Image {
408                 [CCode (cname = "pixman_image_create_solid_fill")]
409                 public Image.solid_fill (Pixman.Color color);
410                 [CCode (cname = "pixman_image_create_linear_gradient")]
411                 public Image.linear_gradient (Pixman.PointFixed p1, Pixman.PointFixed p2, Pixman.GradientStop[] stops);
412                 [CCode (cname = "pixman_image_create_radial_gradient")]
413                 public Image.radial_gradient (Pixman.PointFixed inner, Pixman.PointFixed outer, Pixman.Fixed inner_radius, Pixman.Fixed outer_radius, Pixman.GradientStop[] stops);
414                 [CCode (cname = "pixman_image_create_conical_gradient")]
415                 public Image.conical_gradient (Pixman.PointFixed center, Pixman.Fixed angle, Pixman.GradientStop[] stops);
416                 [CCode (cname = "pixman_image_create_bits")]
417                 public Image.bits (Pixman.Format format, int width, int height, [CCode (type = "uint32_t*", array_length = false)] uint8[]? bits, int rowstride_bytes);
419                 public bool set_clip_region (Pixman.Region16 clip_region);
420                 public Pixman.Region16 clip_region { set; }
421                 public bool set_clip_region32 (Pixman.Region32 clip_region32);
422                 public Pixman.Region32 clip_region32 { set; }
423                 public void set_has_client_clip (bool client_clip);
424                 public bool has_client_clip { set; }
425                 public bool set_transform (Pixman.Transform transform);
426                 public Pixman.Transform transform { set; }
427                 public void set_repeat (Pixman.Repeat repeat);
428                 public Pixman.Repeat repeat { set; }
429                 public bool set_filter (Pixman.Filter filter, Pixman.Fixed[]? filter_params);
430                 public void set_source_clipping (bool source_clipping);
431                 public bool source_clipping { set; }
432                 public void set_alpha_map (Pixman.Image alpha_map, int16 x, int16 y);
433                 public void set_component_alpha (bool component_alpha);
434                 public bool component_alpha { set; }
435                 public bool set_accessors (Pixman.ReadMemoryFunc read_func, Pixman.WriteMemoryFunc write_func);
436                 public bool set_indexed (Pixman.Indexed indexed);
437                 public Pixman.Indexed indexed { set; }
438                 [CCode (array_length = false)]
439                 public unowned uint32[] get_data ();
440                 public int get_width ();
441                 public int width { get; }
442                 public int get_height ();
443                 public int height { get; }
444                 public int get_stride ();
445                 public int stride { get; }
446                 public int get_depth ();
447                 public int depth { get; }
448                 [CCode (instance_pos = 1.1)]
449                 public bool fill_rectangles (Pixman.Operation op, Pixman.Color color, [CCode (array_length_pos = 2.1)] Pixman.Rectangle16[] rects);
451                 public static bool compute_composite_region (Pixman.Region16 region, Pixman.Image src_image, Pixman.Image? mask_image, Pixman.Image dst_image, int src_x, int src_y, int mask_x, int mask_y, int dest_x, int dest_y, int width, int height);
452                 public static void composite (Pixman.Operation op, Pixman.Image src, Pixman.Image? mask, Pixman.Image dest, int16 src_x, int16 src_y, int16 mask_x, int16 mask_y, int16 dest_x, int16 dest_y, uint16 width, uint16 height);
454                 [CCode (cname = "pixman_rasterize_edges")]
455                 public void rasterize_edges (Pixman.Edge l, Pixman.Edge r, Pixman.Fixed t, Pixman.Fixed b);
456                 [CCode (cname = "pixman_add_traps")]
457                 public void add_traps (int16 x_off, int16 y_off, [CCode (array_length_pos = 2.9)] Pixman.Trap[] traps);
458                 [CCode (cname = "pixman_add_trapezoids")]
459                 public void add_trapezoids (int16 x_off, int y_off, [CCode (array_length_pos = 2.9)] Pixman.Trap[] traps);
460                 [CCode (cname = "pixman_rasterize_trapezoid")]
461                 public void rasterize_trapezoid (Pixman.Trapezoid trap, int x_off, int y_off);
462         }
464         [CCode (cname = "struct pixman_edge", has_type_id = false)]
465         public struct Edge {
466                 public Pixman.Fixed x;
467                 public Pixman.Fixed e;
468                 public Pixman.Fixed stepx;
469                 public Pixman.Fixed signdx;
470                 public Pixman.Fixed dy;
471                 public Pixman.Fixed dx;
473                 public Pixman.Fixed stepx_small;
474                 public Pixman.Fixed stepx_big;
475                 public Pixman.Fixed dx_small;
476                 public Pixman.Fixed dx_big;
478                 public void step (int n);
479                 public Edge (int bpp, Pixman.Fixed y_start, Pixman.Fixed x_top, Pixman.Fixed y_top, Pixman.Fixed x_bot, Pixman.Fixed y_bot);
480                 [CCode (cname = "pixman_line_fixed_edge_init")]
481                 public Edge.line_fixed (int bpp, Pixman.Fixed y, Pixman.LineFixed line, int x_off, int y_off);
482         }
484         [CCode (cname = "struct pixman_trapezoid", has_type_id = false)]
485         public struct Trapezoid {
486                 public Pixman.Fixed top;
487                 public Pixman.Fixed bottom;
488                 public Pixman.LineFixed left;
489                 public Pixman.LineFixed right;
491                 public bool valid ();
492         }
494         [CCode (cname = "struct pixman_span_fix", has_type_id = false)]
495         public struct SpanFix {
496                 public Pixman.Fixed l;
497                 public Pixman.Fixed r;
498                 public Pixman.Fixed y;
499         }
501         [CCode (cname = "struct pixman_trap", has_type_id = false)]
502         public struct Trap {
503                 public Pixman.SpanFix top;
504                 public Pixman.SpanFix bot;
505         }