diff options
author | Andrea Canciani <ranma42@gmail.com> | 2011-07-06 22:49:29 +0200 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2011-07-08 11:26:45 +0200 |
commit | 02a331de13313085d671716031a3b61778014b87 (patch) | |
tree | 95d48f5cca4ef3e0c9effdc69d0b054fcd80946c | |
parent | 35d8d206355b281d09d50b61d6497cea39e09624 (diff) |
device: Define the CAIRO_DEVICE_TYPE_INVALID device type
Define a new device type to indicate that the device is not valid.
The -1 value is along the same line as CAIRO_FORMAT_INVALID (and is
likely to have the same issues).
-rw-r--r-- | src/cairo-device.c | 2 | ||||
-rw-r--r-- | src/cairo.h | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/cairo-device.c b/src/cairo-device.c index 3c200e0f..b6dde631 100644 --- a/src/cairo-device.c +++ b/src/cairo-device.c @@ -365,7 +365,7 @@ cairo_device_get_type (cairo_device_t *device) if (device == NULL || CAIRO_REFERENCE_COUNT_IS_INVALID (&device->ref_count)) { - return (cairo_device_type_t) -1; + return CAIRO_DEVICE_TYPE_INVALID; } return device->backend->type; diff --git a/src/cairo.h b/src/cairo.h index 0907b95d..ef3028b5 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -1984,7 +1984,9 @@ typedef enum _cairo_device_type { CAIRO_DEVICE_TYPE_SCRIPT, CAIRO_DEVICE_TYPE_XCB, CAIRO_DEVICE_TYPE_XLIB, - CAIRO_DEVICE_TYPE_XML + CAIRO_DEVICE_TYPE_XML, + + CAIRO_DEVICE_TYPE_INVALID = -1 } cairo_device_type_t; cairo_public cairo_device_type_t |