diff options
author | Andrea Canciani <ranma42@gmail.com> | 2011-07-06 22:45:02 +0200 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2011-07-08 11:26:45 +0200 |
commit | 35d8d206355b281d09d50b61d6497cea39e09624 (patch) | |
tree | 6737c7ea5208cf7d2646bb1e174d68a42e811647 | |
parent | 780534cd31af6f4837a4f5a0e445ae609c3559c3 (diff) |
device: Add CAIRO_STATUS_DEVICE_FINISHED
Instead of abusing CAIRO_STATUS_SURFACE_FINISHED to indicate the use
of a finished device, define and use the new error status
CAIRO_STATUS_DEVICE_FINISHED.
-rw-r--r-- | src/cairo-device.c | 2 | ||||
-rw-r--r-- | src/cairo.c | 3 | ||||
-rw-r--r-- | src/cairo.h | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/cairo-device.c b/src/cairo-device.c index f905caf8..3c200e0f 100644 --- a/src/cairo-device.c +++ b/src/cairo-device.c @@ -411,7 +411,7 @@ cairo_device_acquire (cairo_device_t *device) return device->status; if (unlikely (device->finished)) - return _cairo_device_set_error (device, CAIRO_STATUS_SURFACE_FINISHED); /* XXX */ + return _cairo_device_set_error (device, CAIRO_STATUS_DEVICE_FINISHED); CAIRO_MUTEX_LOCK (device->mutex); if (device->mutex_depth++ == 0) { diff --git a/src/cairo.c b/src/cairo.c index 8f16d6dc..0aae04b2 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -167,7 +167,8 @@ static const cairo_t _cairo_nil[] = { DEFINE_NIL_CONTEXT (CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED), DEFINE_NIL_CONTEXT (CAIRO_STATUS_DEVICE_TYPE_MISMATCH), DEFINE_NIL_CONTEXT (CAIRO_STATUS_DEVICE_ERROR), - DEFINE_NIL_CONTEXT (CAIRO_STATUS_INVALID_MESH_CONSTRUCTION) + DEFINE_NIL_CONTEXT (CAIRO_STATUS_INVALID_MESH_CONSTRUCTION), + DEFINE_NIL_CONTEXT (CAIRO_STATUS_DEVICE_FINISHED) }; COMPILE_TIME_ASSERT (ARRAY_LENGTH (_cairo_nil) == CAIRO_STATUS_LAST_STATUS - 1); diff --git a/src/cairo.h b/src/cairo.h index 68716650..0907b95d 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -275,6 +275,7 @@ typedef struct _cairo_user_data_key { * construction operation was used outside of a * cairo_mesh_pattern_begin_patch()/cairo_mesh_pattern_end_patch() * pair (Since 1.12) + * @CAIRO_STATUS_DEVICE_FINISHED: target device has been finished (Since 1.12) * @CAIRO_STATUS_LAST_STATUS: this is a special value indicating the number of * status values defined in this enumeration. When using this value, note * that the version of cairo at run-time may have additional status values @@ -327,6 +328,7 @@ typedef enum _cairo_status { CAIRO_STATUS_DEVICE_TYPE_MISMATCH, CAIRO_STATUS_DEVICE_ERROR, CAIRO_STATUS_INVALID_MESH_CONSTRUCTION, + CAIRO_STATUS_DEVICE_FINISHED, CAIRO_STATUS_LAST_STATUS } cairo_status_t; |