Skip to content

API Reference / @gtkx/cairo / Device

Abstract Class: Device ​

Defined in: packages/cairo/src/device.ts:16

A cairo device (cairo_device_t): the backend-specific object behind a surface, such as a GL context or an output stream. Instances come from bindings that hand one back.

Constructors ​

Constructor ​

new Device(): Device

Returns ​

Device

Properties ​

__type__ ​

__type__: bigint

Defined in: packages/cairo/src/device.ts:22

GType of CairoDevice, the boxed type this class is registered under.

Methods ​

finish() ​

finish(): void

Defined in: packages/cairo/src/device.ts:35

Finishes the device, dropping its resources; further drawing through it fails.

Returns ​

void


flush() ​

flush(): void

Defined in: packages/cairo/src/device.ts:40

Flushes any pending operations on the device.

Returns ​

void


getReferenceCount() ​

getReferenceCount(): number

Defined in: packages/cairo/src/device.ts:45

Returns the reference count of the device.

Returns ​

number


getType() ​

getType(): DeviceType

Defined in: packages/cairo/src/device.ts:30

Returns the backend the device belongs to.

Returns ​

DeviceType


status() ​

status(): Status

Defined in: packages/cairo/src/device.ts:25

Returns the error status of the device, Status.SUCCESS when it is usable.

Returns ​

Status