comparison dwt/internal/gtk/c/cairotypes.d @ 11:5f725d09c076

Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
author John Reimer<terminal.node@gmail.com>
date Sat, 05 Jan 2008 15:13:44 -0800
parents
children b73b14942338
comparison
equal deleted inserted replaced
10:63c023465156 11:5f725d09c076
1 /******************************************************************************
2
3 This file is part of gtkD.
4
5 gtkD is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9
10 gtkD 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
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with gtkD; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19 ******************************************************************************/
20
21 module dwt.internal.gtk.c.cairotypes;
22
23 public import dwt.internal.gtk.c.glibtypes;
24
25 /******************************************************************************
26
27 ******************************************************************************/
28
29 private alias void* HDC;
30
31 //struct Display; // to support XLib surfaces
32 //struct Visual; // to support XLib surfaces
33 //struct Screen; // to support XLib surfaces
34
35 //private alias void* Drawable;
36 //private alias void* Pixmap;
37 //public alias bool cairo_bool_t;
38
39 alias ubyte uchar;
40
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.
47 */
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
52 */
53 public enum cairo_antialias_t
54 {
55 DEFAULT,
56 NONE,
57 GRAY,
58 SUBPIXEL
59 }
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
71 */
72 public enum cairo_fill_rule_t
73 {
74 WINDING,
75 EVEN_ODD
76 }
77 /**
78 * enumeration for style of line-endings
79 * CAIRO_LINE_CAP_BUTT
80 */
81 public enum cairo_line_cap_t
82 {
83 BUTT,
84 ROUND,
85 SQUARE
86 }
87 public enum cairo_line_join_t
88 {
89 MITER,
90 ROUND,
91 BEVEL
92 }
93 public enum cairo_operator_t
94 {
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
109 }
110 public enum cairo_path_data_type_t
111 {
112 MOVE_TO,
113 LINE_TO,
114 CURVE_TO,
115 CLOSE_PATH
116 }
117 public enum cairo_font_slant_t
118 {
119 NORMAL,
120 ITALIC,
121 OBLIQUE
122 }
123 public enum cairo_font_weight_t
124 {
125 NORMAL,
126 BOLD
127 }
128 /**
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
133 */
134 public enum cairo_extend_t
135 {
136 NONE,
137 REPEAT,
138 REFLECT,
139 PAD
140 }
141 public enum cairo_filter_t
142 {
143 FAST,
144 GOOD,
145 BEST,
146 NEAREST,
147 BILINEAR,
148 GAUSSIAN
149 }
150 /**
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
167 */
168 public enum cairo_pattern_type_t
169 {
170 SOLID,
171 SURFACE,
172 LINEAR,
173 RADIAL
174 }
175 /**
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
197 */
198 public enum cairo_font_type_t
199 {
200 TOY,
201 FT,
202 WIN32,
203 ATSUI
204 }
205 /**
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
210 */
211 public enum cairo_subpixel_order_t
212 {
213 DEFAULT,
214 RGB,
215 BGR,
216 VRGB,
217 VBGR
218 }
219 /**
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
228 */
229 public enum cairo_hint_style_t
230 {
231 DEFAULT,
232 NONE,
233 SLIGHT,
234 MEDIUM,
235 FULL
236 }
237 /**
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
244 */
245 public enum cairo_hint_metrics_t
246 {
247 DEFAULT,
248 OFF,
249 ON
250 }
251 /**
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
259 */
260 public enum cairo_content_t
261 {
262 COLOR = 0x1000,
263 ALPHA = 0x2000,
264 COLOR_ALPHA = 0x3000
265 }
266 /**
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
283 */
284 public enum cairo_surface_type_t
285 {
286 IMAGE,
287 PDF,
288 PS,
289 XLIB,
290 XCB,
291 GLITZ,
292 QUARTZ,
293 WIN32,
294 BEOS,
295 DIRECTFB,
296 SVG
297 }
298 /**
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
303 */
304 public enum cairo_format_t
305 {
306 ARGB32,
307 RGB24,
308 A8,
309 A1,
310 RGB16_565
311 }
312 /**
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
320 */
321 public enum cairo_status_t
322 {
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
344 }
345
346 /**
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.
350 */
351 public struct cairo_t{}
352
353
354 /**
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;
366 */
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
374
375
376 /**
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 * unsignedlongindex;
391 */
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
399
400
401 /**
402 * Main Gtk struct.
403 */
404 public struct cairo_pattern_t{}
405
406
407 /**
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().
415 */
416 public struct cairo_font_face_t{}
417
418
419 /**
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.
425 */
426 public struct cairo_scaled_font_t{}
427
428
429 /**
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;
441 */
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
453
454
455 /**
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;
466 */
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
480
481
482 /**
483 * Main Gtk struct.
484 */
485 public struct cairo_font_options_t{}
486
487
488 /**
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().
497 */
498 public struct cairo_surface_t{}
499
500
501 /**
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:
506 */
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
514
515
516 /**
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;
523 */
524 public struct cairo_user_data_key_t{}
525 // int unused;
526 // cairo-Types.html
527
528
529 /*
530 * major:
531 * minor:
532 * micro:
533 */
534 // TODO
535 // #define CAIRO_VERSION_ENCODE(major, minor, micro)
536
537 /*
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.
543 */
544 // void (*cairo_destroy_func_t) (void *data);
545 public typedef extern(C) void function (void*) cairo_destroy_func_t;
546
547 // skipped union cairo_path_data_t
548