alternative to assert
[gtkD.git] / src / cairoLib / cairoLibtypes.d
blob223c659c1bc2d824b52d3ad1b7bd436fc74d4136
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
23 module cairoLib.cairoLibtypes;
26 public import glib.glibtypes;
28 //public import std.c.windows.windows;
29 private alias void* HDC;
31 //struct Display; // to support XLib surfaces
32 //struct Visual; // to support XLib surfaces
33 //struct Screen; // to support XLib surfaces
35 //private alias void* Drawable;
36 //private alias void* Pixmap;
37 //public alias bool cairo_bool_t;
39 alias ubyte uchar;
41 /**
42 * typedef int cairo_bool_t;
43 * cairo_bool_t is used for boolean values. Returns of type
44 * cairo_bool_t will always be either 0 or 1, but testing against
45 * these values explicitly is not encouraged; just use the
46 * value as a boolean condition.
48 public alias int cairo_bool_t;
49 /**
50 * Specifies the type of antialiasing to do when rendering text or shapes.
51 * CAIRO_ANTIALIAS_DEFAULT
53 public enum cairo_antialias_t
55 DEFAULT,
56 NONE,
57 GRAY,
58 SUBPIXEL
60 /**
61 * cairo_fill_rule_t is used to select how paths are filled. For both
62 * fill rules, whether or not a point is included in the fill is
63 * determined by taking a ray from that point to infinity and looking
64 * at intersections with the path. The ray can be in any direction,
65 * as long as it doesn't pass through the end point of a segment
66 * or have a tricky intersection such as intersecting tangent to the path.
67 * (Note that filling is not actually implemented in this way. This
68 * is just a description of the rule that is applied.)
69 * New entries may be added in future versions.
70 * CAIRO_FILL_RULE_WINDING
72 public enum cairo_fill_rule_t
74 WINDING,
75 EVEN_ODD
77 /**
78 * enumeration for style of line-endings
79 * CAIRO_LINE_CAP_BUTT
81 public enum cairo_line_cap_t
83 BUTT,
84 ROUND,
85 SQUARE
87 public enum cairo_line_join_t
89 MITER,
90 ROUND,
91 BEVEL
93 public enum cairo_operator_t
95 CLEAR,
96 SOURCE,
97 OVER,
98 IN,
99 OUT,
100 ATOP,
101 DEST,
102 DEST_OVER,
103 DEST_IN,
104 DEST_OUT,
105 DEST_ATOP,
106 XOR,
107 ADD,
108 SATURATE
110 public enum cairo_path_data_type_t
112 MOVE_TO,
113 LINE_TO,
114 CURVE_TO,
115 CLOSE_PATH
117 public enum cairo_font_slant_t
119 NORMAL,
120 ITALIC,
121 OBLIQUE
123 public enum cairo_font_weight_t
125 NORMAL,
126 BOLD
129 * cairo_extend_t is used to describe how the area outside
130 * of a pattern will be drawn.
131 * New entries may be added in future versions.
132 * CAIRO_EXTEND_NONE
134 public enum cairo_extend_t
136 NONE,
137 REPEAT,
138 REFLECT,
141 public enum cairo_filter_t
143 FAST,
144 GOOD,
145 BEST,
146 NEAREST,
147 BILINEAR,
148 GAUSSIAN
151 * cairo_pattern_type_t is used to describe the type of a given pattern.
152 * The type of a pattern is determined by the function used to create
153 * it. The cairo_pattern_create_rgb() and cairo_pattern_create_rgba()
154 * functions create SOLID patterns. The remaining
155 * cairo_pattern_create functions map to pattern types in obvious
156 * ways.
157 * The pattern type can be queried with cairo_pattern_get_type()
158 * Most cairo_pattern functions can be called with a pattern of any
159 * type, (though trying to change the extend or filter for a solid
160 * pattern will have no effect). A notable exception is
161 * cairo_pattern_add_color_stop_rgb() and
162 * cairo_pattern_add_color_stop_rgba() which must only be called with
163 * gradient patterns (either LINEAR or RADIAL). Otherwise the pattern
164 * will be shutdown and put into an error state.
165 * New entries may be added in future versions.
166 * CAIRO_PATTERN_TYPE_SOLID
168 public enum cairo_pattern_type_t
170 SOLID,
171 SURFACE,
172 LINEAR,
173 RADIAL
176 * cairo_font_type_t is used to describe the type of a given font
177 * face or scaled font. The font types are also known as "font
178 * backends" within cairo.
179 * The type of a font face is determined by the function used to
180 * create it, which will generally be of the form
181 * cairo_type_font_face_create. The font face type can be queried
182 * with cairo_font_face_get_type()
183 * The various cairo_font_face functions can be used with a font face
184 * of any type.
185 * The type of a scaled font is determined by the type of the font
186 * face passed to cairo_scaled_font_create. The scaled font type can
187 * be queried with cairo_scaled_font_get_type()
188 * The various cairo_scaled_font functions can be used with scaled
189 * fonts of any type, but some font backends also provide
190 * type-specific functions that must only be called with a scaled font
191 * of the appropriate type. These functions have names that begin with
192 * cairo_type_scaled_font such as cairo_ft_scaled_font_lock_face.
193 * The behavior of calling a type-specific function with a scaled font
194 * of the wrong type is undefined.
195 * New entries may be added in future versions.
196 * CAIRO_FONT_TYPE_TOY
198 public enum cairo_font_type_t
200 TOY,
202 WIN32,
203 ATSUI
206 * The subpixel order specifies the order of color elements within
207 * each pixel on the display device when rendering with an
208 * antialiasing mode of CAIRO_ANTIALIAS_SUBPIXEL.
209 * CAIRO_SUBPIXEL_ORDER_DEFAULT
211 public enum cairo_subpixel_order_t
213 DEFAULT,
214 RGB,
215 BGR,
216 VRGB,
217 VBGR
220 * Specifies the type of hinting to do on font outlines. Hinting
221 * is the process of fitting outlines to the pixel grid in order
222 * to improve the appearance of the result. Since hinting outlines
223 * involves distorting them, it also reduces the faithfulness
224 * to the original outline shapes. Not all of the outline hinting
225 * styles are supported by all font backends.
226 * New entries may be added in future versions.
227 * CAIRO_HINT_STYLE_DEFAULT
229 public enum cairo_hint_style_t
231 DEFAULT,
232 NONE,
233 SLIGHT,
234 MEDIUM,
235 FULL
238 * Specifies whether to hint font metrics; hinting font metrics
239 * means quantizing them so that they are integer values in
240 * device space. Doing this improves the consistency of
241 * letter and line spacing, however it also means that text
242 * will be laid out differently at different zoom factors.
243 * CAIRO_HINT_METRICS_DEFAULT
245 public enum cairo_hint_metrics_t
247 DEFAULT,
248 OFF,
252 * cairo_content_t is used to describe the content that a surface will
253 * contain, whether color information, alpha information (translucence
254 * vs. opacity), or both.
255 * Note: The large values here are designed to keep cairo_content_t
256 * values distinct from cairo_format_t values so that the
257 * implementation can detect the error if users confuse the two types.
258 * CAIRO_CONTENT_COLOR
260 public enum cairo_content_t
262 COLOR = 0x1000,
263 ALPHA = 0x2000,
264 COLOR_ALPHA = 0x3000
267 * cairo_surface_type_t is used to describe the type of a given
268 * surface. The surface types are also known as "backends" or "surface
269 * backends" within cairo.
270 * The type of a surface is determined by the function used to create
271 * it, which will generally be of the form cairo_type_surface_create,
272 * (though see cairo_surface_create_similar as well).
273 * The surface type can be queried with cairo_surface_get_type()
274 * The various cairo_surface functions can be used with surfaces of
275 * any type, but some backends also provide type-specific functions
276 * that must only be called with a surface of the appropriate
277 * type. These functions have names that begin with
278 * cairo_type_surface such as cairo_image_surface_get_width().
279 * The behavior of calling a type-specific function with a surface of
280 * the wrong type is undefined.
281 * New entries may be added in future versions.
282 * CAIRO_SURFACE_TYPE_IMAGE
284 public enum cairo_surface_type_t
286 IMAGE,
287 PDF,
289 XLIB,
290 XCB,
291 GLITZ,
292 QUARTZ,
293 WIN32,
294 BEOS,
295 DIRECTFB,
299 * cairo_format_t is used to identify the memory format of
300 * image data.
301 * New entries may be added in future versions.
302 * CAIRO_FORMAT_ARGB32
304 public enum cairo_format_t
306 ARGB32,
307 RGB24,
310 RGB16_565
313 * cairo_status_t is used to indicate errors that can occur when
314 * using Cairo. In some cases it is returned directly by functions.
315 * but when using cairo_t, the last error, if any, is stored in
316 * the context and can be retrieved with cairo_status().
317 * New entries may be added in future versions. Use cairo_status_to_string()
318 * to get a human-readable representation of an error message.
319 * CAIRO_STATUS_SUCCESS
321 public enum cairo_status_t
323 SUCCESS = 0,
324 NO_MEMORY,
325 INVALID_RESTORE,
326 INVALID_POP_GROUP,
327 NO_CURRENT_POINT,
328 INVALID_MATRIX,
329 INVALID_STATUS,
330 NULL_POINTER,
331 INVALID_STRING,
332 INVALID_PATH_DATA,
333 READ_ERROR,
334 WRITE_ERROR,
335 SURFACE_FINISHED,
336 SURFACE_TYPE_MISMATCH,
337 PATTERN_TYPE_MISMATCH,
338 INVALID_CONTENT,
339 INVALID_FORMAT,
340 INVALID_VISUAL,
341 FILE_NOT_FOUND,
342 INVALID_DASH,
343 INVALID_DSC_COMMENT
347 * Main Gtk struct.
348 * A cairo_t contains the current state of the rendering device,
349 * including coordinates of yet to be drawn shapes.
351 public struct cairo_t{}
355 * A data structure for holding a path. This data structure serves as
356 * the return value for cairo_copy_path() and
357 * cairo_copy_path_flat() as well the input value for
358 * cairo_append_path().
359 * See cairo_path_data_t for hints on how to iterate over the
360 * actual data within the path.
361 * The num_data member gives the number of elements in the data
362 * array. This number is larger than the number of independent path
363 * portions (defined in cairo_path_data_type_t), since the data
364 * includes both headers and coordinates for each portion.
365 * cairo_status_tstatus;
367 public struct cairo_path_t{}
368 // cairo_status_t status;
369 // cairo-Paths.html
370 // cairo_path_data_t *data;
371 // cairo-Paths.html
372 // int numData;
373 // cairo-Paths.html
377 * The cairo_glyph_t structure holds information about a single glyph
378 * when drawing or measuring text. A font is (in simple terms) a
379 * collection of shapes used to draw text. A glyph is one of these
380 * shapes. There can be multiple glyphs for a single character
381 * (alternates to be used in different contexts, for example), or a
382 * glyph can be a ligature of multiple
383 * characters. Cairo doesn't expose any way of converting input text
384 * into glyphs, so in order to use the Cairo interfaces that take
385 * arrays of glyphs, you must directly access the appropriate
386 * underlying font system.
387 * Note that the offsets given by x and y are not cumulative. When
388 * drawing or measuring text, each glyph is individually positioned
389 * with respect to the overall origin
390 * doublex;
392 public struct cairo_glyph_t{}
393 // unsigned long index;
394 // cairo-Text.html
395 // double x;
396 // cairo-Text.html
397 // double y;
398 // cairo-Text.html
402 * Main Gtk struct.
404 public struct cairo_pattern_t{}
408 * Main Gtk struct.
409 * A cairo_font_face_t specifies all aspects of a font other
410 * than the size or font matrix (a font matrix is used to distort
411 * a font by sheering it or scaling it unequally in the two
412 * directions) . A font face can be set on a cairo_t by using
413 * cairo_set_font_face(); the size and font matrix are set with
414 * cairo_set_font_size() and cairo_set_font_matrix().
416 public struct cairo_font_face_t{}
420 * Main Gtk struct.
421 * A cairo_scaled_font_t is a font scaled to a particular size and device
422 * resolution. A cairo_scaled_font_t is most useful for low-level font
423 * usage where a library or application wants to cache a reference
424 * to a scaled font to speed up the computation of metrics.
426 public struct cairo_scaled_font_t{}
430 * The cairo_font_extents_t structure stores metric information for
431 * a font. Values are given in the current user-space coordinate
432 * system.
433 * Because font metrics are in user-space coordinates, they are
434 * mostly, but not entirely, independent of the current transformation
435 * matrix. If you call cairo_scale(cr, 2.0, 2.0),
436 * text will be drawn twice as big, but the reported text extents will
437 * not be doubled. They will change slightly due to hinting (so you
438 * can't assume that metrics are independent of the transformation
439 * matrix), but otherwise will remain unchanged.
440 * doubleascent;
442 public struct cairo_font_extents_t{}
443 // double ascent;
444 // cairo-Scaled-Fonts.html
445 // double descent;
446 // cairo-Scaled-Fonts.html
447 // double height;
448 // cairo-Scaled-Fonts.html
449 // double maxXAdvance;
450 // cairo-Scaled-Fonts.html
451 // double maxYAdvance;
452 // cairo-Scaled-Fonts.html
456 * The cairo_text_extents_t structure stores the extents of a single
457 * glyph or a string of glyphs in user-space coordinates. Because text
458 * extents are in user-space coordinates, they are mostly, but not
459 * entirely, independent of the current transformation matrix. If you call
460 * cairo_scale(cr, 2.0, 2.0), text will
461 * be drawn twice as big, but the reported text extents will not be
462 * doubled. They will change slightly due to hinting (so you can't
463 * assume that metrics are independent of the transformation matrix),
464 * but otherwise will remain unchanged.
465 * doublex_bearing;
467 public struct cairo_text_extents_t{}
468 // double xBearing;
469 // cairo-Scaled-Fonts.html
470 // double yBearing;
471 // cairo-Scaled-Fonts.html
472 // double width;
473 // cairo-Scaled-Fonts.html
474 // double height;
475 // cairo-Scaled-Fonts.html
476 // double xAdvance;
477 // cairo-Scaled-Fonts.html
478 // double yAdvance;
479 // cairo-Scaled-Fonts.html
483 * Main Gtk struct.
485 public struct cairo_font_options_t{}
489 * Main Gtk struct.
490 * A cairo_surface_t represents an image, either as the destination
491 * of a drawing operation or as source when drawing onto another
492 * surface. There are different subtypes of cairo_surface_t for
493 * different drawing backends; for example, cairo_image_surface_create()
494 * creates a bitmap image in memory.
495 * Memory management of cairo_surface_t is done with
496 * cairo_surface_reference() and cairo_surface_destroy().
498 public struct cairo_surface_t{}
502 * Main Gtk struct.
503 * A cairo_matrix_t holds an affine transformation, such as a scale,
504 * rotation, shear, or a combination of those. The transformation of
505 * a point (x, y) is given by:
507 public struct cairo_matrix_t{}
508 // double xx; double yx;
509 // cairo-cairo-matrix-t.html
510 // double xy; double yy;
511 // cairo-cairo-matrix-t.html
512 // double x0; double y0;
513 // cairo-cairo-matrix-t.html
517 * cairo_user_data_key_t is used for attaching user data to cairo
518 * data structures. The actual contents of the struct is never used,
519 * and there is no need to initialize the object; only the unique
520 * address of a cairo_data_key_t object is used. Typically, you
521 * would just use the address of a static cairo_data_key_t object.
522 * intunused;
524 public struct cairo_user_data_key_t{}
525 // int unused;
526 // cairo-Types.html
530 * major:
531 * minor:
532 * micro:
534 // TODO
535 // #define CAIRO_VERSION_ENCODE(major, minor, micro)
538 * cairo_destroy_func_t the type of function which is called when a
539 * data element is destroyed. It is passed the pointer to the data
540 * element and should free any memory and resources allocated for it.
541 * data:
542 * The data element being destroyed.
544 // void (*cairo_destroy_func_t) (void *data);
545 public typedef extern(C) void function (void*) cairo_destroy_func_t;
547 // skipped union cairo_path_data_t