@gjsify/node-gi 0.63.0 → 0.64.1
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/cairo.d.ts +25 -0
- package/cairo.js +23 -0
- package/gi.js +380 -122
- package/index.d.ts +13 -11
- package/index.js +1 -0
- package/overrides/gio-settings.js +2 -24
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/node_gi.node +0 -0
- package/prebuilds/darwin-x64/node_gi.node +0 -0
- package/prebuilds/linux-arm64/node_gi.node +0 -0
- package/prebuilds/linux-x64/node_gi.node +0 -0
- package/prebuilds/win32-arm64/node_gi.node +0 -0
- package/prebuilds/win32-x64/node_gi.node +0 -0
- package/src/addon.cc +1 -0
- package/src/cairo.cc +66 -1
- package/src/calls.cc +84 -63
- package/src/class.cc +2 -2
- package/src/common.h +174 -28
- package/src/marshal.cc +93 -111
- package/src/object.cc +79 -10
- package/src/private.cc +33 -0
- package/src/repo.cc +43 -15
package/cairo.d.ts
CHANGED
|
@@ -17,6 +17,25 @@ export const Operator: CairoEnum;
|
|
|
17
17
|
export const PatternType: CairoEnum;
|
|
18
18
|
export const SurfaceType: CairoEnum;
|
|
19
19
|
|
|
20
|
+
/** `cairo_text_extents_t`, in the shape GJS returns. */
|
|
21
|
+
export interface TextExtents {
|
|
22
|
+
xBearing: number;
|
|
23
|
+
yBearing: number;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
xAdvance: number;
|
|
27
|
+
yAdvance: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** `cairo_font_extents_t`, in the shape GJS returns. */
|
|
31
|
+
export interface FontExtents {
|
|
32
|
+
ascent: number;
|
|
33
|
+
descent: number;
|
|
34
|
+
height: number;
|
|
35
|
+
maxXAdvance: number;
|
|
36
|
+
maxYAdvance: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
20
39
|
/** cairo drawing context (`cairo_t`). */
|
|
21
40
|
export class Context {
|
|
22
41
|
constructor(surface: Surface);
|
|
@@ -28,6 +47,12 @@ export class Context {
|
|
|
28
47
|
lineTo(x: number, y: number): void;
|
|
29
48
|
relMoveTo(dx: number, dy: number): void;
|
|
30
49
|
relLineTo(dx: number, dy: number): void;
|
|
50
|
+
selectFontFace(family: string, slant: number, weight: number): void;
|
|
51
|
+
setFontSize(size: number): void;
|
|
52
|
+
showText(utf8: string): void;
|
|
53
|
+
textPath(utf8: string): void;
|
|
54
|
+
textExtents(utf8: string): TextExtents;
|
|
55
|
+
fontExtents(): FontExtents;
|
|
31
56
|
rectangle(x: number, y: number, width: number, height: number): void;
|
|
32
57
|
arc(xc: number, yc: number, radius: number, angle1: number, angle2: number): void;
|
|
33
58
|
arcNegative(xc: number, yc: number, radius: number, angle1: number, angle2: number): void;
|
package/cairo.js
CHANGED
|
@@ -332,6 +332,29 @@ export class Context {
|
|
|
332
332
|
fillExtents() {
|
|
333
333
|
return c.fillExtents(this[H]);
|
|
334
334
|
}
|
|
335
|
+
/** Select the toy-API font: `family` with a {@link FontSlant} and {@link FontWeight}. */
|
|
336
|
+
selectFontFace(family, slant, weight) {
|
|
337
|
+
c.selectFontFace(this[H], family, slant, weight);
|
|
338
|
+
}
|
|
339
|
+
setFontSize(size) {
|
|
340
|
+
c.setFontSize(this[H], size);
|
|
341
|
+
}
|
|
342
|
+
/** Draw `utf8` at the current point with the current source. */
|
|
343
|
+
showText(utf8) {
|
|
344
|
+
c.showText(this[H], utf8);
|
|
345
|
+
}
|
|
346
|
+
/** Append the outline of `utf8` to the current path. */
|
|
347
|
+
textPath(utf8) {
|
|
348
|
+
c.textPath(this[H], utf8);
|
|
349
|
+
}
|
|
350
|
+
/** `{ xBearing, yBearing, width, height, xAdvance, yAdvance }` of `utf8` in the current font. */
|
|
351
|
+
textExtents(utf8) {
|
|
352
|
+
return c.textExtents(this[H], utf8);
|
|
353
|
+
}
|
|
354
|
+
/** `{ ascent, descent, height, maxXAdvance, maxYAdvance }` of the current font. */
|
|
355
|
+
fontExtents() {
|
|
356
|
+
return c.fontExtents(this[H]);
|
|
357
|
+
}
|
|
335
358
|
/** Stroke bounding box as `[x1, y1, x2, y2]`. */
|
|
336
359
|
strokeExtents() {
|
|
337
360
|
return c.strokeExtents(this[H]);
|