Cairo: A Vector Graphics Library | ||||
---|---|---|---|---|
enum cairo_status_t; const char* cairo_status_to_string (cairo_status_t status); void cairo_debug_reset_static_data (void);
typedef enum _cairo_status { CAIRO_STATUS_SUCCESS = 0, CAIRO_STATUS_NO_MEMORY, CAIRO_STATUS_INVALID_RESTORE, CAIRO_STATUS_INVALID_POP_GROUP, CAIRO_STATUS_NO_CURRENT_POINT, CAIRO_STATUS_INVALID_MATRIX, CAIRO_STATUS_INVALID_STATUS, CAIRO_STATUS_NULL_POINTER, CAIRO_STATUS_INVALID_STRING, CAIRO_STATUS_INVALID_PATH_DATA, CAIRO_STATUS_READ_ERROR, CAIRO_STATUS_WRITE_ERROR, CAIRO_STATUS_SURFACE_FINISHED, CAIRO_STATUS_SURFACE_TYPE_MISMATCH, CAIRO_STATUS_PATTERN_TYPE_MISMATCH, CAIRO_STATUS_INVALID_CONTENT, CAIRO_STATUS_INVALID_FORMAT, CAIRO_STATUS_INVALID_VISUAL, CAIRO_STATUS_FILE_NOT_FOUND, CAIRO_STATUS_INVALID_DASH } cairo_status_t;
cairo_status_t is used to indicate errors that can occur when
using Cairo. In some cases it is returned directly by functions.
but when using cairo_t, the last error, if any, is stored in
the context and can be retrieved with cairo_status()
.
no error has occurred | |
out of memory | |
cairo_restore without matching cairo_save | |
no saved group to pop | |
no current point defined | |
invalid matrix (not invertible) | |
invalid value for an input cairo_status_t | |
NULL pointer | |
input string not valid UTF-8 | |
input path data not valid | |
error while reading from input stream | |
error while writing to output stream | |
target surface has been finished | |
the surface type is not appropriate for the operation | |
the pattern type is not appropriate for the operation | |
invalid value for an input cairo_content_t | |
invalid value for an input cairo_format_t | |
invalid value for an input Visual* | |
file not found | |
invalid value for a dash setting |
const char* cairo_status_to_string (cairo_status_t status);
Provides a human-readable description of a cairo_status_t.
|
a cairo status |
Returns : |
a string representation of the status |
void cairo_debug_reset_static_data (void);
Resets all static data within cairo to its original state, (ie. identical to the state at the time of program invocation). For example, all caches within cairo will be flushed empty.
This function is intended to be useful when using memory-checking tools such as valgrind. When valgrind's memcheck analyzes a cairo-using program without a call to cairo_debug_reset_static_data, it will report all data reachable via cairo's static objects as "still reachable". Calling cairo_debug_reset_static_data just prior to program termination will make it easier to get squeaky clean reports from valgrind.
WARNING: It is only safe to call this function when there are no active cairo objects remaining, (ie. the appropriate destroy functions have been called as necessary). If there are active cairo objects, this call is likely to cause a crash, (eg. an assertion failure due to a hash table being destroyed when non-empty).