- All Implemented Interfaces:
Serializable
,Comparable<Status>
,Constable
Status is used to indicate errors that can occur when using Cairo. In some
cases it is returned directly by functions. but when using
Context
,
the last error, if any, is stored in the context and can be retrieved with
Context.status()
.
Cairo uses a single status type to represent all kinds of errors. A status
value of 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 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.
New entries may be added in future versions. Use toString()
to get a
human-readable representation of an error message.
- Since:
- 1.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionclip region not representable in desired formatan operation to the device caused an unspecified errortarget device has been finishedthe device type is not appropriate for the operationerror occurred in the Windows Direct Write APIfile not foundthe font type is not appropriate for the operationerror occurred in libfreetypeinput clusters do not represent the accompanying text and glyph arrayinvalid value for an input cairo_content_tinvalid value for a dash settinginvalid value for a DSC commentinvalid value for an input cairo_format_tinvalid index passed to getterinvalid matrix (not invertible)a mesh pattern construction operation was used outside of a cairo_mesh_pattern_begin_patch()/cairo_mesh_pattern_end_patch() pairinput path data not validno saved group to pop, i.e.cairo_restore() called without matching cairo_save()invalid value (typically too big) for the size of the input (surface, pattern, etc.)invalid value for an input cairo_font_slant_tinvalid value for an input tinvalid value for strideinput string not valid UTF-8invalid value for an input Visual*invalid value for an input cairo_font_weight_tCAIRO_MIME_TYPE_JBIG2_GLOBAL_ID has been used on at least one image but no image provided CAIRO_MIME_TYPE_JBIG2_GLOBALthis is a special value indicating the number of status values defined in this enumeration.negative number used where it is not allowedno current point definedout of memoryNULL pointerthe pattern type is not appropriate for the operationerror occurred in libpng while reading from or writing to a PNG fileerror while reading from input streamno error has occurredtarget surface has been finishedthe surface type is not appropriate for the operationerror occurred in OpenType-SVG font renderinginvalid tag name, attributes, or nestingerror creating or writing to a temporary fileerror occurred in a user-font callback functionthe user-font is immutableuser-font method not implementederror occurred in the Windows Graphics Device Interfaceerror while writing to output stream -
Method Summary
Modifier and TypeMethodDescriptionstatic org.gnome.glib.Type
getType()
Get the CairoStatus GTypeint
getValue()
Return the value of this enumstatic Status
of
(int ordinal) Returns the enum constant for the given ordinal (its position in the enum declaration).toString()
Provides a human-readable description of aStatus
.static Status
Returns the enum constant of this class with the specified name.static Status[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SUCCESS
-
NO_MEMORY
-
INVALID_RESTORE
cairo_restore() called without matching cairo_save()- Since:
- 1.0
-
INVALID_POP_GROUP
no saved group to pop, i.e. cairo_pop_group() without matching cairo_push_group()- Since:
- 1.0
-
NO_CURRENT_POINT
-
INVALID_MATRIX
-
INVALID_STATUS
-
NULL_POINTER
-
INVALID_STRING
-
INVALID_PATH_DATA
-
READ_ERROR
-
WRITE_ERROR
-
SURFACE_FINISHED
-
SURFACE_TYPE_MISMATCH
the surface type is not appropriate for the operation- Since:
- 1.0
-
PATTERN_TYPE_MISMATCH
the pattern type is not appropriate for the operation- Since:
- 1.0
-
INVALID_CONTENT
-
INVALID_FORMAT
-
INVALID_VISUAL
-
FILE_NOT_FOUND
-
INVALID_DASH
-
INVALID_DSC_COMMENT
-
INVALID_INDEX
-
CLIP_NOT_REPRESENTABLE
clip region not representable in desired format- Since:
- 1.4
-
TEMP_FILE_ERROR
-
INVALID_STRIDE
-
FONT_TYPE_MISMATCH
the font type is not appropriate for the operation- Since:
- 1.8
-
USER_FONT_IMMUTABLE
-
USER_FONT_ERROR
error occurred in a user-font callback function- Since:
- 1.8
-
NEGATIVE_COUNT
-
INVALID_CLUSTERS
input clusters do not represent the accompanying text and glyph array- Since:
- 1.8
-
INVALID_SLANT
-
INVALID_WEIGHT
-
INVALID_SIZE
invalid value (typically too big) for the size of the input (surface, pattern, etc.)- Since:
- 1.10
-
USER_FONT_NOT_IMPLEMENTED
-
DEVICE_TYPE_MISMATCH
the device type is not appropriate for the operation- Since:
- 1.10
-
DEVICE_ERROR
an operation to the device caused an unspecified error- Since:
- 1.10
-
INVALID_MESH_CONSTRUCTION
a mesh pattern construction operation was used outside of a cairo_mesh_pattern_begin_patch()/cairo_mesh_pattern_end_patch() pair- Since:
- 1.12
-
DEVICE_FINISHED
-
JBIG2_GLOBAL_MISSING
CAIRO_MIME_TYPE_JBIG2_GLOBAL_ID has been used on at least one image but no image provided CAIRO_MIME_TYPE_JBIG2_GLOBAL- Since:
- 1.14
-
PNG_ERROR
error occurred in libpng while reading from or writing to a PNG file- Since:
- 1.16
-
FREETYPE_ERROR
-
WIN32_GDI_ERROR
error occurred in the Windows Graphics Device Interface- Since:
- 1.16
-
TAG_ERROR
-
DWRITE_ERROR
-
SVG_FONT_ERROR
-
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 defined than the value of this symbol at compile-time.- Since:
- 1.10
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
public int getValue()Return the value of this enum- Returns:
- the value
-
toString
-
of
Returns the enum constant for the given ordinal (its position in the enum declaration).- Parameters:
ordinal
- the position in the enum declaration, starting from zero- Returns:
- the enum constant for the given ordinal
-
getType
public static org.gnome.glib.Type getType()Get the CairoStatus GType- Returns:
- the GType
-