Device

A #cairo_device_t represents the driver interface for drawing operations to a #cairo_surface_t. There are different subtypes of #cairo_device_t for different drawing backends.

The type of a device can be queried with cairo.device.Device.getDeviceType.

Memory management of #cairo_device_t is done with cairo.device.Device.reference and cairo.device.Device.destroy.

Members

Functions

acquire
cairo.types.Status acquire()

Acquires the device for the current thread. This function will block until no other thread has acquired the device.

finish
void finish()

This function finishes the device and drops all references to external resources. All surfaces, fonts and other objects created for this device will be finished, too. Further operations on the device will not affect the device but will instead trigger a cairo.types.Status.DeviceFinished error.

flush
void flush()

Finish any pending operations for the device and also restore any temporary modifications cairo has made to the device's state. This function must be called before switching from using the device with Cairo to operating on it directly with native APIs. If the device doesn't support direct access, then this function does nothing.

getDeviceType
cairo.types.DeviceType getDeviceType()

This function returns the type of the device. See #cairo_device_type_t for available types.

getUserData
void* getUserData(cairo.types.UserDataKey key)

Return user data previously attached to device using the specified key. If no user data has been attached with the given key this function returns null.

observerElapsed
double observerElapsed()

Returns the total elapsed time of the observation.

observerFillElapsed
double observerFillElapsed()

Returns the elapsed time of the fill operations.

observerGlyphsElapsed
double observerGlyphsElapsed()

Returns the elapsed time of the glyph operations.

observerMaskElapsed
double observerMaskElapsed()

Returns the elapsed time of the mask operations.

observerPaintElapsed
double observerPaintElapsed()

Returns the elapsed time of the paint operations.

observerPrint
cairo.types.Status observerPrint(cairo.types.WriteFunc writeFunc)

Prints the device log using the given function.

observerStrokeElapsed
double observerStrokeElapsed()

Returns the elapsed time of the stroke operations.

release
void release()

Releases a device previously acquired using cairo.device.Device.acquire. See that function for details.

status
cairo.types.Status status()

Checks whether an error has previously occurred for this device.

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.