Add experimental generation of .gir and .typelib
[libprolooks.git] / vapi / pixman.vapi
blob094d94a8f5c3df94b0c83e38c6afee8e48f86c97
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3  * pixman.vapi
4  * Copyright (C) Nicolas Bruguier 2009 <gandalfn@club-internet.fr>
5  * 
6  * maiawm is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published
8  * by the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  * 
11  * maiawm is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU Lesser General Public License for more details.
15  * 
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
20 [CCode (cprefix = "Pixman", lower_case_cprefix = "pixman_", cheader_filename = "pixman.h")]
21 namespace Pixman 
23         [SimpleType]
24         [CCode (cname = "pixman_fixed_t")]
25         [IntegerType (rank = 6)]
26         public struct Fixed {
27                 [CCode (cname = "pixman_fixed_to_double")]
28                 public Pixman.double to_double();
29                 [CCode (cname = "pixman_fixed_to_int")]
30                 public Pixman.int to_int();
31                 [CCode (cname = "pixman_fixed_ceil")]
32                 public Fixed ceil();
33         }
35         [CCode (cname = "int")]
36         [IntegerType (rank = 6)]
37         public struct int {
38                 [CCode (cname = "pixman_int_to_fixed")]
39                 public Fixed to_fixed();
40         }
42         [CCode (cname = "double", default_value = "0.0")]
43         [FloatingType (rank = 2)]
44         public struct double {
45                 [CCode (cname = "pixman_double_to_fixed")]
46                 public Fixed to_fixed();
47         }
49         [CCode (cname = "pixman_box32_t")]
50         public struct Box32 {
51                 public int32 x1;
52                 public int32 y1;
53                 public int32 x2;
54                 public int32 y2;
55         }
57         [CCode (cname = "pixman_region32_t")]
58         public struct Region32 {
59                 public Box32 extents;
61                 public void init ();
62                 public void init_rect (int x, int y, uint width, uint height);
63                 public bool init_rects (Box32 boxes, int count);
64                 public void init_with_extents (Box32 extents);
65                 public void fini ();
67                 public bool copy (Region32 inRegion);
69                 public bool not_empty ();
70                 [CCode (cname = "pixman_region32_extents")]
71                 public unowned Box32* get_extents();
72                 public unowned Box32[] rectangles();
73                 public bool subtract (Region32 reg_m, Region32 reg_s);
74                 public bool union (Region32 reg_m, Region32 reg_s);
75                 public bool intersect (Region32 reg_m, Region32 reg_s);
76         }
78         [CCode (cname = "pixman_filter_t")]
79         public enum Filter {
80                 FAST,
81                 GOOD,
82                 BEST,
83                 NEAREST,
84                 BILINEAR,
85                 CONVOLUTION
86         }
88         [CCode (cname = "pixman_op_t")]
89         public enum Op {
90                 CLEAR,
91                 SRC,
92                 DST,
93                 OVER,
94                 OVER_REVERSE,
95                 IN,
96                 IN_REVERSE,
97                 OUT,
98                 OUT_REVERSE,
99                 ATOP,
100                 ATOP_REVERSE,
101                 XOR,
102                 ADD,
103                 SATURATE,
105                 DISJOINT_CLEAR,
106                 DISJOINT_SRC,
107                 DISJOINT_DST,
108                 DISJOINT_OVER,
109                 DISJOINT_OVER_REVERSE,
110                 DISJOINT_IN,
111                 DISJOINT_IN_REVERSE,
112                 DISJOINT_OUT,
113                 DISJOINT_OUT_REVERSE,
114                 DISJOINT_ATOP,
115                 DISJOINT_ATOP_REVERSE,
116                 DISJOINT_XOR,
118                 CONJOINT_CLEAR,
119                 CONJOINT_SRC,
120                 CONJOINT_DST,
121                 CONJOINT_OVER,
122                 CONJOINT_OVER_REVERSE,
123                 CONJOINT_IN,
124                 CONJOINT_IN_REVERSE,
125                 CONJOINT_OUT,
126                 CONJOINT_OUT_REVERSE,
127                 CONJOINT_ATOP,
128                 CONJOINT_ATOP_REVERSE,
129                 CONJOINT_XOR,
131                 MULTIPLY,
132                 SCREEN,
133                 OVERLAY,
134                 DARKEN,
135                 LIGHTEN,
136                 COLOR_DODGE,
137                 COLOR_BURN,
138                 HARD_LIGHT,
139                 SOFT_LIGHT,
140                 DIFFERENCE,
141                 EXCLUSION,
142                 HSL_HUE,
143                 HSL_SATURATION,
144                 HSL_COLOR,
145                 HSL_LUMINOSITY,
147                 NONE
148         }
150         [CCode (cname = "pixman_format_code_t", cprefix = "PIXMAN_")]
151         public enum Format {
152                 a8r8g8b8,
153                 x8r8g8b8,
154                 a8b8g8r8,
155                 x8b8g8r8,
156                 b8g8r8a8,
157                 b8g8r8x8,
158                 x2r10g10b10,
159                 a2r10g10b10,
160                 x2b10g10r10,
161                 a2b10g10r10,
163                 /* 24bpp formats */
164                 r8g8b8,
165                 b8g8r8,
166     
167                 /* 16bpp formats */
168                 r5g6b5,
169                 b5g6r5,
170     
171                 a1r5g5b5,
172                 x1r5g5b5,
173                 a1b5g5r5,
174                 x1b5g5r5,
175                 a4r4g4b4,
176                 x4r4g4b4,
177                 a4b4g4r4,
178                 x4b4g4r4,
179     
180                 /* 8bpp formats */
181                 a8,
182                 r3g3b2,
183                 b2g3r3,
184                 a2r2g2b2,
185                 a2b2g2r2,
186     
187                 c8,
188                 g8,
189     
190                 x4a4,
191     
192                 x4c4,
193                 x4g4,
194     
195                 /* 4bpp formats */
196                 a4,
197                 r1g2b1,
198                 b1g2r1,
199                 a1r1g1b1,
200                 a1b1g1r1,
201     
202                 c4,
203                 g4,
204     
205                 /* 1bpp formats */
206                 a1,    
207                 g1,
209                 /* YUV formats */
210                 yuy2,
211                 yv12
212         }
214         [Compact]
215         [CCode (ref_function = "pixman_image_ref", unref_function = "pixman_image_unref", cname = "pixman_image_t")]
216         public class Image {
217                 [CCode (cname = "pixman_image_create_bits")]
218                         public Image.for_bits (Format format, int width, int height, [CCode (array_length = false)] uchar[] bits, int rowstride_bytes);
220                 [CCode (cname = "pixman_image_set_filter")]
221                 public int set_filter (Pixman.Filter filter, [CCode (array_length = false)] Pixman.Fixed[] params, int n_filter_params);
222         }       
224         [CCode (cname = "pixman_image_composite")]
225         public static void image_composite (Op op, Image src, Image? mask, Image dest, int16 src_x, int16 src_y, int16 mask_x, int16 mask_y, int16 dest_x, int16 dest_y, uint16 width, uint16 height);