cairo.device

Module for [Device] class

class Device

Types 1

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].

Methods
void * _cPtr(Flag!"Dup" dup = No.Dup)
GType _gType() @property
Device self()Returns `this`, for use in `with` statements.
cairo.types.Status acquire()Acquires the device for the current thread. This function will block until no other thread has acquired the device.
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 devi...
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 w...
cairo.types.DeviceType getDeviceType()This function returns the type of the device. See #cairodevicetype_t for available types. Returns: The type of device.
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.
double observerElapsed()Returns the total elapsed time of the observation. Returns: the elapsed time, in nanoseconds.
double observerFillElapsed()Returns the elapsed time of the fill operations. Returns: the elapsed time, in nanoseconds.
double observerGlyphsElapsed()Returns the elapsed time of the glyph operations. Returns: the elapsed time, in nanoseconds.
double observerMaskElapsed()Returns the elapsed time of the mask operations. Returns: the elapsed time, in nanoseconds
double observerPaintElapsed()Returns the elapsed time of the paint operations. Returns: the elapsed time, in nanoseconds.
cairo.types.Status observerPrint(cairo.types.WriteFunc writeFunc)Prints the device log using the given function.
double observerStrokeElapsed()Returns the elapsed time of the stroke operations. Returns: the elapsed time, in nanoseconds.
void release()Releases a device previously acquired using [cairo.device.Device.acquire]. See that function for details.
cairo.types.Status status()Checks whether an error has previously occurred for this device. Returns: [cairo.types.Status.Success] on success or an error code if the device is in an error state.
Constructors
this(void * ptr, Flag!"Take" take)