@gtkx/cairo 1.2.2

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.
Files changed (86) hide show
  1. package/dist/context.d.ts +229 -0
  2. package/dist/context.d.ts.map +1 -0
  3. package/dist/context.js +646 -0
  4. package/dist/context.js.map +1 -0
  5. package/dist/device.d.ts +21 -0
  6. package/dist/device.d.ts.map +1 -0
  7. package/dist/device.js +39 -0
  8. package/dist/device.js.map +1 -0
  9. package/dist/enums.d.ts +526 -0
  10. package/dist/enums.d.ts.map +1 -0
  11. package/dist/enums.js +482 -0
  12. package/dist/enums.js.map +1 -0
  13. package/dist/font-face.d.ts +55 -0
  14. package/dist/font-face.d.ts.map +1 -0
  15. package/dist/font-face.js +103 -0
  16. package/dist/font-face.js.map +1 -0
  17. package/dist/font-options.d.ts +43 -0
  18. package/dist/font-options.d.ts.map +1 -0
  19. package/dist/font-options.js +95 -0
  20. package/dist/font-options.js.map +1 -0
  21. package/dist/index.d.ts +29 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +27 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/lib.d.ts +36 -0
  26. package/dist/lib.d.ts.map +1 -0
  27. package/dist/lib.js +120 -0
  28. package/dist/lib.js.map +1 -0
  29. package/dist/matrix.d.ts +40 -0
  30. package/dist/matrix.d.ts.map +1 -0
  31. package/dist/matrix.js +93 -0
  32. package/dist/matrix.js.map +1 -0
  33. package/dist/path.d.ts +14 -0
  34. package/dist/path.d.ts.map +1 -0
  35. package/dist/path.js +67 -0
  36. package/dist/path.js.map +1 -0
  37. package/dist/pattern.d.ts +95 -0
  38. package/dist/pattern.d.ts.map +1 -0
  39. package/dist/pattern.js +250 -0
  40. package/dist/pattern.js.map +1 -0
  41. package/dist/region.d.ts +59 -0
  42. package/dist/region.d.ts.map +1 -0
  43. package/dist/region.js +154 -0
  44. package/dist/region.js.map +1 -0
  45. package/dist/scaled-font.d.ts +43 -0
  46. package/dist/scaled-font.d.ts.map +1 -0
  47. package/dist/scaled-font.js +156 -0
  48. package/dist/scaled-font.js.map +1 -0
  49. package/dist/structs.d.ts +120 -0
  50. package/dist/structs.d.ts.map +1 -0
  51. package/dist/structs.js +185 -0
  52. package/dist/structs.js.map +1 -0
  53. package/dist/surface.d.ts +98 -0
  54. package/dist/surface.d.ts.map +1 -0
  55. package/dist/surface.js +274 -0
  56. package/dist/surface.js.map +1 -0
  57. package/dist/text.d.ts +10 -0
  58. package/dist/text.d.ts.map +1 -0
  59. package/dist/text.js +45 -0
  60. package/dist/text.js.map +1 -0
  61. package/dist/types.d.ts +245 -0
  62. package/dist/types.d.ts.map +1 -0
  63. package/dist/types.js +2 -0
  64. package/dist/types.js.map +1 -0
  65. package/dist/version.d.ts +9 -0
  66. package/dist/version.d.ts.map +1 -0
  67. package/dist/version.js +13 -0
  68. package/dist/version.js.map +1 -0
  69. package/package.json +64 -0
  70. package/src/context.ts +899 -0
  71. package/src/device.ts +50 -0
  72. package/src/enums.ts +571 -0
  73. package/src/font-face.ts +157 -0
  74. package/src/font-options.ts +142 -0
  75. package/src/index.ts +28 -0
  76. package/src/lib.ts +186 -0
  77. package/src/matrix.ts +135 -0
  78. package/src/path.ts +87 -0
  79. package/src/pattern.ts +423 -0
  80. package/src/region.ts +216 -0
  81. package/src/scaled-font.ts +268 -0
  82. package/src/structs.ts +306 -0
  83. package/src/surface.ts +411 -0
  84. package/src/text.ts +56 -0
  85. package/src/types.ts +290 -0
  86. package/src/version.ts +16 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface.js","sourceRoot":"","sources":["../src/surface.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EAEL,SAAS,EAET,IAAI,EACJ,oBAAoB,EACpB,4BAA4B,EAC5B,SAAS,EACT,CAAC,EACD,UAAU,EAEV,KAAK,GACR,MAAM,eAAe,CAAC;AAGvB,OAAO,EAA0C,WAAW,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE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C,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 read,\n registerWrapperClass,\n registerWrapperClassResolver,\n setHandle,\n t,\n wrapHandle,\n type WrapperClassResolver,\n write,\n} from \"@gtkx/runtime\";\nimport type { RectangleInt } from \"./structs.js\";\nimport type { DeviceOffset, DeviceScale, FallbackResolution, InkExtents, RectangleData } from \"./types.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_INT_T,\n RECTANGLE_T,\n SURFACE_FULL_T,\n SURFACE_T,\n} from \"./lib.js\";\n\nconst SURFACE_TYPE = cairoGType(\"cairo_gobject_surface_get_type\");\nconst RECTANGLE_SIZE = 32;\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(\"full\")], 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(\"full\")],\n t.boolean,\n);\n\nconst cairoSurfaceMapToImage = bindCairo(\"cairo_surface_map_to_image\", [SURFACE_T, RECTANGLE_INT_T], SURFACE_T);\nconst cairoSurfaceUnmapImage = bindCairo(\"cairo_surface_unmap_image\", [SURFACE_T, SURFACE_T], t.void);\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(\"full\")],\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 cairoRecordingSurfaceCreateUnbounded = bindCairo(\n \"cairo_recording_surface_create\",\n [t.int32, t.uint64],\n SURFACE_FULL_T,\n);\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: read(buffer, t.float64, 0) as number,\n y: read(buffer, t.float64, 8) as number,\n width: read(buffer, t.float64, 16) as number,\n height: read(buffer, t.float64, 24) as number,\n});\n\nconst createRecordingSurface = (content: Content, extents?: RectangleData): ExternalObject<Handle> =>\n (extents === undefined\n ? cairoRecordingSurfaceCreateUnbounded(content, 0)\n : cairoRecordingSurfaceCreate(content, allocRectangle(extents))) as ExternalObject<Handle>;\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 return wrapSurface(cairoSurfaceCreateSimilar(getHandle(other), content, width, height));\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): Surface {\n return wrapSurface(cairoSurfaceCreateSimilarImage(getHandle(other), format, width, height));\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 return wrapSurface(cairoSurfaceCreateForRectangle(getHandle(target), x, y, width, height));\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 raw handle of the device behind the surface, or null when it has none. */\n getDevice(): ExternalObject<Handle> | null {\n return cairoSurfaceGetDevice(getHandle(this)) as ExternalObject<Handle> | null;\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 /** Returns an image surface giving direct access to the pixels of `extents`; release it with `unmapImage`. */\n mapToImage(extents: RectangleInt): Surface {\n return wrapSurface(cairoSurfaceMapToImage(getHandle(this), getHandle(extents)));\n }\n\n /** Uploads the pixels of `image`, obtained from `mapToImage`, back to the surface and releases it. */\n unmapImage(image: Surface): void {\n cairoSurfaceUnmapImage(getHandle(this), getHandle(image));\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(cairoImageSurfaceCreate(format, width, height) as ExternalObject<Handle>, this);\n }\n\n /** Loads a PNG file into a new image surface; a missing or invalid file yields a surface in an error status. */\n static createFromPng(filename: string): ImageSurface {\n return wrapHandle(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, 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 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.struct(\"borrowed\", { size: totalBytes }),\n );\n\n const data = getImageData(getHandle(this)) as ExternalObject<Handle> | null;\n\n if (data === null) {\n return new Uint8Array(0);\n }\n\n return Uint8Array.from({ length: totalBytes }, (_, index) => read(data, t.uint8, index) as number);\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, 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 ADDED
@@ -0,0 +1,10 @@
1
+ import { type ExternalObject, type Handle } from "@gtkx/runtime";
2
+ import type { CairoGlyph, CairoTextCluster, FontExtents, TextExtents } from "./types.js";
3
+ declare const allocGlyphBuffer: (glyphs: CairoGlyph[]) => ExternalObject<Handle>;
4
+ declare const allocClusterBuffer: (clusters: CairoTextCluster[]) => ExternalObject<Handle>;
5
+ declare const allocTextExtents: () => ExternalObject<Handle>;
6
+ declare const allocFontExtents: () => ExternalObject<Handle>;
7
+ declare const readTextExtents: (handle: ExternalObject<Handle>) => TextExtents;
8
+ declare const readFontExtents: (handle: ExternalObject<Handle>) => FontExtents;
9
+ export { allocClusterBuffer, allocFontExtents, allocGlyphBuffer, allocTextExtents, readFontExtents, readTextExtents };
10
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,cAAc,EAAE,KAAK,MAAM,EAAkB,MAAM,eAAe,CAAC;AACxF,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAOzF,QAAA,MAAM,gBAAgB,GAAI,QAAQ,UAAU,EAAE,KAAG,cAAc,CAAC,MAAM,CAYrE,CAAC;AAEF,QAAA,MAAM,kBAAkB,GAAI,UAAU,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,GAAI,QAAQ,cAAc,CAAC,MAAM,CAAC,KAAG,WAOxD,CAAC;AAEH,QAAA,MAAM,eAAe,GAAI,QAAQ,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/text.js ADDED
@@ -0,0 +1,45 @@
1
+ import { alloc, read, t, write } from "@gtkx/runtime";
2
+ const GLYPH_SIZE = 24;
3
+ const CLUSTER_SIZE = 8;
4
+ const TEXT_EXTENTS_SIZE = 48;
5
+ const FONT_EXTENTS_SIZE = 40;
6
+ const allocGlyphBuffer = (glyphs) => {
7
+ const buffer = alloc(glyphs.length * GLYPH_SIZE);
8
+ let offset = 0;
9
+ for (const glyph of glyphs) {
10
+ write(buffer, t.uint64, offset, glyph.index);
11
+ write(buffer, t.float64, offset + 8, glyph.x);
12
+ write(buffer, t.float64, offset + 16, glyph.y);
13
+ offset += GLYPH_SIZE;
14
+ }
15
+ return buffer;
16
+ };
17
+ const allocClusterBuffer = (clusters) => {
18
+ const buffer = alloc(clusters.length * CLUSTER_SIZE);
19
+ let offset = 0;
20
+ for (const cluster of clusters) {
21
+ write(buffer, t.int32, offset, cluster.numBytes);
22
+ write(buffer, t.int32, offset + 4, cluster.numGlyphs);
23
+ offset += CLUSTER_SIZE;
24
+ }
25
+ return buffer;
26
+ };
27
+ const allocTextExtents = () => alloc(TEXT_EXTENTS_SIZE);
28
+ const allocFontExtents = () => alloc(FONT_EXTENTS_SIZE);
29
+ const readTextExtents = (handle) => ({
30
+ xBearing: read(handle, t.float64, 0),
31
+ yBearing: read(handle, t.float64, 8),
32
+ width: read(handle, t.float64, 16),
33
+ height: read(handle, t.float64, 24),
34
+ xAdvance: read(handle, t.float64, 32),
35
+ yAdvance: read(handle, t.float64, 40),
36
+ });
37
+ const readFontExtents = (handle) => ({
38
+ ascent: read(handle, t.float64, 0),
39
+ descent: read(handle, t.float64, 8),
40
+ height: read(handle, t.float64, 16),
41
+ maxXAdvance: read(handle, t.float64, 24),
42
+ maxYAdvance: read(handle, t.float64, 32),
43
+ });
44
+ export { allocClusterBuffer, allocFontExtents, allocGlyphBuffer, allocTextExtents, readFontExtents, readTextExtents };
45
+ //# sourceMappingURL=text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGxF,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MA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Ae,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import { alloc, type ExternalObject, type Handle, read, t, write } from \"@gtkx/runtime\";\nimport type { CairoGlyph, CairoTextCluster, FontExtents, TextExtents } from \"./types.js\";\n\nconst GLYPH_SIZE = 24;\nconst CLUSTER_SIZE = 8;\nconst TEXT_EXTENTS_SIZE = 48;\nconst FONT_EXTENTS_SIZE = 40;\n\nconst allocGlyphBuffer = (glyphs: CairoGlyph[]): ExternalObject<Handle> => {\n const buffer = alloc(glyphs.length * GLYPH_SIZE);\n let offset = 0;\n\n for (const glyph of glyphs) {\n write(buffer, t.uint64, offset, glyph.index);\n write(buffer, t.float64, offset + 8, glyph.x);\n write(buffer, t.float64, offset + 16, glyph.y);\n offset += GLYPH_SIZE;\n }\n\n return buffer;\n};\n\nconst allocClusterBuffer = (clusters: CairoTextCluster[]): ExternalObject<Handle> => {\n const buffer = alloc(clusters.length * CLUSTER_SIZE);\n let offset = 0;\n\n for (const cluster of clusters) {\n write(buffer, t.int32, offset, cluster.numBytes);\n write(buffer, t.int32, offset + 4, cluster.numGlyphs);\n offset += CLUSTER_SIZE;\n }\n\n return buffer;\n};\n\nconst allocTextExtents = (): ExternalObject<Handle> => alloc(TEXT_EXTENTS_SIZE);\nconst allocFontExtents = (): ExternalObject<Handle> => alloc(FONT_EXTENTS_SIZE);\n\nconst readTextExtents = (handle: ExternalObject<Handle>): TextExtents => ({\n xBearing: read(handle, t.float64, 0) as number,\n yBearing: read(handle, t.float64, 8) as number,\n width: read(handle, t.float64, 16) as number,\n height: read(handle, t.float64, 24) as number,\n xAdvance: read(handle, t.float64, 32) as number,\n yAdvance: read(handle, t.float64, 40) as number,\n});\n\nconst readFontExtents = (handle: ExternalObject<Handle>): FontExtents => ({\n ascent: read(handle, t.float64, 0) as number,\n descent: read(handle, t.float64, 8) as number,\n height: read(handle, t.float64, 16) as number,\n maxXAdvance: read(handle, t.float64, 24) as number,\n maxYAdvance: read(handle, t.float64, 32) as number,\n});\n\nexport { allocClusterBuffer, allocFontExtents, allocGlyphBuffer, allocTextExtents, readFontExtents, readTextExtents };\n"]}
@@ -0,0 +1,245 @@
1
+ /** One glyph to draw: its index in the font and its position in user space. */
2
+ type CairoGlyph = {
3
+ /** Index of the glyph in the font. */
4
+ index: number;
5
+ /** Horizontal position of the glyph origin. */
6
+ x: number;
7
+ /** Vertical position of the glyph origin. */
8
+ y: number;
9
+ };
10
+ /** One text cluster: how many bytes of text map to how many glyphs. */
11
+ type CairoTextCluster = {
12
+ /** Number of UTF-8 bytes the cluster covers. */
13
+ numBytes: number;
14
+ /** Number of glyphs the cluster covers. */
15
+ numGlyphs: number;
16
+ };
17
+ /** Extents of a run of text or glyphs in user space. */
18
+ type TextExtents = {
19
+ /** Horizontal distance from the origin to the leftmost part of the glyphs. */
20
+ xBearing: number;
21
+ /** Vertical distance from the origin to the topmost part of the glyphs. */
22
+ yBearing: number;
23
+ /** Width of the glyphs as drawn. */
24
+ width: number;
25
+ /** Height of the glyphs as drawn. */
26
+ height: number;
27
+ /** Horizontal distance to advance after drawing the glyphs. */
28
+ xAdvance: number;
29
+ /** Vertical distance to advance after drawing the glyphs. */
30
+ yAdvance: number;
31
+ };
32
+ /** Metrics of a font in user space. */
33
+ type FontExtents = {
34
+ /** Distance the font extends above the baseline. */
35
+ ascent: number;
36
+ /** Distance the font extends below the baseline. */
37
+ descent: number;
38
+ /** Recommended vertical distance between baselines. */
39
+ height: number;
40
+ /** Maximum horizontal advance of any glyph in the font. */
41
+ maxXAdvance: number;
42
+ /** Maximum vertical advance of any glyph in the font. */
43
+ maxYAdvance: number;
44
+ };
45
+ /** A path segment starting a new sub-path at a point. */
46
+ type MoveToSegment = {
47
+ /** Tag of the segment. */
48
+ type: "moveTo";
49
+ /** Horizontal position of the point. */
50
+ x: number;
51
+ /** Vertical position of the point. */
52
+ y: number;
53
+ };
54
+ /** A path segment drawing a straight line to a point. */
55
+ type LineToSegment = {
56
+ /** Tag of the segment. */
57
+ type: "lineTo";
58
+ /** Horizontal position of the end point. */
59
+ x: number;
60
+ /** Vertical position of the end point. */
61
+ y: number;
62
+ };
63
+ /** A path segment drawing a cubic Bézier curve through two control points to an end point. */
64
+ type CurveToSegment = {
65
+ /** Tag of the segment. */
66
+ type: "curveTo";
67
+ /** Horizontal position of the first control point. */
68
+ x1: number;
69
+ /** Vertical position of the first control point. */
70
+ y1: number;
71
+ /** Horizontal position of the second control point. */
72
+ x2: number;
73
+ /** Vertical position of the second control point. */
74
+ y2: number;
75
+ /** Horizontal position of the end point. */
76
+ x3: number;
77
+ /** Vertical position of the end point. */
78
+ y3: number;
79
+ };
80
+ /** A path segment closing the current sub-path. */
81
+ type ClosePathSegment = {
82
+ /** Tag of the segment. */
83
+ type: "closePath";
84
+ };
85
+ /** One segment of a path copied out of a context or a mesh pattern. */
86
+ type PathData = MoveToSegment | LineToSegment | CurveToSegment | ClosePathSegment;
87
+ /** A position in user or device space. */
88
+ type Point = {
89
+ /** Horizontal coordinate. */
90
+ x: number;
91
+ /** Vertical coordinate. */
92
+ y: number;
93
+ };
94
+ /** A displacement in user or device space, unaffected by translation. */
95
+ type Distance = {
96
+ /** Horizontal component. */
97
+ dx: number;
98
+ /** Vertical component. */
99
+ dy: number;
100
+ };
101
+ /** A bounding box given by its two opposite corners in user space. */
102
+ type Extents = {
103
+ /** Left edge. */
104
+ x1: number;
105
+ /** Top edge. */
106
+ y1: number;
107
+ /** Right edge. */
108
+ x2: number;
109
+ /** Bottom edge. */
110
+ y2: number;
111
+ };
112
+ /** A dash pattern as a context reports it: alternating on and off lengths and the offset into them. */
113
+ type DashPattern = {
114
+ /** Alternating on and off lengths in user space; empty for a solid line. */
115
+ dashes: number[];
116
+ /** Offset into the pattern at which the stroke starts. */
117
+ offset: number;
118
+ };
119
+ /** A rectangle as plain data, for the calls that take or return many at once. */
120
+ type RectangleData = {
121
+ /** Horizontal position of the left edge. */
122
+ x: number;
123
+ /** Vertical position of the top edge. */
124
+ y: number;
125
+ /** Width of the rectangle. */
126
+ width: number;
127
+ /** Height of the rectangle. */
128
+ height: number;
129
+ };
130
+ /** A color with straight (non-premultiplied) components in the 0 to 1 range. */
131
+ type RgbaColor = {
132
+ /** Red component. */
133
+ red: number;
134
+ /** Green component. */
135
+ green: number;
136
+ /** Blue component. */
137
+ blue: number;
138
+ /** Alpha component. */
139
+ alpha: number;
140
+ };
141
+ /** A color stop of a gradient pattern: its offset along the gradient and its color. */
142
+ type ColorStop = {
143
+ /** Position of the stop along the gradient, from 0 at the start to 1 at the end. */
144
+ offset: number;
145
+ /** Red component. */
146
+ red: number;
147
+ /** Green component. */
148
+ green: number;
149
+ /** Blue component. */
150
+ blue: number;
151
+ /** Alpha component. */
152
+ alpha: number;
153
+ };
154
+ /** The two end points of a linear gradient in pattern space. */
155
+ type LinearPoints = {
156
+ /** Horizontal coordinate of the start point. */
157
+ x0: number;
158
+ /** Vertical coordinate of the start point. */
159
+ y0: number;
160
+ /** Horizontal coordinate of the end point. */
161
+ x1: number;
162
+ /** Vertical coordinate of the end point. */
163
+ y1: number;
164
+ };
165
+ /** The two circles of a radial gradient in pattern space. */
166
+ type RadialCircles = {
167
+ /** Horizontal center of the start circle. */
168
+ x0: number;
169
+ /** Vertical center of the start circle. */
170
+ y0: number;
171
+ /** Radius of the start circle. */
172
+ r0: number;
173
+ /** Horizontal center of the end circle. */
174
+ x1: number;
175
+ /** Vertical center of the end circle. */
176
+ y1: number;
177
+ /** Radius of the end circle. */
178
+ r1: number;
179
+ };
180
+ /** The offset a surface adds to device coordinates. */
181
+ type DeviceOffset = {
182
+ /** Horizontal offset in device units. */
183
+ xOffset: number;
184
+ /** Vertical offset in device units. */
185
+ yOffset: number;
186
+ };
187
+ /** The scale a surface applies between user and device units. */
188
+ type DeviceScale = {
189
+ /** Horizontal scale factor. */
190
+ xScale: number;
191
+ /** Vertical scale factor. */
192
+ yScale: number;
193
+ };
194
+ /** The resolution a surface falls back to when it rasterizes vector content. */
195
+ type FallbackResolution = {
196
+ /** Horizontal pixels per inch. */
197
+ xPixelsPerInch: number;
198
+ /** Vertical pixels per inch. */
199
+ yPixelsPerInch: number;
200
+ };
201
+ /** The area a recording surface has been drawn on, in its coordinate space. */
202
+ type InkExtents = {
203
+ /** Horizontal position of the left edge. */
204
+ x0: number;
205
+ /** Vertical position of the top edge. */
206
+ y0: number;
207
+ /** Width of the drawn area. */
208
+ width: number;
209
+ /** Height of the drawn area. */
210
+ height: number;
211
+ };
212
+ /** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
213
+ type ContextConstructorProps = Record<string, never>;
214
+ /** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
215
+ type DeviceConstructorProps = Record<string, never>;
216
+ /** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
217
+ type SurfaceConstructorProps = Record<string, never>;
218
+ /** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
219
+ type PatternConstructorProps = Record<string, never>;
220
+ /** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
221
+ type RegionConstructorProps = Record<string, never>;
222
+ /** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
223
+ type FontOptionsConstructorProps = Record<string, never>;
224
+ /** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
225
+ type FontFaceConstructorProps = Record<string, never>;
226
+ /** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */
227
+ type ScaledFontConstructorProps = Record<string, never>;
228
+ export type { CairoGlyph, CairoTextCluster, ClosePathSegment, ColorStop,
229
+ /** @deprecated Since 1.3. Removed in v2. */
230
+ ContextConstructorProps, CurveToSegment, DashPattern,
231
+ /** @deprecated Since 1.3. Removed in v2. */
232
+ DeviceConstructorProps, DeviceOffset, DeviceScale, Distance, Extents, FallbackResolution, FontExtents,
233
+ /** @deprecated Since 1.3. Removed in v2. */
234
+ FontFaceConstructorProps,
235
+ /** @deprecated Since 1.3. Removed in v2. */
236
+ FontOptionsConstructorProps, InkExtents, LinearPoints, LineToSegment, MoveToSegment, PathData,
237
+ /** @deprecated Since 1.3. Removed in v2. */
238
+ PatternConstructorProps, Point, RadialCircles, RectangleData,
239
+ /** @deprecated Since 1.3. Removed in v2. */
240
+ RegionConstructorProps, RgbaColor,
241
+ /** @deprecated Since 1.3. Removed in v2. */
242
+ ScaledFontConstructorProps,
243
+ /** @deprecated Since 1.3. Removed in v2. */
244
+ SurfaceConstructorProps, TextExtents, };
245
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,KAAK,UAAU,GAAG;IACd,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,CAAC,EAAE,MAAM,CAAC;IACV,6CAA6C;IAC7C,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,uEAAuE;AACvE,KAAK,gBAAgB,GAAG;IACpB,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wDAAwD;AACxD,KAAK,WAAW,GAAG;IACf,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,uCAAuC;AACvC,KAAK,WAAW,GAAG;IACf,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;I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-0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["/** One glyph to draw: its index in the font and its position in user space. */\ntype CairoGlyph = {\n /** Index of the glyph in the font. */\n index: number;\n /** Horizontal position of the glyph origin. */\n x: number;\n /** Vertical position of the glyph origin. */\n y: number;\n};\n\n/** One text cluster: how many bytes of text map to how many glyphs. */\ntype CairoTextCluster = {\n /** Number of UTF-8 bytes the cluster covers. */\n numBytes: number;\n /** Number of glyphs the cluster covers. */\n numGlyphs: number;\n};\n\n/** Extents of a run of text or glyphs in user space. */\ntype TextExtents = {\n /** Horizontal distance from the origin to the leftmost part of the glyphs. */\n xBearing: number;\n /** Vertical distance from the origin to the topmost part of the glyphs. */\n yBearing: number;\n /** Width of the glyphs as drawn. */\n width: number;\n /** Height of the glyphs as drawn. */\n height: number;\n /** Horizontal distance to advance after drawing the glyphs. */\n xAdvance: number;\n /** Vertical distance to advance after drawing the glyphs. */\n yAdvance: number;\n};\n\n/** Metrics of a font in user space. */\ntype FontExtents = {\n /** Distance the font extends above the baseline. */\n ascent: number;\n /** Distance the font extends below the baseline. */\n descent: number;\n /** Recommended vertical distance between baselines. */\n height: number;\n /** Maximum horizontal advance of any glyph in the font. */\n maxXAdvance: number;\n /** Maximum vertical advance of any glyph in the font. */\n maxYAdvance: number;\n};\n\n/** A path segment starting a new sub-path at a point. */\ntype MoveToSegment = {\n /** Tag of the segment. */\n type: \"moveTo\";\n /** Horizontal position of the point. */\n x: number;\n /** Vertical position of the point. */\n y: number;\n};\n\n/** A path segment drawing a straight line to a point. */\ntype LineToSegment = {\n /** Tag of the segment. */\n type: \"lineTo\";\n /** Horizontal position of the end point. */\n x: number;\n /** Vertical position of the end point. */\n y: number;\n};\n\n/** A path segment drawing a cubic Bézier curve through two control points to an end point. */\ntype CurveToSegment = {\n /** Tag of the segment. */\n type: \"curveTo\";\n /** Horizontal position of the first control point. */\n x1: number;\n /** Vertical position of the first control point. */\n y1: number;\n /** Horizontal position of the second control point. */\n x2: number;\n /** Vertical position of the second control point. */\n y2: number;\n /** Horizontal position of the end point. */\n x3: number;\n /** Vertical position of the end point. */\n y3: number;\n};\n\n/** A path segment closing the current sub-path. */\ntype ClosePathSegment = {\n /** Tag of the segment. */\n type: \"closePath\";\n};\n\n/** One segment of a path copied out of a context or a mesh pattern. */\ntype PathData = MoveToSegment | LineToSegment | CurveToSegment | ClosePathSegment;\n\n/** A position in user or device space. */\ntype Point = {\n /** Horizontal coordinate. */\n x: number;\n /** Vertical coordinate. */\n y: number;\n};\n\n/** A displacement in user or device space, unaffected by translation. */\ntype Distance = {\n /** Horizontal component. */\n dx: number;\n /** Vertical component. */\n dy: number;\n};\n\n/** A bounding box given by its two opposite corners in user space. */\ntype Extents = {\n /** Left edge. */\n x1: number;\n /** Top edge. */\n y1: number;\n /** Right edge. */\n x2: number;\n /** Bottom edge. */\n y2: number;\n};\n\n/** A dash pattern as a context reports it: alternating on and off lengths and the offset into them. */\ntype DashPattern = {\n /** Alternating on and off lengths in user space; empty for a solid line. */\n dashes: number[];\n /** Offset into the pattern at which the stroke starts. */\n offset: number;\n};\n\n/** A rectangle as plain data, for the calls that take or return many at once. */\ntype RectangleData = {\n /** Horizontal position of the left edge. */\n x: number;\n /** Vertical position of the top edge. */\n y: number;\n /** Width of the rectangle. */\n width: number;\n /** Height of the rectangle. */\n height: number;\n};\n\n/** A color with straight (non-premultiplied) components in the 0 to 1 range. */\ntype RgbaColor = {\n /** Red component. */\n red: number;\n /** Green component. */\n green: number;\n /** Blue component. */\n blue: number;\n /** Alpha component. */\n alpha: number;\n};\n\n/** A color stop of a gradient pattern: its offset along the gradient and its color. */\ntype ColorStop = {\n /** Position of the stop along the gradient, from 0 at the start to 1 at the end. */\n offset: number;\n /** Red component. */\n red: number;\n /** Green component. */\n green: number;\n /** Blue component. */\n blue: number;\n /** Alpha component. */\n alpha: number;\n};\n\n/** The two end points of a linear gradient in pattern space. */\ntype LinearPoints = {\n /** Horizontal coordinate of the start point. */\n x0: number;\n /** Vertical coordinate of the start point. */\n y0: number;\n /** Horizontal coordinate of the end point. */\n x1: number;\n /** Vertical coordinate of the end point. */\n y1: number;\n};\n\n/** The two circles of a radial gradient in pattern space. */\ntype RadialCircles = {\n /** Horizontal center of the start circle. */\n x0: number;\n /** Vertical center of the start circle. */\n y0: number;\n /** Radius of the start circle. */\n r0: number;\n /** Horizontal center of the end circle. */\n x1: number;\n /** Vertical center of the end circle. */\n y1: number;\n /** Radius of the end circle. */\n r1: number;\n};\n\n/** The offset a surface adds to device coordinates. */\ntype DeviceOffset = {\n /** Horizontal offset in device units. */\n xOffset: number;\n /** Vertical offset in device units. */\n yOffset: number;\n};\n\n/** The scale a surface applies between user and device units. */\ntype DeviceScale = {\n /** Horizontal scale factor. */\n xScale: number;\n /** Vertical scale factor. */\n yScale: number;\n};\n\n/** The resolution a surface falls back to when it rasterizes vector content. */\ntype FallbackResolution = {\n /** Horizontal pixels per inch. */\n xPixelsPerInch: number;\n /** Vertical pixels per inch. */\n yPixelsPerInch: number;\n};\n\n/** The area a recording surface has been drawn on, in its coordinate space. */\ntype InkExtents = {\n /** Horizontal position of the left edge. */\n x0: number;\n /** Vertical position of the top edge. */\n y0: number;\n /** Width of the drawn area. */\n width: number;\n /** Height of the drawn area. */\n height: number;\n};\n\n/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */\ntype ContextConstructorProps = Record<string, never>;\n/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */\ntype DeviceConstructorProps = Record<string, never>;\n/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */\ntype SurfaceConstructorProps = Record<string, never>;\n/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */\ntype PatternConstructorProps = Record<string, never>;\n/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */\ntype RegionConstructorProps = Record<string, never>;\n/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */\ntype FontOptionsConstructorProps = Record<string, never>;\n/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */\ntype FontFaceConstructorProps = Record<string, never>;\n/** @deprecated Since 1.3. Props of the generated stub constructor that `@gtkx/cairo` replaced; removed in v2. */\ntype ScaledFontConstructorProps = Record<string, never>;\n\nexport type {\n CairoGlyph,\n CairoTextCluster,\n ClosePathSegment,\n ColorStop,\n /** @deprecated Since 1.3. Removed in v2. */\n ContextConstructorProps,\n CurveToSegment,\n DashPattern,\n /** @deprecated Since 1.3. Removed in v2. */\n DeviceConstructorProps,\n DeviceOffset,\n DeviceScale,\n Distance,\n Extents,\n FallbackResolution,\n FontExtents,\n /** @deprecated Since 1.3. Removed in v2. */\n FontFaceConstructorProps,\n /** @deprecated Since 1.3. Removed in v2. */\n FontOptionsConstructorProps,\n InkExtents,\n LinearPoints,\n LineToSegment,\n MoveToSegment,\n PathData,\n /** @deprecated Since 1.3. Removed in v2. */\n PatternConstructorProps,\n Point,\n RadialCircles,\n RectangleData,\n /** @deprecated Since 1.3. Removed in v2. */\n RegionConstructorProps,\n RgbaColor,\n /** @deprecated Since 1.3. Removed in v2. */\n ScaledFontConstructorProps,\n /** @deprecated Since 1.3. Removed in v2. */\n SurfaceConstructorProps,\n TextExtents,\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import type { Status } from "./enums.js";
2
+ /** Returns the version of the cairo library in use, encoded as `major * 10000 + minor * 100 + micro`. */
3
+ declare const version: () => number;
4
+ /** Returns the version of the cairo library in use as a string such as `"1.18.2"`. */
5
+ declare const versionString: () => string;
6
+ /** Returns a human-readable description of a status code. */
7
+ declare const statusToString: (status: Status) => string;
8
+ export { statusToString, version, versionString };
9
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +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,GAAI,QAAQ,MAAM,KAAG,MAA+C,CAAC;AAEzF,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { t } from "@gtkx/runtime";
2
+ import { bindCairo } from "./lib.js";
3
+ const cairoVersion = bindCairo("cairo_version", [], t.int32);
4
+ const cairoVersionString = bindCairo("cairo_version_string", [], t.string("borrowed"));
5
+ const cairoStatusToString = bindCairo("cairo_status_to_string", [t.int32], t.string("borrowed"));
6
+ /** Returns the version of the cairo library in use, encoded as `major * 10000 + minor * 100 + micro`. */
7
+ const version = () => cairoVersion();
8
+ /** Returns the version of the cairo library in use as a string such as `"1.18.2"`. */
9
+ const versionString = () => cairoVersionString();
10
+ /** Returns a human-readable description of a status code. */
11
+ const statusToString = (status) => cairoStatusToString(status);
12
+ export { statusToString, version, versionString };
13
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,YAAY,GAAG,SAAS,CAAC,eAAe,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;AAC7D,MAAM,kBAAkB,GAAG,SAAS,CAAC,sBAAsB,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AACvF,MAAM,mBAAmB,GAAG,SAAS,CAAC,wBAAwB,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AAEjG,yGAAyG;AACzG,MAAM,OAAO,GAAG,GAAW,EAAE,CAAC,YAAY,EAAY,CAAC;AACvD,sFAAsF;AACtF,MAAM,aAAa,GAAG,GAAW,EAAE,CAAC,kBAAkB,EAAY,CAAC;AACnE,6DAA6D;AAC7D,MAAM,cAAc,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAW,CAAC;AAEzF,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { t } from \"@gtkx/runtime\";\nimport type { Status } from \"./enums.js\";\nimport { bindCairo } from \"./lib.js\";\n\nconst cairoVersion = bindCairo(\"cairo_version\", [], t.int32);\nconst cairoVersionString = bindCairo(\"cairo_version_string\", [], t.string(\"borrowed\"));\nconst cairoStatusToString = bindCairo(\"cairo_status_to_string\", [t.int32], t.string(\"borrowed\"));\n\n/** Returns the version of the cairo library in use, encoded as `major * 10000 + minor * 100 + micro`. */\nconst version = (): number => cairoVersion() as number;\n/** Returns the version of the cairo library in use as a string such as `\"1.18.2\"`. */\nconst versionString = (): string => cairoVersionString() as string;\n/** Returns a human-readable description of a status code. */\nconst statusToString = (status: Status): string => cairoStatusToString(status) as string;\n\nexport { statusToString, version, versionString };\n"]}
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@gtkx/cairo",
3
+ "version": "1.2.2",
4
+ "description": "Cairo drawing bindings for GTKX: contexts, surfaces, patterns, fonts, regions and matrices behind the GTK draw callbacks",
5
+ "keywords": [
6
+ "gtkx",
7
+ "gtk",
8
+ "gtk4",
9
+ "cairo",
10
+ "drawing",
11
+ "graphics",
12
+ "linux",
13
+ "desktop"
14
+ ],
15
+ "homepage": "https://gtkx.dev",
16
+ "bugs": {
17
+ "url": "https://github.com/gtkx-org/gtkx/issues"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/gtkx-org/gtkx.git",
22
+ "directory": "packages/cairo"
23
+ },
24
+ "license": "MPL-2.0",
25
+ "author": "Eugenio Depalo <eugeniodepalo@gmail.com>",
26
+ "type": "module",
27
+ "sideEffects": true,
28
+ "exports": {
29
+ "./package.json": "./package.json",
30
+ ".": {
31
+ "source": "./src/index.ts",
32
+ "types": "./dist/index.d.ts",
33
+ "default": "./dist/index.js"
34
+ }
35
+ },
36
+ "files": [
37
+ "dist",
38
+ "src"
39
+ ],
40
+ "scripts": {
41
+ "release": "tsx ../../scripts/release-package.ts"
42
+ },
43
+ "nx": {
44
+ "targets": {
45
+ "lint": {
46
+ "options": {
47
+ "cwd": ".",
48
+ "command": "eslint {projectRoot}"
49
+ }
50
+ }
51
+ }
52
+ },
53
+ "engines": {
54
+ "node": ">=24"
55
+ },
56
+ "dependencies": {
57
+ "@gtkx/runtime": "workspace:*"
58
+ },
59
+ "devDependencies": {
60
+ "@gtkx/vitest": "workspace:*",
61
+ "@types/node": "catalog:",
62
+ "fast-xml-parser": "^5.11.0"
63
+ }
64
+ }