Subversion Repositories Kolibri OS

Rev

Rev 1892 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1892 Rev 3959
Line 42... Line 42...
42
#include "cairo.h"
42
#include "cairo.h"
43
#include "cairo-fixed-type-private.h"
43
#include "cairo-fixed-type-private.h"
44
#include "cairo-list-private.h"
44
#include "cairo-list-private.h"
45
#include "cairo-reference-count-private.h"
45
#include "cairo-reference-count-private.h"
Line -... Line 46...
-
 
46
 
-
 
47
CAIRO_BEGIN_DECLS
46
 
48
 
47
/**
49
/**
48
 * SECTION:cairo-types
50
 * SECTION:cairo-types
49
 * @Title: Types
51
 * @Title: Types
50
 * @Short_Description: Generic data types
52
 * @Short_Description: Generic data types
51
 *
53
 *
52
 * This section lists generic data types used in the cairo API.
54
 * This section lists generic data types used in the cairo API.
Line 53... Line 55...
53
 */
55
 **/
54
 
56
 
55
typedef struct _cairo_array cairo_array_t;
57
typedef struct _cairo_array cairo_array_t;
56
typedef struct _cairo_backend cairo_backend_t;
58
typedef struct _cairo_backend cairo_backend_t;
57
typedef struct _cairo_boxes_t cairo_boxes_t;
59
typedef struct _cairo_boxes_t cairo_boxes_t;
58
typedef struct _cairo_cache cairo_cache_t;
60
typedef struct _cairo_cache cairo_cache_t;
59
typedef struct _cairo_composite_rectangles cairo_composite_rectangles_t;
61
typedef struct _cairo_composite_rectangles cairo_composite_rectangles_t;
60
typedef struct _cairo_clip cairo_clip_t;
62
typedef struct _cairo_clip cairo_clip_t;
61
typedef struct _cairo_clip_path cairo_clip_path_t;
63
typedef struct _cairo_clip_path cairo_clip_path_t;
-
 
64
typedef struct _cairo_color cairo_color_t;
-
 
65
typedef struct _cairo_color_stop cairo_color_stop_t;
-
 
66
typedef struct _cairo_contour cairo_contour_t;
-
 
67
typedef struct _cairo_contour_chain cairo_contour_chain_t;
62
typedef struct _cairo_color cairo_color_t;
68
typedef struct _cairo_contour_iter cairo_contour_iter_t;
63
typedef struct _cairo_color_stop cairo_color_stop_t;
69
typedef struct _cairo_damage cairo_damage_t;
64
typedef struct _cairo_device_backend cairo_device_backend_t;
70
typedef struct _cairo_device_backend cairo_device_backend_t;
-
 
71
typedef struct _cairo_font_face_backend     cairo_font_face_backend_t;
-
 
72
typedef struct _cairo_gstate cairo_gstate_t;
65
typedef struct _cairo_font_face_backend     cairo_font_face_backend_t;
73
typedef struct _cairo_gstate_backend cairo_gstate_backend_t;
66
typedef struct _cairo_gstate cairo_gstate_t;
74
typedef struct _cairo_glyph_text_info cairo_glyph_text_info_t;
67
typedef struct _cairo_hash_entry cairo_hash_entry_t;
75
typedef struct _cairo_hash_entry cairo_hash_entry_t;
68
typedef struct _cairo_hash_table cairo_hash_table_t;
76
typedef struct _cairo_hash_table cairo_hash_table_t;
69
typedef struct _cairo_image_surface cairo_image_surface_t;
77
typedef struct _cairo_image_surface cairo_image_surface_t;
70
typedef struct _cairo_mime_data cairo_mime_data_t;
78
typedef struct _cairo_mime_data cairo_mime_data_t;
71
typedef struct _cairo_observer cairo_observer_t;
79
typedef struct _cairo_observer cairo_observer_t;
72
typedef struct _cairo_output_stream cairo_output_stream_t;
80
typedef struct _cairo_output_stream cairo_output_stream_t;
73
typedef struct _cairo_paginated_surface_backend cairo_paginated_surface_backend_t;
81
typedef struct _cairo_paginated_surface_backend cairo_paginated_surface_backend_t;
74
typedef struct _cairo_path_fixed cairo_path_fixed_t;
-
 
75
typedef struct _cairo_rectangle_int16 cairo_glyph_size_t;
82
typedef struct _cairo_path_fixed cairo_path_fixed_t;
76
typedef struct _cairo_scaled_font_backend   cairo_scaled_font_backend_t;
83
typedef struct _cairo_rectangle_int16 cairo_glyph_size_t;
-
 
84
typedef struct _cairo_scaled_font_subsets cairo_scaled_font_subsets_t;
77
typedef struct _cairo_scaled_font_subsets cairo_scaled_font_subsets_t;
85
typedef struct _cairo_solid_pattern cairo_solid_pattern_t;
-
 
86
typedef struct _cairo_surface_attributes cairo_surface_attributes_t;
78
typedef struct _cairo_solid_pattern cairo_solid_pattern_t;
87
typedef struct _cairo_surface_backend cairo_surface_backend_t;
79
typedef struct _cairo_surface_backend cairo_surface_backend_t;
88
typedef struct _cairo_surface_observer cairo_surface_observer_t;
80
typedef struct _cairo_surface_snapshot cairo_surface_snapshot_t;
89
typedef struct _cairo_surface_snapshot cairo_surface_snapshot_t;
-
 
90
typedef struct _cairo_surface_subsurface cairo_surface_subsurface_t;
-
 
91
typedef struct _cairo_surface_wrapper cairo_surface_wrapper_t;
81
typedef struct _cairo_surface_subsurface cairo_surface_subsurface_t;
92
typedef struct _cairo_traps cairo_traps_t;
82
typedef struct _cairo_surface_wrapper cairo_surface_wrapper_t;
93
typedef struct _cairo_tristrip cairo_tristrip_t;
Line 83... Line 94...
83
typedef struct _cairo_unscaled_font_backend cairo_unscaled_font_backend_t;
94
typedef struct _cairo_unscaled_font_backend cairo_unscaled_font_backend_t;
Line -... Line 95...
-
 
95
typedef struct _cairo_xlib_screen_info cairo_xlib_screen_info_t;
-
 
96
 
-
 
97
typedef cairo_array_t cairo_user_data_array_t;
-
 
98
 
-
 
99
typedef struct _cairo_scaled_font_private cairo_scaled_font_private_t;
-
 
100
typedef struct _cairo_scaled_font_backend   cairo_scaled_font_backend_t;
-
 
101
typedef struct _cairo_scaled_glyph cairo_scaled_glyph_t;
-
 
102
typedef struct _cairo_scaled_glyph_private cairo_scaled_glyph_private_t;
-
 
103
 
-
 
104
typedef struct cairo_compositor cairo_compositor_t;
-
 
105
typedef struct cairo_fallback_compositor cairo_fallback_compositor_t;
84
typedef struct _cairo_xlib_screen_info cairo_xlib_screen_info_t;
106
typedef struct cairo_mask_compositor cairo_mask_compositor_t;
85
 
107
typedef struct cairo_traps_compositor cairo_traps_compositor_t;
86
typedef cairo_array_t cairo_user_data_array_t;
108
typedef struct cairo_spans_compositor cairo_spans_compositor_t;
87
 
109
 
Line 107... Line 129...
107
 * which then allows a pointer to my_entry_t to be passed to any of
129
 * which then allows a pointer to my_entry_t to be passed to any of
108
 * the #cairo_hash_table_t functions as follows without requiring a cast:
130
 * the #cairo_hash_table_t functions as follows without requiring a cast:
109
 *
131
 *
110
 *	_cairo_hash_table_insert (hash_table, &my_entry->base);
132
 *	_cairo_hash_table_insert (hash_table, &my_entry->base);
111
 *
133
 *
112
 * IMPORTANT: The caller is reponsible for initializing
134
 * IMPORTANT: The caller is responsible for initializing
113
 * my_entry->base.hash with a hash code derived from the key. The
135
 * my_entry->base.hash with a hash code derived from the key. The
114
 * essential property of the hash code is that keys_equal must never
136
 * essential property of the hash code is that keys_equal must never
115
 * return %TRUE for two keys that have different hashes. The best hash
137
 * return %TRUE for two keys that have different hashes. The best hash
116
 * code will reduce the frequency of two keys with the same code for
138
 * code will reduce the frequency of two keys with the same code for
117
 * which keys_equal returns %FALSE.
139
 * which keys_equal returns %FALSE.
Line 130... Line 152...
130
 
152
 
131
struct _cairo_array {
153
struct _cairo_array {
132
    unsigned int size;
154
    unsigned int size;
133
    unsigned int num_elements;
155
    unsigned int num_elements;
134
    unsigned int element_size;
156
    unsigned int element_size;
135
    char **elements;
-
 
136
 
-
 
137
    cairo_bool_t is_snapshot;
157
    char *elements;
Line 138... Line 158...
138
};
158
};
139
 
159
 
140
/**
160
/**
Line 159... Line 179...
159
    CAIRO_LCD_FILTER_INTRA_PIXEL,
179
    CAIRO_LCD_FILTER_INTRA_PIXEL,
160
    CAIRO_LCD_FILTER_FIR3,
180
    CAIRO_LCD_FILTER_FIR3,
161
    CAIRO_LCD_FILTER_FIR5
181
    CAIRO_LCD_FILTER_FIR5
162
} cairo_lcd_filter_t;
182
} cairo_lcd_filter_t;
Line -... Line 183...
-
 
183
 
-
 
184
typedef enum _cairo_round_glyph_positions {
-
 
185
    CAIRO_ROUND_GLYPH_POS_DEFAULT,
-
 
186
    CAIRO_ROUND_GLYPH_POS_ON,
-
 
187
    CAIRO_ROUND_GLYPH_POS_OFF
-
 
188
} cairo_round_glyph_positions_t;
163
 
189
 
164
struct _cairo_font_options {
190
struct _cairo_font_options {
165
    cairo_antialias_t antialias;
191
    cairo_antialias_t antialias;
166
    cairo_subpixel_order_t subpixel_order;
192
    cairo_subpixel_order_t subpixel_order;
167
    cairo_lcd_filter_t lcd_filter;
193
    cairo_lcd_filter_t lcd_filter;
168
    cairo_hint_style_t hint_style;
194
    cairo_hint_style_t hint_style;
-
 
195
    cairo_hint_metrics_t hint_metrics;
-
 
196
    cairo_round_glyph_positions_t round_glyph_positions;
-
 
197
};
-
 
198
 
-
 
199
struct _cairo_glyph_text_info {
-
 
200
    const char *utf8;
-
 
201
    int utf8_len;
-
 
202
 
-
 
203
    const cairo_text_cluster_t *clusters;
-
 
204
    int num_clusters;
169
    cairo_hint_metrics_t hint_metrics;
205
    cairo_text_cluster_flags_t cluster_flags;
Line -... Line 206...
-
 
206
};
170
};
207
 
171
 
208
 
172
/* XXX: Right now, the _cairo_color structure puts unpremultiplied
209
/* XXX: Right now, the _cairo_color structure puts unpremultiplied
173
   color in the doubles and premultiplied color in the shorts. Yes,
210
   color in the doubles and premultiplied color in the shorts. Yes,
174
   this is crazy insane, (but at least we don't export this
211
   this is crazy insane, (but at least we don't export this
Line 205... Line 242...
205
    CAIRO_PAGINATED_MODE_ANALYZE,	/* analyze page regions */
242
    CAIRO_PAGINATED_MODE_ANALYZE,	/* analyze page regions */
206
    CAIRO_PAGINATED_MODE_RENDER,	/* render page contents */
243
    CAIRO_PAGINATED_MODE_RENDER,	/* render page contents */
207
    CAIRO_PAGINATED_MODE_FALLBACK 	/* paint fallback images */
244
    CAIRO_PAGINATED_MODE_FALLBACK	/* paint fallback images */
208
} cairo_paginated_mode_t;
245
} cairo_paginated_mode_t;
Line 209... Line -...
209
 
-
 
210
/* Sure wish C had a real enum type so that this would be distinct
-
 
211
 * from #cairo_status_t. Oh well, without that, I'll use this bogus 100
-
 
212
 * offset.  We want to keep it fit in int8_t as the compiler may choose
-
 
213
 * that for #cairo_status_t */
-
 
214
typedef enum _cairo_int_status {
-
 
215
    CAIRO_INT_STATUS_UNSUPPORTED = 100,
-
 
216
    CAIRO_INT_STATUS_DEGENERATE,
-
 
217
    CAIRO_INT_STATUS_NOTHING_TO_DO,
-
 
218
    CAIRO_INT_STATUS_FLATTEN_TRANSPARENCY,
-
 
219
    CAIRO_INT_STATUS_IMAGE_FALLBACK,
-
 
220
    CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN,
-
 
221
 
-
 
222
    CAIRO_INT_STATUS_LAST_STATUS
-
 
223
} cairo_int_status_t;
-
 
224
 
246
 
225
typedef enum _cairo_internal_surface_type {
247
typedef enum _cairo_internal_surface_type {
226
    CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT = 0x1000,
248
    CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT = 0x1000,
227
    CAIRO_INTERNAL_SURFACE_TYPE_PAGINATED,
249
    CAIRO_INTERNAL_SURFACE_TYPE_PAGINATED,
-
 
250
    CAIRO_INTERNAL_SURFACE_TYPE_ANALYSIS,
228
    CAIRO_INTERNAL_SURFACE_TYPE_ANALYSIS,
251
    CAIRO_INTERNAL_SURFACE_TYPE_OBSERVER,
229
    CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
252
    CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
230
    CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED,
253
    CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED,
231
    CAIRO_INTERNAL_SURFACE_TYPE_TEST_WRAPPING,
254
    CAIRO_INTERNAL_SURFACE_TYPE_TEST_WRAPPING,
232
    CAIRO_INTERNAL_SURFACE_TYPE_NULL,
255
    CAIRO_INTERNAL_SURFACE_TYPE_NULL,
233
    CAIRO_INTERNAL_SURFACE_TYPE_TYPE3_GLYPH
256
    CAIRO_INTERNAL_SURFACE_TYPE_TYPE3_GLYPH
Line -... Line 257...
-
 
257
} cairo_internal_surface_type_t;
-
 
258
 
-
 
259
typedef enum _cairo_internal_device_type {
-
 
260
    CAIRO_INTERNAL_DEVICE_TYPE_OBSERVER = 0x1000,
234
} cairo_internal_surface_type_t;
261
} cairo_device_surface_type_t;
235
 
-
 
236
#define CAIRO_HAS_TEST_PAGINATED_SURFACE 1
-
 
Line 237... Line 262...
237
#define CAIRO_HAS_TEST_NULL_SURFACE 1
262
 
238
#define CAIRO_HAS_TEST_WRAPPING_SURFACE 1
263
#define CAIRO_HAS_TEST_PAGINATED_SURFACE 1
239
 
264
 
240
typedef struct _cairo_slope {
265
typedef struct _cairo_slope {
Line 245... Line 270...
245
typedef struct _cairo_point_double {
270
typedef struct _cairo_point_double {
246
    double x;
271
    double x;
247
    double y;
272
    double y;
248
} cairo_point_double_t;
273
} cairo_point_double_t;
Line -... Line 274...
-
 
274
 
-
 
275
typedef struct _cairo_circle_double {
-
 
276
    cairo_point_double_t center;
-
 
277
    double               radius;
-
 
278
} cairo_circle_double_t;
249
 
279
 
250
typedef struct _cairo_distance_double {
280
typedef struct _cairo_distance_double {
251
    double dx;
281
    double dx;
252
    double dy;
282
    double dy;
Line -... Line 283...
-
 
283
} cairo_distance_double_t;
-
 
284
 
-
 
285
typedef struct _cairo_box_double {
-
 
286
    cairo_point_double_t p1;
-
 
287
    cairo_point_double_t p2;
253
} cairo_distance_double_t;
288
} cairo_box_double_t;
254
 
289
 
255
typedef struct _cairo_line {
290
typedef struct _cairo_line {
256
    cairo_point_t p1;
291
    cairo_point_t p1;
Line 281... Line 316...
281
} cairo_edge_t;
316
} cairo_edge_t;
Line 282... Line 317...
282
 
317
 
283
typedef struct _cairo_polygon {
318
typedef struct _cairo_polygon {
Line 284... Line -...
284
    cairo_status_t status;
-
 
285
 
-
 
286
    cairo_point_t first_point;
-
 
287
    cairo_point_t last_point;
-
 
288
    cairo_point_t current_point;
-
 
289
    cairo_slope_t current_edge;
-
 
290
    cairo_bool_t has_current_point;
-
 
291
    cairo_bool_t has_current_edge;
319
    cairo_status_t status;
292
 
320
 
293
    cairo_box_t extents;
321
    cairo_box_t extents;
294
    cairo_box_t limit;
322
    cairo_box_t limit;
Line 301... Line 329...
301
    cairo_edge_t  edges_embedded[32];
329
    cairo_edge_t  edges_embedded[32];
302
} cairo_polygon_t;
330
} cairo_polygon_t;
Line 303... Line 331...
303
 
331
 
304
typedef cairo_warn cairo_status_t
332
typedef cairo_warn cairo_status_t
305
(*cairo_spline_add_point_func_t) (void *closure,
333
(*cairo_spline_add_point_func_t) (void *closure,
-
 
334
				  const cairo_point_t *point,
Line 306... Line 335...
306
				  const cairo_point_t *point);
335
				  const cairo_slope_t *tangent);
307
 
336
 
308
typedef struct _cairo_spline_knots {
337
typedef struct _cairo_spline_knots {
Line 368... Line 397...
368
    CAIRO_IMAGE_HAS_BILEVEL_ALPHA,
397
    CAIRO_IMAGE_HAS_BILEVEL_ALPHA,
369
    CAIRO_IMAGE_HAS_ALPHA,
398
    CAIRO_IMAGE_HAS_ALPHA,
370
    CAIRO_IMAGE_UNKNOWN
399
    CAIRO_IMAGE_UNKNOWN
371
} cairo_image_transparency_t;
400
} cairo_image_transparency_t;
Line -... Line 401...
-
 
401
 
-
 
402
typedef enum _cairo_image_color {
-
 
403
    CAIRO_IMAGE_IS_COLOR,
-
 
404
    CAIRO_IMAGE_IS_GRAYSCALE,
-
 
405
    CAIRO_IMAGE_IS_MONOCHROME,
-
 
406
    CAIRO_IMAGE_UNKNOWN_COLOR
-
 
407
} cairo_image_color_t;
-
 
408
 
372
 
409
 
373
struct _cairo_mime_data {
410
struct _cairo_mime_data {
374
    cairo_reference_count_t ref_count;
411
    cairo_reference_count_t ref_count;
375
    unsigned char *data;
412
    unsigned char *data;
376
    unsigned long length;
413
    unsigned long length;
377
    cairo_destroy_func_t destroy;
414
    cairo_destroy_func_t destroy;
378
    void *closure;
415
    void *closure;
Line 379... Line -...
379
};
-
 
380
 
-
 
381
struct _cairo_pattern {
-
 
382
    cairo_pattern_type_t	type;
-
 
383
    cairo_reference_count_t	ref_count;
-
 
384
    cairo_status_t		status;
-
 
385
    cairo_user_data_array_t	user_data;
-
 
386
 
-
 
387
    cairo_matrix_t		matrix;
-
 
388
    cairo_filter_t		filter;
-
 
389
    cairo_extend_t		extend;
-
 
390
 
-
 
391
    cairo_bool_t		has_component_alpha;
-
 
392
};
-
 
393
 
-
 
394
struct _cairo_solid_pattern {
-
 
395
    cairo_pattern_t base;
-
 
396
    cairo_color_t color;
-
 
397
};
-
 
398
 
-
 
399
typedef struct _cairo_surface_pattern {
-
 
400
    cairo_pattern_t base;
-
 
401
 
-
 
402
    cairo_surface_t *surface;
-
 
403
} cairo_surface_pattern_t;
-
 
404
 
-
 
405
typedef struct _cairo_gradient_stop {
-
 
406
    double offset;
-
 
407
    cairo_color_stop_t color;
-
 
408
} cairo_gradient_stop_t;
-
 
409
 
-
 
410
typedef struct _cairo_gradient_pattern {
-
 
411
    cairo_pattern_t base;
-
 
412
 
-
 
413
    unsigned int	    n_stops;
-
 
414
    unsigned int	    stops_size;
-
 
415
    cairo_gradient_stop_t  *stops;
-
 
416
    cairo_gradient_stop_t   stops_embedded[2];
-
 
417
} cairo_gradient_pattern_t;
-
 
418
 
-
 
419
typedef struct _cairo_linear_pattern {
-
 
420
    cairo_gradient_pattern_t base;
-
 
421
 
-
 
422
    cairo_point_t p1;
-
 
423
    cairo_point_t p2;
-
 
424
} cairo_linear_pattern_t;
-
 
425
 
-
 
426
typedef struct _cairo_radial_pattern {
-
 
427
    cairo_gradient_pattern_t base;
-
 
428
 
-
 
429
    cairo_point_t c1;
-
 
430
    cairo_fixed_t r1;
-
 
431
    cairo_point_t c2;
-
 
432
    cairo_fixed_t r2;
-
 
433
} cairo_radial_pattern_t;
-
 
434
 
-
 
435
typedef union {
-
 
436
    cairo_gradient_pattern_t base;
-
 
437
 
-
 
438
    cairo_linear_pattern_t linear;
-
 
439
    cairo_radial_pattern_t radial;
-
 
440
} cairo_gradient_pattern_union_t;
-
 
441
 
-
 
442
typedef union {
-
 
443
    cairo_pattern_type_t	    type;
-
 
444
    cairo_pattern_t		    base;
-
 
445
 
-
 
446
    cairo_solid_pattern_t	    solid;
-
 
447
    cairo_surface_pattern_t	    surface;
-
 
448
    cairo_gradient_pattern_union_t  gradient;
-
 
449
} cairo_pattern_union_t;
416
};
450
 
417
 
451
/*
418
/*
452
 * A #cairo_unscaled_font_t is just an opaque handle we use in the
419
 * A #cairo_unscaled_font_t is just an opaque handle we use in the
453
 * glyph cache.
420
 * glyph cache.
454
 */
421
 */
455
typedef struct _cairo_unscaled_font {
422
typedef struct _cairo_unscaled_font {
456
    cairo_hash_entry_t			 hash_entry;
423
    cairo_hash_entry_t			 hash_entry;
457
    cairo_reference_count_t		 ref_count;
424
    cairo_reference_count_t		 ref_count;
-
 
425
    const cairo_unscaled_font_backend_t	*backend;
Line 458... Line -...
458
    const cairo_unscaled_font_backend_t	*backend;
-
 
459
} cairo_unscaled_font_t;
-
 
460
 
-
 
461
typedef struct _cairo_scaled_glyph {
-
 
462
    cairo_hash_entry_t hash_entry;
-
 
463
 
-
 
464
    cairo_text_extents_t    metrics;		/* user-space metrics */
-
 
465
    cairo_text_extents_t    fs_metrics;		/* font-space metrics */
-
 
466
    cairo_box_t		    bbox;		/* device-space bounds */
-
 
467
    int16_t                 x_advance;		/* device-space rounded X advance */
-
 
468
    int16_t                 y_advance;		/* device-space rounded Y advance */
-
 
469
 
-
 
470
    unsigned int	    has_info;
-
 
471
    cairo_image_surface_t   *surface;		/* device-space image */
-
 
472
    cairo_path_fixed_t	    *path;		/* device-space outline */
-
 
473
    cairo_surface_t         *recording_surface;	/* device-space recording-surface */
-
 
474
 
426
} cairo_unscaled_font_t;