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 99... Line 99...
99
 * 
99
 * 
100
 *  if (cairo_in_stroke (cr, x, y)) {
100
 *  if (cairo_in_stroke (cr, x, y)) {
101
 *      /* do something */
101
 *      /* do something */
102
 *  }
102
 *  }
103
 * 
103
 * 
-
 
104
 *
-
 
105
 * Since: 1.0
104
 **/
106
 **/
105
typedef int cairo_bool_t;
107
typedef int cairo_bool_t;
Line 106... Line 108...
106
 
108
 
107
/**
109
/**
Line 114... Line 116...
114
 * cairo and all drawing with cairo is always done to a #cairo_t
116
 * cairo and all drawing with cairo is always done to a #cairo_t
115
 * object.
117
 * object.
116
 *
118
 *
117
 * Memory management of #cairo_t is done with
119
 * Memory management of #cairo_t is done with
118
 * cairo_reference() and cairo_destroy().
120
 * cairo_reference() and cairo_destroy().
-
 
121
 *
-
 
122
 * Since: 1.0
119
 **/
123
 **/
120
typedef struct _cairo cairo_t;
124
typedef struct _cairo cairo_t;
Line 121... Line 125...
121
 
125
 
122
/**
126
/**
Line 141... Line 145...
141
 * not modified; for example, cairo_image_surface_create_for_data() and
145
 * not modified; for example, cairo_image_surface_create_for_data() and
142
 * cairo_xlib_surface_create().
146
 * cairo_xlib_surface_create().
143
 *
147
 *
144
 * Memory management of #cairo_surface_t is done with
148
 * Memory management of #cairo_surface_t is done with
145
 * cairo_surface_reference() and cairo_surface_destroy().
149
 * cairo_surface_reference() and cairo_surface_destroy().
-
 
150
 *
-
 
151
 * Since: 1.0
146
 **/
152
 **/
147
typedef struct _cairo_surface cairo_surface_t;
153
typedef struct _cairo_surface cairo_surface_t;
Line 148... Line 154...
148
 
154
 
149
/**
155
/**
150
 * cairo_device_t:
156
 * cairo_device_t:
151
 *
157
 *
152
 * A #cairo_device_t represents the driver interface for drawing
158
 * A #cairo_device_t represents the driver interface for drawing
153
 * operations to a #cairo_surface_t.  There are different subtypes of
159
 * operations to a #cairo_surface_t.  There are different subtypes of
154
 * #cairo_device_t for different drawing backends; for example,
160
 * #cairo_device_t for different drawing backends; for example,
155
 * cairo_xcb_device_create() creates a device that wraps the connection
161
 * cairo_egl_device_create() creates a device that wraps an EGL display and
156
 * to an X Windows System using the XCB library.
162
 * context.
157
 *
163
 *
158
 * The type of a device can be queried with cairo_device_get_type().
164
 * The type of a device can be queried with cairo_device_get_type().
159
 *
165
 *
160
 * Memory management of #cairo_device_t is done with
166
 * Memory management of #cairo_device_t is done with
Line 178... Line 184...
178
 * a point (x, y) is given by:
184
 * a point (x, y) is given by:
179
 * 
185
 * 
180
 *     x_new = xx * x + xy * y + x0;
186
 *     x_new = xx * x + xy * y + x0;
181
 *     y_new = yx * x + yy * y + y0;
187
 *     y_new = yx * x + yy * y + y0;
182
 * 
188
 * 
-
 
189
 *
-
 
190
 * Since: 1.0
183
 **/
191
 **/
184
typedef struct _cairo_matrix {
192
typedef struct _cairo_matrix {
185
    double xx; double yx;
193
    double xx; double yx;
186
    double xy; double yy;
194
    double xy; double yy;
187
    double x0; double y0;
195
    double x0; double y0;
Line 194... Line 202...
194
 * surface. There are different subtypes of #cairo_pattern_t,
202
 * surface. There are different subtypes of #cairo_pattern_t,
195
 * for different types of sources; for example,
203
 * for different types of sources; for example,
196
 * cairo_pattern_create_rgb() creates a pattern for a solid
204
 * cairo_pattern_create_rgb() creates a pattern for a solid
197
 * opaque color.
205
 * opaque color.
198
 *
206
 *
-
 
207
 * Other than various
199
 * Other than various cairo_pattern_create_type()
208
 * cairo_pattern_create_type()
200
 * functions, some of the pattern types can be implicitly created
209
 * functions, some of the pattern types can be implicitly created using various
201
 * using various cairo_set_source_type() functions;
210
 * cairo_set_source_type() functions;
202
 * for example cairo_set_source_rgb().
211
 * for example cairo_set_source_rgb().
203
 *
212
 *
204
 * The type of a pattern can be queried with cairo_pattern_get_type().
213
 * The type of a pattern can be queried with cairo_pattern_get_type().
205
 *
214
 *
206
 * Memory management of #cairo_pattern_t is done with
215
 * Memory management of #cairo_pattern_t is done with
207
 * cairo_pattern_reference() and cairo_pattern_destroy().
216
 * cairo_pattern_reference() and cairo_pattern_destroy().
-
 
217
 *
-
 
218
 * Since: 1.0
208
 **/
219
 **/
209
typedef struct _cairo_pattern cairo_pattern_t;
220
typedef struct _cairo_pattern cairo_pattern_t;
Line 210... Line 221...
210
 
221
 
211
/**
222
/**
212
 * cairo_destroy_func_t:
223
 * cairo_destroy_func_t:
213
 * @data: The data element being destroyed.
224
 * @data: The data element being destroyed.
214
 *
225
 *
215
 * #cairo_destroy_func_t the type of function which is called when a
226
 * #cairo_destroy_func_t the type of function which is called when a
216
 * data element is destroyed. It is passed the pointer to the data
227
 * data element is destroyed. It is passed the pointer to the data
-
 
228
 * element and should free any memory and resources allocated for it.
-
 
229
 *
217
 * element and should free any memory and resources allocated for it.
230
 * Since: 1.0
218
 **/
231
 **/
Line 219... Line 232...
219
typedef void (*cairo_destroy_func_t) (void *data);
232
typedef void (*cairo_destroy_func_t) (void *data);
220
 
233
 
Line 225... Line 238...
225
 * #cairo_user_data_key_t is used for attaching user data to cairo
238
 * #cairo_user_data_key_t is used for attaching user data to cairo
226
 * data structures.  The actual contents of the struct is never used,
239
 * data structures.  The actual contents of the struct is never used,
227
 * and there is no need to initialize the object; only the unique
240
 * and there is no need to initialize the object; only the unique
228
 * address of a #cairo_data_key_t object is used.  Typically, you
241
 * address of a #cairo_data_key_t object is used.  Typically, you
229
 * would just use the address of a static #cairo_data_key_t object.
242
 * would just use the address of a static #cairo_data_key_t object.
-
 
243
 *
-
 
244
 * Since: 1.0
230
 **/
245
 **/
231
typedef struct _cairo_user_data_key {
246
typedef struct _cairo_user_data_key {
232
    int unused;
247
    int unused;
233
} cairo_user_data_key_t;
248
} cairo_user_data_key_t;
Line 234... Line 249...
234
 
249
 
235
/**
250
/**
236
 * cairo_status_t:
251
 * cairo_status_t:
237
 * @CAIRO_STATUS_SUCCESS: no error has occurred
252
 * @CAIRO_STATUS_SUCCESS: no error has occurred (Since 1.0)
238
 * @CAIRO_STATUS_NO_MEMORY: out of memory
253
 * @CAIRO_STATUS_NO_MEMORY: out of memory (Since 1.0)
239
 * @CAIRO_STATUS_INVALID_RESTORE: cairo_restore() called without matching cairo_save()
254
 * @CAIRO_STATUS_INVALID_RESTORE: cairo_restore() called without matching cairo_save() (Since 1.0)
240
 * @CAIRO_STATUS_INVALID_POP_GROUP: no saved group to pop, i.e. cairo_pop_group() without matching cairo_push_group()
255
 * @CAIRO_STATUS_INVALID_POP_GROUP: no saved group to pop, i.e. cairo_pop_group() without matching cairo_push_group() (Since 1.0)
241
 * @CAIRO_STATUS_NO_CURRENT_POINT: no current point defined
256
 * @CAIRO_STATUS_NO_CURRENT_POINT: no current point defined (Since 1.0)
242
 * @CAIRO_STATUS_INVALID_MATRIX: invalid matrix (not invertible)
257
 * @CAIRO_STATUS_INVALID_MATRIX: invalid matrix (not invertible) (Since 1.0)
243
 * @CAIRO_STATUS_INVALID_STATUS: invalid value for an input #cairo_status_t
258
 * @CAIRO_STATUS_INVALID_STATUS: invalid value for an input #cairo_status_t (Since 1.0)
244
 * @CAIRO_STATUS_NULL_POINTER: %NULL pointer
259
 * @CAIRO_STATUS_NULL_POINTER: %NULL pointer (Since 1.0)
245
 * @CAIRO_STATUS_INVALID_STRING: input string not valid UTF-8
260
 * @CAIRO_STATUS_INVALID_STRING: input string not valid UTF-8 (Since 1.0)
246
 * @CAIRO_STATUS_INVALID_PATH_DATA: input path data not valid
261
 * @CAIRO_STATUS_INVALID_PATH_DATA: input path data not valid (Since 1.0)
247
 * @CAIRO_STATUS_READ_ERROR: error while reading from input stream
262
 * @CAIRO_STATUS_READ_ERROR: error while reading from input stream (Since 1.0)
248
 * @CAIRO_STATUS_WRITE_ERROR: error while writing to output stream
263
 * @CAIRO_STATUS_WRITE_ERROR: error while writing to output stream (Since 1.0)
249
 * @CAIRO_STATUS_SURFACE_FINISHED: target surface has been finished
264
 * @CAIRO_STATUS_SURFACE_FINISHED: target surface has been finished (Since 1.0)
250
 * @CAIRO_STATUS_SURFACE_TYPE_MISMATCH: the surface type is not appropriate for the operation
265
 * @CAIRO_STATUS_SURFACE_TYPE_MISMATCH: the surface type is not appropriate for the operation (Since 1.0)
251
 * @CAIRO_STATUS_PATTERN_TYPE_MISMATCH: the pattern type is not appropriate for the operation
266
 * @CAIRO_STATUS_PATTERN_TYPE_MISMATCH: the pattern type is not appropriate for the operation (Since 1.0)
252
 * @CAIRO_STATUS_INVALID_CONTENT: invalid value for an input #cairo_content_t
267
 * @CAIRO_STATUS_INVALID_CONTENT: invalid value for an input #cairo_content_t (Since 1.0)
253
 * @CAIRO_STATUS_INVALID_FORMAT: invalid value for an input #cairo_format_t
268
 * @CAIRO_STATUS_INVALID_FORMAT: invalid value for an input #cairo_format_t (Since 1.0)
254
 * @CAIRO_STATUS_INVALID_VISUAL: invalid value for an input Visual*
269
 * @CAIRO_STATUS_INVALID_VISUAL: invalid value for an input Visual* (Since 1.0)
255
 * @CAIRO_STATUS_FILE_NOT_FOUND: file not found
270
 * @CAIRO_STATUS_FILE_NOT_FOUND: file not found (Since 1.0)
256
 * @CAIRO_STATUS_INVALID_DASH: invalid value for a dash setting
271
 * @CAIRO_STATUS_INVALID_DASH: invalid value for a dash setting (Since 1.0)
257
 * @CAIRO_STATUS_INVALID_DSC_COMMENT: invalid value for a DSC comment (Since 1.2)
272
 * @CAIRO_STATUS_INVALID_DSC_COMMENT: invalid value for a DSC comment (Since 1.2)
258
 * @CAIRO_STATUS_INVALID_INDEX: invalid index passed to getter (Since 1.4)
273
 * @CAIRO_STATUS_INVALID_INDEX: invalid index passed to getter (Since 1.4)
259
 * @CAIRO_STATUS_CLIP_NOT_REPRESENTABLE: clip region not representable in desired format (Since 1.4)
274
 * @CAIRO_STATUS_CLIP_NOT_REPRESENTABLE: clip region not representable in desired format (Since 1.4)
260
 * @CAIRO_STATUS_TEMP_FILE_ERROR: error creating or writing to a temporary file (Since 1.6)
275
 * @CAIRO_STATUS_TEMP_FILE_ERROR: error creating or writing to a temporary file (Since 1.6)
Line 268... Line 283...
268
 * @CAIRO_STATUS_INVALID_WEIGHT: invalid value for an input #cairo_font_weight_t (Since 1.8)
283
 * @CAIRO_STATUS_INVALID_WEIGHT: invalid value for an input #cairo_font_weight_t (Since 1.8)
269
 * @CAIRO_STATUS_INVALID_SIZE: invalid value (typically too big) for the size of the input (surface, pattern, etc.) (Since 1.10)
284
 * @CAIRO_STATUS_INVALID_SIZE: invalid value (typically too big) for the size of the input (surface, pattern, etc.) (Since 1.10)
270
 * @CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED: user-font method not implemented (Since 1.10)
285
 * @CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED: user-font method not implemented (Since 1.10)
271
 * @CAIRO_STATUS_DEVICE_TYPE_MISMATCH: the device type is not appropriate for the operation (Since 1.10)
286
 * @CAIRO_STATUS_DEVICE_TYPE_MISMATCH: the device type is not appropriate for the operation (Since 1.10)
272
 * @CAIRO_STATUS_DEVICE_ERROR: an operation to the device caused an unspecified error (Since 1.10)
287
 * @CAIRO_STATUS_DEVICE_ERROR: an operation to the device caused an unspecified error (Since 1.10)
-
 
288
 * @CAIRO_STATUS_INVALID_MESH_CONSTRUCTION: a mesh pattern
-
 
289
 *   construction operation was used outside of a
-
 
290
 *   cairo_mesh_pattern_begin_patch()/cairo_mesh_pattern_end_patch()
-
 
291
 *   pair (Since 1.12)
-
 
292
 * @CAIRO_STATUS_DEVICE_FINISHED: target device has been finished (Since 1.12)
273
 * @CAIRO_STATUS_LAST_STATUS: this is a special value indicating the number of
293
 * @CAIRO_STATUS_LAST_STATUS: this is a special value indicating the number of
274
 *   status values defined in this enumeration.  When using this value, note
294
 *   status values defined in this enumeration.  When using this value, note
275
 *   that the version of cairo at run-time may have additional status values
295
 *   that the version of cairo at run-time may have additional status values
276
 *   defined than the value of this symbol at compile-time. (Since 1.10)
296
 *   defined than the value of this symbol at compile-time. (Since 1.10)
277
 *
297
 *
Line 280... Line 300...
280
 * but when using #cairo_t, the last error, if any, is stored in
300
 * but when using #cairo_t, the last error, if any, is stored in
281
 * the context and can be retrieved with cairo_status().
301
 * the context and can be retrieved with cairo_status().
282
 *
302
 *
283
 * New entries may be added in future versions.  Use cairo_status_to_string()
303
 * New entries may be added in future versions.  Use cairo_status_to_string()
284
 * to get a human-readable representation of an error message.
304
 * to get a human-readable representation of an error message.
-
 
305
 *
-
 
306
 * Since: 1.0
285
 **/
307
 **/
286
typedef enum _cairo_status {
308
typedef enum _cairo_status {
287
    CAIRO_STATUS_SUCCESS = 0,
309
    CAIRO_STATUS_SUCCESS = 0,
Line 288... Line 310...
288
 
310
 
Line 319... Line 341...
319
    CAIRO_STATUS_INVALID_WEIGHT,
341
    CAIRO_STATUS_INVALID_WEIGHT,
320
    CAIRO_STATUS_INVALID_SIZE,
342
    CAIRO_STATUS_INVALID_SIZE,
321
    CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED,
343
    CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED,
322
    CAIRO_STATUS_DEVICE_TYPE_MISMATCH,
344
    CAIRO_STATUS_DEVICE_TYPE_MISMATCH,
323
    CAIRO_STATUS_DEVICE_ERROR,
345
    CAIRO_STATUS_DEVICE_ERROR,
-
 
346
    CAIRO_STATUS_INVALID_MESH_CONSTRUCTION,
-
 
347
    CAIRO_STATUS_DEVICE_FINISHED,
Line 324... Line 348...
324
 
348
 
325
    CAIRO_STATUS_LAST_STATUS
349
    CAIRO_STATUS_LAST_STATUS
Line 326... Line 350...
326
} cairo_status_t;
350
} cairo_status_t;
327
 
351
 
328
/**
352
/**
329
 * cairo_content_t:
353
 * cairo_content_t:
330
 * @CAIRO_CONTENT_COLOR: The surface will hold color content only.
354
 * @CAIRO_CONTENT_COLOR: The surface will hold color content only. (Since 1.0)
331
 * @CAIRO_CONTENT_ALPHA: The surface will hold alpha content only.
355
 * @CAIRO_CONTENT_ALPHA: The surface will hold alpha content only. (Since 1.0)
332
 * @CAIRO_CONTENT_COLOR_ALPHA: The surface will hold color and alpha content.
356
 * @CAIRO_CONTENT_COLOR_ALPHA: The surface will hold color and alpha content. (Since 1.0)
333
 *
357
 *
334
 * #cairo_content_t is used to describe the content that a surface will
358
 * #cairo_content_t is used to describe the content that a surface will
335
 * contain, whether color information, alpha information (translucence
359
 * contain, whether color information, alpha information (translucence
336
 * vs. opacity), or both.
360
 * vs. opacity), or both.
337
 *
361
 *
338
 * Note: The large values here are designed to keep #cairo_content_t
362
 * Note: The large values here are designed to keep #cairo_content_t
-
 
363
 * values distinct from #cairo_format_t values so that the
-
 
364
 * implementation can detect the error if users confuse the two types.
339
 * values distinct from #cairo_format_t values so that the
365
 *
340
 * implementation can detect the error if users confuse the two types.
366
 * Since: 1.0
341
 **/
367
 **/
342
typedef enum _cairo_content {
368
typedef enum _cairo_content {
343
    CAIRO_CONTENT_COLOR		= 0x1000,
369
    CAIRO_CONTENT_COLOR		= 0x1000,
344
    CAIRO_CONTENT_ALPHA		= 0x2000,
370
    CAIRO_CONTENT_ALPHA		= 0x2000,
Line 345... Line 371...
345
    CAIRO_CONTENT_COLOR_ALPHA	= 0x3000
371
    CAIRO_CONTENT_COLOR_ALPHA	= 0x3000
-
 
372
} cairo_content_t;
-
 
373
 
-
 
374
/**
-
 
375
 * cairo_format_t:
-
 
376
 * @CAIRO_FORMAT_INVALID: no such format exists or is supported.
-
 
377
 * @CAIRO_FORMAT_ARGB32: each pixel is a 32-bit quantity, with
-
 
378
 *   alpha in the upper 8 bits, then red, then green, then blue.
-
 
379
 *   The 32-bit quantities are stored native-endian. Pre-multiplied
-
 
380
 *   alpha is used. (That is, 50% transparent red is 0x80800000,
-
 
381
 *   not 0x80ff0000.) (Since 1.0)
-
 
382
 * @CAIRO_FORMAT_RGB24: each pixel is a 32-bit quantity, with
-
 
383
 *   the upper 8 bits unused. Red, Green, and Blue are stored
-
 
384
 *   in the remaining 24 bits in that order. (Since 1.0)
-
 
385
 * @CAIRO_FORMAT_A8: each pixel is a 8-bit quantity holding
-
 
386
 *   an alpha value. (Since 1.0)
-
 
387
 * @CAIRO_FORMAT_A1: each pixel is a 1-bit quantity holding
-
 
388
 *   an alpha value. Pixels are packed together into 32-bit
-
 
389
 *   quantities. The ordering of the bits matches the
-
 
390
 *   endianess of the platform. On a big-endian machine, the
-
 
391
 *   first pixel is in the uppermost bit, on a little-endian
-
 
392
 *   machine the first pixel is in the least-significant bit. (Since 1.0)
-
 
393
 * @CAIRO_FORMAT_RGB16_565: each pixel is a 16-bit quantity
-
 
394
 *   with red in the upper 5 bits, then green in the middle
-
 
395
 *   6 bits, and blue in the lower 5 bits. (Since 1.2)
-
 
396
 * @CAIRO_FORMAT_RGB30: like RGB24 but with 10bpc. (Since 1.12)
-
 
397
 *
-
 
398
 * #cairo_format_t is used to identify the memory format of
-
 
399
 * image data.
-
 
400
 *
-
 
401
 * New entries may be added in future versions.
-
 
402
 *
-
 
403
 * Since: 1.0
-
 
404
 **/
-
 
405
typedef enum _cairo_format {
-
 
406
    CAIRO_FORMAT_INVALID   = -1,
-
 
407
    CAIRO_FORMAT_ARGB32    = 0,
-
 
408
    CAIRO_FORMAT_RGB24     = 1,
-
 
409
    CAIRO_FORMAT_A8        = 2,
-
 
410
    CAIRO_FORMAT_A1        = 3,
-
 
411
    CAIRO_FORMAT_RGB16_565 = 4,
-
 
412
    CAIRO_FORMAT_RGB30     = 5
-
 
413
} cairo_format_t;
346
} cairo_content_t;
414
 
347
 
415
 
348
/**
416
/**
349
 * cairo_write_func_t:
417
 * cairo_write_func_t:
350
 * @closure: the output closure
418
 * @closure: the output closure
Line 358... Line 426...
358
 * data in bytes.  The write function should return
426
 * data in bytes.  The write function should return
359
 * %CAIRO_STATUS_SUCCESS if all the data was successfully written,
427
 * %CAIRO_STATUS_SUCCESS if all the data was successfully written,
360
 * %CAIRO_STATUS_WRITE_ERROR otherwise.
428
 * %CAIRO_STATUS_WRITE_ERROR otherwise.
361
 *
429
 *
362
 * Returns: the status code of the write operation
430
 * Returns: the status code of the write operation
-
 
431
 *
-
 
432
 * Since: 1.0
363
 **/
433
 **/
364
typedef cairo_status_t (*cairo_write_func_t) (void		  *closure,
434
typedef cairo_status_t (*cairo_write_func_t) (void		  *closure,
365
					      const unsigned char *data,
435
					      const unsigned char *data,
366
					      unsigned int	   length);
436
					      unsigned int	   length);
Line 378... Line 448...
378
 * length of the data in bytes.  The read function should return
448
 * length of the data in bytes.  The read function should return
379
 * %CAIRO_STATUS_SUCCESS if all the data was successfully read,
449
 * %CAIRO_STATUS_SUCCESS if all the data was successfully read,
380
 * %CAIRO_STATUS_READ_ERROR otherwise.
450
 * %CAIRO_STATUS_READ_ERROR otherwise.
381
 *
451
 *
382
 * Returns: the status code of the read operation
452
 * Returns: the status code of the read operation
-
 
453
 *
-
 
454
 * Since: 1.0
383
 **/
455
 **/
384
typedef cairo_status_t (*cairo_read_func_t) (void		*closure,
456
typedef cairo_status_t (*cairo_read_func_t) (void		*closure,
385
					     unsigned char	*data,
457
					     unsigned char	*data,
386
					     unsigned int	length);
458
					     unsigned int	length);
Line -... Line 459...
-
 
459
 
-
 
460
/**
-
 
461
 * cairo_rectangle_int_t:
-
 
462
 * @x: X coordinate of the left side of the rectangle
-
 
463
 * @y: Y coordinate of the the top side of the rectangle
-
 
464
 * @width: width of the rectangle
-
 
465
 * @height: height of the rectangle
-
 
466
 *
-
 
467
 * A data structure for holding a rectangle with integer coordinates.
-
 
468
 *
-
 
469
 * Since: 1.10
-
 
470
 **/
-
 
471
 
-
 
472
typedef struct _cairo_rectangle_int {
-
 
473
    int x, y;
-
 
474
    int width, height;
-
 
475
} cairo_rectangle_int_t;
-
 
476
 
387
 
477
 
388
/* Functions for manipulating state objects */
478
/* Functions for manipulating state objects */
389
cairo_public cairo_t *
479
cairo_public cairo_t *
Line 390... Line 480...
390
cairo_create (cairo_surface_t *target);
480
cairo_create (cairo_surface_t *target);
Line 428... Line 518...
428
 
518
 
Line 429... Line 519...
429
/* Modify state */
519
/* Modify state */
430
 
520
 
431
/**
521
/**
432
 * cairo_operator_t:
522
 * cairo_operator_t:
433
 * @CAIRO_OPERATOR_CLEAR: clear destination layer (bounded)
523
 * @CAIRO_OPERATOR_CLEAR: clear destination layer (bounded) (Since 1.0)
434
 * @CAIRO_OPERATOR_SOURCE: replace destination layer (bounded)
524
 * @CAIRO_OPERATOR_SOURCE: replace destination layer (bounded) (Since 1.0)
435
 * @CAIRO_OPERATOR_OVER: draw source layer on top of destination layer
525
 * @CAIRO_OPERATOR_OVER: draw source layer on top of destination layer
436
 * (bounded)
526
 * (bounded) (Since 1.0)
437
 * @CAIRO_OPERATOR_IN: draw source where there was destination content
527
 * @CAIRO_OPERATOR_IN: draw source where there was destination content
438
 * (unbounded)
528
 * (unbounded) (Since 1.0)
439
 * @CAIRO_OPERATOR_OUT: draw source where there was no destination
529
 * @CAIRO_OPERATOR_OUT: draw source where there was no destination
440
 * content (unbounded)
530
 * content (unbounded) (Since 1.0)
441
 * @CAIRO_OPERATOR_ATOP: draw source on top of destination content and
531
 * @CAIRO_OPERATOR_ATOP: draw source on top of destination content and
442
 * only there
532
 * only there (Since 1.0)
443
 * @CAIRO_OPERATOR_DEST: ignore the source
533
 * @CAIRO_OPERATOR_DEST: ignore the source (Since 1.0)
444
 * @CAIRO_OPERATOR_DEST_OVER: draw destination on top of source
534
 * @CAIRO_OPERATOR_DEST_OVER: draw destination on top of source (Since 1.0)
445
 * @CAIRO_OPERATOR_DEST_IN: leave destination only where there was
535
 * @CAIRO_OPERATOR_DEST_IN: leave destination only where there was
446
 * source content (unbounded)
536
 * source content (unbounded) (Since 1.0)
447
 * @CAIRO_OPERATOR_DEST_OUT: leave destination only where there was no
537
 * @CAIRO_OPERATOR_DEST_OUT: leave destination only where there was no
448
 * source content
538
 * source content (Since 1.0)
449
 * @CAIRO_OPERATOR_DEST_ATOP: leave destination on top of source content
539
 * @CAIRO_OPERATOR_DEST_ATOP: leave destination on top of source content
450
 * and only there (unbounded)
540
 * and only there (unbounded) (Since 1.0)
451
 * @CAIRO_OPERATOR_XOR: source and destination are shown where there is only
541
 * @CAIRO_OPERATOR_XOR: source and destination are shown where there is only
452
 * one of them
542
 * one of them (Since 1.0)
453
 * @CAIRO_OPERATOR_ADD: source and destination layers are accumulated
543
 * @CAIRO_OPERATOR_ADD: source and destination layers are accumulated (Since 1.0)
454
 * @CAIRO_OPERATOR_SATURATE: like over, but assuming source and dest are
544
 * @CAIRO_OPERATOR_SATURATE: like over, but assuming source and dest are
455
 * disjoint geometries
545
 * disjoint geometries (Since 1.0)
456
 * @CAIRO_OPERATOR_MULTIPLY: source and destination layers are multiplied.
546
 * @CAIRO_OPERATOR_MULTIPLY: source and destination layers are multiplied.
457
 * This causes the result to be at least as dark as the darker inputs.
547
 * This causes the result to be at least as dark as the darker inputs. (Since 1.10)
458
 * @CAIRO_OPERATOR_SCREEN: source and destination are complemented and
548
 * @CAIRO_OPERATOR_SCREEN: source and destination are complemented and
459
 * multiplied. This causes the result to be at least as light as the lighter
549
 * multiplied. This causes the result to be at least as light as the lighter
460
 * inputs.
550
 * inputs. (Since 1.10)
461
 * @CAIRO_OPERATOR_OVERLAY: multiplies or screens, depending on the
551
 * @CAIRO_OPERATOR_OVERLAY: multiplies or screens, depending on the
462
 * lightness of the destination color.
552
 * lightness of the destination color. (Since 1.10)
463
 * @CAIRO_OPERATOR_DARKEN: replaces the destination with the source if it
553
 * @CAIRO_OPERATOR_DARKEN: replaces the destination with the source if it
464
 * is darker, otherwise keeps the source.
554
 * is darker, otherwise keeps the source. (Since 1.10)
465
 * @CAIRO_OPERATOR_LIGHTEN: replaces the destination with the source if it
555
 * @CAIRO_OPERATOR_LIGHTEN: replaces the destination with the source if it
466
 * is lighter, otherwise keeps the source.
556
 * is lighter, otherwise keeps the source. (Since 1.10)
467
 * @CAIRO_OPERATOR_COLOR_DODGE: brightens the destination color to reflect
557
 * @CAIRO_OPERATOR_COLOR_DODGE: brightens the destination color to reflect
468
 * the source color.
558
 * the source color. (Since 1.10)
469
 * @CAIRO_OPERATOR_COLOR_BURN: darkens the destination color to reflect
559
 * @CAIRO_OPERATOR_COLOR_BURN: darkens the destination color to reflect
470
 * the source color.
560
 * the source color. (Since 1.10)
471
 * @CAIRO_OPERATOR_HARD_LIGHT: Multiplies or screens, dependant on source
561
 * @CAIRO_OPERATOR_HARD_LIGHT: Multiplies or screens, dependent on source
472
 * color.
562
 * color. (Since 1.10)
473
 * @CAIRO_OPERATOR_SOFT_LIGHT: Darkens or lightens, dependant on source
563
 * @CAIRO_OPERATOR_SOFT_LIGHT: Darkens or lightens, dependent on source
474
 * color.
564
 * color. (Since 1.10)
475
 * @CAIRO_OPERATOR_DIFFERENCE: Takes the difference of the source and
565
 * @CAIRO_OPERATOR_DIFFERENCE: Takes the difference of the source and
476
 * destination color.
566
 * destination color. (Since 1.10)
477
 * @CAIRO_OPERATOR_EXCLUSION: Produces an effect similar to difference, but
567
 * @CAIRO_OPERATOR_EXCLUSION: Produces an effect similar to difference, but
478
 * with lower contrast.
568
 * with lower contrast. (Since 1.10)
479
 * @CAIRO_OPERATOR_HSL_HUE: Creates a color with the hue of the source
569
 * @CAIRO_OPERATOR_HSL_HUE: Creates a color with the hue of the source
480
 * and the saturation and luminosity of the target.
570
 * and the saturation and luminosity of the target. (Since 1.10)
481
 * @CAIRO_OPERATOR_HSL_SATURATION: Creates a color with the saturation
571
 * @CAIRO_OPERATOR_HSL_SATURATION: Creates a color with the saturation
482
 * of the source and the hue and luminosity of the target. Painting with
572
 * of the source and the hue and luminosity of the target. Painting with
483
 * this mode onto a gray area prduces no change.
573
 * this mode onto a gray area produces no change. (Since 1.10)
484
 * @CAIRO_OPERATOR_HSL_COLOR: Creates a color with the hue and saturation
574
 * @CAIRO_OPERATOR_HSL_COLOR: Creates a color with the hue and saturation
485
 * of the source and the luminosity of the target. This preserves the gray
575
 * of the source and the luminosity of the target. This preserves the gray
486
 * levels of the target and is useful for coloring monochrome images or
576
 * levels of the target and is useful for coloring monochrome images or
487
 * tinting color images.
577
 * tinting color images. (Since 1.10)
488
 * @CAIRO_OPERATOR_HSL_LUMINOSITY: Creates a color with the luminosity of
578
 * @CAIRO_OPERATOR_HSL_LUMINOSITY: Creates a color with the luminosity of
489
 * the source and the hue and saturation of the target. This produces an
579
 * the source and the hue and saturation of the target. This produces an
490
 * inverse effect to @CAIRO_OPERATOR_HSL_COLOR.
580
 * inverse effect to @CAIRO_OPERATOR_HSL_COLOR. (Since 1.10)
491
 *
581
 *
492
 * #cairo_operator_t is used to set the compositing operator for all cairo
582
 * #cairo_operator_t is used to set the compositing operator for all cairo
493
 * drawing operations.
583
 * drawing operations.
Line 504... Line 594...
504
 * transparent or fully opaque.  The actual implementation works for
594
 * transparent or fully opaque.  The actual implementation works for
505
 * translucent layers too.
595
 * translucent layers too.
506
 * For a more detailed explanation of the effects of each operator, including
596
 * For a more detailed explanation of the effects of each operator, including
507
 * the mathematical definitions, see
597
 * the mathematical definitions, see
508
 * http://cairographics.org/operators/.
598
 * http://cairographics.org/operators/.
-
 
599
 *
-
 
600
 * Since: 1.0
509
 **/
601
 **/
510
typedef enum _cairo_operator {
602
typedef enum _cairo_operator {
511
    CAIRO_OPERATOR_CLEAR,
603
    CAIRO_OPERATOR_CLEAR,
Line 512... Line 604...
512
 
604
 
Line 567... Line 659...
567
cairo_set_tolerance (cairo_t *cr, double tolerance);
659
cairo_set_tolerance (cairo_t *cr, double tolerance);
Line 568... Line 660...
568
 
660
 
569
/**
661
/**
570
 * cairo_antialias_t:
662
 * cairo_antialias_t:
571
 * @CAIRO_ANTIALIAS_DEFAULT: Use the default antialiasing for
663
 * @CAIRO_ANTIALIAS_DEFAULT: Use the default antialiasing for
572
 *   the subsystem and target device
664
 *   the subsystem and target device, since 1.0
573
 * @CAIRO_ANTIALIAS_NONE: Use a bilevel alpha mask
665
 * @CAIRO_ANTIALIAS_NONE: Use a bilevel alpha mask, since 1.0
574
 * @CAIRO_ANTIALIAS_GRAY: Perform single-color antialiasing (using
666
 * @CAIRO_ANTIALIAS_GRAY: Perform single-color antialiasing (using
575
 *  shades of gray for black text on a white background, for example).
667
 *  shades of gray for black text on a white background, for example), since 1.0
576
 * @CAIRO_ANTIALIAS_SUBPIXEL: Perform antialiasing by taking
668
 * @CAIRO_ANTIALIAS_SUBPIXEL: Perform antialiasing by taking
577
 *  advantage of the order of subpixel elements on devices
669
 *  advantage of the order of subpixel elements on devices
-
 
670
 *  such as LCD panels, since 1.0
-
 
671
 * @CAIRO_ANTIALIAS_FAST: Hint that the backend should perform some
-
 
672
 * antialiasing but prefer speed over quality, since 1.12
-
 
673
 * @CAIRO_ANTIALIAS_GOOD: The backend should balance quality against
-
 
674
 * performance, since 1.12
-
 
675
 * @CAIRO_ANTIALIAS_BEST: Hint that the backend should render at the highest
578
 *  such as LCD panels
676
 * quality, sacrificing speed if necessary, since 1.12
579
 *
677
 *
-
 
678
 * Specifies the type of antialiasing to do when rendering text or shapes.
-
 
679
 *
-
 
680
 * As it is not necessarily clear from the above what advantages a particular
-
 
681
 * antialias method provides, since 1.12, there is also a set of hints:
-
 
682
 * @CAIRO_ANTIALIAS_FAST: Allow the backend to degrade raster quality for speed
-
 
683
 * @CAIRO_ANTIALIAS_GOOD: A balance between speed and quality
-
 
684
 * @CAIRO_ANTIALIAS_BEST: A high-fidelity, but potentially slow, raster mode
-
 
685
 *
-
 
686
 * These make no guarantee on how the backend will perform its rasterisation
-
 
687
 * (if it even rasterises!), nor that they have any differing effect other
-
 
688
 * than to enable some form of antialiasing. In the case of glyph rendering,
-
 
689
 * @CAIRO_ANTIALIAS_FAST and @CAIRO_ANTIALIAS_GOOD will be mapped to
-
 
690
 * @CAIRO_ANTIALIAS_GRAY, with @CAIRO_ANTALIAS_BEST being equivalent to
-
 
691
 * @CAIRO_ANTIALIAS_SUBPIXEL.
-
 
692
 *
-
 
693
 * The interpretation of @CAIRO_ANTIALIAS_DEFAULT is left entirely up to
-
 
694
 * the backend, typically this will be similar to @CAIRO_ANTIALIAS_GOOD.
-
 
695
 *
580
 * Specifies the type of antialiasing to do when rendering text or shapes.
696
 * Since: 1.0
581
 **/
697
 **/
582
typedef enum _cairo_antialias {
698
typedef enum _cairo_antialias {
-
 
699
    CAIRO_ANTIALIAS_DEFAULT,
-
 
700
 
583
    CAIRO_ANTIALIAS_DEFAULT,
701
    /* method */
584
    CAIRO_ANTIALIAS_NONE,
702
    CAIRO_ANTIALIAS_NONE,
585
    CAIRO_ANTIALIAS_GRAY,
703
    CAIRO_ANTIALIAS_GRAY,
-
 
704
    CAIRO_ANTIALIAS_SUBPIXEL,
-
 
705
 
-
 
706
    /* hints */
-
 
707
    CAIRO_ANTIALIAS_FAST,
-
 
708
    CAIRO_ANTIALIAS_GOOD,
586
    CAIRO_ANTIALIAS_SUBPIXEL
709
    CAIRO_ANTIALIAS_BEST
Line 587... Line 710...
587
} cairo_antialias_t;
710
} cairo_antialias_t;
588
 
711
 
Line 593... Line 716...
593
 * cairo_fill_rule_t:
716
 * cairo_fill_rule_t:
594
 * @CAIRO_FILL_RULE_WINDING: If the path crosses the ray from
717
 * @CAIRO_FILL_RULE_WINDING: If the path crosses the ray from
595
 * left-to-right, counts +1. If the path crosses the ray
718
 * left-to-right, counts +1. If the path crosses the ray
596
 * from right to left, counts -1. (Left and right are determined
719
 * from right to left, counts -1. (Left and right are determined
597
 * from the perspective of looking along the ray from the starting
720
 * from the perspective of looking along the ray from the starting
598
 * point.) If the total count is non-zero, the point will be filled.
721
 * point.) If the total count is non-zero, the point will be filled. (Since 1.0)
599
 * @CAIRO_FILL_RULE_EVEN_ODD: Counts the total number of
722
 * @CAIRO_FILL_RULE_EVEN_ODD: Counts the total number of
600
 * intersections, without regard to the orientation of the contour. If
723
 * intersections, without regard to the orientation of the contour. If
601
 * the total number of intersections is odd, the point will be
724
 * the total number of intersections is odd, the point will be
602
 * filled.
725
 * filled. (Since 1.0)
603
 *
726
 *
604
 * #cairo_fill_rule_t is used to select how paths are filled. For both
727
 * #cairo_fill_rule_t is used to select how paths are filled. For both
605
 * fill rules, whether or not a point is included in the fill is
728
 * fill rules, whether or not a point is included in the fill is
606
 * determined by taking a ray from that point to infinity and looking
729
 * determined by taking a ray from that point to infinity and looking
607
 * at intersections with the path. The ray can be in any direction,
730
 * at intersections with the path. The ray can be in any direction,
Line 611... Line 734...
611
 * is just a description of the rule that is applied.)
734
 * is just a description of the rule that is applied.)
612
 *
735
 *
613
 * The default fill rule is %CAIRO_FILL_RULE_WINDING.
736
 * The default fill rule is %CAIRO_FILL_RULE_WINDING.
614
 *
737
 *
615
 * New entries may be added in future versions.
738
 * New entries may be added in future versions.
-
 
739
 *
-
 
740
 * Since: 1.0
616
 **/
741
 **/
617
typedef enum _cairo_fill_rule {
742
typedef enum _cairo_fill_rule {
618
    CAIRO_FILL_RULE_WINDING,
743
    CAIRO_FILL_RULE_WINDING,
619
    CAIRO_FILL_RULE_EVEN_ODD
744
    CAIRO_FILL_RULE_EVEN_ODD
620
} cairo_fill_rule_t;
745
} cairo_fill_rule_t;
Line 625... Line 750...
625
cairo_public void
750
cairo_public void
626
cairo_set_line_width (cairo_t *cr, double width);
751
cairo_set_line_width (cairo_t *cr, double width);
Line 627... Line 752...
627
 
752
 
628
/**
753
/**
629
 * cairo_line_cap_t:
754
 * cairo_line_cap_t:
630
 * @CAIRO_LINE_CAP_BUTT: start(stop) the line exactly at the start(end) point
755
 * @CAIRO_LINE_CAP_BUTT: start(stop) the line exactly at the start(end) point (Since 1.0)
631
 * @CAIRO_LINE_CAP_ROUND: use a round ending, the center of the circle is the end point
756
 * @CAIRO_LINE_CAP_ROUND: use a round ending, the center of the circle is the end point (Since 1.0)
632
 * @CAIRO_LINE_CAP_SQUARE: use squared ending, the center of the square is the end point
757
 * @CAIRO_LINE_CAP_SQUARE: use squared ending, the center of the square is the end point (Since 1.0)
633
 *
758
 *
634
 * Specifies how to render the endpoints of the path when stroking.
759
 * Specifies how to render the endpoints of the path when stroking.
635
 *
760
 *
-
 
761
 * The default line cap style is %CAIRO_LINE_CAP_BUTT.
-
 
762
 *
636
 * The default line cap style is %CAIRO_LINE_CAP_BUTT.
763
 * Since: 1.0
637
 **/
764
 **/
638
typedef enum _cairo_line_cap {
765
typedef enum _cairo_line_cap {
639
    CAIRO_LINE_CAP_BUTT,
766
    CAIRO_LINE_CAP_BUTT,
640
    CAIRO_LINE_CAP_ROUND,
767
    CAIRO_LINE_CAP_ROUND,
Line 645... Line 772...
645
cairo_set_line_cap (cairo_t *cr, cairo_line_cap_t line_cap);
772
cairo_set_line_cap (cairo_t *cr, cairo_line_cap_t line_cap);
Line 646... Line 773...
646
 
773
 
647
/**
774
/**
648
 * cairo_line_join_t:
775
 * cairo_line_join_t:
649
 * @CAIRO_LINE_JOIN_MITER: use a sharp (angled) corner, see
776
 * @CAIRO_LINE_JOIN_MITER: use a sharp (angled) corner, see
650
 * cairo_set_miter_limit()
777
 * cairo_set_miter_limit() (Since 1.0)
651
 * @CAIRO_LINE_JOIN_ROUND: use a rounded join, the center of the circle is the
778
 * @CAIRO_LINE_JOIN_ROUND: use a rounded join, the center of the circle is the
652
 * joint point
779
 * joint point (Since 1.0)
653
 * @CAIRO_LINE_JOIN_BEVEL: use a cut-off join, the join is cut off at half
780
 * @CAIRO_LINE_JOIN_BEVEL: use a cut-off join, the join is cut off at half
654
 * the line width from the joint point
781
 * the line width from the joint point (Since 1.0)
655
 *
782
 *
656
 * Specifies how to render the junction of two lines when stroking.
783
 * Specifies how to render the junction of two lines when stroking.
657
 *
784
 *
-
 
785
 * The default line join style is %CAIRO_LINE_JOIN_MITER.
-
 
786
 *
658
 * The default line join style is %CAIRO_LINE_JOIN_MITER.
787
 * Since: 1.0
659
 **/
788
 **/
660
typedef enum _cairo_line_join {
789
typedef enum _cairo_line_join {
661
    CAIRO_LINE_JOIN_MITER,
790
    CAIRO_LINE_JOIN_MITER,
662
    CAIRO_LINE_JOIN_ROUND,
791
    CAIRO_LINE_JOIN_ROUND,
Line 900... Line 1029...
900
 * font backend they use. The type of a
1029
 * font backend they use. The type of a
901
 * scaled font can be queried using cairo_scaled_font_get_type().
1030
 * scaled font can be queried using cairo_scaled_font_get_type().
902
 *
1031
 *
903
 * Memory management of #cairo_scaled_font_t is done with
1032
 * Memory management of #cairo_scaled_font_t is done with
904
 * cairo_scaled_font_reference() and cairo_scaled_font_destroy().
1033
 * cairo_scaled_font_reference() and cairo_scaled_font_destroy().
-
 
1034
 *
-
 
1035
 * Since: 1.0
905
 **/
1036
 **/
906
typedef struct _cairo_scaled_font cairo_scaled_font_t;
1037
typedef struct _cairo_scaled_font cairo_scaled_font_t;
Line 907... Line 1038...
907
 
1038
 
908
/**
1039
/**
Line 919... Line 1050...
919
 * font backend they use. The type of a
1050
 * font backend they use. The type of a
920
 * font face can be queried using cairo_font_face_get_type().
1051
 * font face can be queried using cairo_font_face_get_type().
921
 *
1052
 *
922
 * Memory management of #cairo_font_face_t is done with
1053
 * Memory management of #cairo_font_face_t is done with
923
 * cairo_font_face_reference() and cairo_font_face_destroy().
1054
 * cairo_font_face_reference() and cairo_font_face_destroy().
-
 
1055
 *
-
 
1056
 * Since: 1.0
924
 **/
1057
 **/
925
typedef struct _cairo_font_face cairo_font_face_t;
1058
typedef struct _cairo_font_face cairo_font_face_t;
Line 926... Line 1059...
926
 
1059
 
927
/**
1060
/**
Line 945... Line 1078...
945
 * underlying font system.
1078
 * underlying font system.
946
 *
1079
 *
947
 * Note that the offsets given by @x and @y are not cumulative. When
1080
 * Note that the offsets given by @x and @y are not cumulative. When
948
 * drawing or measuring text, each glyph is individually positioned
1081
 * drawing or measuring text, each glyph is individually positioned
949
 * with respect to the overall origin
1082
 * with respect to the overall origin
-
 
1083
 *
-
 
1084
 * Since: 1.0
950
 **/
1085
 **/
951
typedef struct {
1086
typedef struct {
952
    unsigned long        index;
1087
    unsigned long        index;
953
    double               x;
1088
    double               x;
954
    double               y;
1089
    double               y;
Line 992... Line 1127...
992
cairo_text_cluster_free (cairo_text_cluster_t *clusters);
1127
cairo_text_cluster_free (cairo_text_cluster_t *clusters);
Line 993... Line 1128...
993
 
1128
 
994
/**
1129
/**
995
 * cairo_text_cluster_flags_t:
1130
 * cairo_text_cluster_flags_t:
996
 * @CAIRO_TEXT_CLUSTER_FLAG_BACKWARD: The clusters in the cluster array
1131
 * @CAIRO_TEXT_CLUSTER_FLAG_BACKWARD: The clusters in the cluster array
997
 * map to glyphs in the glyph array from end to start.
1132
 * map to glyphs in the glyph array from end to start. (Since 1.8)
998
 *
1133
 *
999
 * Specifies properties of a text cluster mapping.
1134
 * Specifies properties of a text cluster mapping.
1000
 *
1135
 *
1001
 * Since: 1.8
1136
 * Since: 1.8
Line 1028... Line 1163...
1028
 * cairo_scale(cr, 2.0, 2.0), text will
1163
 * cairo_scale(cr, 2.0, 2.0), text will
1029
 * be drawn twice as big, but the reported text extents will not be
1164
 * be drawn twice as big, but the reported text extents will not be
1030
 * doubled. They will change slightly due to hinting (so you can't
1165
 * doubled. They will change slightly due to hinting (so you can't
1031
 * assume that metrics are independent of the transformation matrix),
1166
 * assume that metrics are independent of the transformation matrix),
1032
 * but otherwise will remain unchanged.
1167
 * but otherwise will remain unchanged.
-
 
1168
 *
-
 
1169
 * Since: 1.0
1033
 **/
1170
 **/
1034
typedef struct {
1171
typedef struct {
1035
    double x_bearing;
1172
    double x_bearing;
1036
    double y_bearing;
1173
    double y_bearing;
1037
    double width;
1174
    double width;
Line 1050... Line 1187...
1050
 * @descent: the distance that the font extends below the baseline.
1187
 * @descent: the distance that the font extends below the baseline.
1051
 *           This value is positive for typical fonts that include
1188
 *           This value is positive for typical fonts that include
1052
 *           portions below the baseline. Note that this is not always
1189
 *           portions below the baseline. Note that this is not always
1053
 *           exactly equal to the maximum of the extents of all the
1190
 *           exactly equal to the maximum of the extents of all the
1054
 *           glyphs in the font, but rather is picked to express the
1191
 *           glyphs in the font, but rather is picked to express the
1055
 *           font designer's intent as to how the the font should
1192
 *           font designer's intent as to how the font should
1056
 *           align with elements below it.
1193
 *           align with elements below it.
1057
 * @height: the recommended vertical distance between baselines when
1194
 * @height: the recommended vertical distance between baselines when
1058
 *          setting consecutive lines of text with the font. This
1195
 *          setting consecutive lines of text with the font. This
1059
 *          is greater than @ascent+@descent by a
1196
 *          is greater than @ascent+@descent by a
1060
 *          quantity known as the line spacing
1197
 *          quantity known as the line spacing
1061
 *          or external leading. When space
1198
 *          or external leading. When space
1062
 *          is at a premium, most fonts can be set with only
1199
 *          is at a premium, most fonts can be set with only
1063
 *          a distance of @ascent+@descent between lines.
1200
 *          a distance of @ascent+@descent between lines.
1064
 * @max_x_advance: the maximum distance in the X direction that
1201
 * @max_x_advance: the maximum distance in the X direction that
1065
 *         the the origin is advanced for any glyph in the font.
1202
 *         the origin is advanced for any glyph in the font.
1066
 * @max_y_advance: the maximum distance in the Y direction that
1203
 * @max_y_advance: the maximum distance in the Y direction that
1067
 *         the the origin is advanced for any glyph in the font.
1204
 *         the origin is advanced for any glyph in the font.
1068
 *         this will be zero for normal fonts used for horizontal
1205
 *         This will be zero for normal fonts used for horizontal
1069
 *         writing. (The scripts of East Asia are sometimes written
1206
 *         writing. (The scripts of East Asia are sometimes written
1070
 *         vertically.)
1207
 *         vertically.)
1071
 *
1208
 *
1072
 * The #cairo_font_extents_t structure stores metric information for
1209
 * The #cairo_font_extents_t structure stores metric information for
1073
 * a font. Values are given in the current user-space coordinate
1210
 * a font. Values are given in the current user-space coordinate
Line 1078... Line 1215...
1078
 * matrix. If you call cairo_scale(cr, 2.0, 2.0),
1215
 * matrix. If you call cairo_scale(cr, 2.0, 2.0),
1079
 * text will be drawn twice as big, but the reported text extents will
1216
 * text will be drawn twice as big, but the reported text extents will
1080
 * not be doubled. They will change slightly due to hinting (so you
1217
 * not be doubled. They will change slightly due to hinting (so you
1081
 * can't assume that metrics are independent of the transformation
1218
 * can't assume that metrics are independent of the transformation
1082
 * matrix), but otherwise will remain unchanged.
1219
 * matrix), but otherwise will remain unchanged.
-
 
1220
 *
-
 
1221
 * Since: 1.0
1083
 **/
1222
 **/
1084
typedef struct {
1223
typedef struct {
1085
    double ascent;
1224
    double ascent;
1086
    double descent;
1225
    double descent;
1087
    double height;
1226
    double height;
Line 1089... Line 1228...
1089
    double max_y_advance;
1228
    double max_y_advance;
1090
} cairo_font_extents_t;
1229
} cairo_font_extents_t;
Line 1091... Line 1230...
1091
 
1230
 
1092
/**
1231
/**
1093
 * cairo_font_slant_t:
1232
 * cairo_font_slant_t:
1094
 * @CAIRO_FONT_SLANT_NORMAL: Upright font style
1233
 * @CAIRO_FONT_SLANT_NORMAL: Upright font style, since 1.0
1095
 * @CAIRO_FONT_SLANT_ITALIC: Italic font style
1234
 * @CAIRO_FONT_SLANT_ITALIC: Italic font style, since 1.0
1096
 * @CAIRO_FONT_SLANT_OBLIQUE: Oblique font style
1235
 * @CAIRO_FONT_SLANT_OBLIQUE: Oblique font style, since 1.0
1097
 *
1236
 *
-
 
1237
 * Specifies variants of a font face based on their slant.
-
 
1238
 *
1098
 * Specifies variants of a font face based on their slant.
1239
 * Since: 1.0
1099
 **/
1240
 **/
1100
typedef enum _cairo_font_slant {
1241
typedef enum _cairo_font_slant {
1101
    CAIRO_FONT_SLANT_NORMAL,
1242
    CAIRO_FONT_SLANT_NORMAL,
1102
    CAIRO_FONT_SLANT_ITALIC,
1243
    CAIRO_FONT_SLANT_ITALIC,
1103
    CAIRO_FONT_SLANT_OBLIQUE
1244
    CAIRO_FONT_SLANT_OBLIQUE
Line 1104... Line 1245...
1104
} cairo_font_slant_t;
1245
} cairo_font_slant_t;
1105
 
1246
 
1106
/**
1247
/**
1107
 * cairo_font_weight_t:
1248
 * cairo_font_weight_t:
1108
 * @CAIRO_FONT_WEIGHT_NORMAL: Normal font weight
1249
 * @CAIRO_FONT_WEIGHT_NORMAL: Normal font weight, since 1.0
1109
 * @CAIRO_FONT_WEIGHT_BOLD: Bold font weight
1250
 * @CAIRO_FONT_WEIGHT_BOLD: Bold font weight, since 1.0
-
 
1251
 *
-
 
1252
 * Specifies variants of a font face based on their weight.
1110
 *
1253
 *
1111
 * Specifies variants of a font face based on their weight.
1254
 * Since: 1.0
1112
 **/
1255
 **/
1113
typedef enum _cairo_font_weight {
1256
typedef enum _cairo_font_weight {
1114
    CAIRO_FONT_WEIGHT_NORMAL,
1257
    CAIRO_FONT_WEIGHT_NORMAL,
Line 1115... Line 1258...
1115
    CAIRO_FONT_WEIGHT_BOLD
1258
    CAIRO_FONT_WEIGHT_BOLD
1116
} cairo_font_weight_t;
1259
} cairo_font_weight_t;
1117
 
1260
 
1118
/**
1261
/**
1119
 * cairo_subpixel_order_t:
1262
 * cairo_subpixel_order_t:
1120
 * @CAIRO_SUBPIXEL_ORDER_DEFAULT: Use the default subpixel order for
1263
 * @CAIRO_SUBPIXEL_ORDER_DEFAULT: Use the default subpixel order for
1121
 *   for the target device
1264
 *   for the target device, since 1.0
1122
 * @CAIRO_SUBPIXEL_ORDER_RGB: Subpixel elements are arranged horizontally
1265
 * @CAIRO_SUBPIXEL_ORDER_RGB: Subpixel elements are arranged horizontally
1123
 *   with red at the left
1266
 *   with red at the left, since 1.0
1124
 * @CAIRO_SUBPIXEL_ORDER_BGR:  Subpixel elements are arranged horizontally
1267
 * @CAIRO_SUBPIXEL_ORDER_BGR:  Subpixel elements are arranged horizontally
1125
 *   with blue at the left
1268
 *   with blue at the left, since 1.0
1126
 * @CAIRO_SUBPIXEL_ORDER_VRGB: Subpixel elements are arranged vertically
1269
 * @CAIRO_SUBPIXEL_ORDER_VRGB: Subpixel elements are arranged vertically
1127
 *   with red at the top
1270
 *   with red at the top, since 1.0
1128
 * @CAIRO_SUBPIXEL_ORDER_VBGR: Subpixel elements are arranged vertically
1271
 * @CAIRO_SUBPIXEL_ORDER_VBGR: Subpixel elements are arranged vertically
1129
 *   with blue at the top
1272
 *   with blue at the top, since 1.0
1130
 *
1273
 *
-
 
1274
 * The subpixel order specifies the order of color elements within
-
 
1275
 * each pixel on the display device when rendering with an
1131
 * The subpixel order specifies the order of color elements within
1276
 * antialiasing mode of %CAIRO_ANTIALIAS_SUBPIXEL.
1132
 * each pixel on the display device when rendering with an
1277
 *
1133
 * antialiasing mode of %CAIRO_ANTIALIAS_SUBPIXEL.
1278
 * Since: 1.0
1134
 **/
1279
 **/
1135
typedef enum _cairo_subpixel_order {
1280
typedef enum _cairo_subpixel_order {
Line 1141... Line 1286...
1141
} cairo_subpixel_order_t;
1286
} cairo_subpixel_order_t;
Line 1142... Line 1287...
1142
 
1287
 
1143
/**
1288
/**
1144
 * cairo_hint_style_t:
1289
 * cairo_hint_style_t:
1145
 * @CAIRO_HINT_STYLE_DEFAULT: Use the default hint style for
1290
 * @CAIRO_HINT_STYLE_DEFAULT: Use the default hint style for
1146
 *   font backend and target device
1291
 *   font backend and target device, since 1.0
1147
 * @CAIRO_HINT_STYLE_NONE: Do not hint outlines
1292
 * @CAIRO_HINT_STYLE_NONE: Do not hint outlines, since 1.0
1148
 * @CAIRO_HINT_STYLE_SLIGHT: Hint outlines slightly to improve
1293
 * @CAIRO_HINT_STYLE_SLIGHT: Hint outlines slightly to improve
1149
 *   contrast while retaining good fidelity to the original
1294
 *   contrast while retaining good fidelity to the original
1150
 *   shapes.
1295
 *   shapes, since 1.0
1151
 * @CAIRO_HINT_STYLE_MEDIUM: Hint outlines with medium strength
1296
 * @CAIRO_HINT_STYLE_MEDIUM: Hint outlines with medium strength
1152
 *   giving a compromise between fidelity to the original shapes
1297
 *   giving a compromise between fidelity to the original shapes
1153
 *   and contrast
1298
 *   and contrast, since 1.0
1154
 * @CAIRO_HINT_STYLE_FULL: Hint outlines to maximize contrast
1299
 * @CAIRO_HINT_STYLE_FULL: Hint outlines to maximize contrast, since 1.0
1155
 *
1300
 *
1156
 * Specifies the type of hinting to do on font outlines. Hinting
1301
 * Specifies the type of hinting to do on font outlines. Hinting
1157
 * is the process of fitting outlines to the pixel grid in order
1302
 * is the process of fitting outlines to the pixel grid in order
1158
 * to improve the appearance of the result. Since hinting outlines
1303
 * to improve the appearance of the result. Since hinting outlines
1159
 * involves distorting them, it also reduces the faithfulness
1304
 * involves distorting them, it also reduces the faithfulness
1160
 * to the original outline shapes. Not all of the outline hinting
1305
 * to the original outline shapes. Not all of the outline hinting
1161
 * styles are supported by all font backends.
1306
 * styles are supported by all font backends.
1162
 *
1307
 *
-
 
1308
 * New entries may be added in future versions.
-
 
1309
 *
1163
 * New entries may be added in future versions.
1310
 * Since: 1.0
1164
 **/
1311
 **/
1165
typedef enum _cairo_hint_style {
1312
typedef enum _cairo_hint_style {
1166
    CAIRO_HINT_STYLE_DEFAULT,
1313
    CAIRO_HINT_STYLE_DEFAULT,
1167
    CAIRO_HINT_STYLE_NONE,
1314
    CAIRO_HINT_STYLE_NONE,
Line 1171... Line 1318...
1171
} cairo_hint_style_t;
1318
} cairo_hint_style_t;
Line 1172... Line 1319...
1172
 
1319
 
1173
/**
1320
/**
1174
 * cairo_hint_metrics_t:
1321
 * cairo_hint_metrics_t:
1175
 * @CAIRO_HINT_METRICS_DEFAULT: Hint metrics in the default
1322
 * @CAIRO_HINT_METRICS_DEFAULT: Hint metrics in the default
1176
 *  manner for the font backend and target device
1323
 *  manner for the font backend and target device, since 1.0
1177
 * @CAIRO_HINT_METRICS_OFF: Do not hint font metrics
1324
 * @CAIRO_HINT_METRICS_OFF: Do not hint font metrics, since 1.0
1178
 * @CAIRO_HINT_METRICS_ON: Hint font metrics
1325
 * @CAIRO_HINT_METRICS_ON: Hint font metrics, since 1.0
1179
 *
1326
 *
1180
 * Specifies whether to hint font metrics; hinting font metrics
1327
 * Specifies whether to hint font metrics; hinting font metrics
1181
 * means quantizing them so that they are integer values in
1328
 * means quantizing them so that they are integer values in
1182
 * device space. Doing this improves the consistency of
1329
 * device space. Doing this improves the consistency of
1183
 * letter and line spacing, however it also means that text
1330
 * letter and line spacing, however it also means that text
-
 
1331
 * will be laid out differently at different zoom factors.
-
 
1332
 *
1184
 * will be laid out differently at different zoom factors.
1333
 * Since: 1.0
1185
 **/
1334
 **/
1186
typedef enum _cairo_hint_metrics {
1335
typedef enum _cairo_hint_metrics {
1187
    CAIRO_HINT_METRICS_DEFAULT,
1336
    CAIRO_HINT_METRICS_DEFAULT,
1188
    CAIRO_HINT_METRICS_OFF,
1337
    CAIRO_HINT_METRICS_OFF,
Line 1195... Line 1344...
1195
 * An opaque structure holding all options that are used when
1344
 * An opaque structure holding all options that are used when
1196
 * rendering fonts.
1345
 * rendering fonts.
1197
 *
1346
 *
1198
 * Individual features of a #cairo_font_options_t can be set or
1347
 * Individual features of a #cairo_font_options_t can be set or
1199
 * accessed using functions named
1348
 * accessed using functions named
1200
 * cairo_font_options_set_feature_name and
1349
 * cairo_font_options_set_feature_name() and
1201
 * cairo_font_options_get_feature_name, like
1350
 * cairo_font_options_get_feature_name(), like
1202
 * cairo_font_options_set_antialias() and
1351
 * cairo_font_options_set_antialias() and
1203
 * cairo_font_options_get_antialias().
1352
 * cairo_font_options_get_antialias().
1204
 *
1353
 *
1205
 * New features may be added to a #cairo_font_options_t in the
1354
 * New features may be added to a #cairo_font_options_t in the
1206
 * future.  For this reason, cairo_font_options_copy(),
1355
 * future.  For this reason, cairo_font_options_copy(),
1207
 * cairo_font_options_equal(), cairo_font_options_merge(), and
1356
 * cairo_font_options_equal(), cairo_font_options_merge(), and
1208
 * cairo_font_options_hash() should be used to copy, check
1357
 * cairo_font_options_hash() should be used to copy, check
1209
 * for equality, merge, or compute a hash value of
1358
 * for equality, merge, or compute a hash value of
1210
 * #cairo_font_options_t objects.
1359
 * #cairo_font_options_t objects.
-
 
1360
 *
-
 
1361
 * Since: 1.0
1211
 **/
1362
 **/
1212
typedef struct _cairo_font_options cairo_font_options_t;
1363
typedef struct _cairo_font_options cairo_font_options_t;
Line 1213... Line 1364...
1213
 
1364
 
1214
cairo_public cairo_font_options_t *
1365
cairo_public cairo_font_options_t *
Line 1350... Line 1501...
1350
cairo_font_face_status (cairo_font_face_t *font_face);
1501
cairo_font_face_status (cairo_font_face_t *font_face);
Line 1351... Line 1502...
1351
 
1502
 
1352
 
1503
 
1353
/**
1504
/**
1354
 * cairo_font_type_t:
1505
 * cairo_font_type_t:
1355
 * @CAIRO_FONT_TYPE_TOY: The font was created using cairo's toy font api
1506
 * @CAIRO_FONT_TYPE_TOY: The font was created using cairo's toy font api (Since: 1.2)
1356
 * @CAIRO_FONT_TYPE_FT: The font is of type FreeType
1507
 * @CAIRO_FONT_TYPE_FT: The font is of type FreeType (Since: 1.2)
-
 
1508
 * @CAIRO_FONT_TYPE_WIN32: The font is of type Win32 (Since: 1.2)
1357
 * @CAIRO_FONT_TYPE_WIN32: The font is of type Win32
1509
 * @CAIRO_FONT_TYPE_QUARTZ: The font is of type Quartz (Since: 1.6, in 1.2 and
1358
 * @CAIRO_FONT_TYPE_QUARTZ: The font is of type Quartz (Since: 1.6)
1510
 * 1.4 it was named CAIRO_FONT_TYPE_ATSUI)
1359
 * @CAIRO_FONT_TYPE_USER: The font was create using cairo's user font api (Since: 1.8)
1511
 * @CAIRO_FONT_TYPE_USER: The font was create using cairo's user font api (Since: 1.8)
1360
 *
1512
 *
1361
 * #cairo_font_type_t is used to describe the type of a given font
1513
 * #cairo_font_type_t is used to describe the type of a given font
1362
 * face or scaled font. The font types are also known as "font
1514
 * face or scaled font. The font types are also known as "font
1363
 * backends" within cairo.
1515
 * backends" within cairo.
1364
 *
1516
 *
1365
 * The type of a font face is determined by the function used to
1517
 * The type of a font face is determined by the function used to
1366
 * create it, which will generally be of the form
1518
 * create it, which will generally be of the form
1367
 * cairo_type_font_face_create(). The font face type can be queried
1519
 * cairo_type_font_face_create().
1368
 * with cairo_font_face_get_type()
1520
 * The font face type can be queried with cairo_font_face_get_type()
1369
 *
1521
 *
1370
 * The various #cairo_font_face_t functions can be used with a font face
1522
 * The various #cairo_font_face_t functions can be used with a font face
1371
 * of any type.
1523
 * of any type.
Line 1376... Line 1528...
1376
 *
1528
 *
1377
 * The various #cairo_scaled_font_t functions can be used with scaled
1529
 * The various #cairo_scaled_font_t functions can be used with scaled
1378
 * fonts of any type, but some font backends also provide
1530
 * fonts of any type, but some font backends also provide
1379
 * type-specific functions that must only be called with a scaled font
1531
 * type-specific functions that must only be called with a scaled font
1380
 * of the appropriate type. These functions have names that begin with
1532
 * of the appropriate type. These functions have names that begin with
1381
 * cairo_type_scaled_font() such as cairo_ft_scaled_font_lock_face().
1533
 * cairo_type_scaled_font()
-
 
1534
 * such as cairo_ft_scaled_font_lock_face().
1382
 *
1535
 *
1383
 * The behavior of calling a type-specific function with a scaled font
1536
 * The behavior of calling a type-specific function with a scaled font
1384
 * of the wrong type is undefined.
1537
 * of the wrong type is undefined.
1385
 *
1538
 *
1386
 * New entries may be added in future versions.
1539
 * New entries may be added in future versions.
Line 1622... Line 1775...
1622
 * @num_glyphs will be zero.  If the provided glyph array is too short for
1775
 * @num_glyphs will be zero.  If the provided glyph array is too short for
1623
 * the conversion (or for convenience), a new glyph array may be allocated
1776
 * the conversion (or for convenience), a new glyph array may be allocated
1624
 * using cairo_glyph_allocate() and placed in @glyphs.  Upon return,
1777
 * using cairo_glyph_allocate() and placed in @glyphs.  Upon return,
1625
 * @num_glyphs should contain the number of generated glyphs.  If the value
1778
 * @num_glyphs should contain the number of generated glyphs.  If the value
1626
 * @glyphs points at has changed after the call, the caller will free the
1779
 * @glyphs points at has changed after the call, the caller will free the
1627
 * allocated glyph array using cairo_glyph_free().
1780
 * allocated glyph array using cairo_glyph_free().  The caller will also free
-
 
1781
 * the original value of @glyphs, so the callback shouldn't do so.
1628
 * The callback should populate the glyph indices and positions (in font space)
1782
 * The callback should populate the glyph indices and positions (in font space)
1629
 * assuming that the text is to be shown at the origin.
1783
 * assuming that the text is to be shown at the origin.
1630
 *
1784
 *
1631
 * If @clusters is not %NULL, @num_clusters and @cluster_flags are also
1785
 * If @clusters is not %NULL, @num_clusters and @cluster_flags are also
1632
 * non-%NULL, and cluster mapping should be computed. The semantics of how
1786
 * non-%NULL, and cluster mapping should be computed. The semantics of how
1633
 * cluster array allocation works is similar to the glyph array.  That is,
1787
 * cluster array allocation works is similar to the glyph array.  That is,
1634
 * if @clusters initially points to a non-%NULL value, that array may be used
1788
 * if @clusters initially points to a non-%NULL value, that array may be used
1635
 * as a cluster buffer, and @num_clusters points to the number of cluster
1789
 * as a cluster buffer, and @num_clusters points to the number of cluster
1636
 * entries available there.  If the provided cluster array is too short for
1790
 * entries available there.  If the provided cluster array is too short for
1637
 * the conversion (or for convenience), a new cluster array may be allocated
1791
 * the conversion (or for convenience), a new cluster array may be allocated
1638
 * using cairo_text_cluster_allocate() and placed in @clusters.  Upon return,
1792
 * using cairo_text_cluster_allocate() and placed in @clusters.  In this case,
-
 
1793
 * the original value of @clusters will still be freed by the caller.  Upon
1639
 * @num_clusters should contain the number of generated clusters.
1794
 * return, @num_clusters should contain the number of generated clusters.
1640
 * If the value @clusters points at has changed after the call, the caller
1795
 * If the value @clusters points at has changed after the call, the caller
1641
 * will free the allocated cluster array using cairo_text_cluster_free().
1796
 * will free the allocated cluster array using cairo_text_cluster_free().
1642
 *
1797
 *
1643
 * The callback is optional.  If @num_glyphs is negative upon
1798
 * The callback is optional.  If @num_glyphs is negative upon
1644
 * the callback returning or if the return value
1799
 * the callback returning or if the return value
Line 1793... Line 1948...
1793
cairo_public cairo_surface_t *
1948
cairo_public cairo_surface_t *
1794
cairo_get_group_target (cairo_t *cr);
1949
cairo_get_group_target (cairo_t *cr);
Line 1795... Line 1950...
1795
 
1950
 
1796
/**
1951
/**
1797
 * cairo_path_data_type_t:
1952
 * cairo_path_data_type_t:
1798
 * @CAIRO_PATH_MOVE_TO: A move-to operation
1953
 * @CAIRO_PATH_MOVE_TO: A move-to operation, since 1.0
1799
 * @CAIRO_PATH_LINE_TO: A line-to operation
1954
 * @CAIRO_PATH_LINE_TO: A line-to operation, since 1.0
1800
 * @CAIRO_PATH_CURVE_TO: A curve-to operation
1955
 * @CAIRO_PATH_CURVE_TO: A curve-to operation, since 1.0
1801
 * @CAIRO_PATH_CLOSE_PATH: A close-path operation
1956
 * @CAIRO_PATH_CLOSE_PATH: A close-path operation, since 1.0
1802
 *
1957
 *
1803
 * #cairo_path_data_t is used to describe the type of one portion
1958
 * #cairo_path_data_t is used to describe the type of one portion
1804
 * of a path when represented as a #cairo_path_t.
1959
 * of a path when represented as a #cairo_path_t.
-
 
1960
 * See #cairo_path_data_t for details.
-
 
1961
 *
1805
 * See #cairo_path_data_t for details.
1962
 * Since: 1.0
1806
 **/
1963
 **/
1807
typedef enum _cairo_path_data_type {
1964
typedef enum _cairo_path_data_type {
1808
    CAIRO_PATH_MOVE_TO,
1965
    CAIRO_PATH_MOVE_TO,
1809
    CAIRO_PATH_LINE_TO,
1966
    CAIRO_PATH_LINE_TO,
Line 1874... Line 2031...
1874
 * users of the cairo API to hold extra values in the path data
2031
 * users of the cairo API to hold extra values in the path data
1875
 * structure.  For this reason, it is recommended that applications
2032
 * structure.  For this reason, it is recommended that applications
1876
 * always use data->header.length to
2033
 * always use data->header.length to
1877
 * iterate over the path data, instead of hardcoding the number of
2034
 * iterate over the path data, instead of hardcoding the number of
1878
 * elements for each element type.
2035
 * elements for each element type.
-
 
2036
 *
-
 
2037
 * Since: 1.0
1879
 **/
2038
 **/
1880
typedef union _cairo_path_data_t cairo_path_data_t;
2039
typedef union _cairo_path_data_t cairo_path_data_t;
1881
union _cairo_path_data_t {
2040
union _cairo_path_data_t {
1882
    struct {
2041
    struct {
1883
	cairo_path_data_type_t type;
2042
	cairo_path_data_type_t type;
Line 1904... Line 2063...
1904
 *
2063
 *
1905
 * The num_data member gives the number of elements in the data
2064
 * The num_data member gives the number of elements in the data
1906
 * array. This number is larger than the number of independent path
2065
 * array. This number is larger than the number of independent path
1907
 * portions (defined in #cairo_path_data_type_t), since the data
2066
 * portions (defined in #cairo_path_data_type_t), since the data
1908
 * includes both headers and coordinates for each portion.
2067
 * includes both headers and coordinates for each portion.
-
 
2068
 *
-
 
2069
 * Since: 1.0
1909
 **/
2070
 **/
1910
typedef struct cairo_path {
2071
typedef struct cairo_path {
1911
    cairo_status_t status;
2072
    cairo_status_t status;
1912
    cairo_path_data_t *data;
2073
    cairo_path_data_t *data;
1913
    int num_data;
2074
    int num_data;
Line 1939... Line 2100...
1939
cairo_public cairo_device_t *
2100
cairo_public cairo_device_t *
1940
cairo_device_reference (cairo_device_t *device);
2101
cairo_device_reference (cairo_device_t *device);
Line 1941... Line 2102...
1941
 
2102
 
1942
/**
2103
/**
1943
 * cairo_device_type_t:
2104
 * cairo_device_type_t:
1944
 * @CAIRO_DEVICE_TYPE_DRM: The surface is of type Direct Render Manager
2105
 * @CAIRO_DEVICE_TYPE_DRM: The device is of type Direct Render Manager, since 1.10
1945
 * @CAIRO_DEVICE_TYPE_GL: The surface is of type OpenGL
2106
 * @CAIRO_DEVICE_TYPE_GL: The device is of type OpenGL, since 1.10
1946
 * @CAIRO_DEVICE_TYPE_SCRIPT: The surface is of type script
2107
 * @CAIRO_DEVICE_TYPE_SCRIPT: The device is of type script, since 1.10
1947
 * @CAIRO_DEVICE_TYPE_XCB: The surface is of type xcb
2108
 * @CAIRO_DEVICE_TYPE_XCB: The device is of type xcb, since 1.10
1948
 * @CAIRO_DEVICE_TYPE_XLIB: The surface is of type xlib
2109
 * @CAIRO_DEVICE_TYPE_XLIB: The device is of type xlib, since 1.10
1949
 * @CAIRO_DEVICE_TYPE_XML: The surface is of type XML
2110
 * @CAIRO_DEVICE_TYPE_XML: The device is of type XML, since 1.10
-
 
2111
 * @CAIRO_DEVICE_TYPE_COGL: The device is of type cogl, since 1.12
-
 
2112
 * @CAIRO_DEVICE_TYPE_WIN32: The device is of type win32, since 1.12
1950
 *   cairo_surface_create_for_rectangle()
2113
 * @CAIRO_DEVICE_TYPE_INVALID: The device is invalid, since 1.10
1951
 *
2114
 *
1952
 * #cairo_device_type_t is used to describe the type of a given
2115
 * #cairo_device_type_t is used to describe the type of a given
1953
 * device. The devices types are also known as "backends" within cairo.
2116
 * device. The devices types are also known as "backends" within cairo.
1954
 *
2117
 *
1955
 * The device type can be queried with cairo_device_get_type()
2118
 * The device type can be queried with cairo_device_get_type()
1956
 *
2119
 *
1957
 * The various #cairo_device_t functions can be used with surfaces of
2120
 * The various #cairo_device_t functions can be used with devices of
1958
 * any type, but some backends also provide type-specific functions
2121
 * any type, but some backends also provide type-specific functions
1959
 * that must only be called with a device of the appropriate
2122
 * that must only be called with a device of the appropriate
1960
 * type. These functions have names that begin with
2123
 * type. These functions have names that begin with
-
 
2124
 * cairo_type_device such as
1961
 * cairo_type_device such as cairo_xcb_device_debug_set_render_version().
2125
 * cairo_xcb_device_debug_cap_xrender_version().
1962
 *
2126
 *
1963
 * The behavior of calling a type-specific function with a surface of
2127
 * The behavior of calling a type-specific function with a device of
1964
 * the wrong type is undefined.
2128
 * the wrong type is undefined.
1965
 *
2129
 *
1966
 * New entries may be added in future versions.
2130
 * New entries may be added in future versions.
1967
 *
2131
 *
Line 1971... Line 2135...
1971
    CAIRO_DEVICE_TYPE_DRM,
2135
    CAIRO_DEVICE_TYPE_DRM,
1972
    CAIRO_DEVICE_TYPE_GL,
2136
    CAIRO_DEVICE_TYPE_GL,
1973
    CAIRO_DEVICE_TYPE_SCRIPT,
2137
    CAIRO_DEVICE_TYPE_SCRIPT,
1974
    CAIRO_DEVICE_TYPE_XCB,
2138
    CAIRO_DEVICE_TYPE_XCB,
1975
    CAIRO_DEVICE_TYPE_XLIB,
2139
    CAIRO_DEVICE_TYPE_XLIB,
1976
    CAIRO_DEVICE_TYPE_XML
2140
    CAIRO_DEVICE_TYPE_XML,
-
 
2141
    CAIRO_DEVICE_TYPE_COGL,
-
 
2142
    CAIRO_DEVICE_TYPE_WIN32,
-
 
2143
 
-
 
2144
    CAIRO_DEVICE_TYPE_INVALID = -1
1977
} cairo_device_type_t;
2145
} cairo_device_type_t;
Line 1978... Line 2146...
1978
 
2146
 
1979
cairo_public cairo_device_type_t
2147
cairo_public cairo_device_type_t
Line 2018... Line 2186...
2018
			      cairo_content_t	content,
2186
			      cairo_content_t	content,
2019
			      int		width,
2187
			      int		width,
2020
			      int		height);
2188
			      int		height);
Line 2021... Line 2189...
2021
 
2189
 
-
 
2190
cairo_public cairo_surface_t *
-
 
2191
cairo_surface_create_similar_image (cairo_surface_t  *other,
-
 
2192
				    cairo_format_t    format,
-
 
2193
				    int		width,
-
 
2194
				    int		height);
-
 
2195
 
-
 
2196
cairo_public cairo_surface_t *
-
 
2197
cairo_surface_map_to_image (cairo_surface_t  *surface,
-
 
2198
			    const cairo_rectangle_int_t *extents);
-
 
2199
 
-
 
2200
cairo_public void
-
 
2201
cairo_surface_unmap_image (cairo_surface_t *surface,
-
 
2202
			   cairo_surface_t *image);
-
 
2203
 
2022
cairo_public cairo_surface_t *
2204
cairo_public cairo_surface_t *
2023
cairo_surface_create_for_rectangle (cairo_surface_t	*target,
2205
cairo_surface_create_for_rectangle (cairo_surface_t	*target,
2024
                                    double		 x,
2206
                                    double		 x,
2025
                                    double		 y,
2207
                                    double		 y,
2026
                                    double		 width,
2208
                                    double		 width,
Line -... Line 2209...
-
 
2209
                                    double		 height);
-
 
2210
 
-
 
2211
typedef enum {
-
 
2212
	CAIRO_SURFACE_OBSERVER_NORMAL = 0,
-
 
2213
	CAIRO_SURFACE_OBSERVER_RECORD_OPERATIONS = 0x1
-
 
2214
} cairo_surface_observer_mode_t;
-
 
2215
 
-
 
2216
cairo_public cairo_surface_t *
-
 
2217
cairo_surface_create_observer (cairo_surface_t *target,
-
 
2218
			       cairo_surface_observer_mode_t mode);
-
 
2219
 
-
 
2220
typedef void (*cairo_surface_observer_callback_t) (cairo_surface_t *observer,
-
 
2221
						   cairo_surface_t *target,
-
 
2222
						   void *data);
-
 
2223
 
-
 
2224
cairo_public cairo_status_t
-
 
2225
cairo_surface_observer_add_paint_callback (cairo_surface_t *abstract_surface,
-
 
2226
					   cairo_surface_observer_callback_t func,
-
 
2227
					   void *data);
-
 
2228
 
-
 
2229
cairo_public cairo_status_t
-
 
2230
cairo_surface_observer_add_mask_callback (cairo_surface_t *abstract_surface,
-
 
2231
					  cairo_surface_observer_callback_t func,
-
 
2232
					  void *data);
-
 
2233
 
-
 
2234
cairo_public cairo_status_t
-
 
2235
cairo_surface_observer_add_fill_callback (cairo_surface_t *abstract_surface,
-
 
2236
					  cairo_surface_observer_callback_t func,
-
 
2237
					  void *data);
-
 
2238
 
-
 
2239
cairo_public cairo_status_t
-
 
2240
cairo_surface_observer_add_stroke_callback (cairo_surface_t *abstract_surface,
-
 
2241
					    cairo_surface_observer_callback_t func,
-
 
2242
					    void *data);
-
 
2243
 
-
 
2244
cairo_public cairo_status_t
-
 
2245
cairo_surface_observer_add_glyphs_callback (cairo_surface_t *abstract_surface,
-
 
2246
					    cairo_surface_observer_callback_t func,
-
 
2247
					    void *data);
-
 
2248
 
-
 
2249
cairo_public cairo_status_t
-
 
2250
cairo_surface_observer_add_flush_callback (cairo_surface_t *abstract_surface,
-
 
2251
					   cairo_surface_observer_callback_t func,
-
 
2252
					   void *data);
-
 
2253
 
-
 
2254
cairo_public cairo_status_t
-
 
2255
cairo_surface_observer_add_finish_callback (cairo_surface_t *abstract_surface,
-
 
2256
					    cairo_surface_observer_callback_t func,
-
 
2257
					    void *data);
-
 
2258
 
-
 
2259
cairo_public cairo_status_t
-
 
2260
cairo_surface_observer_print (cairo_surface_t *surface,
-
 
2261
			      cairo_write_func_t write_func,
-
 
2262
			      void *closure);
-
 
2263
cairo_public double
-
 
2264
cairo_surface_observer_elapsed (cairo_surface_t *surface);
-
 
2265
 
-
 
2266
cairo_public cairo_status_t
-
 
2267
cairo_device_observer_print (cairo_device_t *device,
-
 
2268
			     cairo_write_func_t write_func,
-
 
2269
			     void *closure);
-
 
2270
 
-
 
2271
cairo_public double
-
 
2272
cairo_device_observer_elapsed (cairo_device_t *device);
-
 
2273
 
-
 
2274
cairo_public double
-
 
2275
cairo_device_observer_paint_elapsed (cairo_device_t *device);
-
 
2276
 
-
 
2277
cairo_public double
-
 
2278
cairo_device_observer_mask_elapsed (cairo_device_t *device);
-
 
2279
 
-
 
2280
cairo_public double
-
 
2281
cairo_device_observer_fill_elapsed (cairo_device_t *device);
-
 
2282
 
-
 
2283
cairo_public double
-
 
2284
cairo_device_observer_stroke_elapsed (cairo_device_t *device);
-
 
2285
 
-
 
2286
cairo_public double
2027
                                    double		 height);
2287
cairo_device_observer_glyphs_elapsed (cairo_device_t *device);
2028
 
2288
 
Line 2029... Line 2289...
2029
cairo_public cairo_surface_t *
2289
cairo_public cairo_surface_t *
2030
cairo_surface_reference (cairo_surface_t *surface);
2290
cairo_surface_reference (cairo_surface_t *surface);
Line 2044... Line 2304...
2044
cairo_public cairo_status_t
2304
cairo_public cairo_status_t
2045
cairo_surface_status (cairo_surface_t *surface);
2305
cairo_surface_status (cairo_surface_t *surface);
Line 2046... Line 2306...
2046
 
2306
 
2047
/**
2307
/**
2048
 * cairo_surface_type_t:
2308
 * cairo_surface_type_t:
2049
 * @CAIRO_SURFACE_TYPE_IMAGE: The surface is of type image
2309
 * @CAIRO_SURFACE_TYPE_IMAGE: The surface is of type image, since 1.2
2050
 * @CAIRO_SURFACE_TYPE_PDF: The surface is of type pdf
2310
 * @CAIRO_SURFACE_TYPE_PDF: The surface is of type pdf, since 1.2
2051
 * @CAIRO_SURFACE_TYPE_PS: The surface is of type ps
2311
 * @CAIRO_SURFACE_TYPE_PS: The surface is of type ps, since 1.2
2052
 * @CAIRO_SURFACE_TYPE_XLIB: The surface is of type xlib
2312
 * @CAIRO_SURFACE_TYPE_XLIB: The surface is of type xlib, since 1.2
2053
 * @CAIRO_SURFACE_TYPE_XCB: The surface is of type xcb
2313
 * @CAIRO_SURFACE_TYPE_XCB: The surface is of type xcb, since 1.2
2054
 * @CAIRO_SURFACE_TYPE_GLITZ: The surface is of type glitz
2314
 * @CAIRO_SURFACE_TYPE_GLITZ: The surface is of type glitz, since 1.2
2055
 * @CAIRO_SURFACE_TYPE_QUARTZ: The surface is of type quartz
2315
 * @CAIRO_SURFACE_TYPE_QUARTZ: The surface is of type quartz, since 1.2
2056
 * @CAIRO_SURFACE_TYPE_WIN32: The surface is of type win32
2316
 * @CAIRO_SURFACE_TYPE_WIN32: The surface is of type win32, since 1.2
2057
 * @CAIRO_SURFACE_TYPE_BEOS: The surface is of type beos
2317
 * @CAIRO_SURFACE_TYPE_BEOS: The surface is of type beos, since 1.2
2058
 * @CAIRO_SURFACE_TYPE_DIRECTFB: The surface is of type directfb
2318
 * @CAIRO_SURFACE_TYPE_DIRECTFB: The surface is of type directfb, since 1.2
2059
 * @CAIRO_SURFACE_TYPE_SVG: The surface is of type svg
2319
 * @CAIRO_SURFACE_TYPE_SVG: The surface is of type svg, since 1.2
2060
 * @CAIRO_SURFACE_TYPE_OS2: The surface is of type os2
2320
 * @CAIRO_SURFACE_TYPE_OS2: The surface is of type os2, since 1.4
2061
 * @CAIRO_SURFACE_TYPE_WIN32_PRINTING: The surface is a win32 printing surface
2321
 * @CAIRO_SURFACE_TYPE_WIN32_PRINTING: The surface is a win32 printing surface, since 1.6
2062
 * @CAIRO_SURFACE_TYPE_QUARTZ_IMAGE: The surface is of type quartz_image
2322
 * @CAIRO_SURFACE_TYPE_QUARTZ_IMAGE: The surface is of type quartz_image, since 1.6
2063
 * @CAIRO_SURFACE_TYPE_SCRIPT: The surface is of type script, since 1.10
2323
 * @CAIRO_SURFACE_TYPE_SCRIPT: The surface is of type script, since 1.10
2064
 * @CAIRO_SURFACE_TYPE_QT: The surface is of type Qt, since 1.10
2324
 * @CAIRO_SURFACE_TYPE_QT: The surface is of type Qt, since 1.10
2065
 * @CAIRO_SURFACE_TYPE_RECORDING: The surface is of type recording, since 1.10
2325
 * @CAIRO_SURFACE_TYPE_RECORDING: The surface is of type recording, since 1.10
2066
 * @CAIRO_SURFACE_TYPE_VG: The surface is a OpenVG surface, since 1.10
2326
 * @CAIRO_SURFACE_TYPE_VG: The surface is a OpenVG surface, since 1.10
Line 2069... Line 2329...
2069
 * @CAIRO_SURFACE_TYPE_TEE: The surface is of type 'tee' (a multiplexing surface), since 1.10
2329
 * @CAIRO_SURFACE_TYPE_TEE: The surface is of type 'tee' (a multiplexing surface), since 1.10
2070
 * @CAIRO_SURFACE_TYPE_XML: The surface is of type XML (for debugging), since 1.10
2330
 * @CAIRO_SURFACE_TYPE_XML: The surface is of type XML (for debugging), since 1.10
2071
 * @CAIRO_SURFACE_TYPE_SKIA: The surface is of type Skia, since 1.10
2331
 * @CAIRO_SURFACE_TYPE_SKIA: The surface is of type Skia, since 1.10
2072
 * @CAIRO_SURFACE_TYPE_SUBSURFACE: The surface is a subsurface created with
2332
 * @CAIRO_SURFACE_TYPE_SUBSURFACE: The surface is a subsurface created with
2073
 *   cairo_surface_create_for_rectangle(), since 1.10
2333
 *   cairo_surface_create_for_rectangle(), since 1.10
-
 
2334
 * @CAIRO_SURFACE_TYPE_COGL: This surface is of type Cogl, since 1.12
2074
 *
2335
 *
2075
 * #cairo_surface_type_t is used to describe the type of a given
2336
 * #cairo_surface_type_t is used to describe the type of a given
2076
 * surface. The surface types are also known as "backends" or "surface
2337
 * surface. The surface types are also known as "backends" or "surface
2077
 * backends" within cairo.
2338
 * backends" within cairo.
2078
 *
2339
 *
2079
 * The type of a surface is determined by the function used to create
2340
 * The type of a surface is determined by the function used to create
-
 
2341
 * it, which will generally be of the form
2080
 * it, which will generally be of the form cairo_type_surface_create(),
2342
 * cairo_type_surface_create(),
2081
 * (though see cairo_surface_create_similar() as well).
2343
 * (though see cairo_surface_create_similar() as well).
2082
 *
2344
 *
2083
 * The surface type can be queried with cairo_surface_get_type()
2345
 * The surface type can be queried with cairo_surface_get_type()
2084
 *
2346
 *
2085
 * The various #cairo_surface_t functions can be used with surfaces of
2347
 * The various #cairo_surface_t functions can be used with surfaces of
2086
 * any type, but some backends also provide type-specific functions
2348
 * any type, but some backends also provide type-specific functions
2087
 * that must only be called with a surface of the appropriate
2349
 * that must only be called with a surface of the appropriate
2088
 * type. These functions have names that begin with
2350
 * type. These functions have names that begin with
2089
 * cairo_type_surface such as cairo_image_surface_get_width().
2351
 * cairo_type_surface such as cairo_image_surface_get_width().
2090
 *
2352
 *
2091
 * The behavior of calling a type-specific function with a surface of
2353
 * The behavior of calling a type-specific function with a surface of
2092
 * the wrong type is undefined.
2354
 * the wrong type is undefined.
2093
 *
2355
 *
2094
 * New entries may be added in future versions.
2356
 * New entries may be added in future versions.
Line 2117... Line 2379...
2117
    CAIRO_SURFACE_TYPE_GL,
2379
    CAIRO_SURFACE_TYPE_GL,
2118
    CAIRO_SURFACE_TYPE_DRM,
2380
    CAIRO_SURFACE_TYPE_DRM,
2119
    CAIRO_SURFACE_TYPE_TEE,
2381
    CAIRO_SURFACE_TYPE_TEE,
2120
    CAIRO_SURFACE_TYPE_XML,
2382
    CAIRO_SURFACE_TYPE_XML,
2121
    CAIRO_SURFACE_TYPE_SKIA,
2383
    CAIRO_SURFACE_TYPE_SKIA,
2122
    CAIRO_SURFACE_TYPE_SUBSURFACE
2384
    CAIRO_SURFACE_TYPE_SUBSURFACE,
-
 
2385
    CAIRO_SURFACE_TYPE_COGL
2123
} cairo_surface_type_t;
2386
} cairo_surface_type_t;
Line 2124... Line 2387...
2124
 
2387
 
2125
cairo_public cairo_surface_type_t
2388
cairo_public cairo_surface_type_t
Line 2153... Line 2416...
2153
 
2416
 
2154
#define CAIRO_MIME_TYPE_JPEG "image/jpeg"
2417
#define CAIRO_MIME_TYPE_JPEG "image/jpeg"
2155
#define CAIRO_MIME_TYPE_PNG "image/png"
2418
#define CAIRO_MIME_TYPE_PNG "image/png"
2156
#define CAIRO_MIME_TYPE_JP2 "image/jp2"
2419
#define CAIRO_MIME_TYPE_JP2 "image/jp2"
-
 
2420
#define CAIRO_MIME_TYPE_URI "text/x-uri"
Line 2157... Line 2421...
2157
#define CAIRO_MIME_TYPE_URI "text/x-uri"
2421
#define CAIRO_MIME_TYPE_UNIQUE_ID "application/x-cairo.uuid"
2158
 
2422
 
2159
cairo_public void
2423
cairo_public void
2160
cairo_surface_get_mime_data (cairo_surface_t		*surface,
2424
cairo_surface_get_mime_data (cairo_surface_t		*surface,
Line 2168... Line 2432...
2168
                             const unsigned char	*data,
2432
                             const unsigned char	*data,
2169
                             unsigned long		 length,
2433
                             unsigned long		 length,
2170
			     cairo_destroy_func_t	 destroy,
2434
			     cairo_destroy_func_t	 destroy,
2171
			     void			*closure);
2435
			     void			*closure);
Line -... Line 2436...
-
 
2436
 
-
 
2437
cairo_public cairo_bool_t
-
 
2438
cairo_surface_supports_mime_type (cairo_surface_t		*surface,
-
 
2439
				  const char		        *mime_type);
2172
 
2440
 
2173
cairo_public void
2441
cairo_public void
2174
cairo_surface_get_font_options (cairo_surface_t      *surface,
2442
cairo_surface_get_font_options (cairo_surface_t      *surface,
Line 2175... Line 2443...
2175
				cairo_font_options_t *options);
2443
				cairo_font_options_t *options);
Line 2216... Line 2484...
2216
cairo_public cairo_bool_t
2484
cairo_public cairo_bool_t
2217
cairo_surface_has_show_text_glyphs (cairo_surface_t *surface);
2485
cairo_surface_has_show_text_glyphs (cairo_surface_t *surface);
Line 2218... Line 2486...
2218
 
2486
 
Line 2219... Line -...
2219
/* Image-surface functions */
-
 
2220
 
-
 
2221
/**
-
 
2222
 * cairo_format_t:
-
 
2223
 * @CAIRO_FORMAT_INVALID: no such format exists or is supported.
-
 
2224
 * @CAIRO_FORMAT_ARGB32: each pixel is a 32-bit quantity, with
-
 
2225
 *   alpha in the upper 8 bits, then red, then green, then blue.
-
 
2226
 *   The 32-bit quantities are stored native-endian. Pre-multiplied
-
 
2227
 *   alpha is used. (That is, 50% transparent red is 0x80800000,
-
 
2228
 *   not 0x80ff0000.)
-
 
2229
 * @CAIRO_FORMAT_RGB24: each pixel is a 32-bit quantity, with
-
 
2230
 *   the upper 8 bits unused. Red, Green, and Blue are stored
-
 
2231
 *   in the remaining 24 bits in that order.
-
 
2232
 * @CAIRO_FORMAT_A8: each pixel is a 8-bit quantity holding
-
 
2233
 *   an alpha value.
-
 
2234
 * @CAIRO_FORMAT_A1: each pixel is a 1-bit quantity holding
-
 
2235
 *   an alpha value. Pixels are packed together into 32-bit
-
 
2236
 *   quantities. The ordering of the bits matches the
-
 
2237
 *   endianess of the platform. On a big-endian machine, the
-
 
2238
 *   first pixel is in the uppermost bit, on a little-endian
-
 
2239
 *   machine the first pixel is in the least-significant bit.
-
 
2240
 * @CAIRO_FORMAT_RGB16_565: each pixel is a 16-bit quantity
-
 
2241
 *   with red in the upper 5 bits, then green in the middle
-
 
2242
 *   6 bits, and blue in the lower 5 bits.
-
 
2243
 *
-
 
2244
 * #cairo_format_t is used to identify the memory format of
-
 
2245
 * image data.
-
 
2246
 *
-
 
2247
 * New entries may be added in future versions.
-
 
2248
 **/
-
 
2249
typedef enum _cairo_format {
-
 
2250
    CAIRO_FORMAT_INVALID   = -1,
-
 
2251
    CAIRO_FORMAT_ARGB32    = 0,
-
 
2252
    CAIRO_FORMAT_RGB24     = 1,
-
 
2253
    CAIRO_FORMAT_A8        = 2,
-
 
2254
    CAIRO_FORMAT_A1        = 3,
-
 
2255
    CAIRO_FORMAT_RGB16_565 = 4
-
 
2256
} cairo_format_t;
2487
/* Image-surface functions */
2257
 
2488
 
2258
cairo_public cairo_surface_t *
2489
cairo_public cairo_surface_t *
2259
cairo_image_surface_create (cairo_format_t	format,
2490
cairo_image_surface_create (cairo_format_t	format,
Line 2308... Line 2539...
2308
                                     double *x0,
2539
                                     double *x0,
2309
                                     double *y0,
2540
                                     double *y0,
2310
                                     double *width,
2541
                                     double *width,
2311
                                     double *height);
2542
                                     double *height);
Line -... Line 2543...
-
 
2543
 
-
 
2544
cairo_public cairo_bool_t
-
 
2545
cairo_recording_surface_get_extents (cairo_surface_t *surface,
-
 
2546
				     cairo_rectangle_t *extents);
-
 
2547
 
-
 
2548
/* raster-source pattern (callback) functions */
-
 
2549
 
-
 
2550
/**
-
 
2551
 * cairo_raster_source_acquire_func_t:
-
 
2552
 * @pattern: the pattern being rendered from
-
 
2553
 * @callback_data: the user data supplied during creation
-
 
2554
 * @target: the rendering target surface
-
 
2555
 * @extents: rectangular region of interest in pixels in sample space
-
 
2556
 *
-
 
2557
 * #cairo_raster_source_acquire_func_t is the type of function which is
-
 
2558
 * called when a pattern is being rendered from. It should create a surface
-
 
2559
 * that provides the pixel data for the region of interest as defined by
-
 
2560
 * extents, though the surface itself does not have to be limited to that
-
 
2561
 * area. For convenience the surface should probably be of image type,
-
 
2562
 * created with cairo_surface_create_similar_image() for the target (which
-
 
2563
 * enables the number of copies to be reduced during transfer to the
-
 
2564
 * device). Another option, might be to return a similar surface to the
-
 
2565
 * target for explicit handling by the application of a set of cached sources
-
 
2566
 * on the device. The region of sample data provided should be defined using
-
 
2567
 * cairo_surface_set_device_offset() to specify the top-left corner of the
-
 
2568
 * sample data (along with width and height of the surface).
-
 
2569
 *
-
 
2570
 * Returns: a #cairo_surface_t
-
 
2571
 *
-
 
2572
 * Since: 1.12
-
 
2573
 **/
-
 
2574
typedef cairo_surface_t *
-
 
2575
(*cairo_raster_source_acquire_func_t) (cairo_pattern_t *pattern,
-
 
2576
				       void *callback_data,
-
 
2577
				       cairo_surface_t *target,
-
 
2578
				       const cairo_rectangle_int_t *extents);
-
 
2579
 
-
 
2580
/**
-
 
2581
 * cairo_raster_source_release_func_t:
-
 
2582
 * @pattern: the pattern being rendered from
-
 
2583
 * @callback_data: the user data supplied during creation
-
 
2584
 * @surface: the surface created during acquire
-
 
2585
 *
-
 
2586
 * #cairo_raster_source_release_func_t is the type of function which is
-
 
2587
 * called when the pixel data is no longer being access by the pattern
-
 
2588
 * for the rendering operation. Typically this function will simply
-
 
2589
 * destroy the surface created during acquire.
-
 
2590
 *
-
 
2591
 * Since: 1.12
-
 
2592
 **/
-
 
2593
typedef void
-
 
2594
(*cairo_raster_source_release_func_t) (cairo_pattern_t *pattern,
-
 
2595
				       void *callback_data,
-
 
2596
				       cairo_surface_t *surface);
-
 
2597
 
-
 
2598
/**
-
 
2599
 * cairo_raster_source_snapshot_func_t:
-
 
2600
 * @pattern: the pattern being rendered from
-
 
2601
 * @callback_data: the user data supplied during creation
-
 
2602
 *
-
 
2603
 * #cairo_raster_source_snapshot_func_t is the type of function which is
-
 
2604
 * called when the pixel data needs to be preserved for later use
-
 
2605
 * during printing. This pattern will be accessed again later, and it
-
 
2606
 * is expected to provide the pixel data that was current at the time
-
 
2607
 * of snapshotting.
-
 
2608
 *
-
 
2609
 * Return value: CAIRO_STATUS_SUCCESS on success, or one of the
-
 
2610
 * #cairo_status_t error codes for failure.
-
 
2611
 *
-
 
2612
 * Since: 1.12
-
 
2613
 **/
-
 
2614
typedef cairo_status_t
-
 
2615
(*cairo_raster_source_snapshot_func_t) (cairo_pattern_t *pattern,
-
 
2616
					void *callback_data);
-
 
2617
 
-
 
2618
/**
-
 
2619
 * cairo_raster_source_copy_func_t:
-
 
2620
 * @pattern: the #cairo_pattern_t that was copied to
-
 
2621
 * @callback_data: the user data supplied during creation
-
 
2622
 * @other: the #cairo_pattern_t being used as the source for the copy
-
 
2623
 *
-
 
2624
 * #cairo_raster_source_copy_func_t is the type of function which is
-
 
2625
 * called when the pattern gets copied as a normal part of rendering.
-
 
2626
 *
-
 
2627
 * Return value: CAIRO_STATUS_SUCCESS on success, or one of the
-
 
2628
 * #cairo_status_t error codes for failure.
-
 
2629
 *
-
 
2630
 * Since: 1.12
-
 
2631
 **/
-
 
2632
typedef cairo_status_t
-
 
2633
(*cairo_raster_source_copy_func_t) (cairo_pattern_t *pattern,
-
 
2634
				    void *callback_data,
-
 
2635
				    const cairo_pattern_t *other);
-
 
2636
 
-
 
2637
/**
-
 
2638
 * cairo_raster_source_finish_func_t:
-
 
2639
 * @pattern: the pattern being rendered from
-
 
2640
 * @callback_data: the user data supplied during creation
-
 
2641
 *
-
 
2642
 * #cairo_raster_source_finish_func_t is the type of function which is
-
 
2643
 * called when the pattern (or a copy thereof) is no longer required.
-
 
2644
 *
-
 
2645
 * Since: 1.12
-
 
2646
 **/
-
 
2647
typedef void
-
 
2648
(*cairo_raster_source_finish_func_t) (cairo_pattern_t *pattern,
-
 
2649
				      void *callback_data);
-
 
2650
 
-
 
2651
cairo_public cairo_pattern_t *
-
 
2652
cairo_pattern_create_raster_source (void *user_data,
-
 
2653
				    cairo_content_t content,
-
 
2654
				    int width, int height);
-
 
2655
 
-
 
2656
cairo_public void
-
 
2657
cairo_raster_source_pattern_set_callback_data (cairo_pattern_t *pattern,
-
 
2658
					       void *data);
-
 
2659
 
-
 
2660
cairo_public void *
-
 
2661
cairo_raster_source_pattern_get_callback_data (cairo_pattern_t *pattern);
-
 
2662
 
-
 
2663
cairo_public void
-
 
2664
cairo_raster_source_pattern_set_acquire (cairo_pattern_t *pattern,
-
 
2665
					 cairo_raster_source_acquire_func_t acquire,
-
 
2666
					 cairo_raster_source_release_func_t release);
-
 
2667
 
-
 
2668
cairo_public void
-
 
2669
cairo_raster_source_pattern_get_acquire (cairo_pattern_t *pattern,
-
 
2670
					 cairo_raster_source_acquire_func_t *acquire,
-
 
2671
					 cairo_raster_source_release_func_t *release);
-
 
2672
cairo_public void
-
 
2673
cairo_raster_source_pattern_set_snapshot (cairo_pattern_t *pattern,
-
 
2674
					  cairo_raster_source_snapshot_func_t snapshot);
-
 
2675
 
-
 
2676
cairo_public cairo_raster_source_snapshot_func_t
-
 
2677
cairo_raster_source_pattern_get_snapshot (cairo_pattern_t *pattern);
-
 
2678
 
-
 
2679
cairo_public void
-
 
2680
cairo_raster_source_pattern_set_copy (cairo_pattern_t *pattern,
-
 
2681
				      cairo_raster_source_copy_func_t copy);
-
 
2682
 
-
 
2683
cairo_public cairo_raster_source_copy_func_t
-
 
2684
cairo_raster_source_pattern_get_copy (cairo_pattern_t *pattern);
-
 
2685
 
-
 
2686
cairo_public void
-
 
2687
cairo_raster_source_pattern_set_finish (cairo_pattern_t *pattern,
-
 
2688
					cairo_raster_source_finish_func_t finish);
-
 
2689
 
-
 
2690
cairo_public cairo_raster_source_finish_func_t
-
 
2691
cairo_raster_source_pattern_get_finish (cairo_pattern_t *pattern);
2312
 
2692
 
Line 2313... Line 2693...
2313
/* Pattern creation functions */
2693
/* Pattern creation functions */
2314
 
2694
 
Line 2329... Line 2709...
2329
cairo_public cairo_pattern_t *
2709
cairo_public cairo_pattern_t *
2330
cairo_pattern_create_radial (double cx0, double cy0, double radius0,
2710
cairo_pattern_create_radial (double cx0, double cy0, double radius0,
2331
			     double cx1, double cy1, double radius1);
2711
			     double cx1, double cy1, double radius1);
Line 2332... Line 2712...
2332
 
2712
 
-
 
2713
cairo_public cairo_pattern_t *
-
 
2714
cairo_pattern_create_mesh (void);
-
 
2715
 
2333
cairo_public cairo_pattern_t *
2716
cairo_public cairo_pattern_t *
Line 2334... Line 2717...
2334
cairo_pattern_reference (cairo_pattern_t *pattern);
2717
cairo_pattern_reference (cairo_pattern_t *pattern);
2335
 
2718
 
Line 2353... Line 2736...
2353
			     cairo_destroy_func_t	  destroy);
2736
			     cairo_destroy_func_t	  destroy);
Line 2354... Line 2737...
2354
 
2737
 
2355
/**
2738
/**
2356
 * cairo_pattern_type_t:
2739
 * cairo_pattern_type_t:
2357
 * @CAIRO_PATTERN_TYPE_SOLID: The pattern is a solid (uniform)
2740
 * @CAIRO_PATTERN_TYPE_SOLID: The pattern is a solid (uniform)
2358
 * color. It may be opaque or translucent.
2741
 * color. It may be opaque or translucent, since 1.2.
2359
 * @CAIRO_PATTERN_TYPE_SURFACE: The pattern is a based on a surface (an image).
2742
 * @CAIRO_PATTERN_TYPE_SURFACE: The pattern is a based on a surface (an image), since 1.2.
2360
 * @CAIRO_PATTERN_TYPE_LINEAR: The pattern is a linear gradient.
2743
 * @CAIRO_PATTERN_TYPE_LINEAR: The pattern is a linear gradient, since 1.2.
-
 
2744
 * @CAIRO_PATTERN_TYPE_RADIAL: The pattern is a radial gradient, since 1.2.
-
 
2745
 * @CAIRO_PATTERN_TYPE_MESH: The pattern is a mesh, since 1.12.
2361
 * @CAIRO_PATTERN_TYPE_RADIAL: The pattern is a radial gradient.
2746
 * @CAIRO_PATTERN_TYPE_RASTER_SOURCE: The pattern is a user pattern providing raster data, since 1.12.
2362
 *
2747
 *
2363
 * #cairo_pattern_type_t is used to describe the type of a given pattern.
2748
 * #cairo_pattern_type_t is used to describe the type of a given pattern.
2364
 *
2749
 *
2365
 * The type of a pattern is determined by the function used to create
2750
 * The type of a pattern is determined by the function used to create
Line 2384... Line 2769...
2384
 **/
2769
 **/
2385
typedef enum _cairo_pattern_type {
2770
typedef enum _cairo_pattern_type {
2386
    CAIRO_PATTERN_TYPE_SOLID,
2771
    CAIRO_PATTERN_TYPE_SOLID,
2387
    CAIRO_PATTERN_TYPE_SURFACE,
2772
    CAIRO_PATTERN_TYPE_SURFACE,
2388
    CAIRO_PATTERN_TYPE_LINEAR,
2773
    CAIRO_PATTERN_TYPE_LINEAR,
2389
    CAIRO_PATTERN_TYPE_RADIAL
2774
    CAIRO_PATTERN_TYPE_RADIAL,
-
 
2775
    CAIRO_PATTERN_TYPE_MESH,
-
 
2776
    CAIRO_PATTERN_TYPE_RASTER_SOURCE
2390
} cairo_pattern_type_t;
2777
} cairo_pattern_type_t;
Line 2391... Line 2778...
2391
 
2778
 
2392
cairo_public cairo_pattern_type_t
2779
cairo_public cairo_pattern_type_t
Line 2402... Line 2789...
2402
				   double offset,
2789
				   double offset,
2403
				   double red, double green, double blue,
2790
				   double red, double green, double blue,
2404
				   double alpha);
2791
				   double alpha);
Line 2405... Line 2792...
2405
 
2792
 
-
 
2793
cairo_public void
-
 
2794
cairo_mesh_pattern_begin_patch (cairo_pattern_t *pattern);
-
 
2795
 
-
 
2796
cairo_public void
-
 
2797
cairo_mesh_pattern_end_patch (cairo_pattern_t *pattern);
-
 
2798
 
-
 
2799
cairo_public void
-
 
2800
cairo_mesh_pattern_curve_to (cairo_pattern_t *pattern,
-
 
2801
			     double x1, double y1,
-
 
2802
			     double x2, double y2,
-
 
2803
			     double x3, double y3);
-
 
2804
 
-
 
2805
cairo_public void
-
 
2806
cairo_mesh_pattern_line_to (cairo_pattern_t *pattern,
-
 
2807
			    double x, double y);
-
 
2808
 
-
 
2809
cairo_public void
-
 
2810
cairo_mesh_pattern_move_to (cairo_pattern_t *pattern,
-
 
2811
			    double x, double y);
-
 
2812
 
-
 
2813
cairo_public void
-
 
2814
cairo_mesh_pattern_set_control_point (cairo_pattern_t *pattern,
-
 
2815
				      unsigned int point_num,
-
 
2816
				      double x, double y);
-
 
2817
 
-
 
2818
cairo_public void
-
 
2819
cairo_mesh_pattern_set_corner_color_rgb (cairo_pattern_t *pattern,
-
 
2820
					 unsigned int corner_num,
-
 
2821
					 double red, double green, double blue);
-
 
2822
 
-
 
2823
cairo_public void
-
 
2824
cairo_mesh_pattern_set_corner_color_rgba (cairo_pattern_t *pattern,
-
 
2825
					  unsigned int corner_num,
-
 
2826
					  double red, double green, double blue,
-
 
2827
					  double alpha);
-
 
2828
 
2406
cairo_public void
2829
cairo_public void
2407
cairo_pattern_set_matrix (cairo_pattern_t      *pattern,
2830
cairo_pattern_set_matrix (cairo_pattern_t      *pattern,
Line 2408... Line 2831...
2408
			  const cairo_matrix_t *matrix);
2831
			  const cairo_matrix_t *matrix);
2409
 
2832
 
2410
cairo_public void
2833
cairo_public void
Line 2411... Line 2834...
2411
cairo_pattern_get_matrix (cairo_pattern_t *pattern,
2834
cairo_pattern_get_matrix (cairo_pattern_t *pattern,
2412
			  cairo_matrix_t  *matrix);
2835
			  cairo_matrix_t  *matrix);
2413
 
2836
 
2414
/**
2837
/**
2415
 * cairo_extend_t:
2838
 * cairo_extend_t:
2416
 * @CAIRO_EXTEND_NONE: pixels outside of the source pattern
2839
 * @CAIRO_EXTEND_NONE: pixels outside of the source pattern
2417
 *   are fully transparent
2840
 *   are fully transparent (Since 1.0)
2418
 * @CAIRO_EXTEND_REPEAT: the pattern is tiled by repeating
2841
 * @CAIRO_EXTEND_REPEAT: the pattern is tiled by repeating (Since 1.0)
2419
 * @CAIRO_EXTEND_REFLECT: the pattern is tiled by reflecting
2842
 * @CAIRO_EXTEND_REFLECT: the pattern is tiled by reflecting
2420
 *   at the edges (Implemented for surface patterns since 1.6)
2843
 *   at the edges (Since 1.0; but only implemented for surface patterns since 1.6)
2421
 * @CAIRO_EXTEND_PAD: pixels outside of the pattern copy
2844
 * @CAIRO_EXTEND_PAD: pixels outside of the pattern copy
2422
 *   the closest pixel from the source (Since 1.2; but only
2845
 *   the closest pixel from the source (Since 1.2; but only
2423
 *   implemented for surface patterns since 1.6)
2846
 *   implemented for surface patterns since 1.6)
2424
 *
2847
 *
2425
 * #cairo_extend_t is used to describe how pattern color/alpha will be
2848
 * #cairo_extend_t is used to describe how pattern color/alpha will be
2426
 * determined for areas "outside" the pattern's natural area, (for
2849
 * determined for areas "outside" the pattern's natural area, (for
-
 
2850
 * example, outside the surface bounds or outside the gradient
-
 
2851
 * geometry).
2427
 * example, outside the surface bounds or outside the gradient
2852
 *
2428
 * geometry).
2853
 * Mesh patterns are not affected by the extend mode.
2429
 *
2854
 *
2430
 * The default extend mode is %CAIRO_EXTEND_NONE for surface patterns
2855
 * The default extend mode is %CAIRO_EXTEND_NONE for surface patterns
-
 
2856
 * and %CAIRO_EXTEND_PAD for gradient patterns.
-
 
2857
 *
2431
 * and %CAIRO_EXTEND_PAD for gradient patterns.
2858
 * New entries may be added in future versions.
2432
 *
2859
 *
2433
 * New entries may be added in future versions.
2860
 * Since: 1.0
2434
 **/
2861
 **/
2435
typedef enum _cairo_extend {
2862
typedef enum _cairo_extend {
Line 2446... Line 2873...
2446
cairo_pattern_get_extend (cairo_pattern_t *pattern);
2873
cairo_pattern_get_extend (cairo_pattern_t *pattern);
Line 2447... Line 2874...
2447
 
2874
 
2448
/**
2875
/**
2449
 * cairo_filter_t:
2876
 * cairo_filter_t:
2450
 * @CAIRO_FILTER_FAST: A high-performance filter, with quality similar
2877
 * @CAIRO_FILTER_FAST: A high-performance filter, with quality similar
2451
 *     to %CAIRO_FILTER_NEAREST
2878
 *     to %CAIRO_FILTER_NEAREST (Since 1.0)
2452
 * @CAIRO_FILTER_GOOD: A reasonable-performance filter, with quality
2879
 * @CAIRO_FILTER_GOOD: A reasonable-performance filter, with quality
2453
 *     similar to %CAIRO_FILTER_BILINEAR
2880
 *     similar to %CAIRO_FILTER_BILINEAR (Since 1.0)
2454
 * @CAIRO_FILTER_BEST: The highest-quality available, performance may
2881
 * @CAIRO_FILTER_BEST: The highest-quality available, performance may
2455
 *     not be suitable for interactive use.
2882
 *     not be suitable for interactive use. (Since 1.0)
2456
 * @CAIRO_FILTER_NEAREST: Nearest-neighbor filtering
2883
 * @CAIRO_FILTER_NEAREST: Nearest-neighbor filtering (Since 1.0)
2457
 * @CAIRO_FILTER_BILINEAR: Linear interpolation in two dimensions
2884
 * @CAIRO_FILTER_BILINEAR: Linear interpolation in two dimensions (Since 1.0)
2458
 * @CAIRO_FILTER_GAUSSIAN: This filter value is currently
2885
 * @CAIRO_FILTER_GAUSSIAN: This filter value is currently
2459
 *     unimplemented, and should not be used in current code.
2886
 *     unimplemented, and should not be used in current code. (Since 1.0)
2460
 *
2887
 *
2461
 * #cairo_filter_t is used to indicate what filtering should be
2888
 * #cairo_filter_t is used to indicate what filtering should be
2462
 * applied when reading pixel values from patterns. See
2889
 * applied when reading pixel values from patterns. See
2463
 * cairo_pattern_set_source() for indicating the desired filter to be
2890
 * cairo_pattern_set_filter() for indicating the desired filter to be
-
 
2891
 * used with a particular pattern.
-
 
2892
 *
2464
 * used with a particular pattern.
2893
 * Since: 1.0
2465
 */
2894
 **/
2466
typedef enum _cairo_filter {
2895
typedef enum _cairo_filter {
2467
    CAIRO_FILTER_FAST,
2896
    CAIRO_FILTER_FAST,
2468
    CAIRO_FILTER_GOOD,
2897
    CAIRO_FILTER_GOOD,
2469
    CAIRO_FILTER_BEST,
2898
    CAIRO_FILTER_BEST,
Line 2506... Line 2935...
2506
cairo_public cairo_status_t
2935
cairo_public cairo_status_t
2507
cairo_pattern_get_radial_circles (cairo_pattern_t *pattern,
2936
cairo_pattern_get_radial_circles (cairo_pattern_t *pattern,
2508
				  double *x0, double *y0, double *r0,
2937
				  double *x0, double *y0, double *r0,
2509
				  double *x1, double *y1, double *r1);
2938
				  double *x1, double *y1, double *r1);
Line -... Line 2939...
-
 
2939
 
-
 
2940
cairo_public cairo_status_t
-
 
2941
cairo_mesh_pattern_get_patch_count (cairo_pattern_t *pattern,
-
 
2942
				    unsigned int *count);
-
 
2943
 
-
 
2944
cairo_public cairo_path_t *
-
 
2945
cairo_mesh_pattern_get_path (cairo_pattern_t *pattern,
-
 
2946
			     unsigned int patch_num);
-
 
2947
 
-
 
2948
cairo_public cairo_status_t
-
 
2949
cairo_mesh_pattern_get_corner_color_rgba (cairo_pattern_t *pattern,
-
 
2950
					  unsigned int patch_num,
-
 
2951
					  unsigned int corner_num,
-
 
2952
					  double *red, double *green,
-
 
2953
					  double *blue, double *alpha);
-
 
2954
 
-
 
2955
cairo_public cairo_status_t
-
 
2956
cairo_mesh_pattern_get_control_point (cairo_pattern_t *pattern,
-
 
2957
				      unsigned int patch_num,
-
 
2958
				      unsigned int point_num,
-
 
2959
				      double *x, double *y);
2510
 
2960
 
Line 2511... Line 2961...
2511
/* Matrix functions */
2961
/* Matrix functions */
2512
 
2962
 
2513
cairo_public void
2963
cairo_public void
Line 2571... Line 3021...
2571
 *
3021
 *
2572
 * Since: 1.10
3022
 * Since: 1.10
2573
 **/
3023
 **/
2574
typedef struct _cairo_region cairo_region_t;
3024
typedef struct _cairo_region cairo_region_t;
Line 2575... Line -...
2575
 
-
 
2576
/**
-
 
2577
 * cairo_rectangle_int_t:
-
 
2578
 * @x: X coordinate of the left side of the rectangle
-
 
2579
 * @y: Y coordinate of the the top side of the rectangle
-
 
2580
 * @width: width of the rectangle
-
 
2581
 * @height: height of the rectangle
-
 
2582
 *
-
 
2583
 * A data structure for holding a rectangle with integer coordinates.
-
 
2584
 *
-
 
2585
 * Since: 1.10
-
 
2586
 **/
-
 
2587
 
-
 
2588
typedef struct _cairo_rectangle_int {
-
 
2589
    int x, y;
-
 
2590
    int width, height;
-
 
2591
} cairo_rectangle_int_t;
-
 
2592
 
3025
 
2593
typedef enum _cairo_region_overlap {
3026
typedef enum _cairo_region_overlap {
2594
    CAIRO_REGION_OVERLAP_IN,		/* completely inside region */
3027
    CAIRO_REGION_OVERLAP_IN,		/* completely inside region */
2595
    CAIRO_REGION_OVERLAP_OUT,		/* completely outside region */
3028
    CAIRO_REGION_OVERLAP_OUT,		/* completely outside region */
2596
    CAIRO_REGION_OVERLAP_PART		/* partly inside region */
3029
    CAIRO_REGION_OVERLAP_PART		/* partly inside region */