Add status CAIRO_STATUS_NEGATIVE_COUNT

To be used for things like passing a negative number of glyphs
to cairo_show_glyphs().
This commit is contained in:
Behdad Esfahbod 2008-06-23 17:53:25 -04:00
parent ce24588d1c
commit 498f3ddf2e
6 changed files with 8 additions and 4 deletions

View file

@ -66,6 +66,7 @@ code is required before or after each individual cairo function call.
@CAIRO_STATUS_FONT_TYPE_MISMATCH:
@CAIRO_STATUS_USER_FONT_IMMUTABLE:
@CAIRO_STATUS_USER_FONT_ERROR:
@CAIRO_STATUS_NEGATIVE_COUNT:
<!-- ##### FUNCTION cairo_status_to_string ##### -->
<para>

View file

@ -9,13 +9,11 @@ User Fonts
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -107,6 +107,8 @@ cairo_status_to_string (cairo_status_t status)
return "the user-font is immutable";
case CAIRO_STATUS_USER_FONT_ERROR:
return "error occurred in a user-font callback function";
case CAIRO_STATUS_NEGATIVE_COUNT:
return "negative number used where it is not allowed";
}
return "<unknown error status>";

View file

@ -2579,6 +2579,7 @@ _cairo_surface_create_in_error (cairo_status_t status)
case CAIRO_STATUS_FONT_TYPE_MISMATCH:
case CAIRO_STATUS_USER_FONT_IMMUTABLE:
case CAIRO_STATUS_USER_FONT_ERROR:
case CAIRO_STATUS_NEGATIVE_COUNT:
default:
_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
return (cairo_surface_t *) &_cairo_surface_nil;

View file

@ -206,6 +206,7 @@ typedef struct _cairo_user_data_key {
* @CAIRO_STATUS_FONT_TYPE_MISMATCH: the font type is not appropriate for the operation (Since 1.8)
* @CAIRO_STATUS_USER_FONT_IMMUTABLE: the user-font is immutable (Since 1.8)
* @CAIRO_STATUS_USER_FONT_ERROR: error occurred in a user-font callback function (Since 1.8)
* @CAIRO_STATUS_NEGATIVE_COUNT: negative number used where it is not allowed (Since 1.8)
*
* #cairo_status_t is used to indicate errors that can occur when
* using Cairo. In some cases it is returned directly by functions.
@ -243,7 +244,8 @@ typedef enum _cairo_status {
CAIRO_STATUS_INVALID_STRIDE,
CAIRO_STATUS_FONT_TYPE_MISMATCH,
CAIRO_STATUS_USER_FONT_IMMUTABLE,
CAIRO_STATUS_USER_FONT_ERROR
CAIRO_STATUS_USER_FONT_ERROR,
CAIRO_STATUS_NEGATIVE_COUNT
/* after adding a new error: update CAIRO_STATUS_LAST_STATUS in cairoint.h */
} cairo_status_t;

View file

@ -110,7 +110,7 @@ _cairo_win32_tmpfile (void);
* a bit of a pain, but it should be easy to always catch as long as
* one adds a new test case to test a trigger of the new status value.
*/
#define CAIRO_STATUS_LAST_STATUS CAIRO_STATUS_USER_FONT_ERROR
#define CAIRO_STATUS_LAST_STATUS CAIRO_STATUS_NEGATIVE_COUNT
/* Size in bytes of buffer to use off the stack per functions.