@gtkx/cairo 2.0.0-beta.11 → 2.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/device.d.ts.map +1 -1
- package/dist/enums.d.ts.map +1 -1
- package/dist/font-face.d.ts.map +1 -1
- package/dist/font-face.js.map +1 -1
- package/dist/font-options.d.ts.map +1 -1
- package/dist/font-options.js.map +1 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +7 -35
- package/dist/lib.js.map +1 -1
- package/dist/matrix.d.ts.map +1 -1
- package/dist/path.d.ts.map +1 -1
- package/dist/pattern.d.ts.map +1 -1
- package/dist/pattern.js.map +1 -1
- package/dist/region.d.ts.map +1 -1
- package/dist/scaled-font.d.ts.map +1 -1
- package/dist/scaled-font.js.map +1 -1
- package/dist/status.d.ts.map +1 -1
- package/dist/structs.d.ts.map +1 -1
- package/dist/structs.js +32 -36
- package/dist/structs.js.map +1 -1
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js.map +1 -1
- package/dist/text.d.ts.map +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +4 -14
- package/src/font-face.ts +1 -5
- package/src/font-options.ts +1 -5
- package/src/lib.ts +7 -35
- package/src/pattern.ts +1 -6
- package/src/scaled-font.ts +1 -5
- package/src/structs.ts +32 -48
- package/src/surface.ts +8 -8
package/dist/structs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../src/structs.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EAEL,SAAS,EAET,IAAI,EACJ,oBAAoB,EACpB,WAAW,EACX,SAAS,EACT,CAAC,EACD,QAAQ,EACR,KAAK,GACR,MAAM,eAAe,CAAC;AA8CvB,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AACtD,MAAM,cAAc,GA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gDAAgD;IAChD,IAAI,QAAQ,CAAC,KAAa;QACtB,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,2CAA2C;IAC3C,IAAI,SAAS;QACT,OAAO,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;IAED,2CAA2C;IAC3C,IAAI,SAAS,CAAC,KAAa;QACvB,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;CACJ;AAED,OAAO,EACH,KAAK,EAEL,SAAS,EAET,YAAY,EAEZ,WAAW,GAEd,CAAC","sourcesContent":["import {\n alloc,\n type ExternalObject,\n getHandle,\n type Handle,\n read,\n registerWrapperClass,\n resolveType,\n setHandle,\n t,\n toNative,\n write,\n} from \"@gtkx/runtime\";\n\ntype FieldDescriptor = typeof t.float64 | typeof t.int32 | typeof t.biguint64;\n\n/** Initial field values for a `Rectangle`; a field left out or set to null keeps zero. */\ntype RectangleConstructorProps = {\n /** Horizontal position of the left edge. */\n x?: number | null;\n /** Vertical position of the top edge. */\n y?: number | null;\n /** Width of the rectangle. */\n width?: number | null;\n /** Height of the rectangle. */\n height?: number | null;\n};\n\n/** Initial field values for a `RectangleInt`; a field left out or set to null keeps zero. */\ntype RectangleIntConstructorProps = {\n /** Horizontal position of the left edge. */\n x?: number | null;\n /** Vertical position of the top edge. */\n y?: number | null;\n /** Width of the rectangle. */\n width?: number | null;\n /** Height of the rectangle. */\n height?: number | null;\n};\n\n/** Initial field values for a `Glyph`; a field left out or set to null keeps zero. */\ntype GlyphConstructorProps = {\n /** Index of the glyph in the font. */\n index?: bigint | null;\n /** Horizontal position of the glyph origin. */\n x?: number | null;\n /** Vertical position of the glyph origin. */\n y?: number | null;\n};\n\n/** Initial field values for a `TextCluster`; a field left out or set to null keeps zero. */\ntype TextClusterConstructorProps = {\n /** Number of UTF-8 bytes the cluster covers. */\n numBytes?: number | null;\n /** Number of glyphs the cluster covers. */\n numGlyphs?: number | null;\n};\n\nconst CAIRO_GOBJECT_LIBRARY = \"libcairo-gobject.so.2\";\nconst RECTANGLE_TYPE = resolveType(CAIRO_GOBJECT_LIBRARY, \"cairo_gobject_rectangle_get_type\");\nconst RECTANGLE_INT_TYPE = resolveType(CAIRO_GOBJECT_LIBRARY, \"cairo_gobject_rectangle_int_get_type\");\nconst GLYPH_TYPE = resolveType(CAIRO_GOBJECT_LIBRARY, \"cairo_gobject_glyph_get_type\");\nconst TEXT_CLUSTER_TYPE = resolveType(CAIRO_GOBJECT_LIBRARY, \"cairo_gobject_text_cluster_get_type\");\nconst RECTANGLE_SIZE = 32;\nconst RECTANGLE_INT_SIZE = 16;\nconst GLYPH_SIZE = 24;\nconst TEXT_CLUSTER_SIZE = 8;\nconst DOUBLE = t.float64;\nconst INT = t.int32;\nconst ULONG = t.biguint64;\n\nconst readField = (instance: object, descriptor: FieldDescriptor, offset: number): number =>\n read(getHandle(instance), descriptor, offset) as number;\n\nconst writeField = (instance: object, descriptor: FieldDescriptor, offset: number, value: unknown): void => {\n write(getHandle(instance), descriptor, offset, toNative(descriptor, value));\n};\n\nconst writeInitial = (\n handle: ExternalObject<Handle>,\n descriptor: FieldDescriptor,\n offset: number,\n value: unknown,\n): void => {\n if (value != null) {\n write(handle, descriptor, offset, toNative(descriptor, value));\n }\n};\n\n/** A rectangle with double-precision edges, as `copyClipRectangleList` and recording surfaces report. */\nclass Rectangle {\n static {\n registerWrapperClass(this, RECTANGLE_TYPE);\n }\n\n /** GType of `CairoRectangle`, the boxed type this struct is registered under. */\n declare __type__: bigint;\n\n /** Allocates a rectangle, writing the given fields and leaving the others at zero. */\n constructor(props: RectangleConstructorProps = {}) {\n const handle = alloc(RECTANGLE_SIZE, RECTANGLE_TYPE);\n writeInitial(handle, DOUBLE, 0, props.x);\n writeInitial(handle, DOUBLE, 8, props.y);\n writeInitial(handle, DOUBLE, 16, props.width);\n writeInitial(handle, DOUBLE, 24, props.height);\n setHandle(this, handle);\n }\n\n /** Horizontal position of the left edge. */\n get x(): number {\n return readField(this, DOUBLE, 0);\n }\n\n /** Horizontal position of the left edge. */\n set x(value: number) {\n writeField(this, DOUBLE, 0, value);\n }\n\n /** Vertical position of the top edge. */\n get y(): number {\n return readField(this, DOUBLE, 8);\n }\n\n /** Vertical position of the top edge. */\n set y(value: number) {\n writeField(this, DOUBLE, 8, value);\n }\n\n /** Width of the rectangle. */\n get width(): number {\n return readField(this, DOUBLE, 16);\n }\n\n /** Width of the rectangle. */\n set width(value: number) {\n writeField(this, DOUBLE, 16, value);\n }\n\n /** Height of the rectangle. */\n get height(): number {\n return readField(this, DOUBLE, 24);\n }\n\n /** Height of the rectangle. */\n set height(value: number) {\n writeField(this, DOUBLE, 24, value);\n }\n}\n\n/** A rectangle with integer edges, as Cairo regions use. */\nclass RectangleInt {\n static {\n registerWrapperClass(this, RECTANGLE_INT_TYPE);\n }\n\n /** GType of `CairoRectangleInt`, the boxed type this struct is registered under. */\n declare __type__: bigint;\n\n /** Allocates a rectangle, writing the given fields and leaving the others at zero. */\n constructor(props: RectangleIntConstructorProps = {}) {\n const handle = alloc(RECTANGLE_INT_SIZE, RECTANGLE_INT_TYPE);\n writeInitial(handle, INT, 0, props.x);\n writeInitial(handle, INT, 4, props.y);\n writeInitial(handle, INT, 8, props.width);\n writeInitial(handle, INT, 12, props.height);\n setHandle(this, handle);\n }\n\n /** Horizontal position of the left edge. */\n get x(): number {\n return readField(this, INT, 0);\n }\n\n /** Horizontal position of the left edge. */\n set x(value: number) {\n writeField(this, INT, 0, value);\n }\n\n /** Vertical position of the top edge. */\n get y(): number {\n return readField(this, INT, 4);\n }\n\n /** Vertical position of the top edge. */\n set y(value: number) {\n writeField(this, INT, 4, value);\n }\n\n /** Width of the rectangle. */\n get width(): number {\n return readField(this, INT, 8);\n }\n\n /** Width of the rectangle. */\n set width(value: number) {\n writeField(this, INT, 8, value);\n }\n\n /** Height of the rectangle. */\n get height(): number {\n return readField(this, INT, 12);\n }\n\n /** Height of the rectangle. */\n set height(value: number) {\n writeField(this, INT, 12, value);\n }\n}\n\n/** A `cairo_glyph_t`: one glyph index and where to draw it. */\nclass Glyph {\n static {\n registerWrapperClass(this, GLYPH_TYPE);\n }\n\n /** GType of `CairoGlyph`, the boxed type this struct is registered under. */\n declare __type__: bigint;\n\n /** Allocates a glyph, writing the given fields and leaving the others at zero. */\n constructor(props: GlyphConstructorProps = {}) {\n const handle = alloc(GLYPH_SIZE, GLYPH_TYPE);\n writeInitial(handle, ULONG, 0, props.index);\n writeInitial(handle, DOUBLE, 8, props.x);\n writeInitial(handle, DOUBLE, 16, props.y);\n setHandle(this, handle);\n }\n\n /** Index of the glyph in the font. */\n get index(): bigint {\n return read(getHandle(this), ULONG, 0) as bigint;\n }\n\n /** Index of the glyph in the font. */\n set index(value: bigint) {\n writeField(this, ULONG, 0, value);\n }\n\n /** Horizontal position of the glyph origin. */\n get x(): number {\n return readField(this, DOUBLE, 8);\n }\n\n /** Horizontal position of the glyph origin. */\n set x(value: number) {\n writeField(this, DOUBLE, 8, value);\n }\n\n /** Vertical position of the glyph origin. */\n get y(): number {\n return readField(this, DOUBLE, 16);\n }\n\n /** Vertical position of the glyph origin. */\n set y(value: number) {\n writeField(this, DOUBLE, 16, value);\n }\n}\n\n/** A `cairo_text_cluster_t`: how many bytes of text map to how many glyphs. */\nclass TextCluster {\n static {\n registerWrapperClass(this, TEXT_CLUSTER_TYPE);\n }\n\n /** GType of `CairoTextCluster`, the boxed type this struct is registered under. */\n declare __type__: bigint;\n\n /** Allocates a cluster, writing the given fields and leaving the others at zero. */\n constructor(props: TextClusterConstructorProps = {}) {\n const handle = alloc(TEXT_CLUSTER_SIZE, TEXT_CLUSTER_TYPE);\n writeInitial(handle, INT, 0, props.numBytes);\n writeInitial(handle, INT, 4, props.numGlyphs);\n setHandle(this, handle);\n }\n\n /** Number of UTF-8 bytes the cluster covers. */\n get numBytes(): number {\n return readField(this, INT, 0);\n }\n\n /** Number of UTF-8 bytes the cluster covers. */\n set numBytes(value: number) {\n writeField(this, INT, 0, value);\n }\n\n /** Number of glyphs the cluster covers. */\n get numGlyphs(): number {\n return readField(this, INT, 4);\n }\n\n /** Number of glyphs the cluster covers. */\n set numGlyphs(value: number) {\n writeField(this, INT, 4, value);\n }\n}\n\nexport {\n Glyph,\n type GlyphConstructorProps,\n Rectangle,\n type RectangleConstructorProps,\n RectangleInt,\n type RectangleIntConstructorProps,\n TextCluster,\n type TextClusterConstructorProps,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../src/structs.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EAEL,SAAS,EAET,oBAAoB,EACpB,WAAW,EACX,SAAS,EAET,CAAC,GACJ,MAAM,eAAe,CAAC;AA4CvB,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AACtD,MAAM,cAAc,GAAG,WAAW,CAAC,qBAAqB,EAAE,kCAAkC,CAAC,CAAC;AAC9F,MAAM,kBAAkB,GAAG,WAAW,CAAC,qBAAqB,EAAE,sCAAsC,CAAC,CAAC;AACtG,MAAM,UAAU,GAAG,WAAW,CAAC,qBAAqB,EAAE,8BAA8B,CAAC,CAAC;AACtF,MAAM,iBAAiB,GAAG,WAAW,CAAC,qBAAqB,EAAE,qCAAqC,CAAC,CAAC;AACpG,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AACpC,MAAM,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAC/B,MAAM,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CA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,\n registerWrapperClass,\n resolveType,\n setHandle,\n type StridedField,\n t,\n} from \"@gtkx/runtime\";\n\n/** Initial field values for a `Rectangle`; a field left out or set to null keeps zero. */\ntype RectangleConstructorProps = {\n /** Horizontal position of the left edge. */\n x?: number | null;\n /** Vertical position of the top edge. */\n y?: number | null;\n /** Width of the rectangle. */\n width?: number | null;\n /** Height of the rectangle. */\n height?: number | null;\n};\n\n/** Initial field values for a `RectangleInt`; a field left out or set to null keeps zero. */\ntype RectangleIntConstructorProps = {\n /** Horizontal position of the left edge. */\n x?: number | null;\n /** Vertical position of the top edge. */\n y?: number | null;\n /** Width of the rectangle. */\n width?: number | null;\n /** Height of the rectangle. */\n height?: number | null;\n};\n\n/** Initial field values for a `Glyph`; a field left out or set to null keeps zero. */\ntype GlyphConstructorProps = {\n /** Index of the glyph in the font. */\n index?: bigint | null;\n /** Horizontal position of the glyph origin. */\n x?: number | null;\n /** Vertical position of the glyph origin. */\n y?: number | null;\n};\n\n/** Initial field values for a `TextCluster`; a field left out or set to null keeps zero. */\ntype TextClusterConstructorProps = {\n /** Number of UTF-8 bytes the cluster covers. */\n numBytes?: number | null;\n /** Number of glyphs the cluster covers. */\n numGlyphs?: number | null;\n};\n\nconst CAIRO_GOBJECT_LIBRARY = \"libcairo-gobject.so.2\";\nconst RECTANGLE_TYPE = resolveType(CAIRO_GOBJECT_LIBRARY, \"cairo_gobject_rectangle_get_type\");\nconst RECTANGLE_INT_TYPE = resolveType(CAIRO_GOBJECT_LIBRARY, \"cairo_gobject_rectangle_int_get_type\");\nconst GLYPH_TYPE = resolveType(CAIRO_GOBJECT_LIBRARY, \"cairo_gobject_glyph_get_type\");\nconst TEXT_CLUSTER_TYPE = resolveType(CAIRO_GOBJECT_LIBRARY, \"cairo_gobject_text_cluster_get_type\");\nconst RECTANGLE_SIZE = 32;\nconst RECTANGLE_INT_SIZE = 16;\nconst GLYPH_SIZE = 24;\nconst TEXT_CLUSTER_SIZE = 8;\nconst DOUBLE = t.fieldAt(t.float64);\nconst INT = t.fieldAt(t.int32);\nconst ULONG = t.fieldAt(t.biguint64);\n\nconst writeInitial = (handle: ExternalObject<Handle>, field: StridedField, offset: number, value: unknown): void => {\n if (value != null) {\n field.write(handle, offset, value);\n }\n};\n\n/** A rectangle with double-precision edges, as `copyClipRectangleList` and recording surfaces report. */\nclass Rectangle {\n static {\n registerWrapperClass(this, RECTANGLE_TYPE);\n }\n\n /** GType of `CairoRectangle`, the boxed type this struct is registered under. */\n declare __type__: bigint;\n\n /** Allocates a rectangle, writing the given fields and leaving the others at zero. */\n constructor(props: RectangleConstructorProps = {}) {\n const handle = alloc(RECTANGLE_SIZE, RECTANGLE_TYPE);\n writeInitial(handle, DOUBLE, 0, props.x);\n writeInitial(handle, DOUBLE, 8, props.y);\n writeInitial(handle, DOUBLE, 16, props.width);\n writeInitial(handle, DOUBLE, 24, props.height);\n setHandle(this, handle);\n }\n\n /** Horizontal position of the left edge. */\n get x(): number {\n return DOUBLE.read(getHandle(this), 0) as number;\n }\n\n /** Horizontal position of the left edge. */\n set x(value: number) {\n DOUBLE.write(getHandle(this), 0, value);\n }\n\n /** Vertical position of the top edge. */\n get y(): number {\n return DOUBLE.read(getHandle(this), 8) as number;\n }\n\n /** Vertical position of the top edge. */\n set y(value: number) {\n DOUBLE.write(getHandle(this), 8, value);\n }\n\n /** Width of the rectangle. */\n get width(): number {\n return DOUBLE.read(getHandle(this), 16) as number;\n }\n\n /** Width of the rectangle. */\n set width(value: number) {\n DOUBLE.write(getHandle(this), 16, value);\n }\n\n /** Height of the rectangle. */\n get height(): number {\n return DOUBLE.read(getHandle(this), 24) as number;\n }\n\n /** Height of the rectangle. */\n set height(value: number) {\n DOUBLE.write(getHandle(this), 24, value);\n }\n}\n\n/** A rectangle with integer edges, as Cairo regions use. */\nclass RectangleInt {\n static {\n registerWrapperClass(this, RECTANGLE_INT_TYPE);\n }\n\n /** GType of `CairoRectangleInt`, the boxed type this struct is registered under. */\n declare __type__: bigint;\n\n /** Allocates a rectangle, writing the given fields and leaving the others at zero. */\n constructor(props: RectangleIntConstructorProps = {}) {\n const handle = alloc(RECTANGLE_INT_SIZE, RECTANGLE_INT_TYPE);\n writeInitial(handle, INT, 0, props.x);\n writeInitial(handle, INT, 4, props.y);\n writeInitial(handle, INT, 8, props.width);\n writeInitial(handle, INT, 12, props.height);\n setHandle(this, handle);\n }\n\n /** Horizontal position of the left edge. */\n get x(): number {\n return INT.read(getHandle(this), 0) as number;\n }\n\n /** Horizontal position of the left edge. */\n set x(value: number) {\n INT.write(getHandle(this), 0, value);\n }\n\n /** Vertical position of the top edge. */\n get y(): number {\n return INT.read(getHandle(this), 4) as number;\n }\n\n /** Vertical position of the top edge. */\n set y(value: number) {\n INT.write(getHandle(this), 4, value);\n }\n\n /** Width of the rectangle. */\n get width(): number {\n return INT.read(getHandle(this), 8) as number;\n }\n\n /** Width of the rectangle. */\n set width(value: number) {\n INT.write(getHandle(this), 8, value);\n }\n\n /** Height of the rectangle. */\n get height(): number {\n return INT.read(getHandle(this), 12) as number;\n }\n\n /** Height of the rectangle. */\n set height(value: number) {\n INT.write(getHandle(this), 12, value);\n }\n}\n\n/** A `cairo_glyph_t`: one glyph index and where to draw it. */\nclass Glyph {\n static {\n registerWrapperClass(this, GLYPH_TYPE);\n }\n\n /** GType of `CairoGlyph`, the boxed type this struct is registered under. */\n declare __type__: bigint;\n\n /** Allocates a glyph, writing the given fields and leaving the others at zero. */\n constructor(props: GlyphConstructorProps = {}) {\n const handle = alloc(GLYPH_SIZE, GLYPH_TYPE);\n writeInitial(handle, ULONG, 0, props.index);\n writeInitial(handle, DOUBLE, 8, props.x);\n writeInitial(handle, DOUBLE, 16, props.y);\n setHandle(this, handle);\n }\n\n /** Index of the glyph in the font. */\n get index(): bigint {\n return ULONG.read(getHandle(this), 0) as bigint;\n }\n\n /** Index of the glyph in the font. */\n set index(value: bigint) {\n ULONG.write(getHandle(this), 0, value);\n }\n\n /** Horizontal position of the glyph origin. */\n get x(): number {\n return DOUBLE.read(getHandle(this), 8) as number;\n }\n\n /** Horizontal position of the glyph origin. */\n set x(value: number) {\n DOUBLE.write(getHandle(this), 8, value);\n }\n\n /** Vertical position of the glyph origin. */\n get y(): number {\n return DOUBLE.read(getHandle(this), 16) as number;\n }\n\n /** Vertical position of the glyph origin. */\n set y(value: number) {\n DOUBLE.write(getHandle(this), 16, value);\n }\n}\n\n/** A `cairo_text_cluster_t`: how many bytes of text map to how many glyphs. */\nclass TextCluster {\n static {\n registerWrapperClass(this, TEXT_CLUSTER_TYPE);\n }\n\n /** GType of `CairoTextCluster`, the boxed type this struct is registered under. */\n declare __type__: bigint;\n\n /** Allocates a cluster, writing the given fields and leaving the others at zero. */\n constructor(props: TextClusterConstructorProps = {}) {\n const handle = alloc(TEXT_CLUSTER_SIZE, TEXT_CLUSTER_TYPE);\n writeInitial(handle, INT, 0, props.numBytes);\n writeInitial(handle, INT, 4, props.numGlyphs);\n setHandle(this, handle);\n }\n\n /** Number of UTF-8 bytes the cluster covers. */\n get numBytes(): number {\n return INT.read(getHandle(this), 0) as number;\n }\n\n /** Number of UTF-8 bytes the cluster covers. */\n set numBytes(value: number) {\n INT.write(getHandle(this), 0, value);\n }\n\n /** Number of glyphs the cluster covers. */\n get numGlyphs(): number {\n return INT.read(getHandle(this), 4) as number;\n }\n\n /** Number of glyphs the cluster covers. */\n set numGlyphs(value: number) {\n INT.write(getHandle(this), 4, value);\n }\n}\n\nexport {\n Glyph,\n type GlyphConstructorProps,\n Rectangle,\n type RectangleConstructorProps,\n RectangleInt,\n type RectangleIntConstructorProps,\n TextCluster,\n type TextClusterConstructorProps,\n};\n"]}
|
package/dist/surface.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../src/surface.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;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I,CAAC,EAAE,MAAM,CAAY,CAAC;QAEtF,OAAO,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpD,CAAC;CACJ;AAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import {\n alloc,\n type ExternalObject,\n getHandle,\n type Handle,\n registerWrapperClass,\n registerWrapperClassResolver,\n setHandle,\n t,\n wrapHandle,\n type WrapperClassResolver,\n write,\n} from \"@gtkx/runtime\";\nimport type { DeviceOffset, DeviceScale, FallbackResolution, InkExtents, RectangleData } from \"./types.js\";\nimport { Context } from \"./context.js\";\nimport { Device } from \"./device.js\";\nimport { type Content, type Format, type Status, SurfaceType } from \"./enums.js\";\nimport { FontOptions } from \"./font-options.js\";\nimport {\n bindCairo,\n type BoundFunction,\n cairoGType,\n DEVICE_T,\n FONT_OPTIONS_T,\n RECTANGLE_T,\n SURFACE_FULL_T,\n SURFACE_T,\n} from \"./lib.js\";\nimport { checkSurface } from \"./status.js\";\n\nconst SURFACE_TYPE = cairoGType(\"cairo_gobject_surface_get_type\");\nconst RECTANGLE_SIZE = 32;\nconst DOUBLE = t.fieldAt(t.float64);\nconst DEVICE_PAIR_ARGS = [SURFACE_T, t.float64, t.float64];\nconst DEVICE_PAIR_OUT_ARGS = [SURFACE_T, t.ref(t.float64), t.ref(t.float64)];\nconst SIMILAR_ARGS = [SURFACE_T, t.int32, t.int32, t.int32];\nconst cairoSurfaceCreateSimilar = bindCairo(\"cairo_surface_create_similar\", SIMILAR_ARGS, SURFACE_FULL_T);\nconst cairoSurfaceCreateSimilarImage = bindCairo(\"cairo_surface_create_similar_image\", SIMILAR_ARGS, SURFACE_FULL_T);\n\nconst cairoSurfaceCreateForRectangle = bindCairo(\n \"cairo_surface_create_for_rectangle\",\n [SURFACE_T, t.float64, t.float64, t.float64, t.float64],\n SURFACE_FULL_T,\n);\n\nconst cairoSurfaceWriteToPng = bindCairo(\"cairo_surface_write_to_png\", [SURFACE_T, t.string(\"borrowed\")], t.int32);\nconst cairoSurfaceStatus = bindCairo(\"cairo_surface_status\", [SURFACE_T], t.int32);\nconst cairoSurfaceFinish = bindCairo(\"cairo_surface_finish\", [SURFACE_T], t.void);\nconst cairoSurfaceFlush = bindCairo(\"cairo_surface_flush\", [SURFACE_T], t.void);\nconst cairoSurfaceGetDevice = bindCairo(\"cairo_surface_get_device\", [SURFACE_T], DEVICE_T);\nconst cairoSurfaceGetFontOptions = bindCairo(\"cairo_surface_get_font_options\", [SURFACE_T, FONT_OPTIONS_T], t.void);\nconst cairoSurfaceGetContent = bindCairo(\"cairo_surface_get_content\", [SURFACE_T], t.int32);\nconst cairoSurfaceMarkDirty = bindCairo(\"cairo_surface_mark_dirty\", [SURFACE_T], t.void);\n\nconst cairoSurfaceMarkDirtyRectangle = bindCairo(\n \"cairo_surface_mark_dirty_rectangle\",\n [SURFACE_T, t.int32, t.int32, t.int32, t.int32],\n t.void,\n);\n\nconst cairoSurfaceSetDeviceOffset = bindCairo(\"cairo_surface_set_device_offset\", DEVICE_PAIR_ARGS, t.void);\nconst cairoSurfaceGetDeviceOffset = bindCairo(\"cairo_surface_get_device_offset\", DEVICE_PAIR_OUT_ARGS, t.void);\nconst cairoSurfaceGetDeviceScale = bindCairo(\"cairo_surface_get_device_scale\", DEVICE_PAIR_OUT_ARGS, t.void);\nconst cairoSurfaceSetDeviceScale = bindCairo(\"cairo_surface_set_device_scale\", DEVICE_PAIR_ARGS, t.void);\nconst cairoSurfaceSetFallbackResolution = bindCairo(\"cairo_surface_set_fallback_resolution\", DEVICE_PAIR_ARGS, t.void);\n\nconst cairoSurfaceGetFallbackResolution = bindCairo(\n \"cairo_surface_get_fallback_resolution\",\n DEVICE_PAIR_OUT_ARGS,\n t.void,\n);\n\nconst cairoSurfaceGetType = bindCairo(\"cairo_surface_get_type\", [SURFACE_T], t.int32);\nconst cairoSurfaceGetReferenceCount = bindCairo(\"cairo_surface_get_reference_count\", [SURFACE_T], t.int32);\nconst cairoSurfaceCopyPage = bindCairo(\"cairo_surface_copy_page\", [SURFACE_T], t.void);\nconst cairoSurfaceShowPage = bindCairo(\"cairo_surface_show_page\", [SURFACE_T], t.void);\nconst cairoSurfaceHasShowTextGlyphs = bindCairo(\"cairo_surface_has_show_text_glyphs\", [SURFACE_T], t.boolean);\n\nconst cairoSurfaceSupportsMimeType = bindCairo(\n \"cairo_surface_supports_mime_type\",\n [SURFACE_T, t.string(\"borrowed\")],\n t.boolean,\n);\n\nconst cairoImageSurfaceCreate = bindCairo(\"cairo_image_surface_create\", [t.int32, t.int32, t.int32], SURFACE_FULL_T);\n\nconst cairoImageSurfaceCreateFromPng = bindCairo(\n \"cairo_image_surface_create_from_png\",\n [t.string(\"borrowed\")],\n SURFACE_FULL_T,\n);\n\nconst cairoImageSurfaceGetWidth = bindCairo(\"cairo_image_surface_get_width\", [SURFACE_T], t.int32);\nconst cairoImageSurfaceGetHeight = bindCairo(\"cairo_image_surface_get_height\", [SURFACE_T], t.int32);\nconst cairoImageSurfaceGetFormat = bindCairo(\"cairo_image_surface_get_format\", [SURFACE_T], t.int32);\nconst cairoImageSurfaceGetStride = bindCairo(\"cairo_image_surface_get_stride\", [SURFACE_T], t.int32);\nconst cairoRecordingSurfaceCreate = bindCairo(\"cairo_recording_surface_create\", [t.int32, RECTANGLE_T], SURFACE_FULL_T);\n\nconst cairoRecordingSurfaceInkExtents = bindCairo(\n \"cairo_recording_surface_ink_extents\",\n [SURFACE_T, t.ref(t.float64), t.ref(t.float64), t.ref(t.float64), t.ref(t.float64)],\n t.void,\n);\n\nconst cairoRecordingSurfaceGetExtents = bindCairo(\n \"cairo_recording_surface_get_extents\",\n [SURFACE_T, RECTANGLE_T],\n t.boolean,\n);\n\nconst wrapSurface = (handle: unknown): Surface => wrapHandle(handle as ExternalObject<Handle>, Surface);\n\nconst readPair = <T>(boundFn: BoundFunction, self: object, build: (first: number, second: number) => T): T => {\n const first = { value: 0 };\n const second = { value: 0 };\n boundFn(getHandle(self), first, second);\n\n return build(first.value, second.value);\n};\n\nconst allocRectangle = (rect: RectangleData): ExternalObject<Handle> => {\n const buffer = alloc(RECTANGLE_SIZE);\n write(buffer, t.float64, 0, rect.x);\n write(buffer, t.float64, 8, rect.y);\n write(buffer, t.float64, 16, rect.width);\n write(buffer, t.float64, 24, rect.height);\n\n return buffer;\n};\n\nconst readRectangle = (buffer: ExternalObject<Handle>): RectangleData => ({\n x: DOUBLE.read(buffer, 0) as number,\n y: DOUBLE.read(buffer, 8) as number,\n width: DOUBLE.read(buffer, 16) as number,\n height: DOUBLE.read(buffer, 24) as number,\n});\n\nconst createRecordingSurface = (content: Content, extents?: RectangleData): ExternalObject<Handle> => {\n const rectangle = extents === undefined ? null : allocRectangle(extents);\n\n return cairoRecordingSurfaceCreate(content, rectangle) as ExternalObject<Handle>;\n};\n\nconst surfaceClassFor: WrapperClassResolver = (handle) => {\n const type = cairoSurfaceGetType(handle) as SurfaceType;\n\n if (type === SurfaceType.IMAGE) {\n return ImageSurface;\n }\n\n if (type === SurfaceType.RECORDING) {\n return RecordingSurface;\n }\n\n return Surface;\n};\n\n/**\n * A cairo surface (`cairo_surface_t`): the target a context draws onto. Surfaces come from the `create*`\n * statics, from `ImageSurface` and `RecordingSurface`, or from GTK, and wrap as the concrete class their\n * backend reports (`instanceof ImageSurface` for an image surface).\n */\nabstract class Surface {\n static {\n registerWrapperClass(this, SURFACE_TYPE);\n registerWrapperClassResolver(this, surfaceClassFor);\n }\n\n /** Creates a surface of the given `content` and size as compatible as possible with `other`. */\n static createSimilar(other: Surface, content: Content, width: number, height: number): Surface {\n const handle = cairoSurfaceCreateSimilar(getHandle(other), content, width, height) as ExternalObject<Handle>;\n\n return wrapSurface(checkSurface(handle));\n }\n\n /** Creates an image surface of the given `format` and size as compatible as possible with `other`. */\n static createSimilarImage(other: Surface, format: Format, width: number, height: number): ImageSurface {\n const handle =\n cairoSurfaceCreateSimilarImage(getHandle(other), format, width, height) as ExternalObject<Handle>;\n\n return wrapHandle(checkSurface(handle), ImageSurface);\n }\n\n /** Creates a surface that draws onto the given rectangle of `target`. */\n static createForRectangle(target: Surface, x: number, y: number, width: number, height: number): Surface {\n const handle =\n cairoSurfaceCreateForRectangle(getHandle(target), x, y, width, height) as ExternalObject<Handle>;\n\n return wrapSurface(checkSurface(handle));\n }\n\n /** GType of `CairoSurface`, the boxed type this class is registered under. */\n declare __type__: bigint;\n\n /** Writes the surface to a PNG file at `filename` and returns the resulting status. */\n writeToPng(filename: string): Status {\n return cairoSurfaceWriteToPng(getHandle(this), filename) as Status;\n }\n\n /** Returns the error status of the surface, `Status.SUCCESS` when it is usable. */\n status(): Status {\n return cairoSurfaceStatus(getHandle(this)) as Status;\n }\n\n /** Finishes the surface and drops its backend resources; further drawing reports an error. */\n finish(): void {\n cairoSurfaceFinish(getHandle(this));\n }\n\n /** Performs any pending drawing so the backend storage is up to date. */\n flush(): void {\n cairoSurfaceFlush(getHandle(this));\n }\n\n /** Returns the managed device behind the surface, or null when it has none. */\n getDevice(): Device | null {\n const handle = cairoSurfaceGetDevice(getHandle(this)) as ExternalObject<Handle> | null;\n\n return handle === null ? null : wrapHandle(handle, Device);\n }\n\n /** Returns the font options the surface's backend prefers for rendering text. */\n getFontOptions(): FontOptions {\n const options = FontOptions.create();\n cairoSurfaceGetFontOptions(getHandle(this), getHandle(options));\n\n return options;\n }\n\n /** Returns whether the surface holds color, alpha or both. */\n getContent(): Content {\n return cairoSurfaceGetContent(getHandle(this)) as Content;\n }\n\n /** Tells cairo the surface's storage was modified outside of cairo. */\n markDirty(): void {\n cairoSurfaceMarkDirty(getHandle(this));\n }\n\n /** Tells cairo the given rectangle of the surface's storage was modified outside of cairo. */\n markDirtyRectangle(x: number, y: number, width: number, height: number): void {\n cairoSurfaceMarkDirtyRectangle(getHandle(this), x, y, width, height);\n }\n\n /** Sets the offset added to device coordinates when drawing onto the surface. */\n setDeviceOffset(xOffset: number, yOffset: number): void {\n cairoSurfaceSetDeviceOffset(getHandle(this), xOffset, yOffset);\n }\n\n /** Returns the offset added to device coordinates when drawing onto the surface. */\n getDeviceOffset(): DeviceOffset {\n return readPair(cairoSurfaceGetDeviceOffset, this, (xOffset, yOffset) => ({ xOffset, yOffset }));\n }\n\n /** Returns the scale applied between user and device units. */\n getDeviceScale(): DeviceScale {\n return readPair(cairoSurfaceGetDeviceScale, this, (xScale, yScale) => ({ xScale, yScale }));\n }\n\n /** Sets the scale applied between user and device units. */\n setDeviceScale(xScale: number, yScale: number): void {\n cairoSurfaceSetDeviceScale(getHandle(this), xScale, yScale);\n }\n\n /** Sets the resolution used when vector content has to be rasterized. */\n setFallbackResolution(xPixelsPerInch: number, yPixelsPerInch: number): void {\n cairoSurfaceSetFallbackResolution(getHandle(this), xPixelsPerInch, yPixelsPerInch);\n }\n\n /** Returns the resolution used when vector content has to be rasterized. */\n getFallbackResolution(): FallbackResolution {\n return readPair(cairoSurfaceGetFallbackResolution, this, (xPixelsPerInch, yPixelsPerInch) => ({\n xPixelsPerInch,\n yPixelsPerInch,\n }));\n }\n\n /** Returns the backend type of the surface. */\n getType(): SurfaceType {\n return cairoSurfaceGetType(getHandle(this)) as SurfaceType;\n }\n\n /** Returns the reference count of the surface. */\n getReferenceCount(): number {\n return cairoSurfaceGetReferenceCount(getHandle(this)) as number;\n }\n\n /** Emits the current page and keeps its content for the next one, on paged backends. */\n copyPage(): void {\n cairoSurfaceCopyPage(getHandle(this));\n }\n\n /** Emits the current page and starts a blank one, on paged backends. */\n showPage(): void {\n cairoSurfaceShowPage(getHandle(this));\n }\n\n /** Returns whether the surface supports `Context.showTextGlyphs` natively. */\n hasShowTextGlyphs(): boolean {\n return cairoSurfaceHasShowTextGlyphs(getHandle(this)) as boolean;\n }\n\n /** Returns whether the surface can embed data of the given MIME type. */\n supportsMimeType(mimeType: string): boolean {\n return cairoSurfaceSupportsMimeType(getHandle(this), mimeType) as boolean;\n }\n}\n\n/** A surface backed by an in-memory pixel buffer, the usual target for offscreen drawing. */\nclass ImageSurface extends Surface {\n /** Creates an image surface of the given pixel `format` and size, the same as `new ImageSurface(...)`. */\n static create(format: Format, width: number, height: number): ImageSurface {\n return wrapHandle(\n checkSurface(cairoImageSurfaceCreate(format, width, height) as ExternalObject<Handle>),\n this,\n );\n }\n\n /** Loads a PNG file into a new image surface; throws when the file is missing or invalid. */\n static createFromPng(filename: string): ImageSurface {\n return wrapHandle(checkSurface(cairoImageSurfaceCreateFromPng(filename) as ExternalObject<Handle>), this);\n }\n\n /** Creates an image surface of the given pixel `format` and size. */\n constructor(format: Format, width: number, height: number) {\n super();\n setHandle(this, checkSurface(cairoImageSurfaceCreate(format, width, height) as ExternalObject<Handle>));\n }\n\n /** Returns the width of the surface in pixels. */\n getWidth(): number {\n return cairoImageSurfaceGetWidth(getHandle(this)) as number;\n }\n\n /** Returns the height of the surface in pixels. */\n getHeight(): number {\n return cairoImageSurfaceGetHeight(getHandle(this)) as number;\n }\n\n /** Returns the pixel format of the surface. */\n getFormat(): Format {\n return cairoImageSurfaceGetFormat(getHandle(this)) as Format;\n }\n\n /** Returns the number of bytes between the starts of consecutive rows. */\n getStride(): number {\n return cairoImageSurfaceGetStride(getHandle(this)) as number;\n }\n\n /** Returns a copy of the pixel data, `getStride() * getHeight()` bytes in the surface's format. */\n getData(): Uint8Array {\n /* TODO: Keep this finished-state check until Cairo stops exposing released image storage.\n * https://github.com/gtkx-org/gtkx/issues/730\n */\n Context.create(this);\n this.flush();\n const totalBytes = this.getStride() * this.getHeight();\n\n if (totalBytes === 0) {\n return new Uint8Array(0);\n }\n\n const getImageData = bindCairo(\n \"cairo_image_surface_get_data\",\n [SURFACE_T],\n t.fixedArray(t.uint8, totalBytes, \"borrowed\", { isBytes: true }),\n );\n\n return getImageData(getHandle(this)) as Uint8Array;\n }\n}\n\n/** A surface that records the drawing operations applied to it, for replaying them onto other surfaces. */\nclass RecordingSurface extends Surface {\n /** Creates a recording surface, the same as `new RecordingSurface(...)`. */\n static create(content: Content, extents?: RectangleData): RecordingSurface {\n return new RecordingSurface(content, extents);\n }\n\n /** Creates a recording surface of the given `content`, bounded to `extents` or unbounded when omitted. */\n constructor(content: Content, extents?: RectangleData) {\n super();\n setHandle(this, checkSurface(createRecordingSurface(content, extents)));\n }\n\n /** Returns the area that has been drawn on so far. */\n inkExtents(): InkExtents {\n const x0 = { value: 0 };\n const y0 = { value: 0 };\n const width = { value: 0 };\n const height = { value: 0 };\n cairoRecordingSurfaceInkExtents(getHandle(this), x0, y0, width, height);\n\n return { x0: x0.value, y0: y0.value, width: width.value, height: height.value };\n }\n\n /** Returns the extents the surface was created with, or null for an unbounded surface. */\n getExtents(): RectangleData | null {\n const buffer = alloc(RECTANGLE_SIZE);\n const isBounded = cairoRecordingSurfaceGetExtents(getHandle(this), buffer) as boolean;\n\n return isBounded ? readRectangle(buffer) : null;\n }\n}\n\nexport { ImageSurface, RecordingSurface, Surface };\n"]}
|
|
1
|
+
{"version":3,"file":"surface.js","sourceRoot":"","sources":["../src/surface.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EAEL,SAAS,EAET,oBAAoB,EACpB,4BAA4B,EAC5B,SAAS,EACT,CAAC,EACD,UAAU,EAEV,KAAK,GACR,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAA0C,WAAW,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACH,SAAS,EAET,UAAU,EACV,QAAQ,EACR,cAAc,EACd,WAAW,EACX,cAAc,EACd,SAAS,GACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,YAAY,GAAG,UAAU,CAAC,gCAAgC,CAAC,CAAC;AAClE,MAAM,cAAc,GAAG,EAAE,CAAC;AA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,EAAE,CAAC;QACxB,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAC5B,+BAA+B,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAExE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;IACpF,CAAC;IAED,0FAA0F;IAC1F,UAAU;QACN,MAAM,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,+BAA+B,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAY,CAAC;QAEtF,OAAO,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpD,CAAC;CACJ;AAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import {\n alloc,\n type ExternalObject,\n getHandle,\n type Handle,\n registerWrapperClass,\n registerWrapperClassResolver,\n setHandle,\n t,\n wrapHandle,\n type WrapperClassResolver,\n write,\n} from \"@gtkx/runtime\";\nimport type { DeviceOffset, DeviceScale, FallbackResolution, InkExtents, RectangleData } from \"./types.js\";\nimport { Context } from \"./context.js\";\nimport { Device } from \"./device.js\";\nimport { type Content, type Format, type Status, SurfaceType } from \"./enums.js\";\nimport { FontOptions } from \"./font-options.js\";\nimport {\n bindCairo,\n type BoundFunction,\n cairoGType,\n DEVICE_T,\n FONT_OPTIONS_T,\n RECTANGLE_T,\n SURFACE_FULL_T,\n SURFACE_T,\n} from \"./lib.js\";\nimport { checkSurface } from \"./status.js\";\n\nconst SURFACE_TYPE = cairoGType(\"cairo_gobject_surface_get_type\");\nconst RECTANGLE_SIZE = 32;\nconst DOUBLE = t.fieldAt(t.float64);\nconst DEVICE_PAIR_ARGS = [SURFACE_T, t.float64, t.float64];\nconst DEVICE_PAIR_OUT_ARGS = [SURFACE_T, t.ref(t.float64), t.ref(t.float64)];\nconst SIMILAR_ARGS = [SURFACE_T, t.int32, t.int32, t.int32];\nconst cairoSurfaceCreateSimilar = bindCairo(\"cairo_surface_create_similar\", SIMILAR_ARGS, SURFACE_FULL_T);\nconst cairoSurfaceCreateSimilarImage = bindCairo(\"cairo_surface_create_similar_image\", SIMILAR_ARGS, SURFACE_FULL_T);\n\nconst cairoSurfaceCreateForRectangle = bindCairo(\n \"cairo_surface_create_for_rectangle\",\n [SURFACE_T, t.float64, t.float64, t.float64, t.float64],\n SURFACE_FULL_T,\n);\n\nconst cairoSurfaceWriteToPng = bindCairo(\"cairo_surface_write_to_png\", [SURFACE_T, t.string(\"borrowed\")], t.int32);\nconst cairoSurfaceStatus = bindCairo(\"cairo_surface_status\", [SURFACE_T], t.int32);\nconst cairoSurfaceFinish = bindCairo(\"cairo_surface_finish\", [SURFACE_T], t.void);\nconst cairoSurfaceFlush = bindCairo(\"cairo_surface_flush\", [SURFACE_T], t.void);\nconst cairoSurfaceGetDevice = bindCairo(\"cairo_surface_get_device\", [SURFACE_T], DEVICE_T);\nconst cairoSurfaceGetFontOptions = bindCairo(\"cairo_surface_get_font_options\", [SURFACE_T, FONT_OPTIONS_T], t.void);\nconst cairoSurfaceGetContent = bindCairo(\"cairo_surface_get_content\", [SURFACE_T], t.int32);\nconst cairoSurfaceMarkDirty = bindCairo(\"cairo_surface_mark_dirty\", [SURFACE_T], t.void);\n\nconst cairoSurfaceMarkDirtyRectangle = bindCairo(\n \"cairo_surface_mark_dirty_rectangle\",\n [SURFACE_T, t.int32, t.int32, t.int32, t.int32],\n t.void,\n);\n\nconst cairoSurfaceSetDeviceOffset = bindCairo(\"cairo_surface_set_device_offset\", DEVICE_PAIR_ARGS, t.void);\nconst cairoSurfaceGetDeviceOffset = bindCairo(\"cairo_surface_get_device_offset\", DEVICE_PAIR_OUT_ARGS, t.void);\nconst cairoSurfaceGetDeviceScale = bindCairo(\"cairo_surface_get_device_scale\", DEVICE_PAIR_OUT_ARGS, t.void);\nconst cairoSurfaceSetDeviceScale = bindCairo(\"cairo_surface_set_device_scale\", DEVICE_PAIR_ARGS, t.void);\nconst cairoSurfaceSetFallbackResolution = bindCairo(\"cairo_surface_set_fallback_resolution\", DEVICE_PAIR_ARGS, t.void);\n\nconst cairoSurfaceGetFallbackResolution = bindCairo(\n \"cairo_surface_get_fallback_resolution\",\n DEVICE_PAIR_OUT_ARGS,\n t.void,\n);\n\nconst cairoSurfaceGetType = bindCairo(\"cairo_surface_get_type\", [SURFACE_T], t.int32);\nconst cairoSurfaceGetReferenceCount = bindCairo(\"cairo_surface_get_reference_count\", [SURFACE_T], t.int32);\nconst cairoSurfaceCopyPage = bindCairo(\"cairo_surface_copy_page\", [SURFACE_T], t.void);\nconst cairoSurfaceShowPage = bindCairo(\"cairo_surface_show_page\", [SURFACE_T], t.void);\nconst cairoSurfaceHasShowTextGlyphs = bindCairo(\"cairo_surface_has_show_text_glyphs\", [SURFACE_T], t.boolean);\n\nconst cairoSurfaceSupportsMimeType = bindCairo(\n \"cairo_surface_supports_mime_type\",\n [SURFACE_T, t.string(\"borrowed\")],\n t.boolean,\n);\n\nconst cairoImageSurfaceCreate = bindCairo(\"cairo_image_surface_create\", [t.int32, t.int32, t.int32], SURFACE_FULL_T);\n\nconst cairoImageSurfaceCreateFromPng = bindCairo(\n \"cairo_image_surface_create_from_png\",\n [t.string(\"borrowed\")],\n SURFACE_FULL_T,\n);\n\nconst cairoImageSurfaceGetWidth = bindCairo(\"cairo_image_surface_get_width\", [SURFACE_T], t.int32);\nconst cairoImageSurfaceGetHeight = bindCairo(\"cairo_image_surface_get_height\", [SURFACE_T], t.int32);\nconst cairoImageSurfaceGetFormat = bindCairo(\"cairo_image_surface_get_format\", [SURFACE_T], t.int32);\nconst cairoImageSurfaceGetStride = bindCairo(\"cairo_image_surface_get_stride\", [SURFACE_T], t.int32);\nconst cairoRecordingSurfaceCreate = bindCairo(\"cairo_recording_surface_create\", [t.int32, RECTANGLE_T], SURFACE_FULL_T);\n\nconst cairoRecordingSurfaceInkExtents = bindCairo(\n \"cairo_recording_surface_ink_extents\",\n [SURFACE_T, t.ref(t.float64), t.ref(t.float64), t.ref(t.float64), t.ref(t.float64)],\n t.void,\n);\n\nconst cairoRecordingSurfaceGetExtents = bindCairo(\n \"cairo_recording_surface_get_extents\",\n [SURFACE_T, RECTANGLE_T],\n t.boolean,\n);\n\nconst wrapSurface = (handle: unknown): Surface => wrapHandle(handle as ExternalObject<Handle>, Surface);\n\nconst readPair = <T>(boundFn: BoundFunction, self: object, build: (first: number, second: number) => T): T => {\n const first = { value: 0 };\n const second = { value: 0 };\n boundFn(getHandle(self), first, second);\n\n return build(first.value, second.value);\n};\n\nconst allocRectangle = (rect: RectangleData): ExternalObject<Handle> => {\n const buffer = alloc(RECTANGLE_SIZE);\n write(buffer, t.float64, 0, rect.x);\n write(buffer, t.float64, 8, rect.y);\n write(buffer, t.float64, 16, rect.width);\n write(buffer, t.float64, 24, rect.height);\n\n return buffer;\n};\n\nconst readRectangle = (buffer: ExternalObject<Handle>): RectangleData => ({\n x: DOUBLE.read(buffer, 0) as number,\n y: DOUBLE.read(buffer, 8) as number,\n width: DOUBLE.read(buffer, 16) as number,\n height: DOUBLE.read(buffer, 24) as number,\n});\n\nconst createRecordingSurface = (content: Content, extents?: RectangleData): ExternalObject<Handle> => {\n const rectangle = extents === undefined ? null : allocRectangle(extents);\n\n return cairoRecordingSurfaceCreate(content, rectangle) as ExternalObject<Handle>;\n};\n\nconst surfaceClassFor: WrapperClassResolver = (handle) => {\n const type = cairoSurfaceGetType(handle) as SurfaceType;\n\n if (type === SurfaceType.IMAGE) {\n return ImageSurface;\n }\n\n if (type === SurfaceType.RECORDING) {\n return RecordingSurface;\n }\n\n return Surface;\n};\n\n/**\n * A cairo surface (`cairo_surface_t`): the target a context draws onto. Surfaces come from the `create*`\n * statics, from `ImageSurface` and `RecordingSurface`, or from GTK, and wrap as the concrete class their\n * backend reports (`instanceof ImageSurface` for an image surface).\n */\nabstract class Surface {\n static {\n registerWrapperClass(this, SURFACE_TYPE);\n registerWrapperClassResolver(this, surfaceClassFor);\n }\n\n /** Creates a surface of the given `content` and size as compatible as possible with `other`. */\n static createSimilar(other: Surface, content: Content, width: number, height: number): Surface {\n const handle = cairoSurfaceCreateSimilar(getHandle(other), content, width, height) as ExternalObject<Handle>;\n\n return wrapSurface(checkSurface(handle));\n }\n\n /** Creates an image surface of the given `format` and size as compatible as possible with `other`. */\n static createSimilarImage(other: Surface, format: Format, width: number, height: number): ImageSurface {\n const handle = cairoSurfaceCreateSimilarImage(\n getHandle(other),\n format,\n width,\n height,\n ) as ExternalObject<Handle>;\n\n return wrapHandle(checkSurface(handle), ImageSurface);\n }\n\n /** Creates a surface that draws onto the given rectangle of `target`. */\n static createForRectangle(target: Surface, x: number, y: number, width: number, height: number): Surface {\n const handle = cairoSurfaceCreateForRectangle(getHandle(target), x, y, width, height) as ExternalObject<Handle>;\n\n return wrapSurface(checkSurface(handle));\n }\n\n /** GType of `CairoSurface`, the boxed type this class is registered under. */\n declare __type__: bigint;\n\n /** Writes the surface to a PNG file at `filename` and returns the resulting status. */\n writeToPng(filename: string): Status {\n return cairoSurfaceWriteToPng(getHandle(this), filename) as Status;\n }\n\n /** Returns the error status of the surface, `Status.SUCCESS` when it is usable. */\n status(): Status {\n return cairoSurfaceStatus(getHandle(this)) as Status;\n }\n\n /** Finishes the surface and drops its backend resources; further drawing reports an error. */\n finish(): void {\n cairoSurfaceFinish(getHandle(this));\n }\n\n /** Performs any pending drawing so the backend storage is up to date. */\n flush(): void {\n cairoSurfaceFlush(getHandle(this));\n }\n\n /** Returns the managed device behind the surface, or null when it has none. */\n getDevice(): Device | null {\n const handle = cairoSurfaceGetDevice(getHandle(this)) as ExternalObject<Handle> | null;\n\n return handle === null ? null : wrapHandle(handle, Device);\n }\n\n /** Returns the font options the surface's backend prefers for rendering text. */\n getFontOptions(): FontOptions {\n const options = FontOptions.create();\n cairoSurfaceGetFontOptions(getHandle(this), getHandle(options));\n\n return options;\n }\n\n /** Returns whether the surface holds color, alpha or both. */\n getContent(): Content {\n return cairoSurfaceGetContent(getHandle(this)) as Content;\n }\n\n /** Tells cairo the surface's storage was modified outside of cairo. */\n markDirty(): void {\n cairoSurfaceMarkDirty(getHandle(this));\n }\n\n /** Tells cairo the given rectangle of the surface's storage was modified outside of cairo. */\n markDirtyRectangle(x: number, y: number, width: number, height: number): void {\n cairoSurfaceMarkDirtyRectangle(getHandle(this), x, y, width, height);\n }\n\n /** Sets the offset added to device coordinates when drawing onto the surface. */\n setDeviceOffset(xOffset: number, yOffset: number): void {\n cairoSurfaceSetDeviceOffset(getHandle(this), xOffset, yOffset);\n }\n\n /** Returns the offset added to device coordinates when drawing onto the surface. */\n getDeviceOffset(): DeviceOffset {\n return readPair(cairoSurfaceGetDeviceOffset, this, (xOffset, yOffset) => ({ xOffset, yOffset }));\n }\n\n /** Returns the scale applied between user and device units. */\n getDeviceScale(): DeviceScale {\n return readPair(cairoSurfaceGetDeviceScale, this, (xScale, yScale) => ({ xScale, yScale }));\n }\n\n /** Sets the scale applied between user and device units. */\n setDeviceScale(xScale: number, yScale: number): void {\n cairoSurfaceSetDeviceScale(getHandle(this), xScale, yScale);\n }\n\n /** Sets the resolution used when vector content has to be rasterized. */\n setFallbackResolution(xPixelsPerInch: number, yPixelsPerInch: number): void {\n cairoSurfaceSetFallbackResolution(getHandle(this), xPixelsPerInch, yPixelsPerInch);\n }\n\n /** Returns the resolution used when vector content has to be rasterized. */\n getFallbackResolution(): FallbackResolution {\n return readPair(cairoSurfaceGetFallbackResolution, this, (xPixelsPerInch, yPixelsPerInch) => ({\n xPixelsPerInch,\n yPixelsPerInch,\n }));\n }\n\n /** Returns the backend type of the surface. */\n getType(): SurfaceType {\n return cairoSurfaceGetType(getHandle(this)) as SurfaceType;\n }\n\n /** Returns the reference count of the surface. */\n getReferenceCount(): number {\n return cairoSurfaceGetReferenceCount(getHandle(this)) as number;\n }\n\n /** Emits the current page and keeps its content for the next one, on paged backends. */\n copyPage(): void {\n cairoSurfaceCopyPage(getHandle(this));\n }\n\n /** Emits the current page and starts a blank one, on paged backends. */\n showPage(): void {\n cairoSurfaceShowPage(getHandle(this));\n }\n\n /** Returns whether the surface supports `Context.showTextGlyphs` natively. */\n hasShowTextGlyphs(): boolean {\n return cairoSurfaceHasShowTextGlyphs(getHandle(this)) as boolean;\n }\n\n /** Returns whether the surface can embed data of the given MIME type. */\n supportsMimeType(mimeType: string): boolean {\n return cairoSurfaceSupportsMimeType(getHandle(this), mimeType) as boolean;\n }\n}\n\n/** A surface backed by an in-memory pixel buffer, the usual target for offscreen drawing. */\nclass ImageSurface extends Surface {\n /** Creates an image surface of the given pixel `format` and size, the same as `new ImageSurface(...)`. */\n static create(format: Format, width: number, height: number): ImageSurface {\n return wrapHandle(checkSurface(cairoImageSurfaceCreate(format, width, height) as ExternalObject<Handle>), this);\n }\n\n /** Loads a PNG file into a new image surface; throws when the file is missing or invalid. */\n static createFromPng(filename: string): ImageSurface {\n return wrapHandle(checkSurface(cairoImageSurfaceCreateFromPng(filename) as ExternalObject<Handle>), this);\n }\n\n /** Creates an image surface of the given pixel `format` and size. */\n constructor(format: Format, width: number, height: number) {\n super();\n setHandle(this, checkSurface(cairoImageSurfaceCreate(format, width, height) as ExternalObject<Handle>));\n }\n\n /** Returns the width of the surface in pixels. */\n getWidth(): number {\n return cairoImageSurfaceGetWidth(getHandle(this)) as number;\n }\n\n /** Returns the height of the surface in pixels. */\n getHeight(): number {\n return cairoImageSurfaceGetHeight(getHandle(this)) as number;\n }\n\n /** Returns the pixel format of the surface. */\n getFormat(): Format {\n return cairoImageSurfaceGetFormat(getHandle(this)) as Format;\n }\n\n /** Returns the number of bytes between the starts of consecutive rows. */\n getStride(): number {\n return cairoImageSurfaceGetStride(getHandle(this)) as number;\n }\n\n /** Returns a copy of the pixel data, `getStride() * getHeight()` bytes in the surface's format. */\n getData(): Uint8Array {\n /* TODO: Keep this finished-state check until Cairo stops exposing released image storage.\n * https://github.com/gtkx-org/gtkx/issues/730\n */\n Context.create(this);\n this.flush();\n const totalBytes = this.getStride() * this.getHeight();\n\n if (totalBytes === 0) {\n return new Uint8Array(0);\n }\n\n const getImageData = bindCairo(\n \"cairo_image_surface_get_data\",\n [SURFACE_T],\n t.fixedArray(t.uint8, totalBytes, \"borrowed\", { isBytes: true }),\n );\n\n return getImageData(getHandle(this)) as Uint8Array;\n }\n}\n\n/** A surface that records the drawing operations applied to it, for replaying them onto other surfaces. */\nclass RecordingSurface extends Surface {\n /** Creates a recording surface, the same as `new RecordingSurface(...)`. */\n static create(content: Content, extents?: RectangleData): RecordingSurface {\n return new RecordingSurface(content, extents);\n }\n\n /** Creates a recording surface of the given `content`, bounded to `extents` or unbounded when omitted. */\n constructor(content: Content, extents?: RectangleData) {\n super();\n setHandle(this, checkSurface(createRecordingSurface(content, extents)));\n }\n\n /** Returns the area that has been drawn on so far. */\n inkExtents(): InkExtents {\n const x0 = { value: 0 };\n const y0 = { value: 0 };\n const width = { value: 0 };\n const height = { value: 0 };\n cairoRecordingSurfaceInkExtents(getHandle(this), x0, y0, width, height);\n\n return { x0: x0.value, y0: y0.value, width: width.value, height: height.value };\n }\n\n /** Returns the extents the surface was created with, or null for an unbounded surface. */\n getExtents(): RectangleData | null {\n const buffer = alloc(RECTANGLE_SIZE);\n const isBounded = cairoRecordingSurfaceGetExtents(getHandle(this), buffer) as boolean;\n\n return isBounded ? readRectangle(buffer) : null;\n }\n}\n\nexport { ImageSurface, RecordingSurface, Surface };\n"]}
|
package/dist/text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,cAAc,EAAE,KAAK,MAAM,EAAK,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAUzF,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,cAAc,EAAE,KAAK,MAAM,EAAK,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAUzF,QAAA,MAAM,gBAAgB,WAAY,UAAU,EAAE,KAAG,cAAc,CAAC,MAAM,CAYrE,CAAC;AAEF,QAAA,MAAM,kBAAkB,aAAc,gBAAgB,EAAE,KAAG,cAAc,CAAC,MAAM,CAW/E,CAAC;AAEF,QAAA,MAAM,gBAAgB,QAAO,cAAc,CAAC,MAAM,CAA6B,CAAC;AAChF,QAAA,MAAM,gBAAgB,QAAO,cAAc,CAAC,MAAM,CAA6B,CAAC;AAEhF,QAAA,MAAM,eAAe,WAAY,cAAc,CAAC,MAAM,CAAC,KAAG,WAOxD,CAAC;AAEH,QAAA,MAAM,eAAe,WAAY,cAAc,CAAC,MAAM,CAAC,KAAG,WAMxD,CAAC;AAEH,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC"}
|
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAOzC,yGAAyG;AACzG,QAAA,MAAM,OAAO,QAAO,MAAkC,CAAC;AACvD,sFAAsF;AACtF,QAAA,MAAM,aAAa,QAAO,MAAwC,CAAC;AACnE,6DAA6D;AAC7D,QAAA,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAOzC,yGAAyG;AACzG,QAAA,MAAM,OAAO,QAAO,MAAkC,CAAC;AACvD,sFAAsF;AACtF,QAAA,MAAM,aAAa,QAAO,MAAwC,CAAC;AACnE,6DAA6D;AAC7D,QAAA,MAAM,cAAc,WAAY,MAAM,KAAG,MAA+C,CAAC;AAEzF,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/cairo",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.12",
|
|
4
4
|
"description": "Cairo drawing for GTKX applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gtkx",
|
|
@@ -40,27 +40,17 @@
|
|
|
40
40
|
"dist",
|
|
41
41
|
"src"
|
|
42
42
|
],
|
|
43
|
-
"nx": {
|
|
44
|
-
"targets": {
|
|
45
|
-
"lint": {
|
|
46
|
-
"options": {
|
|
47
|
-
"cwd": ".",
|
|
48
|
-
"command": "eslint {projectRoot}"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
43
|
"engines": {
|
|
54
44
|
"node": ">=26.7.0"
|
|
55
45
|
},
|
|
56
46
|
"dependencies": {
|
|
57
|
-
"@gtkx/runtime": "2.0.0-beta.
|
|
47
|
+
"@gtkx/runtime": "2.0.0-beta.12"
|
|
58
48
|
},
|
|
59
49
|
"devDependencies": {
|
|
60
|
-
"@gtkx/vitest": "2.0.0-beta.
|
|
50
|
+
"@gtkx/vitest": "2.0.0-beta.12",
|
|
61
51
|
"@types/node": "^26.5.1"
|
|
62
52
|
},
|
|
63
53
|
"scripts": {
|
|
64
|
-
"release": "
|
|
54
|
+
"release": "node ../../scripts/release/publish-package.ts"
|
|
65
55
|
}
|
|
66
56
|
}
|
package/src/font-face.ts
CHANGED
|
@@ -30,11 +30,7 @@ const cairoToyFontFaceCreate = bindCairo(
|
|
|
30
30
|
FONT_FACE_FULL_T,
|
|
31
31
|
);
|
|
32
32
|
|
|
33
|
-
const cairoFtFontFaceUnsetSynthesize = bindCairo(
|
|
34
|
-
"cairo_ft_font_face_unset_synthesize",
|
|
35
|
-
[FONT_FACE_T, t.int32],
|
|
36
|
-
t.void,
|
|
37
|
-
);
|
|
33
|
+
const cairoFtFontFaceUnsetSynthesize = bindCairo("cairo_ft_font_face_unset_synthesize", [FONT_FACE_T, t.int32], t.void);
|
|
38
34
|
|
|
39
35
|
/**
|
|
40
36
|
* Styles a FreeType font face synthesizes when the font itself lacks them.
|
package/src/font-options.ts
CHANGED
|
@@ -39,11 +39,7 @@ const cairoFontOptionsSetSubpixelOrder = bindCairo(
|
|
|
39
39
|
t.void,
|
|
40
40
|
);
|
|
41
41
|
|
|
42
|
-
const cairoFontOptionsGetSubpixelOrder = bindCairo(
|
|
43
|
-
"cairo_font_options_get_subpixel_order",
|
|
44
|
-
[FONT_OPTIONS_T],
|
|
45
|
-
t.int32,
|
|
46
|
-
);
|
|
42
|
+
const cairoFontOptionsGetSubpixelOrder = bindCairo("cairo_font_options_get_subpixel_order", [FONT_OPTIONS_T], t.int32);
|
|
47
43
|
|
|
48
44
|
/**
|
|
49
45
|
* Cairo font options (`cairo_font_options_t`): the rendering settings applied to text, such as antialiasing,
|
package/src/lib.ts
CHANGED
|
@@ -13,11 +13,7 @@ const CONTEXT_T: BoxedDescriptor = t.boxed("CairoContext", {
|
|
|
13
13
|
getTypeFnName: "cairo_gobject_context_get_type",
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
const CONTEXT_FULL_T: BoxedDescriptor =
|
|
17
|
-
ownership: "full",
|
|
18
|
-
sharedLibrary: CAIRO_GOBJECT_LIBRARY,
|
|
19
|
-
getTypeFnName: "cairo_gobject_context_get_type",
|
|
20
|
-
});
|
|
16
|
+
const CONTEXT_FULL_T: BoxedDescriptor = { ...CONTEXT_T, ownership: "full" };
|
|
21
17
|
|
|
22
18
|
const SURFACE_T: BoxedDescriptor = t.boxed("CairoSurface", {
|
|
23
19
|
ownership: "borrowed",
|
|
@@ -25,11 +21,7 @@ const SURFACE_T: BoxedDescriptor = t.boxed("CairoSurface", {
|
|
|
25
21
|
getTypeFnName: "cairo_gobject_surface_get_type",
|
|
26
22
|
});
|
|
27
23
|
|
|
28
|
-
const SURFACE_FULL_T: BoxedDescriptor =
|
|
29
|
-
ownership: "full",
|
|
30
|
-
sharedLibrary: CAIRO_GOBJECT_LIBRARY,
|
|
31
|
-
getTypeFnName: "cairo_gobject_surface_get_type",
|
|
32
|
-
});
|
|
24
|
+
const SURFACE_FULL_T: BoxedDescriptor = { ...SURFACE_T, ownership: "full" };
|
|
33
25
|
|
|
34
26
|
const DEVICE_T: BoxedDescriptor = t.boxed("CairoDevice", {
|
|
35
27
|
ownership: "borrowed",
|
|
@@ -43,11 +35,7 @@ const PATTERN_T: BoxedDescriptor = t.boxed("CairoPattern", {
|
|
|
43
35
|
getTypeFnName: "cairo_gobject_pattern_get_type",
|
|
44
36
|
});
|
|
45
37
|
|
|
46
|
-
const PATTERN_FULL_T: BoxedDescriptor =
|
|
47
|
-
ownership: "full",
|
|
48
|
-
sharedLibrary: CAIRO_GOBJECT_LIBRARY,
|
|
49
|
-
getTypeFnName: "cairo_gobject_pattern_get_type",
|
|
50
|
-
});
|
|
38
|
+
const PATTERN_FULL_T: BoxedDescriptor = { ...PATTERN_T, ownership: "full" };
|
|
51
39
|
|
|
52
40
|
const REGION_T: BoxedDescriptor = t.boxed("CairoRegion", {
|
|
53
41
|
ownership: "borrowed",
|
|
@@ -55,11 +43,7 @@ const REGION_T: BoxedDescriptor = t.boxed("CairoRegion", {
|
|
|
55
43
|
getTypeFnName: "cairo_gobject_region_get_type",
|
|
56
44
|
});
|
|
57
45
|
|
|
58
|
-
const REGION_FULL_T: BoxedDescriptor =
|
|
59
|
-
ownership: "full",
|
|
60
|
-
sharedLibrary: CAIRO_GOBJECT_LIBRARY,
|
|
61
|
-
getTypeFnName: "cairo_gobject_region_get_type",
|
|
62
|
-
});
|
|
46
|
+
const REGION_FULL_T: BoxedDescriptor = { ...REGION_T, ownership: "full" };
|
|
63
47
|
|
|
64
48
|
const FONT_OPTIONS_T: BoxedDescriptor = t.boxed("CairoFontOptions", {
|
|
65
49
|
ownership: "borrowed",
|
|
@@ -67,11 +51,7 @@ const FONT_OPTIONS_T: BoxedDescriptor = t.boxed("CairoFontOptions", {
|
|
|
67
51
|
getTypeFnName: "cairo_gobject_font_options_get_type",
|
|
68
52
|
});
|
|
69
53
|
|
|
70
|
-
const FONT_OPTIONS_FULL_T: BoxedDescriptor =
|
|
71
|
-
ownership: "full",
|
|
72
|
-
sharedLibrary: CAIRO_GOBJECT_LIBRARY,
|
|
73
|
-
getTypeFnName: "cairo_gobject_font_options_get_type",
|
|
74
|
-
});
|
|
54
|
+
const FONT_OPTIONS_FULL_T: BoxedDescriptor = { ...FONT_OPTIONS_T, ownership: "full" };
|
|
75
55
|
|
|
76
56
|
const FONT_FACE_T: BoxedDescriptor = t.boxed("CairoFontFace", {
|
|
77
57
|
ownership: "borrowed",
|
|
@@ -79,11 +59,7 @@ const FONT_FACE_T: BoxedDescriptor = t.boxed("CairoFontFace", {
|
|
|
79
59
|
getTypeFnName: "cairo_gobject_font_face_get_type",
|
|
80
60
|
});
|
|
81
61
|
|
|
82
|
-
const FONT_FACE_FULL_T: BoxedDescriptor =
|
|
83
|
-
ownership: "full",
|
|
84
|
-
sharedLibrary: CAIRO_GOBJECT_LIBRARY,
|
|
85
|
-
getTypeFnName: "cairo_gobject_font_face_get_type",
|
|
86
|
-
});
|
|
62
|
+
const FONT_FACE_FULL_T: BoxedDescriptor = { ...FONT_FACE_T, ownership: "full" };
|
|
87
63
|
|
|
88
64
|
const SCALED_FONT_T: BoxedDescriptor = t.boxed("CairoScaledFont", {
|
|
89
65
|
ownership: "borrowed",
|
|
@@ -91,11 +67,7 @@ const SCALED_FONT_T: BoxedDescriptor = t.boxed("CairoScaledFont", {
|
|
|
91
67
|
getTypeFnName: "cairo_gobject_scaled_font_get_type",
|
|
92
68
|
});
|
|
93
69
|
|
|
94
|
-
const SCALED_FONT_FULL_T: BoxedDescriptor =
|
|
95
|
-
ownership: "full",
|
|
96
|
-
sharedLibrary: CAIRO_GOBJECT_LIBRARY,
|
|
97
|
-
getTypeFnName: "cairo_gobject_scaled_font_get_type",
|
|
98
|
-
});
|
|
70
|
+
const SCALED_FONT_FULL_T: BoxedDescriptor = { ...SCALED_FONT_T, ownership: "full" };
|
|
99
71
|
|
|
100
72
|
const MATRIX_T: BoxedDescriptor = t.boxed("cairo_matrix_t", { ownership: "borrowed", sharedLibrary: CAIRO_LIBRARY });
|
|
101
73
|
|
package/src/pattern.ts
CHANGED
|
@@ -25,12 +25,7 @@ import { parsePath } from "./path.js";
|
|
|
25
25
|
import { checkStatus } from "./status.js";
|
|
26
26
|
import { Surface } from "./surface.js";
|
|
27
27
|
|
|
28
|
-
type RgbaRefs = [
|
|
29
|
-
red: { value: number },
|
|
30
|
-
green: { value: number },
|
|
31
|
-
blue: { value: number },
|
|
32
|
-
alpha: { value: number },
|
|
33
|
-
];
|
|
28
|
+
type RgbaRefs = [red: { value: number }, green: { value: number }, blue: { value: number }, alpha: { value: number }];
|
|
34
29
|
|
|
35
30
|
const PATTERN_TYPE = cairoGType("cairo_gobject_pattern_get_type");
|
|
36
31
|
const FOUR_DOUBLES_OUT = [t.ref(t.float64), t.ref(t.float64), t.ref(t.float64), t.ref(t.float64)];
|
package/src/scaled-font.ts
CHANGED
|
@@ -66,11 +66,7 @@ const cairoScaledFontGetScaleMatrix = bindCairo(
|
|
|
66
66
|
t.void,
|
|
67
67
|
);
|
|
68
68
|
|
|
69
|
-
const cairoScaledFontGetReferenceCount = bindCairo(
|
|
70
|
-
"cairo_scaled_font_get_reference_count",
|
|
71
|
-
[SCALED_FONT_T],
|
|
72
|
-
t.int32,
|
|
73
|
-
);
|
|
69
|
+
const cairoScaledFontGetReferenceCount = bindCairo("cairo_scaled_font_get_reference_count", [SCALED_FONT_T], t.int32);
|
|
74
70
|
|
|
75
71
|
const readMatrixVia = (self: ScaledFont, boundFn: BoundFunction): Matrix => {
|
|
76
72
|
const { handle, matrix } = allocMatrix();
|