@gtkx/codegen 0.21.0 → 1.0.0-rc.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.
- package/README.md +173 -0
- package/dist/analysis/descriptor-render.d.ts +25 -0
- package/dist/analysis/descriptor-render.d.ts.map +1 -0
- package/dist/analysis/descriptor-render.js +420 -0
- package/dist/analysis/descriptor-render.js.map +1 -0
- package/dist/analysis/descriptor.d.ts +62 -0
- package/dist/analysis/descriptor.d.ts.map +1 -0
- package/dist/analysis/descriptor.js +127 -0
- package/dist/analysis/descriptor.js.map +1 -0
- package/dist/analysis/inheritance.d.ts +38 -0
- package/dist/analysis/inheritance.d.ts.map +1 -0
- package/dist/analysis/inheritance.js +248 -0
- package/dist/analysis/inheritance.js.map +1 -0
- package/dist/analysis/param-structure.d.ts +27 -0
- package/dist/analysis/param-structure.d.ts.map +1 -0
- package/dist/analysis/param-structure.js +158 -0
- package/dist/analysis/param-structure.js.map +1 -0
- package/dist/analysis/ts-type.d.ts +20 -0
- package/dist/analysis/ts-type.d.ts.map +1 -0
- package/dist/analysis/ts-type.js +111 -0
- package/dist/analysis/ts-type.js.map +1 -0
- package/dist/compile.d.ts +18 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +130 -0
- package/dist/compile.js.map +1 -0
- package/dist/docs/api-reference.d.ts +67 -0
- package/dist/docs/api-reference.d.ts.map +1 -0
- package/dist/docs/api-reference.js +372 -0
- package/dist/docs/api-reference.js.map +1 -0
- package/dist/docs/element-page.d.ts +12 -0
- package/dist/docs/element-page.d.ts.map +1 -0
- package/dist/docs/element-page.js +156 -0
- package/dist/docs/element-page.js.map +1 -0
- package/dist/docs/pipeline.d.ts +26 -0
- package/dist/docs/pipeline.d.ts.map +1 -0
- package/dist/docs/pipeline.js +156 -0
- package/dist/docs/pipeline.js.map +1 -0
- package/dist/docs/render.d.ts +34 -0
- package/dist/docs/render.d.ts.map +1 -0
- package/dist/docs/render.js +143 -0
- package/dist/docs/render.js.map +1 -0
- package/dist/docs/symbol-page.d.ts +41 -0
- package/dist/docs/symbol-page.d.ts.map +1 -0
- package/dist/docs/symbol-page.js +380 -0
- package/dist/docs/symbol-page.js.map +1 -0
- package/dist/fingerprint.d.ts +31 -28
- package/dist/fingerprint.d.ts.map +1 -1
- package/dist/fingerprint.js +84 -19
- package/dist/fingerprint.js.map +1 -1
- package/dist/gi.d.ts +13 -0
- package/dist/gi.d.ts.map +1 -0
- package/dist/gi.js +21 -0
- package/dist/gi.js.map +1 -0
- package/dist/gir/ancestry.d.ts +10 -0
- package/dist/gir/ancestry.d.ts.map +1 -0
- package/dist/gir/ancestry.js +26 -0
- package/dist/gir/ancestry.js.map +1 -0
- package/dist/gir/callback.d.ts +8 -14
- package/dist/gir/callback.d.ts.map +1 -1
- package/dist/gir/callback.js +16 -16
- package/dist/gir/callback.js.map +1 -1
- package/dist/gir/class.d.ts +25 -44
- package/dist/gir/class.d.ts.map +1 -1
- package/dist/gir/class.js +16 -26
- package/dist/gir/class.js.map +1 -1
- package/dist/gir/enum.d.ts +16 -34
- package/dist/gir/enum.d.ts.map +1 -1
- package/dist/gir/enum.js +10 -16
- package/dist/gir/enum.js.map +1 -1
- package/dist/gir/field.d.ts +16 -24
- package/dist/gir/field.d.ts.map +1 -1
- package/dist/gir/field.js +35 -18
- package/dist/gir/field.js.map +1 -1
- package/dist/gir/function.d.ts +15 -43
- package/dist/gir/function.d.ts.map +1 -1
- package/dist/gir/function.js +26 -23
- package/dist/gir/function.js.map +1 -1
- package/dist/gir/gir-path.d.ts +3 -0
- package/dist/gir/gir-path.d.ts.map +1 -0
- package/dist/gir/gir-path.js +57 -0
- package/dist/gir/gir-path.js.map +1 -0
- package/dist/gir/libraries.d.ts +5 -0
- package/dist/gir/libraries.d.ts.map +1 -0
- package/dist/gir/libraries.js +74 -0
- package/dist/gir/libraries.js.map +1 -0
- package/dist/gir/library.d.ts +43 -0
- package/dist/gir/library.d.ts.map +1 -0
- package/dist/gir/library.js +242 -0
- package/dist/gir/library.js.map +1 -0
- package/dist/gir/namespace.d.ts +40 -54
- package/dist/gir/namespace.d.ts.map +1 -1
- package/dist/gir/namespace.js +51 -40
- package/dist/gir/namespace.js.map +1 -1
- package/dist/gir/nullable-overrides.d.ts +3 -0
- package/dist/gir/nullable-overrides.d.ts.map +1 -0
- package/dist/gir/nullable-overrides.js +5 -0
- package/dist/gir/nullable-overrides.js.map +1 -0
- package/dist/gir/parameter.d.ts +34 -76
- package/dist/gir/parameter.d.ts.map +1 -1
- package/dist/gir/parameter.js +47 -59
- package/dist/gir/parameter.js.map +1 -1
- package/dist/gir/parse.d.ts +12 -77
- package/dist/gir/parse.d.ts.map +1 -1
- package/dist/gir/parse.js +65 -103
- package/dist/gir/parse.js.map +1 -1
- package/dist/gir/primitives.d.ts +5 -35
- package/dist/gir/primitives.d.ts.map +1 -1
- package/dist/gir/primitives.js +21 -36
- package/dist/gir/primitives.js.map +1 -1
- package/dist/gir/property.d.ts +18 -26
- package/dist/gir/property.d.ts.map +1 -1
- package/dist/gir/property.js +16 -12
- package/dist/gir/property.js.map +1 -1
- package/dist/gir/record.d.ts +28 -0
- package/dist/gir/record.d.ts.map +1 -0
- package/dist/gir/record.js +26 -0
- package/dist/gir/record.js.map +1 -0
- package/dist/gir/size.d.ts +15 -61
- package/dist/gir/size.d.ts.map +1 -1
- package/dist/gir/size.js +49 -72
- package/dist/gir/size.js.map +1 -1
- package/dist/gir/type-id.d.ts +51 -0
- package/dist/gir/type-id.d.ts.map +1 -0
- package/dist/gir/type-id.js +12 -0
- package/dist/gir/type-id.js.map +1 -0
- package/dist/gir/type-ref.d.ts +4 -77
- package/dist/gir/type-ref.d.ts.map +1 -1
- package/dist/gir/type-ref.js +58 -77
- package/dist/gir/type-ref.js.map +1 -1
- package/dist/gir/type.d.ts +34 -0
- package/dist/gir/type.d.ts.map +1 -0
- package/dist/gir/type.js +2 -0
- package/dist/gir/type.js.map +1 -0
- package/dist/index.d.ts +7 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -11
- package/dist/index.js.map +1 -1
- package/dist/jsx.d.ts +26 -0
- package/dist/jsx.d.ts.map +1 -0
- package/dist/jsx.js +40 -0
- package/dist/jsx.js.map +1 -0
- package/dist/khronos/args.d.ts +30 -0
- package/dist/khronos/args.d.ts.map +1 -0
- package/dist/khronos/args.js +171 -0
- package/dist/khronos/args.js.map +1 -0
- package/dist/khronos/jsdoc.d.ts +21 -0
- package/dist/khronos/jsdoc.d.ts.map +1 -0
- package/dist/khronos/jsdoc.js +72 -0
- package/dist/khronos/jsdoc.js.map +1 -0
- package/dist/khronos/model.d.ts +38 -0
- package/dist/khronos/model.d.ts.map +1 -0
- package/dist/khronos/model.js +167 -0
- package/dist/khronos/model.js.map +1 -0
- package/dist/khronos/modules.d.ts +12 -0
- package/dist/khronos/modules.d.ts.map +1 -0
- package/dist/khronos/modules.js +73 -0
- package/dist/khronos/modules.js.map +1 -0
- package/dist/khronos/param-pair.d.ts +11 -0
- package/dist/khronos/param-pair.d.ts.map +1 -0
- package/dist/khronos/param-pair.js +6 -0
- package/dist/khronos/param-pair.js.map +1 -0
- package/dist/khronos/parse.d.ts +8 -0
- package/dist/khronos/parse.d.ts.map +1 -0
- package/dist/khronos/parse.js +62 -0
- package/dist/khronos/parse.js.map +1 -0
- package/dist/khronos/pipeline.d.ts +24 -0
- package/dist/khronos/pipeline.d.ts.map +1 -0
- package/dist/khronos/pipeline.js +223 -0
- package/dist/khronos/pipeline.js.map +1 -0
- package/dist/khronos/plan.d.ts +81 -0
- package/dist/khronos/plan.d.ts.map +1 -0
- package/dist/khronos/plan.js +200 -0
- package/dist/khronos/plan.js.map +1 -0
- package/dist/khronos/render.d.ts +17 -0
- package/dist/khronos/render.d.ts.map +1 -0
- package/dist/khronos/render.js +205 -0
- package/dist/khronos/render.js.map +1 -0
- package/dist/khronos/select.d.ts +15 -0
- package/dist/khronos/select.d.ts.map +1 -0
- package/dist/khronos/select.js +56 -0
- package/dist/khronos/select.js.map +1 -0
- package/dist/react/element-config.d.ts +17 -0
- package/dist/react/element-config.d.ts.map +1 -0
- package/dist/react/element-config.js +61 -0
- package/dist/react/element-config.js.map +1 -0
- package/dist/runner.d.ts +38 -49
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +81 -54
- package/dist/runner.js.map +1 -1
- package/dist/store/compile-store.d.ts +11 -0
- package/dist/store/compile-store.d.ts.map +1 -0
- package/dist/store/compile-store.js +40 -0
- package/dist/store/compile-store.js.map +1 -0
- package/dist/store/gi/async.d.ts +5 -0
- package/dist/store/gi/async.d.ts.map +1 -0
- package/dist/store/gi/async.js +45 -0
- package/dist/store/gi/async.js.map +1 -0
- package/dist/store/gi/callables.d.ts +42 -0
- package/dist/store/gi/callables.d.ts.map +1 -0
- package/dist/store/gi/callables.js +264 -0
- package/dist/store/gi/callables.js.map +1 -0
- package/dist/store/gi/callback.d.ts +5 -0
- package/dist/store/gi/callback.d.ts.map +1 -0
- package/dist/store/gi/callback.js +17 -0
- package/dist/store/gi/callback.js.map +1 -0
- package/dist/store/gi/class-struct-record.d.ts +10 -0
- package/dist/store/gi/class-struct-record.d.ts.map +1 -0
- package/dist/store/gi/class-struct-record.js +52 -0
- package/dist/store/gi/class-struct-record.js.map +1 -0
- package/dist/store/gi/class.d.ts +5 -0
- package/dist/store/gi/class.d.ts.map +1 -0
- package/dist/store/gi/class.js +208 -0
- package/dist/store/gi/class.js.map +1 -0
- package/dist/store/gi/companion.d.ts +5 -0
- package/dist/store/gi/companion.d.ts.map +1 -0
- package/dist/store/gi/companion.js +16 -0
- package/dist/store/gi/companion.js.map +1 -0
- package/dist/store/gi/constant.d.ts +6 -0
- package/dist/store/gi/constant.d.ts.map +1 -0
- package/dist/store/gi/constant.js +35 -0
- package/dist/store/gi/constant.js.map +1 -0
- package/dist/store/gi/constructor-props.d.ts +6 -0
- package/dist/store/gi/constructor-props.d.ts.map +1 -0
- package/dist/store/gi/constructor-props.js +71 -0
- package/dist/store/gi/constructor-props.js.map +1 -0
- package/dist/store/gi/enum.d.ts +6 -0
- package/dist/store/gi/enum.d.ts.map +1 -0
- package/dist/store/gi/enum.js +41 -0
- package/dist/store/gi/enum.js.map +1 -0
- package/dist/store/gi/function.d.ts +9 -0
- package/dist/store/gi/function.d.ts.map +1 -0
- package/dist/store/gi/function.js +114 -0
- package/dist/store/gi/function.js.map +1 -0
- package/dist/store/gi/gtype-binding.d.ts +10 -0
- package/dist/store/gi/gtype-binding.d.ts.map +1 -0
- package/dist/store/gi/gtype-binding.js +24 -0
- package/dist/store/gi/gtype-binding.js.map +1 -0
- package/dist/store/gi/interface.d.ts +5 -0
- package/dist/store/gi/interface.d.ts.map +1 -0
- package/dist/store/gi/interface.js +117 -0
- package/dist/store/gi/interface.js.map +1 -0
- package/dist/store/gi/item-comparators.d.ts +7 -0
- package/dist/store/gi/item-comparators.d.ts.map +1 -0
- package/dist/store/gi/item-comparators.js +88 -0
- package/dist/store/gi/item-comparators.js.map +1 -0
- package/dist/store/gi/method.d.ts +24 -0
- package/dist/store/gi/method.d.ts.map +1 -0
- package/dist/store/gi/method.js +336 -0
- package/dist/store/gi/method.js.map +1 -0
- package/dist/store/gi/param-marshal.d.ts +10 -0
- package/dist/store/gi/param-marshal.d.ts.map +1 -0
- package/dist/store/gi/param-marshal.js +50 -0
- package/dist/store/gi/param-marshal.js.map +1 -0
- package/dist/store/gi/pipeline.d.ts +5 -0
- package/dist/store/gi/pipeline.d.ts.map +1 -0
- package/dist/store/gi/pipeline.js +95 -0
- package/dist/store/gi/pipeline.js.map +1 -0
- package/dist/store/gi/properties.d.ts +6 -0
- package/dist/store/gi/properties.d.ts.map +1 -0
- package/dist/store/gi/properties.js +32 -0
- package/dist/store/gi/properties.js.map +1 -0
- package/dist/store/gi/property-accessor.d.ts +27 -0
- package/dist/store/gi/property-accessor.d.ts.map +1 -0
- package/dist/store/gi/property-accessor.js +158 -0
- package/dist/store/gi/property-accessor.js.map +1 -0
- package/dist/store/gi/record-constructor.d.ts +6 -0
- package/dist/store/gi/record-constructor.d.ts.map +1 -0
- package/dist/store/gi/record-constructor.js +76 -0
- package/dist/store/gi/record-constructor.js.map +1 -0
- package/dist/store/gi/record-field-accessor.d.ts +25 -0
- package/dist/store/gi/record-field-accessor.d.ts.map +1 -0
- package/dist/store/gi/record-field-accessor.js +360 -0
- package/dist/store/gi/record-field-accessor.js.map +1 -0
- package/dist/store/gi/record-layout.d.ts +15 -0
- package/dist/store/gi/record-layout.d.ts.map +1 -0
- package/dist/store/gi/record-layout.js +132 -0
- package/dist/store/gi/record-layout.js.map +1 -0
- package/dist/store/gi/record.d.ts +5 -0
- package/dist/store/gi/record.d.ts.map +1 -0
- package/dist/store/gi/record.js +65 -0
- package/dist/store/gi/record.js.map +1 -0
- package/dist/store/gi/registration.d.ts +16 -0
- package/dist/store/gi/registration.d.ts.map +1 -0
- package/dist/store/gi/registration.js +21 -0
- package/dist/store/gi/registration.js.map +1 -0
- package/dist/store/gi/return-wrap.d.ts +10 -0
- package/dist/store/gi/return-wrap.d.ts.map +1 -0
- package/dist/store/gi/return-wrap.js +67 -0
- package/dist/store/gi/return-wrap.js.map +1 -0
- package/dist/store/gi/runtime-override.d.ts +4 -0
- package/dist/store/gi/runtime-override.d.ts.map +1 -0
- package/dist/store/gi/runtime-override.js +32 -0
- package/dist/store/gi/runtime-override.js.map +1 -0
- package/dist/store/gi/signal.d.ts +6 -0
- package/dist/store/gi/signal.d.ts.map +1 -0
- package/dist/store/gi/signal.js +280 -0
- package/dist/store/gi/signal.js.map +1 -0
- package/dist/store/gi/vtable.d.ts +5 -0
- package/dist/store/gi/vtable.d.ts.map +1 -0
- package/dist/store/gi/vtable.js +108 -0
- package/dist/store/gi/vtable.js.map +1 -0
- package/dist/store/gi-store.d.ts +10 -0
- package/dist/store/gi-store.d.ts.map +1 -0
- package/dist/store/gi-store.js +59 -0
- package/dist/store/gi-store.js.map +1 -0
- package/dist/store/jsx/element-components.d.ts +23 -0
- package/dist/store/jsx/element-components.d.ts.map +1 -0
- package/dist/store/jsx/element-components.js +86 -0
- package/dist/store/jsx/element-components.js.map +1 -0
- package/dist/store/jsx/element-prop-imports.d.ts +17 -0
- package/dist/store/jsx/element-prop-imports.d.ts.map +1 -0
- package/dist/store/jsx/element-prop-imports.js +15 -0
- package/dist/store/jsx/element-prop-imports.js.map +1 -0
- package/dist/store/jsx/element-prop-types.d.ts +10 -0
- package/dist/store/jsx/element-prop-types.d.ts.map +1 -0
- package/dist/store/jsx/element-prop-types.js +41 -0
- package/dist/store/jsx/element-prop-types.js.map +1 -0
- package/dist/store/jsx/gir-index.d.ts +16 -0
- package/dist/store/jsx/gir-index.d.ts.map +1 -0
- package/dist/store/jsx/gir-index.js +33 -0
- package/dist/store/jsx/gir-index.js.map +1 -0
- package/dist/store/jsx/intrinsic-elements.d.ts +27 -0
- package/dist/store/jsx/intrinsic-elements.d.ts.map +1 -0
- package/dist/store/jsx/intrinsic-elements.js +128 -0
- package/dist/store/jsx/intrinsic-elements.js.map +1 -0
- package/dist/store/jsx/jsx.d.ts +16 -0
- package/dist/store/jsx/jsx.d.ts.map +1 -0
- package/dist/store/jsx/jsx.js +242 -0
- package/dist/store/jsx/jsx.js.map +1 -0
- package/dist/store/jsx/metadata.d.ts +4 -0
- package/dist/store/jsx/metadata.d.ts.map +1 -0
- package/dist/store/jsx/metadata.js +253 -0
- package/dist/store/jsx/metadata.js.map +1 -0
- package/dist/store/jsx/pipeline.d.ts +21 -0
- package/dist/store/jsx/pipeline.d.ts.map +1 -0
- package/dist/store/jsx/pipeline.js +81 -0
- package/dist/store/jsx/pipeline.js.map +1 -0
- package/dist/store/jsx/props.d.ts +33 -0
- package/dist/store/jsx/props.d.ts.map +1 -0
- package/dist/store/jsx/props.js +158 -0
- package/dist/store/jsx/props.js.map +1 -0
- package/dist/store/jsx-store.d.ts +7 -0
- package/dist/store/jsx-store.d.ts.map +1 -0
- package/dist/store/jsx-store.js +26 -0
- package/dist/store/jsx-store.js.map +1 -0
- package/dist/store/store-fs.d.ts +43 -0
- package/dist/store/store-fs.d.ts.map +1 -0
- package/dist/store/store-fs.js +73 -0
- package/dist/store/store-fs.js.map +1 -0
- package/dist/writer/context.d.ts +17 -0
- package/dist/writer/context.d.ts.map +1 -0
- package/dist/writer/context.js +50 -0
- package/dist/writer/context.js.map +1 -0
- package/dist/writer/doc.d.ts +3 -0
- package/dist/writer/doc.d.ts.map +1 -0
- package/dist/writer/doc.js +18 -0
- package/dist/writer/doc.js.map +1 -0
- package/dist/writer/emit.d.ts +9 -0
- package/dist/writer/emit.d.ts.map +1 -0
- package/dist/writer/emit.js +24 -0
- package/dist/writer/emit.js.map +1 -0
- package/dist/writer/gtk-doc.d.ts +3 -0
- package/dist/writer/gtk-doc.d.ts.map +1 -0
- package/dist/writer/gtk-doc.js +78 -0
- package/dist/writer/gtk-doc.js.map +1 -0
- package/dist/writer/imports.d.ts +12 -0
- package/dist/writer/imports.d.ts.map +1 -0
- package/dist/writer/imports.js +61 -0
- package/dist/writer/imports.js.map +1 -0
- package/dist/writer/module.d.ts +16 -0
- package/dist/writer/module.d.ts.map +1 -0
- package/dist/writer/module.js +53 -0
- package/dist/writer/module.js.map +1 -0
- package/dist/xml.d.ts +4 -0
- package/dist/xml.d.ts.map +1 -0
- package/dist/xml.js +10 -0
- package/dist/xml.js.map +1 -0
- package/overrides/cairo/context.ts.ejs +1269 -0
- package/overrides/cairo/font-face.ts.ejs +151 -0
- package/overrides/cairo/font-options.ts.ejs +199 -0
- package/overrides/cairo/image-surface.ts.ejs +132 -0
- package/overrides/cairo/index.ts.ejs +22 -0
- package/overrides/cairo/matrix.ts.ejs +171 -0
- package/overrides/cairo/pattern.ts.ejs +476 -0
- package/overrides/cairo/recording-surface.ts.ejs +102 -0
- package/overrides/cairo/region.ts.ejs +237 -0
- package/overrides/cairo/scaled-font.ts.ejs +330 -0
- package/overrides/cairo/surface.ts.ejs +296 -0
- package/overrides/gdk/index.ts.ejs +2 -0
- package/overrides/gdk/rgba.ts.ejs +11 -0
- package/overrides/gobject/index.ts.ejs +29 -0
- package/overrides/gobject/object.ts.ejs +51 -0
- package/overrides/gobject/value.ts.ejs +17 -0
- package/overrides/graphene/index.ts.ejs +2 -0
- package/overrides/graphene/structs.ts.ejs +37 -0
- package/package.json +21 -15
- package/src/analysis/descriptor-render.ts +723 -0
- package/src/analysis/descriptor.ts +300 -0
- package/src/analysis/inheritance.ts +430 -0
- package/src/analysis/param-structure.ts +258 -0
- package/src/analysis/ts-type.ts +174 -0
- package/src/compile.ts +179 -0
- package/src/docs/api-reference.ts +557 -0
- package/src/docs/element-page.ts +281 -0
- package/src/docs/pipeline.ts +241 -0
- package/src/docs/render.ts +255 -0
- package/src/docs/symbol-page.ts +589 -0
- package/src/fingerprint.ts +144 -35
- package/src/gi.ts +26 -0
- package/src/gir/ancestry.ts +53 -0
- package/src/gir/callback.ts +22 -24
- package/src/gir/class.ts +39 -61
- package/src/gir/enum.ts +25 -41
- package/src/gir/field.ts +51 -37
- package/src/gir/function.ts +44 -59
- package/src/gir/gir-path.ts +73 -0
- package/src/gir/libraries.ts +102 -0
- package/src/gir/library.ts +351 -0
- package/src/gir/namespace.ts +109 -88
- package/src/gir/nullable-overrides.ts +5 -0
- package/src/gir/parameter.ts +111 -102
- package/src/gir/parse.ts +124 -121
- package/src/gir/primitives.ts +43 -63
- package/src/gir/property.ts +33 -33
- package/src/gir/record.ts +55 -0
- package/src/gir/size.ts +93 -107
- package/src/gir/type-id.ts +64 -0
- package/src/gir/type-ref.ts +77 -146
- package/src/gir/type.ts +18 -0
- package/src/index.ts +27 -15
- package/src/jsx.ts +70 -0
- package/src/khronos/args.ts +271 -0
- package/src/khronos/jsdoc.ts +114 -0
- package/src/khronos/model.ts +267 -0
- package/src/khronos/modules.ts +115 -0
- package/src/khronos/param-pair.ts +14 -0
- package/src/khronos/parse.ts +86 -0
- package/src/khronos/pipeline.ts +337 -0
- package/src/khronos/plan.ts +340 -0
- package/src/khronos/registry/LICENSE +202 -0
- package/src/khronos/registry/gl.xml +47748 -0
- package/src/khronos/render.ts +330 -0
- package/src/khronos/select.ts +97 -0
- package/src/react/element-config.ts +91 -0
- package/src/runner.ts +153 -80
- package/src/store/compile-store.ts +55 -0
- package/src/store/gi/async.ts +69 -0
- package/src/store/gi/callables.ts +518 -0
- package/src/store/gi/callback.ts +24 -0
- package/src/store/gi/class-struct-record.ts +72 -0
- package/src/store/gi/class.ts +334 -0
- package/src/store/gi/companion.ts +22 -0
- package/src/store/gi/constant.ts +58 -0
- package/src/store/gi/constructor-props.ts +108 -0
- package/src/store/gi/enum.ts +64 -0
- package/src/store/gi/function.ts +173 -0
- package/src/store/gi/gtype-binding.ts +46 -0
- package/src/store/gi/interface.ts +222 -0
- package/src/store/gi/item-comparators.ts +138 -0
- package/src/store/gi/method.ts +634 -0
- package/src/store/gi/param-marshal.ts +71 -0
- package/src/store/gi/pipeline.ts +135 -0
- package/src/store/gi/properties.ts +50 -0
- package/src/store/gi/property-accessor.ts +302 -0
- package/src/store/gi/record-constructor.ts +119 -0
- package/src/store/gi/record-field-accessor.ts +607 -0
- package/src/store/gi/record-layout.ts +221 -0
- package/src/store/gi/record.ts +89 -0
- package/src/store/gi/registration.ts +44 -0
- package/src/store/gi/return-wrap.ts +100 -0
- package/src/store/gi/runtime-override.ts +46 -0
- package/src/store/gi/signal.ts +450 -0
- package/src/store/gi/vtable.ts +175 -0
- package/src/store/gi-store.ts +92 -0
- package/src/store/jsx/element-components.ts +152 -0
- package/src/store/jsx/element-prop-imports.ts +24 -0
- package/src/store/jsx/element-prop-types.ts +59 -0
- package/src/store/jsx/gir-index.ts +62 -0
- package/src/store/jsx/intrinsic-elements.ts +262 -0
- package/src/store/jsx/jsx.ts +408 -0
- package/src/store/jsx/metadata.ts +385 -0
- package/src/store/jsx/pipeline.ts +145 -0
- package/src/store/jsx/props.ts +274 -0
- package/src/store/jsx-store.ts +39 -0
- package/src/store/store-fs.ts +128 -0
- package/src/writer/context.ts +67 -0
- package/src/writer/doc.ts +25 -0
- package/src/writer/emit.ts +35 -0
- package/src/writer/gtk-doc.ts +101 -0
- package/src/writer/imports.ts +94 -0
- package/src/writer/module.ts +69 -0
- package/src/xml.ts +12 -0
- package/LICENSE +0 -373
- package/dist/dsl/context.d.ts +0 -104
- package/dist/dsl/context.d.ts.map +0 -1
- package/dist/dsl/context.js +0 -140
- package/dist/dsl/context.js.map +0 -1
- package/dist/dsl/emit.d.ts +0 -28
- package/dist/dsl/emit.d.ts.map +0 -1
- package/dist/dsl/emit.js +0 -41
- package/dist/dsl/emit.js.map +0 -1
- package/dist/dsl/identifier.d.ts +0 -28
- package/dist/dsl/identifier.d.ts.map +0 -1
- package/dist/dsl/identifier.js +0 -45
- package/dist/dsl/identifier.js.map +0 -1
- package/dist/dsl/imports.d.ts +0 -58
- package/dist/dsl/imports.d.ts.map +0 -1
- package/dist/dsl/imports.js +0 -107
- package/dist/dsl/imports.js.map +0 -1
- package/dist/dsl/module.d.ts +0 -53
- package/dist/dsl/module.d.ts.map +0 -1
- package/dist/dsl/module.js +0 -76
- package/dist/dsl/module.js.map +0 -1
- package/dist/ffi/pipeline.d.ts +0 -19
- package/dist/ffi/pipeline.d.ts.map +0 -1
- package/dist/ffi/pipeline.js +0 -107
- package/dist/ffi/pipeline.js.map +0 -1
- package/dist/gi-store.d.ts +0 -34
- package/dist/gi-store.d.ts.map +0 -1
- package/dist/gi-store.js +0 -154
- package/dist/gi-store.js.map +0 -1
- package/dist/gir/boxed.d.ts +0 -66
- package/dist/gir/boxed.d.ts.map +0 -1
- package/dist/gir/boxed.js +0 -49
- package/dist/gir/boxed.js.map +0 -1
- package/dist/gir/qualified-name.d.ts +0 -37
- package/dist/gir/qualified-name.d.ts.map +0 -1
- package/dist/gir/qualified-name.js +0 -39
- package/dist/gir/qualified-name.js.map +0 -1
- package/dist/gir/qualify.d.ts +0 -32
- package/dist/gir/qualify.d.ts.map +0 -1
- package/dist/gir/qualify.js +0 -60
- package/dist/gir/qualify.js.map +0 -1
- package/dist/gir/repository.d.ts +0 -82
- package/dist/gir/repository.d.ts.map +0 -1
- package/dist/gir/repository.js +0 -122
- package/dist/gir/repository.js.map +0 -1
- package/dist/gir/signal.d.ts +0 -22
- package/dist/gir/signal.d.ts.map +0 -1
- package/dist/gir/signal.js +0 -20
- package/dist/gir/signal.js.map +0 -1
- package/dist/jsx-store.d.ts +0 -22
- package/dist/jsx-store.d.ts.map +0 -1
- package/dist/jsx-store.js +0 -40
- package/dist/jsx-store.js.map +0 -1
- package/dist/react/compounds-meta.d.ts +0 -18
- package/dist/react/compounds-meta.d.ts.map +0 -1
- package/dist/react/compounds-meta.js +0 -93
- package/dist/react/compounds-meta.js.map +0 -1
- package/dist/react/compounds.d.ts +0 -27
- package/dist/react/compounds.d.ts.map +0 -1
- package/dist/react/compounds.js +0 -164
- package/dist/react/compounds.js.map +0 -1
- package/dist/react/internal.d.ts +0 -14
- package/dist/react/internal.d.ts.map +0 -1
- package/dist/react/internal.js +0 -79
- package/dist/react/internal.js.map +0 -1
- package/dist/react/jsx.d.ts +0 -22
- package/dist/react/jsx.d.ts.map +0 -1
- package/dist/react/jsx.js +0 -134
- package/dist/react/jsx.js.map +0 -1
- package/dist/react/pipeline.d.ts +0 -13
- package/dist/react/pipeline.d.ts.map +0 -1
- package/dist/react/pipeline.js +0 -25
- package/dist/react/pipeline.js.map +0 -1
- package/dist/react/props.d.ts +0 -38
- package/dist/react/props.d.ts.map +0 -1
- package/dist/react/props.js +0 -231
- package/dist/react/props.js.map +0 -1
- package/dist/react/slot-props.d.ts +0 -10
- package/dist/react/slot-props.d.ts.map +0 -1
- package/dist/react/slot-props.js +0 -56
- package/dist/react/slot-props.js.map +0 -1
- package/dist/react/widgets.d.ts +0 -83
- package/dist/react/widgets.d.ts.map +0 -1
- package/dist/react/widgets.js +0 -152
- package/dist/react/widgets.js.map +0 -1
- package/dist/store-fs.d.ts +0 -109
- package/dist/store-fs.d.ts.map +0 -1
- package/dist/store-fs.js +0 -98
- package/dist/store-fs.js.map +0 -1
- package/dist/transpile.d.ts +0 -32
- package/dist/transpile.d.ts.map +0 -1
- package/dist/transpile.js +0 -63
- package/dist/transpile.js.map +0 -1
- package/dist/typecheck-store.d.ts +0 -41
- package/dist/typecheck-store.d.ts.map +0 -1
- package/dist/typecheck-store.js +0 -102
- package/dist/typecheck-store.js.map +0 -1
- package/dist/writers/alias.d.ts +0 -13
- package/dist/writers/alias.d.ts.map +0 -1
- package/dist/writers/alias.js +0 -17
- package/dist/writers/alias.js.map +0 -1
- package/dist/writers/async.d.ts +0 -22
- package/dist/writers/async.d.ts.map +0 -1
- package/dist/writers/async.js +0 -48
- package/dist/writers/async.js.map +0 -1
- package/dist/writers/boxed-constructor.d.ts +0 -26
- package/dist/writers/boxed-constructor.d.ts.map +0 -1
- package/dist/writers/boxed-constructor.js +0 -85
- package/dist/writers/boxed-constructor.js.map +0 -1
- package/dist/writers/boxed-field-accessor.d.ts +0 -18
- package/dist/writers/boxed-field-accessor.d.ts.map +0 -1
- package/dist/writers/boxed-field-accessor.js +0 -260
- package/dist/writers/boxed-field-accessor.js.map +0 -1
- package/dist/writers/boxed-layout.d.ts +0 -27
- package/dist/writers/boxed-layout.d.ts.map +0 -1
- package/dist/writers/boxed-layout.js +0 -128
- package/dist/writers/boxed-layout.js.map +0 -1
- package/dist/writers/boxed.d.ts +0 -20
- package/dist/writers/boxed.d.ts.map +0 -1
- package/dist/writers/boxed.js +0 -71
- package/dist/writers/boxed.js.map +0 -1
- package/dist/writers/callables.d.ts +0 -124
- package/dist/writers/callables.d.ts.map +0 -1
- package/dist/writers/callables.js +0 -283
- package/dist/writers/callables.js.map +0 -1
- package/dist/writers/callback.d.ts +0 -16
- package/dist/writers/callback.d.ts.map +0 -1
- package/dist/writers/callback.js +0 -38
- package/dist/writers/callback.js.map +0 -1
- package/dist/writers/class-struct-record.d.ts +0 -31
- package/dist/writers/class-struct-record.d.ts.map +0 -1
- package/dist/writers/class-struct-record.js +0 -67
- package/dist/writers/class-struct-record.js.map +0 -1
- package/dist/writers/class-struct.d.ts +0 -22
- package/dist/writers/class-struct.d.ts.map +0 -1
- package/dist/writers/class-struct.js +0 -85
- package/dist/writers/class-struct.js.map +0 -1
- package/dist/writers/class.d.ts +0 -16
- package/dist/writers/class.d.ts.map +0 -1
- package/dist/writers/class.js +0 -307
- package/dist/writers/class.js.map +0 -1
- package/dist/writers/constant.d.ts +0 -15
- package/dist/writers/constant.d.ts.map +0 -1
- package/dist/writers/constant.js +0 -23
- package/dist/writers/constant.js.map +0 -1
- package/dist/writers/constants.d.ts +0 -15
- package/dist/writers/constants.d.ts.map +0 -1
- package/dist/writers/constants.js +0 -23
- package/dist/writers/constants.js.map +0 -1
- package/dist/writers/constructor-props.d.ts +0 -32
- package/dist/writers/constructor-props.d.ts.map +0 -1
- package/dist/writers/constructor-props.js +0 -110
- package/dist/writers/constructor-props.js.map +0 -1
- package/dist/writers/enum.d.ts +0 -21
- package/dist/writers/enum.d.ts.map +0 -1
- package/dist/writers/enum.js +0 -48
- package/dist/writers/enum.js.map +0 -1
- package/dist/writers/function.d.ts +0 -40
- package/dist/writers/function.d.ts.map +0 -1
- package/dist/writers/function.js +0 -127
- package/dist/writers/function.js.map +0 -1
- package/dist/writers/gtype-binding.d.ts +0 -19
- package/dist/writers/gtype-binding.d.ts.map +0 -1
- package/dist/writers/gtype-binding.js +0 -40
- package/dist/writers/gtype-binding.js.map +0 -1
- package/dist/writers/inheritance.d.ts +0 -48
- package/dist/writers/inheritance.d.ts.map +0 -1
- package/dist/writers/inheritance.js +0 -90
- package/dist/writers/inheritance.js.map +0 -1
- package/dist/writers/interface.d.ts +0 -16
- package/dist/writers/interface.d.ts.map +0 -1
- package/dist/writers/interface.js +0 -155
- package/dist/writers/interface.js.map +0 -1
- package/dist/writers/method.d.ts +0 -150
- package/dist/writers/method.d.ts.map +0 -1
- package/dist/writers/method.js +0 -510
- package/dist/writers/method.js.map +0 -1
- package/dist/writers/param-classify.d.ts +0 -93
- package/dist/writers/param-classify.d.ts.map +0 -1
- package/dist/writers/param-classify.js +0 -163
- package/dist/writers/param-classify.js.map +0 -1
- package/dist/writers/property-accessor.d.ts +0 -19
- package/dist/writers/property-accessor.d.ts.map +0 -1
- package/dist/writers/property-accessor.js +0 -117
- package/dist/writers/property-accessor.js.map +0 -1
- package/dist/writers/registration.d.ts +0 -27
- package/dist/writers/registration.d.ts.map +0 -1
- package/dist/writers/registration.js +0 -30
- package/dist/writers/registration.js.map +0 -1
- package/dist/writers/return-wrap.d.ts +0 -39
- package/dist/writers/return-wrap.d.ts.map +0 -1
- package/dist/writers/return-wrap.js +0 -152
- package/dist/writers/return-wrap.js.map +0 -1
- package/dist/writers/runtime-override.d.ts +0 -18
- package/dist/writers/runtime-override.d.ts.map +0 -1
- package/dist/writers/runtime-override.js +0 -44
- package/dist/writers/runtime-override.js.map +0 -1
- package/dist/writers/signal.d.ts +0 -21
- package/dist/writers/signal.d.ts.map +0 -1
- package/dist/writers/signal.js +0 -260
- package/dist/writers/signal.js.map +0 -1
- package/dist/writers/ts-type.d.ts +0 -50
- package/dist/writers/ts-type.d.ts.map +0 -1
- package/dist/writers/ts-type.js +0 -75
- package/dist/writers/ts-type.js.map +0 -1
- package/dist/writers/types-ts.d.ts +0 -27
- package/dist/writers/types-ts.d.ts.map +0 -1
- package/dist/writers/types-ts.js +0 -97
- package/dist/writers/types-ts.js.map +0 -1
- package/dist/writers/value.d.ts +0 -89
- package/dist/writers/value.d.ts.map +0 -1
- package/dist/writers/value.js +0 -402
- package/dist/writers/value.js.map +0 -1
- package/src/dsl/context.ts +0 -146
- package/src/dsl/emit.ts +0 -42
- package/src/dsl/identifier.ts +0 -52
- package/src/dsl/imports.ts +0 -109
- package/src/dsl/module.ts +0 -75
- package/src/ffi/pipeline.ts +0 -113
- package/src/gi-store.ts +0 -199
- package/src/gir/boxed.ts +0 -94
- package/src/gir/qualified-name.ts +0 -55
- package/src/gir/qualify.ts +0 -64
- package/src/gir/repository.ts +0 -149
- package/src/gir/signal.ts +0 -36
- package/src/jsx-store.ts +0 -53
- package/src/react/compounds-meta.ts +0 -99
- package/src/react/compounds.ts +0 -204
- package/src/react/internal.ts +0 -91
- package/src/react/jsx.ts +0 -155
- package/src/react/pipeline.ts +0 -29
- package/src/react/props.ts +0 -307
- package/src/react/slot-props.ts +0 -57
- package/src/react/widgets.ts +0 -185
- package/src/store-fs.ts +0 -157
- package/src/transpile.ts +0 -80
- package/src/typecheck-store.ts +0 -136
- package/src/writers/alias.ts +0 -19
- package/src/writers/async.ts +0 -44
- package/src/writers/boxed-constructor.ts +0 -105
- package/src/writers/boxed-field-accessor.ts +0 -306
- package/src/writers/boxed-layout.ts +0 -166
- package/src/writers/boxed.ts +0 -77
- package/src/writers/callables.ts +0 -339
- package/src/writers/callback.ts +0 -40
- package/src/writers/class-struct-record.ts +0 -75
- package/src/writers/class-struct.ts +0 -96
- package/src/writers/class.ts +0 -384
- package/src/writers/constant.ts +0 -29
- package/src/writers/constructor-props.ts +0 -130
- package/src/writers/enum.ts +0 -53
- package/src/writers/function.ts +0 -136
- package/src/writers/gtype-binding.ts +0 -48
- package/src/writers/inheritance.ts +0 -104
- package/src/writers/interface.ts +0 -168
- package/src/writers/method.ts +0 -678
- package/src/writers/param-classify.ts +0 -178
- package/src/writers/property-accessor.ts +0 -139
- package/src/writers/registration.ts +0 -42
- package/src/writers/return-wrap.ts +0 -180
- package/src/writers/runtime-override.ts +0 -59
- package/src/writers/signal.ts +0 -318
- package/src/writers/ts-type.ts +0 -115
- package/src/writers/value.ts +0 -485
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { alloc, type ExternalObject, getHandle, type Handle, setHandle, t, wrapHandle, write } from "@gtkx/runtime";
|
|
2
|
+
import type { RegionOverlap, Status } from "../cairo.js";
|
|
3
|
+
import { RectangleInt, Region } from "../cairo.js";
|
|
4
|
+
|
|
5
|
+
const { bind } = t;
|
|
6
|
+
const REGION_T = t.boxed("CairoRegion", {
|
|
7
|
+
ownership: "borrowed",
|
|
8
|
+
sharedLibrary: "libcairo-gobject.so.2",
|
|
9
|
+
getTypeFnName: "cairo_gobject_region_get_type",
|
|
10
|
+
});
|
|
11
|
+
const RECT_INT_ARRAY_T = t.boxed("cairo_rectangle_int_t[]", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" });
|
|
12
|
+
|
|
13
|
+
declare module "../cairo.js" {
|
|
14
|
+
interface Region {
|
|
15
|
+
copy(): Region;
|
|
16
|
+
status(): Status;
|
|
17
|
+
getExtents(): RectangleInt;
|
|
18
|
+
numRectangles(): number;
|
|
19
|
+
getRectangle(nth: number): RectangleInt;
|
|
20
|
+
isEmpty(): boolean;
|
|
21
|
+
containsPoint(x: number, y: number): boolean;
|
|
22
|
+
containsRectangle(rect: RectangleInt): RegionOverlap;
|
|
23
|
+
equal(other: Region): boolean;
|
|
24
|
+
translate(dx: number, dy: number): void;
|
|
25
|
+
intersect(other: Region): void;
|
|
26
|
+
intersectRectangle(rect: RectangleInt): void;
|
|
27
|
+
subtract(other: Region): void;
|
|
28
|
+
subtractRectangle(rect: RectangleInt): void;
|
|
29
|
+
union(other: Region): void;
|
|
30
|
+
unionRectangle(rect: RectangleInt): void;
|
|
31
|
+
xor(other: Region): void;
|
|
32
|
+
xorRectangle(rect: RectangleInt): void;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const cairoRegionCreate = bind(
|
|
37
|
+
"libcairo.so.2",
|
|
38
|
+
"cairo_region_create",
|
|
39
|
+
[],
|
|
40
|
+
t.boxed("CairoRegion", {
|
|
41
|
+
ownership: "full",
|
|
42
|
+
sharedLibrary: "libcairo-gobject.so.2",
|
|
43
|
+
getTypeFnName: "cairo_gobject_region_get_type",
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
const cairoRegionCreateRectangle = bind(
|
|
47
|
+
"libcairo.so.2",
|
|
48
|
+
"cairo_region_create_rectangle",
|
|
49
|
+
[t.boxed("cairo_rectangle_int_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" })],
|
|
50
|
+
t.boxed("CairoRegion", {
|
|
51
|
+
ownership: "full",
|
|
52
|
+
sharedLibrary: "libcairo-gobject.so.2",
|
|
53
|
+
getTypeFnName: "cairo_gobject_region_get_type",
|
|
54
|
+
}),
|
|
55
|
+
);
|
|
56
|
+
const cairoRegionCreateRectangles = bind(
|
|
57
|
+
"libcairo.so.2",
|
|
58
|
+
"cairo_region_create_rectangles",
|
|
59
|
+
[RECT_INT_ARRAY_T, t.int32],
|
|
60
|
+
t.boxed("CairoRegion", {
|
|
61
|
+
ownership: "full",
|
|
62
|
+
sharedLibrary: "libcairo-gobject.so.2",
|
|
63
|
+
getTypeFnName: "cairo_gobject_region_get_type",
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
class RegionImpl extends Region {
|
|
68
|
+
constructor(rect: RectangleInt) {
|
|
69
|
+
super();
|
|
70
|
+
setHandle(this, cairoRegionCreateRectangle(getHandle(rect)) as ExternalObject<Handle>);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static empty(): Region {
|
|
74
|
+
return wrapHandle(cairoRegionCreate() as ExternalObject<Handle>, RegionImpl);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
static copy(original: Region): Region {
|
|
78
|
+
return wrapHandle(cairoRegionCopy(getHandle(original)) as ExternalObject<Handle>, RegionImpl);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
static forRectangle(rect: RectangleInt): Region {
|
|
82
|
+
return wrapHandle(cairoRegionCreateRectangle(getHandle(rect)) as ExternalObject<Handle>, RegionImpl);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static createRectangles(rects: Array<{ x: number; y: number; width: number; height: number }>): Region {
|
|
86
|
+
if (rects.length === 0) {
|
|
87
|
+
return RegionImpl.empty();
|
|
88
|
+
}
|
|
89
|
+
const buf = alloc(rects.length * 16);
|
|
90
|
+
let offset = 0;
|
|
91
|
+
for (const rect of rects) {
|
|
92
|
+
write(buf, t.int32, offset, rect.x);
|
|
93
|
+
write(buf, t.int32, offset + 4, rect.y);
|
|
94
|
+
write(buf, t.int32, offset + 8, rect.width);
|
|
95
|
+
write(buf, t.int32, offset + 12, rect.height);
|
|
96
|
+
offset += 16;
|
|
97
|
+
}
|
|
98
|
+
const ptr = cairoRegionCreateRectangles(buf, rects.length) as ExternalObject<Handle>;
|
|
99
|
+
return wrapHandle(ptr, Region) as Region;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export { RegionImpl as Region };
|
|
104
|
+
|
|
105
|
+
const cairoRegionCopy = bind(
|
|
106
|
+
"libcairo.so.2",
|
|
107
|
+
"cairo_region_copy",
|
|
108
|
+
[REGION_T],
|
|
109
|
+
t.boxed("CairoRegion", {
|
|
110
|
+
ownership: "full",
|
|
111
|
+
sharedLibrary: "libcairo-gobject.so.2",
|
|
112
|
+
getTypeFnName: "cairo_gobject_region_get_type",
|
|
113
|
+
}),
|
|
114
|
+
);
|
|
115
|
+
Region.prototype.copy = function (): Region {
|
|
116
|
+
return wrapHandle(cairoRegionCopy(getHandle(this)) as ExternalObject<Handle>, Region) as Region;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const cairoRegionStatus = bind("libcairo.so.2", "cairo_region_status", [REGION_T], t.int32);
|
|
120
|
+
Region.prototype.status = function (): Status {
|
|
121
|
+
return cairoRegionStatus(getHandle(this)) as Status;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const cairoRegionGetExtents = bind(
|
|
125
|
+
"libcairo.so.2",
|
|
126
|
+
"cairo_region_get_extents",
|
|
127
|
+
[REGION_T, t.boxed("cairo_rectangle_int_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" })],
|
|
128
|
+
t.void,
|
|
129
|
+
);
|
|
130
|
+
Region.prototype.getExtents = function (): RectangleInt {
|
|
131
|
+
const rect = new RectangleInt();
|
|
132
|
+
cairoRegionGetExtents(getHandle(this), getHandle(rect));
|
|
133
|
+
return rect;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const cairoRegionNumRectangles = bind("libcairo.so.2", "cairo_region_num_rectangles", [REGION_T], t.int32);
|
|
137
|
+
Region.prototype.numRectangles = function (): number {
|
|
138
|
+
return cairoRegionNumRectangles(getHandle(this)) as number;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const cairoRegionGetRectangle = bind(
|
|
142
|
+
"libcairo.so.2",
|
|
143
|
+
"cairo_region_get_rectangle",
|
|
144
|
+
[REGION_T, t.int32, t.boxed("cairo_rectangle_int_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" })],
|
|
145
|
+
t.void,
|
|
146
|
+
);
|
|
147
|
+
Region.prototype.getRectangle = function (nth: number): RectangleInt {
|
|
148
|
+
const rect = new RectangleInt();
|
|
149
|
+
cairoRegionGetRectangle(getHandle(this), nth, getHandle(rect));
|
|
150
|
+
return rect;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const cairoRegionIsEmpty = bind("libcairo.so.2", "cairo_region_is_empty", [REGION_T], t.boolean);
|
|
154
|
+
Region.prototype.isEmpty = function (): boolean {
|
|
155
|
+
return cairoRegionIsEmpty(getHandle(this)) as boolean;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const cairoRegionContainsPoint = bind(
|
|
159
|
+
"libcairo.so.2",
|
|
160
|
+
"cairo_region_contains_point",
|
|
161
|
+
[REGION_T, t.int32, t.int32],
|
|
162
|
+
t.boolean,
|
|
163
|
+
);
|
|
164
|
+
Region.prototype.containsPoint = function (x: number, y: number): boolean {
|
|
165
|
+
return cairoRegionContainsPoint(getHandle(this), x, y) as boolean;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const cairoRegionContainsRectangle = bind(
|
|
169
|
+
"libcairo.so.2",
|
|
170
|
+
"cairo_region_contains_rectangle",
|
|
171
|
+
[REGION_T, t.boxed("cairo_rectangle_int_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" })],
|
|
172
|
+
t.int32,
|
|
173
|
+
);
|
|
174
|
+
Region.prototype.containsRectangle = function (rect: RectangleInt): RegionOverlap {
|
|
175
|
+
return cairoRegionContainsRectangle(getHandle(this), getHandle(rect)) as RegionOverlap;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const cairoRegionEqual = bind("libcairo.so.2", "cairo_region_equal", [REGION_T, REGION_T], t.boolean);
|
|
179
|
+
Region.prototype.equal = function (other: Region): boolean {
|
|
180
|
+
return cairoRegionEqual(getHandle(this), getHandle(other)) as boolean;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const cairoRegionTranslate = bind("libcairo.so.2", "cairo_region_translate", [REGION_T, t.int32, t.int32], t.void);
|
|
184
|
+
Region.prototype.translate = function (dx: number, dy: number): void {
|
|
185
|
+
cairoRegionTranslate(getHandle(this), dx, dy);
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const BINARY_OP_ARGS = [REGION_T, REGION_T];
|
|
189
|
+
const cairoRegionIntersect = bind("libcairo.so.2", "cairo_region_intersect", BINARY_OP_ARGS, t.int32);
|
|
190
|
+
const cairoRegionSubtract = bind("libcairo.so.2", "cairo_region_subtract", BINARY_OP_ARGS, t.int32);
|
|
191
|
+
const cairoRegionUnion = bind("libcairo.so.2", "cairo_region_union", BINARY_OP_ARGS, t.int32);
|
|
192
|
+
const cairoRegionXor = bind("libcairo.so.2", "cairo_region_xor", BINARY_OP_ARGS, t.int32);
|
|
193
|
+
|
|
194
|
+
const RECT_OP_ARGS = [
|
|
195
|
+
REGION_T,
|
|
196
|
+
t.boxed("cairo_rectangle_int_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" }),
|
|
197
|
+
];
|
|
198
|
+
const cairoRegionIntersectRectangle = bind("libcairo.so.2", "cairo_region_intersect_rectangle", RECT_OP_ARGS, t.int32);
|
|
199
|
+
const cairoRegionSubtractRectangle = bind("libcairo.so.2", "cairo_region_subtract_rectangle", RECT_OP_ARGS, t.int32);
|
|
200
|
+
const cairoRegionUnionRectangle = bind("libcairo.so.2", "cairo_region_union_rectangle", RECT_OP_ARGS, t.int32);
|
|
201
|
+
const cairoRegionXorRectangle = bind("libcairo.so.2", "cairo_region_xor_rectangle", RECT_OP_ARGS, t.int32);
|
|
202
|
+
|
|
203
|
+
const regionOp = (self: Region, boundFn: (...args: unknown[]) => unknown, arg: Region | RectangleInt): void => {
|
|
204
|
+
boundFn(getHandle(self), getHandle(arg));
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
Region.prototype.intersect = function (other: Region): void {
|
|
208
|
+
regionOp(this, cairoRegionIntersect, other);
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
Region.prototype.intersectRectangle = function (rect: RectangleInt): void {
|
|
212
|
+
regionOp(this, cairoRegionIntersectRectangle, rect);
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
Region.prototype.subtract = function (other: Region): void {
|
|
216
|
+
regionOp(this, cairoRegionSubtract, other);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
Region.prototype.subtractRectangle = function (rect: RectangleInt): void {
|
|
220
|
+
regionOp(this, cairoRegionSubtractRectangle, rect);
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
Region.prototype.union = function (other: Region): void {
|
|
224
|
+
regionOp(this, cairoRegionUnion, other);
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
Region.prototype.unionRectangle = function (rect: RectangleInt): void {
|
|
228
|
+
regionOp(this, cairoRegionUnionRectangle, rect);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
Region.prototype.xor = function (other: Region): void {
|
|
232
|
+
regionOp(this, cairoRegionXor, other);
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
Region.prototype.xorRectangle = function (rect: RectangleInt): void {
|
|
236
|
+
regionOp(this, cairoRegionXorRectangle, rect);
|
|
237
|
+
};
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { alloc, type ExternalObject, getHandle, type Handle, read, t, wrapHandle } from "@gtkx/runtime";
|
|
2
|
+
import type { FontOptions, FontType, Status, TextClusterFlags } from "../cairo.js";
|
|
3
|
+
import { FontFace, ScaledFont } from "../cairo.js";
|
|
4
|
+
import {
|
|
5
|
+
allocGlyphBuffer,
|
|
6
|
+
type CairoGlyph,
|
|
7
|
+
type CairoTextCluster,
|
|
8
|
+
type FontExtents,
|
|
9
|
+
readFontExtents,
|
|
10
|
+
readTextExtents,
|
|
11
|
+
type TextExtents,
|
|
12
|
+
} from "./context.js";
|
|
13
|
+
import { FontOptions as FontOptionsConstructor } from "./font-options.js";
|
|
14
|
+
import { allocMatrix, type Matrix as CairoMatrix } from "./matrix.js";
|
|
15
|
+
|
|
16
|
+
const { bind } = t;
|
|
17
|
+
const SCALED_FONT_T = t.boxed("CairoScaledFont", {
|
|
18
|
+
ownership: "borrowed",
|
|
19
|
+
sharedLibrary: "libcairo-gobject.so.2",
|
|
20
|
+
getTypeFnName: "cairo_gobject_scaled_font_get_type",
|
|
21
|
+
});
|
|
22
|
+
const GLYPH_BUF_REF = t.ref(t.boxed("cairo_glyph_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" }));
|
|
23
|
+
const CLUSTER_BUF_REF = t.ref(
|
|
24
|
+
t.boxed("cairo_text_cluster_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" }),
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
declare module "../cairo.js" {
|
|
28
|
+
interface ScaledFont {
|
|
29
|
+
status(): Status;
|
|
30
|
+
extents(): FontExtents;
|
|
31
|
+
textExtents(text: string): TextExtents;
|
|
32
|
+
glyphExtents(glyphs: Array<{ index: number; x: number; y: number }>): TextExtents;
|
|
33
|
+
getFontFace(): FontFace;
|
|
34
|
+
getFontOptions(): FontOptions;
|
|
35
|
+
getFontMatrix(): CairoMatrix;
|
|
36
|
+
getCtm(): CairoMatrix;
|
|
37
|
+
getScaleMatrix(): CairoMatrix;
|
|
38
|
+
getType(): FontType;
|
|
39
|
+
getReferenceCount(): number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
namespace ScaledFont {
|
|
43
|
+
function create(
|
|
44
|
+
fontFace: FontFace,
|
|
45
|
+
fontMatrix: CairoMatrix,
|
|
46
|
+
ctm: CairoMatrix,
|
|
47
|
+
options: FontOptions,
|
|
48
|
+
): ScaledFont;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
type ScaledFontStatic = {
|
|
53
|
+
create(fontFace: FontFace, fontMatrix: CairoMatrix, ctm: CairoMatrix, options: FontOptions): ScaledFont;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const ScaledFontWithStatics = ScaledFont as typeof ScaledFont & ScaledFontStatic;
|
|
57
|
+
|
|
58
|
+
const cairoScaledFontCreate = bind(
|
|
59
|
+
"libcairo.so.2",
|
|
60
|
+
"cairo_scaled_font_create",
|
|
61
|
+
[
|
|
62
|
+
t.boxed("CairoFontFace", {
|
|
63
|
+
ownership: "borrowed",
|
|
64
|
+
sharedLibrary: "libcairo-gobject.so.2",
|
|
65
|
+
getTypeFnName: "cairo_gobject_font_face_get_type",
|
|
66
|
+
}),
|
|
67
|
+
t.boxed("cairo_matrix_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" }),
|
|
68
|
+
t.boxed("cairo_matrix_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" }),
|
|
69
|
+
t.boxed("CairoFontOptions", {
|
|
70
|
+
ownership: "borrowed",
|
|
71
|
+
sharedLibrary: "libcairo-gobject.so.2",
|
|
72
|
+
getTypeFnName: "cairo_gobject_font_options_get_type",
|
|
73
|
+
}),
|
|
74
|
+
],
|
|
75
|
+
t.boxed("CairoScaledFont", {
|
|
76
|
+
ownership: "full",
|
|
77
|
+
sharedLibrary: "libcairo-gobject.so.2",
|
|
78
|
+
getTypeFnName: "cairo_gobject_scaled_font_get_type",
|
|
79
|
+
}),
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
ScaledFontWithStatics.create = (
|
|
83
|
+
fontFace: FontFace,
|
|
84
|
+
fontMatrix: CairoMatrix,
|
|
85
|
+
ctm: CairoMatrix,
|
|
86
|
+
options: FontOptions,
|
|
87
|
+
): ScaledFont => {
|
|
88
|
+
const ptr = cairoScaledFontCreate(
|
|
89
|
+
getHandle(fontFace),
|
|
90
|
+
getHandle(fontMatrix),
|
|
91
|
+
getHandle(ctm),
|
|
92
|
+
getHandle(options),
|
|
93
|
+
) as ExternalObject<Handle>;
|
|
94
|
+
return wrapHandle(ptr, ScaledFont) as ScaledFont;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const cairoScaledFontStatus = bind("libcairo.so.2", "cairo_scaled_font_status", [SCALED_FONT_T], t.int32);
|
|
98
|
+
ScaledFont.prototype.status = function (): Status {
|
|
99
|
+
return cairoScaledFontStatus(getHandle(this)) as Status;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const cairoScaledFontExtents = bind(
|
|
103
|
+
"libcairo.so.2",
|
|
104
|
+
"cairo_scaled_font_extents",
|
|
105
|
+
[SCALED_FONT_T, t.boxed("cairo_font_extents_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" })],
|
|
106
|
+
t.void,
|
|
107
|
+
);
|
|
108
|
+
ScaledFont.prototype.extents = function (): FontExtents {
|
|
109
|
+
const ext = alloc(40);
|
|
110
|
+
cairoScaledFontExtents(getHandle(this), ext);
|
|
111
|
+
return readFontExtents(ext);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const cairoScaledFontTextExtents = bind(
|
|
115
|
+
"libcairo.so.2",
|
|
116
|
+
"cairo_scaled_font_text_extents",
|
|
117
|
+
[
|
|
118
|
+
SCALED_FONT_T,
|
|
119
|
+
t.string("full"),
|
|
120
|
+
t.boxed("cairo_text_extents_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" }),
|
|
121
|
+
],
|
|
122
|
+
t.void,
|
|
123
|
+
);
|
|
124
|
+
ScaledFont.prototype.textExtents = function (text: string): TextExtents {
|
|
125
|
+
const ext = alloc(48);
|
|
126
|
+
cairoScaledFontTextExtents(getHandle(this), text, ext);
|
|
127
|
+
return readTextExtents(ext);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const cairoScaledFontGlyphExtents = bind(
|
|
131
|
+
"libcairo.so.2",
|
|
132
|
+
"cairo_scaled_font_glyph_extents",
|
|
133
|
+
[
|
|
134
|
+
SCALED_FONT_T,
|
|
135
|
+
t.boxed("cairo_glyph_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" }),
|
|
136
|
+
t.int32,
|
|
137
|
+
t.boxed("cairo_text_extents_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" }),
|
|
138
|
+
],
|
|
139
|
+
t.void,
|
|
140
|
+
);
|
|
141
|
+
ScaledFont.prototype.glyphExtents = function (glyphs: Array<{ index: number; x: number; y: number }>): TextExtents {
|
|
142
|
+
const buf = allocGlyphBuffer(glyphs);
|
|
143
|
+
const ext = alloc(48);
|
|
144
|
+
cairoScaledFontGlyphExtents(getHandle(this), buf, glyphs.length, ext);
|
|
145
|
+
return readTextExtents(ext);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const cairoScaledFontGetFontFace = bind(
|
|
149
|
+
"libcairo.so.2",
|
|
150
|
+
"cairo_scaled_font_get_font_face",
|
|
151
|
+
[SCALED_FONT_T],
|
|
152
|
+
t.boxed("CairoFontFace", {
|
|
153
|
+
ownership: "borrowed",
|
|
154
|
+
sharedLibrary: "libcairo-gobject.so.2",
|
|
155
|
+
getTypeFnName: "cairo_gobject_font_face_get_type",
|
|
156
|
+
}),
|
|
157
|
+
);
|
|
158
|
+
ScaledFont.prototype.getFontFace = function (): FontFace {
|
|
159
|
+
return wrapHandle(cairoScaledFontGetFontFace(getHandle(this)) as ExternalObject<Handle>, FontFace) as FontFace;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const cairoScaledFontGetFontOptions = bind(
|
|
163
|
+
"libcairo.so.2",
|
|
164
|
+
"cairo_scaled_font_get_font_options",
|
|
165
|
+
[
|
|
166
|
+
SCALED_FONT_T,
|
|
167
|
+
t.boxed("CairoFontOptions", {
|
|
168
|
+
ownership: "borrowed",
|
|
169
|
+
sharedLibrary: "libcairo-gobject.so.2",
|
|
170
|
+
getTypeFnName: "cairo_gobject_font_options_get_type",
|
|
171
|
+
}),
|
|
172
|
+
],
|
|
173
|
+
t.void,
|
|
174
|
+
);
|
|
175
|
+
ScaledFont.prototype.getFontOptions = function (): FontOptions {
|
|
176
|
+
const options = FontOptionsConstructor.create();
|
|
177
|
+
cairoScaledFontGetFontOptions(getHandle(this), getHandle(options));
|
|
178
|
+
return options;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const cairoScaledFontGetFontMatrix = bind(
|
|
182
|
+
"libcairo.so.2",
|
|
183
|
+
"cairo_scaled_font_get_font_matrix",
|
|
184
|
+
[SCALED_FONT_T, t.boxed("cairo_matrix_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" })],
|
|
185
|
+
t.void,
|
|
186
|
+
);
|
|
187
|
+
const cairoScaledFontGetCtm = bind(
|
|
188
|
+
"libcairo.so.2",
|
|
189
|
+
"cairo_scaled_font_get_ctm",
|
|
190
|
+
[SCALED_FONT_T, t.boxed("cairo_matrix_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" })],
|
|
191
|
+
t.void,
|
|
192
|
+
);
|
|
193
|
+
const cairoScaledFontGetScaleMatrix = bind(
|
|
194
|
+
"libcairo.so.2",
|
|
195
|
+
"cairo_scaled_font_get_scale_matrix",
|
|
196
|
+
[SCALED_FONT_T, t.boxed("cairo_matrix_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" })],
|
|
197
|
+
t.void,
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
function readMatrixVia(self: ScaledFont, boundFn: (...args: unknown[]) => unknown): CairoMatrix {
|
|
201
|
+
const { handle, obj } = allocMatrix();
|
|
202
|
+
boundFn(getHandle(self), handle);
|
|
203
|
+
return obj;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
ScaledFont.prototype.getFontMatrix = function (): CairoMatrix {
|
|
207
|
+
return readMatrixVia(this, cairoScaledFontGetFontMatrix);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
ScaledFont.prototype.getCtm = function (): CairoMatrix {
|
|
211
|
+
return readMatrixVia(this, cairoScaledFontGetCtm);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
ScaledFont.prototype.getScaleMatrix = function (): CairoMatrix {
|
|
215
|
+
return readMatrixVia(this, cairoScaledFontGetScaleMatrix);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
const cairoScaledFontGetType = bind("libcairo.so.2", "cairo_scaled_font_get_type", [SCALED_FONT_T], t.int32);
|
|
219
|
+
ScaledFont.prototype.getType = function (): FontType {
|
|
220
|
+
return cairoScaledFontGetType(getHandle(this)) as FontType;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const cairoScaledFontGetReferenceCount = bind(
|
|
224
|
+
"libcairo.so.2",
|
|
225
|
+
"cairo_scaled_font_get_reference_count",
|
|
226
|
+
[SCALED_FONT_T],
|
|
227
|
+
t.int32,
|
|
228
|
+
);
|
|
229
|
+
ScaledFont.prototype.getReferenceCount = function (): number {
|
|
230
|
+
return cairoScaledFontGetReferenceCount(getHandle(this)) as number;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
declare module "../cairo.js" {
|
|
234
|
+
interface ScaledFont {
|
|
235
|
+
textToGlyphs(x: number, y: number, text: string): [CairoGlyph[], CairoTextCluster[], TextClusterFlags];
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const cairoScaledFontTextToGlyphs = bind(
|
|
240
|
+
"libcairo.so.2",
|
|
241
|
+
"cairo_scaled_font_text_to_glyphs",
|
|
242
|
+
[
|
|
243
|
+
SCALED_FONT_T,
|
|
244
|
+
t.float64,
|
|
245
|
+
t.float64,
|
|
246
|
+
t.string("full"),
|
|
247
|
+
t.int32,
|
|
248
|
+
GLYPH_BUF_REF,
|
|
249
|
+
t.ref(t.int32),
|
|
250
|
+
CLUSTER_BUF_REF,
|
|
251
|
+
t.ref(t.int32),
|
|
252
|
+
t.ref(t.int32),
|
|
253
|
+
],
|
|
254
|
+
t.int32,
|
|
255
|
+
);
|
|
256
|
+
const cairoGlyphFree = bind(
|
|
257
|
+
"libcairo.so.2",
|
|
258
|
+
"cairo_glyph_free",
|
|
259
|
+
[t.boxed("cairo_glyph_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" })],
|
|
260
|
+
t.void,
|
|
261
|
+
);
|
|
262
|
+
const cairoTextClusterFree = bind(
|
|
263
|
+
"libcairo.so.2",
|
|
264
|
+
"cairo_text_cluster_free",
|
|
265
|
+
[t.boxed("cairo_text_cluster_t", { ownership: "borrowed", sharedLibrary: "libcairo.so.2" })],
|
|
266
|
+
t.void,
|
|
267
|
+
);
|
|
268
|
+
|
|
269
|
+
ScaledFont.prototype.textToGlyphs = function (
|
|
270
|
+
x: number,
|
|
271
|
+
y: number,
|
|
272
|
+
text: string,
|
|
273
|
+
): [CairoGlyph[], CairoTextCluster[], TextClusterFlags] {
|
|
274
|
+
const glyphsRef: { value: ExternalObject<Handle> | null } = { value: null };
|
|
275
|
+
const numGlyphsRef = { value: 0 };
|
|
276
|
+
const clustersRef: { value: ExternalObject<Handle> | null } = { value: null };
|
|
277
|
+
const numClustersRef = { value: 0 };
|
|
278
|
+
const clusterFlagsRef = { value: 0 };
|
|
279
|
+
|
|
280
|
+
cairoScaledFontTextToGlyphs(
|
|
281
|
+
getHandle(this),
|
|
282
|
+
x,
|
|
283
|
+
y,
|
|
284
|
+
text,
|
|
285
|
+
-1,
|
|
286
|
+
glyphsRef,
|
|
287
|
+
numGlyphsRef,
|
|
288
|
+
clustersRef,
|
|
289
|
+
numClustersRef,
|
|
290
|
+
clusterFlagsRef,
|
|
291
|
+
);
|
|
292
|
+
|
|
293
|
+
const numGlyphs = numGlyphsRef.value;
|
|
294
|
+
const numClusters = numClustersRef.value;
|
|
295
|
+
|
|
296
|
+
const glyphsBuf = glyphsRef.value;
|
|
297
|
+
const clustersBuf = clustersRef.value;
|
|
298
|
+
|
|
299
|
+
const glyphs: CairoGlyph[] = [];
|
|
300
|
+
if (glyphsBuf !== null) {
|
|
301
|
+
for (let i = 0; i < numGlyphs; i++) {
|
|
302
|
+
const offset = i * 24;
|
|
303
|
+
glyphs.push({
|
|
304
|
+
index: read(glyphsBuf, t.uint64, offset) as number,
|
|
305
|
+
x: read(glyphsBuf, t.float64, offset + 8) as number,
|
|
306
|
+
y: read(glyphsBuf, t.float64, offset + 16) as number,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
const clusters: CairoTextCluster[] = [];
|
|
312
|
+
if (clustersBuf !== null) {
|
|
313
|
+
for (let i = 0; i < numClusters; i++) {
|
|
314
|
+
const offset = i * 8;
|
|
315
|
+
clusters.push({
|
|
316
|
+
numBytes: read(clustersBuf, t.int32, offset) as number,
|
|
317
|
+
numGlyphs: read(clustersBuf, t.int32, offset + 4) as number,
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (glyphsBuf !== null) {
|
|
323
|
+
cairoGlyphFree(glyphsBuf);
|
|
324
|
+
}
|
|
325
|
+
if (clustersBuf !== null) {
|
|
326
|
+
cairoTextClusterFree(clustersBuf);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
return [glyphs, clusters, clusterFlagsRef.value as TextClusterFlags];
|
|
330
|
+
};
|