w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cairo-types-private.h
Go to the documentation of this file.
1 /* -*- Mode: c; tab-width: 8; c-basic-offset: 4; indent-tabs-mode: t; -*- */
2 /* cairo - a vector graphics library with display and print output
3  *
4  * Copyright © 2002 University of Southern California
5  * Copyright © 2005 Red Hat, Inc.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it either under the terms of the GNU Lesser General Public
9  * License version 2.1 as published by the Free Software Foundation
10  * (the "LGPL") or, at your option, under the terms of the Mozilla
11  * Public License Version 1.1 (the "MPL"). If you do not alter this
12  * notice, a recipient may use your version of this file under either
13  * the MPL or the LGPL.
14  *
15  * You should have received a copy of the LGPL along with this library
16  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
18  * You should have received a copy of the MPL along with this library
19  * in the file COPYING-MPL-1.1
20  *
21  * The contents of this file are subject to the Mozilla Public License
22  * Version 1.1 (the "License"); you may not use this file except in
23  * compliance with the License. You may obtain a copy of the License at
24  * http://www.mozilla.org/MPL/
25  *
26  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
27  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
28  * the specific language governing rights and limitations.
29  *
30  * The Original Code is the cairo graphics library.
31  *
32  * The Initial Developer of the Original Code is University of Southern
33  * California.
34  *
35  * Contributor(s):
36  * Carl D. Worth <cworth@cworth.org>
37  */
38 
39 #ifndef CAIRO_TYPES_PRIVATE_H
40 #define CAIRO_TYPES_PRIVATE_H
41 
42 #include "cairo.h"
44 #include "cairo-list-private.h"
46 
48 
49 /**
50  * SECTION:cairo-types
51  * @Title: Types
52  * @Short_Description: Generic data types
53  *
54  * This section lists generic data types used in the cairo API.
55  **/
56 
57 typedef struct _cairo_array cairo_array_t;
58 typedef struct _cairo_backend cairo_backend_t;
59 typedef struct _cairo_boxes_t cairo_boxes_t;
60 typedef struct _cairo_cache cairo_cache_t;
62 typedef struct _cairo_clip cairo_clip_t;
63 typedef struct _cairo_clip_path cairo_clip_path_t;
64 typedef struct _cairo_color cairo_color_t;
66 typedef struct _cairo_contour cairo_contour_t;
69 typedef struct _cairo_damage cairo_damage_t;
72 typedef struct _cairo_gstate cairo_gstate_t;
73 typedef struct _cairo_gstate_backend cairo_gstate_backend_t;
78 typedef struct _cairo_mime_data cairo_mime_data_t;
79 typedef struct _cairo_observer cairo_observer_t;
83 typedef struct _cairo_rectangle_int16 cairo_glyph_size_t;
92 typedef struct _cairo_traps cairo_traps_t;
93 typedef struct _cairo_tristrip cairo_tristrip_t;
95 typedef struct _cairo_xlib_screen_info cairo_xlib_screen_info_t;
96 
98 
103 
104 typedef struct cairo_compositor cairo_compositor_t;
105 typedef struct cairo_fallback_compositor cairo_fallback_compositor_t;
109 
112  void (*callback) (cairo_observer_t *self, void *arg);
113 };
114 
115 /**
116  * _cairo_hash_entry:
117  *
118  * A #cairo_hash_entry_t contains both a key and a value for
119  * #cairo_hash_table_t. User-derived types for #cairo_hash_entry_t must
120  * be type-compatible with this structure (eg. they must have an
121  * unsigned long as the first parameter. The easiest way to get this
122  * is to use:
123  *
124  * typedef _my_entry {
125  * cairo_hash_entry_t base;
126  * ... Remainder of key and value fields here ..
127  * } my_entry_t;
128  *
129  * which then allows a pointer to my_entry_t to be passed to any of
130  * the #cairo_hash_table_t functions as follows without requiring a cast:
131  *
132  * _cairo_hash_table_insert (hash_table, &my_entry->base);
133  *
134  * IMPORTANT: The caller is responsible for initializing
135  * my_entry->base.hash with a hash code derived from the key. The
136  * essential property of the hash code is that keys_equal must never
137  * return %TRUE for two keys that have different hashes. The best hash
138  * code will reduce the frequency of two keys with the same code for
139  * which keys_equal returns %FALSE.
140  *
141  * Which parts of the entry make up the "key" and which part make up
142  * the value are entirely up to the caller, (as determined by the
143  * computation going into base.hash as well as the keys_equal
144  * function). A few of the #cairo_hash_table_t functions accept an entry
145  * which will be used exclusively as a "key", (indicated by a
146  * parameter name of key). In these cases, the value-related fields of
147  * the entry need not be initialized if so desired.
148  **/
150  unsigned long hash;
151 };
152 
153 struct _cairo_array {
154  unsigned int size;
155  unsigned int num_elements;
156  unsigned int element_size;
157  char *elements;
158 };
159 
160 /**
161  * _cairo_lcd_filter:
162  * @CAIRO_LCD_FILTER_DEFAULT: Use the default LCD filter for
163  * font backend and target device
164  * @CAIRO_LCD_FILTER_NONE: Do not perform LCD filtering
165  * @CAIRO_LCD_FILTER_INTRA_PIXEL: Intra-pixel filter
166  * @CAIRO_LCD_FILTER_FIR3: FIR filter with a 3x3 kernel
167  * @CAIRO_LCD_FILTER_FIR5: FIR filter with a 5x5 kernel
168  *
169  * The LCD filter specifies the low-pass filter applied to LCD-optimized
170  * bitmaps generated with an antialiasing mode of %CAIRO_ANTIALIAS_SUBPIXEL.
171  *
172  * Note: This API was temporarily made available in the public
173  * interface during the 1.7.x development series, but was made private
174  * before 1.8.
175  **/
176 typedef enum _cairo_lcd_filter {
183 
189 
197  char *variations;
198 };
199 
201  const char *utf8;
202  int utf8_len;
203 
207 };
208 
209 
210 /* XXX: Right now, the _cairo_color structure puts unpremultiplied
211  color in the doubles and premultiplied color in the shorts. Yes,
212  this is crazy insane, (but at least we don't export this
213  madness). I'm still working on a cleaner API, but in the meantime,
214  at least this does prevent precision loss in color when changing
215  alpha. */
216 struct _cairo_color {
217  double red;
218  double green;
219  double blue;
220  double alpha;
221 
222  unsigned short red_short;
223  unsigned short green_short;
224  unsigned short blue_short;
225  unsigned short alpha_short;
226 };
227 
229  /* unpremultiplied */
230  double red;
231  double green;
232  double blue;
233  double alpha;
234 
235  /* unpremultipled, for convenience */
240 };
241 
242 typedef enum _cairo_paginated_mode {
243  CAIRO_PAGINATED_MODE_ANALYZE, /* analyze page regions */
244  CAIRO_PAGINATED_MODE_RENDER, /* render page contents */
245  CAIRO_PAGINATED_MODE_FALLBACK /* paint fallback images */
247 
259 
263 
264 #define CAIRO_HAS_TEST_PAGINATED_SURFACE 1
265 
266 typedef struct _cairo_slope {
270 
271 typedef struct _cairo_point_double {
272  double x;
273  double y;
275 
276 typedef struct _cairo_circle_double {
278  double radius;
280 
281 typedef struct _cairo_distance_double {
282  double dx;
283  double dy;
285 
286 typedef struct _cairo_box_double {
290 
291 typedef struct _cairo_line {
295 
296 typedef struct _cairo_trapezoid {
300 
301 typedef struct _cairo_point_int {
302  int x, y;
304 
305 #define CAIRO_RECT_INT_MIN (INT_MIN >> CAIRO_FIXED_FRAC_BITS)
306 #define CAIRO_RECT_INT_MAX (INT_MAX >> CAIRO_FIXED_FRAC_BITS)
307 
308 typedef enum _cairo_direction {
312 
313 typedef struct _cairo_edge {
315  int top, bottom;
316  int dir;
318 
319 typedef struct _cairo_polygon {
321 
326 
332 
335  const cairo_point_t *point,
336  const cairo_slope_t *tangent);
337 
338 typedef struct _cairo_spline_knots {
341 
342 typedef struct _cairo_spline {
344  void *closure;
345 
347 
350 
354 
355 typedef struct _cairo_pen_vertex {
357 
361 
362 typedef struct _cairo_pen {
363  double radius;
364  double tolerance;
365 
370 
371 typedef struct _cairo_stroke_style {
372  double line_width;
375  double miter_limit;
376  double *dash;
377  unsigned int num_dashes;
378  double dash_offset;
380 
381 typedef struct _cairo_format_masks {
382  int bpp;
383  unsigned long alpha_mask;
384  unsigned long red_mask;
385  unsigned long green_mask;
386  unsigned long blue_mask;
388 
389 typedef enum {
394 } cairo_stock_t;
395 
402 
403 typedef enum _cairo_image_color {
409 
410 
413  unsigned char *data;
414  unsigned long length;
416  void *closure;
417 };
418 
419 /*
420  * A #cairo_unscaled_font_t is just an opaque handle we use in the
421  * glyph cache.
422  */
423 typedef struct _cairo_unscaled_font {
429 
430 #endif /* CAIRO_TYPES_PRIVATE_H */
#define cairo_warn
int32_t cairo_fixed_t
@ CAIRO_STOCK_BLACK
@ CAIRO_STOCK_WHITE
@ CAIRO_STOCK_NUM_COLORS
@ CAIRO_STOCK_TRANSPARENT
_cairo_image_transparency
@ CAIRO_IMAGE_IS_OPAQUE
@ CAIRO_IMAGE_HAS_ALPHA
@ CAIRO_IMAGE_UNKNOWN
@ CAIRO_IMAGE_HAS_BILEVEL_ALPHA
enum _cairo_lcd_filter cairo_lcd_filter_t
struct _cairo_point_double cairo_point_double_t
struct _cairo_spline_knots cairo_spline_knots_t
struct _cairo_distance_double cairo_distance_double_t
enum _cairo_image_color cairo_image_color_t
cairo_array_t cairo_user_data_array_t
_cairo_lcd_filter
@ CAIRO_LCD_FILTER_FIR5
@ CAIRO_LCD_FILTER_INTRA_PIXEL
@ CAIRO_LCD_FILTER_DEFAULT
@ CAIRO_LCD_FILTER_FIR3
@ CAIRO_LCD_FILTER_NONE
_cairo_paginated_mode
@ CAIRO_PAGINATED_MODE_ANALYZE
@ CAIRO_PAGINATED_MODE_RENDER
@ CAIRO_PAGINATED_MODE_FALLBACK
struct _cairo_stroke_style cairo_stroke_style_t
struct _cairo_slope cairo_slope_t
struct _cairo_box_double cairo_box_double_t
_cairo_internal_surface_type
@ CAIRO_INTERNAL_SURFACE_TYPE_PAGINATED
@ CAIRO_INTERNAL_SURFACE_TYPE_TEST_WRAPPING
@ CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED
@ CAIRO_INTERNAL_SURFACE_TYPE_TYPE3_GLYPH
@ CAIRO_INTERNAL_SURFACE_TYPE_OBSERVER
@ CAIRO_INTERNAL_SURFACE_TYPE_NULL
@ CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK
@ CAIRO_INTERNAL_SURFACE_TYPE_ANALYSIS
@ CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT
enum _cairo_round_glyph_positions cairo_round_glyph_positions_t
struct _cairo_point_int cairo_point_int_t
struct _cairo_trapezoid cairo_trapezoid_t
struct _cairo_rectangle_int16 cairo_glyph_size_t
struct _cairo_gstate_backend cairo_gstate_backend_t
_cairo_internal_device_type
@ CAIRO_INTERNAL_DEVICE_TYPE_OBSERVER
enum _cairo_paginated_mode cairo_paginated_mode_t
struct _cairo_unscaled_font cairo_unscaled_font_t
enum _cairo_internal_device_type cairo_device_surface_type_t
struct _cairo_line cairo_line_t
enum _cairo_direction cairo_direction_t
_cairo_round_glyph_positions
@ CAIRO_ROUND_GLYPH_POS_DEFAULT
@ CAIRO_ROUND_GLYPH_POS_ON
@ CAIRO_ROUND_GLYPH_POS_OFF
struct _cairo_pen_vertex cairo_pen_vertex_t
struct _cairo_polygon cairo_polygon_t
struct _cairo_format_masks cairo_format_masks_t
enum _cairo_image_transparency cairo_image_transparency_t
struct _cairo_spline cairo_spline_t
cairo_status_t(* cairo_spline_add_point_func_t)(void *closure, const cairo_point_t *point, const cairo_slope_t *tangent)
struct _cairo_edge cairo_edge_t
struct _cairo_pen cairo_pen_t
_cairo_image_color
@ CAIRO_IMAGE_UNKNOWN_COLOR
@ CAIRO_IMAGE_IS_MONOCHROME
@ CAIRO_IMAGE_IS_GRAYSCALE
@ CAIRO_IMAGE_IS_COLOR
enum _cairo_internal_surface_type cairo_internal_surface_type_t
struct _cairo_slope cairo_distance_t
struct _cairo_line cairo_box_t
_cairo_direction
@ CAIRO_DIRECTION_REVERSE
@ CAIRO_DIRECTION_FORWARD
struct _cairo_circle_double cairo_circle_double_t
struct cairo_fallback_compositor cairo_fallback_compositor_t
struct _cairo_xlib_screen_info cairo_xlib_screen_info_t
#define CAIRO_BEGIN_DECLS
Definition: cairo.h:49
enum _cairo_hint_style cairo_hint_style_t
enum _cairo_antialias cairo_antialias_t
#define CAIRO_END_DECLS
Definition: cairo.h:50
int cairo_bool_t
Definition: cairo.h:107
enum _cairo_line_cap cairo_line_cap_t
enum _cairo_status cairo_status_t
void(* cairo_destroy_func_t)(void *data)
Definition: cairo.h:232
enum _cairo_subpixel_order cairo_subpixel_order_t
enum _cairo_hint_metrics cairo_hint_metrics_t
enum _cairo_text_cluster_flags cairo_text_cluster_flags_t
enum _cairo_line_join cairo_line_join_t
static void
Definition: fpif.c:118
unsigned short uint16_t
Definition: stdint.h:79
char * closure
Definition: font.h:85
static double tangent(dpoint_t p0, dpoint_t p1, dpoint_t p2, dpoint_t p3, dpoint_t q0, dpoint_t q1)
Definition: trace.c:231
unsigned int num_elements
unsigned int element_size
unsigned int size
cairo_point_double_t p1
cairo_point_double_t p2
cairo_point_double_t center
unsigned short red_short
unsigned short green_short
unsigned short alpha_short
unsigned short blue_short
cairo_line_t line
cairo_round_glyph_positions_t round_glyph_positions
cairo_subpixel_order_t subpixel_order
cairo_antialias_t antialias
cairo_hint_style_t hint_style
cairo_hint_metrics_t hint_metrics
cairo_lcd_filter_t lcd_filter
const cairo_text_cluster_t * clusters
cairo_text_cluster_flags_t cluster_flags
unsigned long hash
cairo_point_t p2
cairo_point_t p1
cairo_destroy_func_t destroy
cairo_reference_count_t ref_count
unsigned char * data
void(* callback)(cairo_observer_t *self, void *arg)
cairo_pen_vertex_t vertices_embedded[32]
cairo_pen_vertex_t * vertices
const cairo_box_t * limits
cairo_edge_t * edges
cairo_edge_t edges_embedded[32]
cairo_status_t status
cairo_fixed_t dx
cairo_fixed_t dy
cairo_bool_t has_point
cairo_slope_t initial_slope
cairo_spline_add_point_func_t add_point_func
cairo_spline_knots_t knots
cairo_slope_t final_slope
cairo_point_t last_point
cairo_line_cap_t line_cap
cairo_line_join_t line_join
cairo_reference_count_t ref_count
cairo_hash_entry_t hash_entry
const cairo_unscaled_font_backend_t * backend
Definition: mpost.c:238