Top |
Description
Cairo uses a single status type to represent all kinds of errors. A status
value of CAIRO_STATUS_SUCCESS
represents no error and has an integer value
of zero. All other status values represent an error.
Cairo's error handling is designed to be easy to use and safe. All major cairo objects retain an error status internally which can be queried anytime by the users using cairo*_status() calls. In the mean time, it is safe to call all cairo functions normally even if the underlying object is in an error status. This means that no error handling code is required before or after each individual cairo function call.
Functions
cairo_status_to_string ()
const char *
cairo_status_to_string (cairo_status_t status
);
Provides a human-readable description of a cairo_status_t.
Since: 1.0
cairo_debug_reset_static_data ()
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).
Since: 1.0
Types and Values
enum 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()
.
New entries may be added in future versions. Use cairo_status_to_string()
to get a human-readable representation of an error message.
Members
no error has occurred (Since 1.0) |
||
out of memory (Since 1.0) |
||
cairo_restore() called without matching |
||
no saved group to pop, i.e. |
||
no current point defined (Since 1.0) |
||
invalid matrix (not invertible) (Since 1.0) |
||
invalid value for an input cairo_status_t (Since 1.0) |
||
|
||
input string not valid UTF-8 (Since 1.0) |
||
input path data not valid (Since 1.0) |
||
error while reading from input stream (Since 1.0) |
||
error while writing to output stream (Since 1.0) |
||
target surface has been finished (Since 1.0) |
||
the surface type is not appropriate for the operation (Since 1.0) |
||
the pattern type is not appropriate for the operation (Since 1.0) |
||
invalid value for an input cairo_content_t (Since 1.0) |
||
invalid value for an input cairo_format_t (Since 1.0) |
||
invalid value for an input Visual* (Since 1.0) |
||
file not found (Since 1.0) |
||
invalid value for a dash setting (Since 1.0) |
||
invalid value for a DSC comment (Since 1.2) |
||
invalid index passed to getter (Since 1.4) |
||
clip region not representable in desired format (Since 1.4) |
||
error creating or writing to a temporary file (Since 1.6) |
||
invalid value for stride (Since 1.6) |
||
the font type is not appropriate for the operation (Since 1.8) |
||
the user-font is immutable (Since 1.8) |
||
error occurred in a user-font callback function (Since 1.8) |
||
negative number used where it is not allowed (Since 1.8) |
||
input clusters do not represent the accompanying text and glyph array (Since 1.8) |
||
invalid value for an input cairo_font_slant_t (Since 1.8) |
||
invalid value for an input cairo_font_weight_t (Since 1.8) |
||
invalid value (typically too big) for the size of the input (surface, pattern, etc.) (Since 1.10) |
||
user-font method not implemented (Since 1.10) |
||
the device type is not appropriate for the operation (Since 1.10) |
||
an operation to the device caused an unspecified error (Since 1.10) |
||
a mesh pattern
construction operation was used outside of a
|
||
target device has been finished (Since 1.12) |
||
|
||
error occurred in libpng while reading from or writing to a PNG file (Since 1.16) |
||
error occurred in libfreetype (Since 1.16) |
||
error occurred in the Windows Graphics Device Interface (Since 1.16) |
||
invalid tag name, attributes, or nesting (Since 1.16) |
||
error occurred in the Windows Direct Write API (Since 1.18) |
||
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 defined than the value of this symbol at compile-time. (Since 1.10) |
Since: 1.0
See Also
cairo_status(), cairo_surface_status()
, cairo_pattern_status()
,
cairo_font_face_status()
, cairo_scaled_font_status()
,
cairo_region_status()