react-native-gtkx 0.4.0-alpha.3 → 0.4.0
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/dist/apis/host.gtkx.js.map +1 -1
- package/dist/components/modal.d.ts +1 -1
- package/dist/components/modal.js +16 -8
- package/dist/components/modal.js.map +1 -1
- package/dist/gtkx/bridge/adw.js.map +1 -1
- package/dist/gtkx/bridge/core.d.ts +1 -2
- package/dist/gtkx/bridge/core.js +2 -5
- package/dist/gtkx/bridge/core.js.map +1 -1
- package/dist/gtkx/bridge/geometry.js +1 -1
- package/dist/gtkx/bridge/geometry.js.map +1 -1
- package/dist/gtkx/bridge/layout-manager.js +18 -5
- package/dist/gtkx/bridge/layout-manager.js.map +1 -1
- package/dist/gtkx/bridge/slot-portal.js.map +1 -1
- package/dist/gtkx/bridge/svg-node.js +13 -6
- package/dist/gtkx/bridge/svg-node.js.map +1 -1
- package/dist/gtkx/bridge/view-box.js +18 -9
- package/dist/gtkx/bridge/view-box.js.map +1 -1
- package/dist/gtkx/bridge/widgets.generated.adw.js +1 -1
- package/dist/gtkx/bridge/widgets.generated.adw.js.map +1 -1
- package/dist/mcp/data/generated.d.ts +58 -42
- package/dist/mcp/data/generated.js +63 -43
- package/dist/mcp/data/generated.js.map +1 -1
- package/dist/runner/host-dev.js +5 -0
- package/dist/runner/host-dev.js.map +1 -1
- package/dist/runner/host.js +15 -0
- package/dist/runner/host.js.map +1 -1
- package/dist/runner/index.d.ts +27 -0
- package/dist/runner/index.js +206 -1
- package/dist/runner/index.js.map +1 -1
- package/dist/sea/assemble.d.ts +9 -0
- package/dist/sea/assemble.js +16 -3
- package/dist/sea/assemble.js.map +1 -1
- package/dist/sea/bundle.d.ts +37 -2
- package/dist/sea/bundle.js +76 -4
- package/dist/sea/bundle.js.map +1 -1
- package/dist/sea/native-shim.js +1 -1
- package/dist/sea/native-shim.js.map +1 -1
- package/dist/testing/index.js +28 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/vite/index.js +3 -3
- package/dist/vite/index.js.map +1 -1
- package/dist/vitest/index.d.ts +1 -1
- package/dist/vitest/index.js.map +1 -1
- package/package.json +9 -9
- package/dist/gtkx/bridge/use-signal.d.ts +0 -2
- package/dist/gtkx/bridge/use-signal.js +0 -41
- package/dist/gtkx/bridge/use-signal.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg-node.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/svg-node.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,gEAAgE;AAChE,2EAA2E;AAC3E,0EAA0E;AAC1E,oEAAoE;AACpE,sBAAsB;AACtB,EAAE;AACF,qEAAqE;AACrE,6EAA6E;AAC7E,qEAAqE;AACrE,4EAA4E;AAC5E,6EAA6E;AAC7E,4BAA4B;AAC5B,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GAEtB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EACL,uBAAuB,GAGxB,MAAM,oBAAoB,CAAA;AA4E3B,MAAM,eAAe,GAAG,IAAI,OAAO,EAAiC,CAAA;AAEpE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,MAAkB,EAClB,UAA6B,EACvB,EAAE;IACR,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,C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AC,CAAA;AAED;;qCAEqC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAsB,EAAQ,EAAE;IAC7D,UAAU,CAAC,SAAS,EAAE,CAAA;AACxB,CAAC,CAAA","sourcesContent":["// RnGtkxSvgNode — one GObject class (registerClass, same mechanism as\n// RnGtkxLayout/RnGtkxViewBox) reused for the <Svg> root AND every descendant\n// (<G>, <Path>, <Rect>, ..., <Defs>, <LinearGradient>, <Stop>). Descendants\n// are ordinary GTK children (the reconciler's generic set_parent/insert_after\n// attachment — the same one View relies on) that GTK never snapshots on its\n// own, because nothing ever calls snapshotChild() on them: only the mounted\n// <Svg> instance's snapshot() vfunc actually runs, and it walks\n// getFirstChild()/getNextSibling() itself, reading each node's role from a\n// WeakMap (native wrappers get re-created by the runtime, so per-instance\n// state cannot live on `this` — same reasoning as hooksByManager in\n// layout-manager.ts).\n//\n// `Gtk.Widget.snapshot()` is a real, working vfunc in gtkx's codegen\n// (node_modules/@gtkx/gi/gtk/gtk.js, registerWrapperClass(Widget, ...) lists\n// it with byteOffset 320) even though it is missing from the shipped\n// `gtk.d.ts` — the type generator drops it, the codegen that actually wires\n// vfuncs does not. Verified by reading the generated registry before writing\n// any of this; see epic.md.\nimport * as Gdk from \"@gtkx/gi/gdk\"\nimport * as Graphene from \"@gtkx/gi/graphene\"\nimport * as Gsk from \"@gtkx/gi/gsk\"\nimport * as Gtk from \"@gtkx/gi/gtk\"\nimport { createElementComponent } from \"@gtkx/react/internal\"\nimport { registerClass } from \"@gtkx/runtime\"\nimport { parseColor } from \"../../style/colors\"\nimport {\n resolveGradientPoint,\n resolveGradientRadius,\n type BoundingBox,\n} from \"../../svg/gradient-geometry\"\nimport type { SvgTransformOp } from \"../../svg/transform\"\nimport {\n resolveViewBoxTransform,\n type PreserveAspectRatio,\n type ViewBox,\n} from \"../../svg/view-box\"\n\n// --- descriptors --------------------------------------------------------\n\nexport type SvgPaintSpec =\n { kind: \"color\"; rgba: Gdk.RGBA } | { kind: \"ref\"; id: string }\n\nexport type SvgGradientUnits = \"objectBoundingBox\" | \"userSpaceOnUse\"\n\nexport type SvgSvgDescriptor = {\n kind: \"svg\"\n viewBox: ViewBox | null\n preserveAspectRatio: PreserveAspectRatio\n}\n\nexport type SvgGroupDescriptor = {\n kind: \"g\"\n transformOps: SvgTransformOp[]\n opacity: number\n}\n\nexport type SvgShapeDescriptor = {\n kind: \"shape\"\n path: Gsk.Path | null\n fill: SvgPaintSpec | null\n fillOpacity: number\n fillRule: Gsk.FillRule\n stroke: SvgPaintSpec | null\n strokeOpacity: number\n strokeWidth: number\n strokeLinecap: Gsk.LineCap\n strokeLinejoin: Gsk.LineJoin\n strokeMiterlimit: number\n strokeDasharray: number[] | null\n strokeDashoffset: number\n opacity: number\n}\n\nexport type SvgDefsDescriptor = { kind: \"defs\" }\n\nexport type SvgLinearGradientDescriptor = {\n kind: \"gradient\"\n type: \"linear\"\n id: string\n units: SvgGradientUnits\n x1: number\n y1: number\n x2: number\n y2: number\n}\n\nexport type SvgRadialGradientDescriptor = {\n kind: \"gradient\"\n type: \"radial\"\n id: string\n units: SvgGradientUnits\n cx: number\n cy: number\n r: number\n}\n\nexport type SvgStopDescriptor = {\n kind: \"stop\"\n offset: number\n color: Gdk.RGBA\n}\n\nexport type SvgNodeDescriptor =\n | SvgSvgDescriptor\n | SvgGroupDescriptor\n | SvgShapeDescriptor\n | SvgDefsDescriptor\n | SvgLinearGradientDescriptor\n | SvgRadialGradientDescriptor\n | SvgStopDescriptor\n\nconst nodeDescriptors = new WeakMap<Gtk.Widget, SvgNodeDescriptor>()\n\nexport const setSvgNodeDescriptor = (\n widget: Gtk.Widget,\n descriptor: SvgNodeDescriptor,\n): void => {\n nodeDescriptors.set(widget, descriptor)\n}\n\nexport const getSvgNodeDescriptor = (\n widget: Gtk.Widget,\n): SvgNodeDescriptor | undefined => nodeDescriptors.get(widget)\n\n// --- paint resolution ----------------------------------------------------\n\n// `parseColor` also passes CSS variables (`var(--x)`) and legacy GTK named\n// colors (`@name`) through unchanged, for the CSS-cascade styling path\n// elsewhere in this codebase. Raw Gsk paint nodes have no cascade to resolve\n// those against — deliberate cut (epic.md): SVG fill/stroke only accepts\n// static CSS colors (hex/rgb/hsl/named/transparent), not PlatformColor.\nexport const resolveSvgColor = (spec: string | undefined): Gdk.RGBA | null => {\n if (!spec) {\n return null\n }\n const normalized = parseColor(spec)\n if (\n !normalized ||\n normalized.startsWith(\"var(\") ||\n normalized.startsWith(\"@\")\n ) {\n return null\n }\n const rgba = new Gdk.RGBA()\n return rgba.parse(normalized) ? rgba : null\n}\n\nconst URL_REF_PATTERN = /^url\\(#(.+)\\)$/\n\nexport const resolveSvgPaint = (\n spec: string | undefined,\n): SvgPaintSpec | null => {\n if (!spec || spec === \"none\") {\n return null\n }\n const match = URL_REF_PATTERN.exec(spec.trim())\n if (match) {\n return { kind: \"ref\", id: match[1]! }\n }\n const rgba = resolveSvgColor(spec)\n return rgba ? { kind: \"color\", rgba } : null\n}\n\nconst scaledAlpha = (rgba: Gdk.RGBA, factor: number): Gdk.RGBA =>\n factor >= 1\n ? rgba\n : new Gdk.RGBA({\n red: rgba.red,\n green: rgba.green,\n blue: rgba.blue,\n alpha: rgba.alpha * factor,\n })\n\nconst clamp01 = (value: number): number => Math.max(0, Math.min(1, value))\n\n// --- gradients -------------------------------------------------------------\n\ntype GradientEntry = {\n descriptor: SvgLinearGradientDescriptor | SvgRadialGradientDescriptor\n stops: Gsk.ColorStop[]\n}\n\nconst makeColorStop = (offset: number, color: Gdk.RGBA): Gsk.ColorStop =>\n new Gsk.ColorStop({ offset, color })\n\nconst collectStops = (gradientWidget: Gtk.Widget): Gsk.ColorStop[] => {\n const stops: Gsk.ColorStop[] = []\n let child = gradientWidget.getFirstChild()\n while (child) {\n const descriptor = nodeDescriptors.get(child)\n if (descriptor?.kind === \"stop\") {\n stops.push(makeColorStop(descriptor.offset, descriptor.color))\n }\n child = child.getNextSibling()\n }\n return stops\n}\n\n// Only DIRECT <Defs> children of <Svg> are scanned (a deliberate simplicity\n// cut — every real react-native-svg example keeps Defs at the top).\nconst collectGradients = (root: Gtk.Widget): Map<string, GradientEntry> => {\n const gradients = new Map<string, GradientEntry>()\n let child = root.getFirstChild()\n while (child) {\n if (nodeDescriptors.get(child)?.kind === \"defs\") {\n let gradientNode = child.getFirstChild()\n while (gradientNode) {\n const descriptor = nodeDescriptors.get(gradientNode)\n if (descriptor?.kind === \"gradient\") {\n gradients.set(descriptor.id, {\n descriptor,\n stops: collectStops(gradientNode),\n })\n }\n gradientNode = gradientNode.getNextSibling()\n }\n }\n child = child.getNextSibling()\n }\n return gradients\n}\n\nconst asBoundingBox = (rect: Graphene.Rect): BoundingBox => ({\n x: rect.origin.x,\n y: rect.origin.y,\n width: rect.size.width,\n height: rect.size.height,\n})\n\nconst appendGradient = (\n snapshot: Gtk.Snapshot,\n path: Gsk.Path,\n entry: GradientEntry,\n opacity: number,\n): void => {\n if (entry.stops.length === 0) {\n return\n }\n // fillOpacity/strokeOpacity < 1 on a gradient re-builds each stop with a\n // scaled alpha.\n const stops =\n opacity >= 1\n ? entry.stops\n : entry.stops.map((stop) =>\n makeColorStop(stop.offset, scaledAlpha(stop.color, opacity)),\n )\n const [hasBounds, tightBounds] = path.getBounds()\n const bounds = hasBounds ? tightBounds : Graphene.Rect.zero()\n const box = asBoundingBox(bounds)\n const { descriptor } = entry\n\n if (descriptor.type === \"linear\") {\n const start = resolveGradientPoint(\n box,\n descriptor.x1,\n descriptor.y1,\n descriptor.units,\n )\n const end = resolveGradientPoint(\n box,\n descriptor.x2,\n descriptor.y2,\n descriptor.units,\n )\n snapshot.appendLinearGradient(\n bounds,\n new Graphene.Point(start),\n new Graphene.Point(end),\n stops,\n )\n return\n }\n\n const center = resolveGradientPoint(\n box,\n descriptor.cx,\n descriptor.cy,\n descriptor.units,\n )\n const { hradius, vradius } = resolveGradientRadius(\n box,\n descriptor.r,\n descriptor.units,\n )\n snapshot.appendRadialGradient(\n bounds,\n new Graphene.Point(center),\n hradius,\n vradius,\n 0,\n 1,\n stops,\n )\n}\n\n// --- drawing ---------------------------------------------------------------\n\nconst applyTransformOps = (\n snapshot: Gtk.Snapshot,\n ops: SvgTransformOp[],\n): void => {\n for (const op of ops) {\n switch (op.type) {\n case \"translate\":\n snapshot.translate(new Graphene.Point({ x: op.x, y: op.y }))\n break\n case \"scale\":\n snapshot.scale(op.x, op.y)\n break\n case \"rotate\":\n snapshot.rotate(op.angleDeg)\n break\n case \"matrix\":\n snapshot.transform(\n Gsk.Transform.new().matrix2d(op.a, op.b, op.c, op.d, op.e, op.f),\n )\n break\n }\n }\n}\n\nconst paintFill = (\n snapshot: Gtk.Snapshot,\n path: Gsk.Path,\n paint: SvgPaintSpec,\n opacity: number,\n fillRule: Gsk.FillRule,\n gradients: Map<string, GradientEntry>,\n): void => {\n if (paint.kind === \"color\") {\n snapshot.appendFill(path, fillRule, scaledAlpha(paint.rgba, opacity))\n return\n }\n const gradient = gradients.get(paint.id)\n if (!gradient) {\n // url(#missing-id): SVG renders nothing for that paint, not an error.\n return\n }\n snapshot.pushFill(path, fillRule)\n appendGradient(snapshot, path, gradient, opacity)\n snapshot.pop()\n}\n\nconst paintStroke = (\n snapshot: Gtk.Snapshot,\n path: Gsk.Path,\n shape: SvgShapeDescriptor,\n paint: SvgPaintSpec,\n opacity: number,\n gradients: Map<string, GradientEntry>,\n): void => {\n const stroke = Gsk.Stroke.new(shape.strokeWidth)\n stroke.setLineCap(shape.strokeLinecap)\n stroke.setLineJoin(shape.strokeLinejoin)\n stroke.setMiterLimit(shape.strokeMiterlimit)\n if (shape.strokeDasharray && shape.strokeDasharray.length > 0) {\n stroke.setDash(shape.strokeDasharray)\n stroke.setDashOffset(shape.strokeDashoffset)\n }\n if (paint.kind === \"color\") {\n snapshot.appendStroke(path, stroke, scaledAlpha(paint.rgba, opacity))\n return\n }\n const gradient = gradients.get(paint.id)\n if (!gradient) {\n return\n }\n snapshot.pushStroke(path, stroke)\n appendGradient(snapshot, path, gradient, opacity)\n snapshot.pop()\n}\n\nconst drawShape = (\n snapshot: Gtk.Snapshot,\n shape: SvgShapeDescriptor,\n gradients: Map<string, GradientEntry>,\n): void => {\n const path = shape.path\n if (!path || path.isEmpty()) {\n return\n }\n const groupOpacity = clamp01(shape.opacity)\n const needsGroup = groupOpacity < 1\n if (needsGroup) {\n snapshot.pushOpacity(groupOpacity)\n }\n if (shape.fill) {\n paintFill(\n snapshot,\n path,\n shape.fill,\n clamp01(shape.fillOpacity),\n shape.fillRule,\n gradients,\n )\n }\n if (shape.stroke && shape.strokeWidth > 0) {\n paintStroke(\n snapshot,\n path,\n shape,\n shape.stroke,\n clamp01(shape.strokeOpacity),\n gradients,\n )\n }\n if (needsGroup) {\n snapshot.pop()\n }\n}\n\nconst drawChildren = (\n snapshot: Gtk.Snapshot,\n parent: Gtk.Widget,\n gradients: Map<string, GradientEntry>,\n): void => {\n let child = parent.getFirstChild()\n while (child) {\n drawNode(snapshot, child, gradients)\n child = child.getNextSibling()\n }\n}\n\nconst drawNode = (\n snapshot: Gtk.Snapshot,\n widget: Gtk.Widget,\n gradients: Map<string, GradientEntry>,\n): void => {\n const descriptor = nodeDescriptors.get(widget)\n if (!descriptor) {\n return\n }\n switch (descriptor.kind) {\n case \"shape\":\n drawShape(snapshot, descriptor, gradients)\n return\n case \"g\": {\n const opacity = clamp01(descriptor.opacity)\n const needsOpacity = opacity < 1\n snapshot.save()\n applyTransformOps(snapshot, descriptor.transformOps)\n if (needsOpacity) {\n snapshot.pushOpacity(opacity)\n }\n drawChildren(snapshot, widget, gradients)\n if (needsOpacity) {\n snapshot.pop()\n }\n snapshot.restore()\n return\n }\n // defs/gradient/stop are resources, not paint; a nested <Svg> is not a\n // supported composition (undocumented, no-op rather than a crash).\n case \"defs\":\n case \"gradient\":\n case \"stop\":\n case \"svg\":\n return\n }\n}\n\n// --- widget registration ---------------------------------------------------\n\nlet RnGtkxSvgNodeClass: (new () => Gtk.Widget) | null = null\n\nconst ensureRegistered = (): new () => Gtk.Widget => {\n if (RnGtkxSvgNodeClass) {\n return RnGtkxSvgNodeClass\n }\n\n // Box, not a bare Widget: the reconciler only auto-attaches JSX children\n // (generic set_parent/insert_after) for widget types that carry a\n // registered \"children\" behavior, resolved by walking the GType ancestry\n // chain (@gtkx/react's typeInfoFor/buildTypeInfo). Plain GtkWidget has no\n // such behavior — only concrete container types like Box do — which is\n // also why RnGtkxViewBox (view-box.ts) is a Box subclass, not a bare\n // Widget one. GtkBox's own default BoxLayout then measures/allocates\n // these children, but harmlessly: they report a natural size of 0x0 (no\n // style, no content) and their own snapshot() no-ops for anything that\n // is not the mounted <Svg> root (see below), so nothing is ever\n // double-painted through GTK's normal child-snapshot path.\n class RnGtkxSvgNode extends Gtk.Box {\n // Only ever invoked by GTK on the mounted <Svg> root (nothing calls\n // snapshotChild() on the inert descendant instances). Defensive no-op\n // otherwise, so a stray direct call never throws.\n snapshot(snapshot: Gtk.Snapshot): void {\n const descriptor = nodeDescriptors.get(this)\n if (!descriptor || descriptor.kind !== \"svg\") {\n return\n }\n const width = this.getWidth()\n const height = this.getHeight()\n if (width <= 0 || height <= 0) {\n return\n }\n const transform = resolveViewBoxTransform(\n descriptor.viewBox,\n width,\n height,\n descriptor.preserveAspectRatio,\n )\n const gradients = collectGradients(this)\n // SVG clips to the viewport by default (no overflow:visible opt-out\n // in this API — deliberate cut, see epic.md).\n snapshot.pushClip(\n new Graphene.Rect({\n origin: new Graphene.Point({ x: 0, y: 0 }),\n size: new Graphene.Size({ width, height }),\n }),\n )\n snapshot.save()\n snapshot.translate(\n new Graphene.Point({\n x: transform.translateX,\n y: transform.translateY,\n }),\n )\n snapshot.scale(transform.scaleX, transform.scaleY)\n drawChildren(snapshot, this, gradients)\n snapshot.restore()\n snapshot.pop()\n }\n }\n // Explicit typeName: bundlers minify class names (same reasoning as\n // RnGtkxLayout/RnGtkxViewBox).\n registerClass(RnGtkxSvgNode, { typeName: \"RnGtkxSvgNode\" })\n RnGtkxSvgNodeClass = RnGtkxSvgNode\n return RnGtkxSvgNode\n}\n\ntype SvgNodeComponent = ReturnType<typeof createElementComponent>\n\nlet component: SvgNodeComponent | null = null\n\nexport const getSvgNodeComponent = (): SvgNodeComponent => {\n if (component) {\n return component\n }\n ensureRegistered()\n component = createElementComponent(\"RnGtkxSvgNode\")\n return component\n}\n\n/** Imperative invalidation channel for SVG: paint-only changes (including\n * Animated-driven ones) call this instead of queueAllocate/queueResize —\n * nothing here ever touches Yoga. */\nexport const queueSvgRedraw = (rootWidget: Gtk.Widget): void => {\n rootWidget.queueDraw()\n}\n"]}
|
|
1
|
+
{"version":3,"file":"svg-node.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/svg-node.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,gEAAgE;AAChE,2EAA2E;AAC3E,0EAA0E;AAC1E,oEAAoE;AACpE,sBAAsB;AACtB,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,oEAAoE;AACpE,wEAAwE;AACxE,6EAA6E;AAC7E,6EAA6E;AAC7E,qBAAqB;AACrB,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GAEtB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EACL,uBAAuB,GAGxB,MAAM,oBAAoB,CAAA;AA4E3B,MAAM,eAAe,GAAG,IAAI,OA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E7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAqB,EAAE;IACxD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,gBAAgB,EAAE,CAAA;IAClB,SAAS,GAAG,sBAAsB,CAAC,eAAe,CAAC,CAAA;IACnD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAED;;qCAEqC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAsB,EAAQ,EAAE;IAC7D,UAAU,CAAC,SAAS,EAAE,CAAA;AACxB,CAAC,CAAA","sourcesContent":["// RnGtkxSvgNode — one GObject class (registerClass, same mechanism as\n// RnGtkxLayout/RnGtkxViewBox) reused for the <Svg> root AND every descendant\n// (<G>, <Path>, <Rect>, ..., <Defs>, <LinearGradient>, <Stop>). Descendants\n// are ordinary GTK children (the reconciler's generic set_parent/insert_after\n// attachment — the same one View relies on) that GTK never snapshots on its\n// own, because nothing ever calls snapshotChild() on them: only the mounted\n// <Svg> instance's snapshot() vfunc actually runs, and it walks\n// getFirstChild()/getNextSibling() itself, reading each node's role from a\n// WeakMap (native wrappers get re-created by the runtime, so per-instance\n// state cannot live on `this` — same reasoning as hooksByManager in\n// layout-manager.ts).\n//\n// `Gtk.Widget`'s snapshot slot is a real, working vfunc in gtkx's codegen\n// (node_modules/@gtkx/gi/gtk/gtk.js, registerWrapperClass(Widget, ...) lists\n// it, keyed `vfuncSnapshot` since gtkx 1.0 — see the override below for why\n// the method name matters). On rc.4 it was missing from the shipped\n// `gtk.d.ts` even though the registry always had it (the type generator\n// dropped it, the codegen that actually wires vfuncs did not); 1.0 ships the\n// type too. Verified by reading the generated registry before writing any of\n// this; see epic.md.\nimport * as Gdk from \"@gtkx/gi/gdk\"\nimport * as Graphene from \"@gtkx/gi/graphene\"\nimport * as Gsk from \"@gtkx/gi/gsk\"\nimport * as Gtk from \"@gtkx/gi/gtk\"\nimport { createElementComponent } from \"@gtkx/react/internal\"\nimport { registerClass } from \"@gtkx/runtime\"\nimport { parseColor } from \"../../style/colors\"\nimport {\n resolveGradientPoint,\n resolveGradientRadius,\n type BoundingBox,\n} from \"../../svg/gradient-geometry\"\nimport type { SvgTransformOp } from \"../../svg/transform\"\nimport {\n resolveViewBoxTransform,\n type PreserveAspectRatio,\n type ViewBox,\n} from \"../../svg/view-box\"\n\n// --- descriptors --------------------------------------------------------\n\nexport type SvgPaintSpec =\n { kind: \"color\"; rgba: Gdk.RGBA } | { kind: \"ref\"; id: string }\n\nexport type SvgGradientUnits = \"objectBoundingBox\" | \"userSpaceOnUse\"\n\nexport type SvgSvgDescriptor = {\n kind: \"svg\"\n viewBox: ViewBox | null\n preserveAspectRatio: PreserveAspectRatio\n}\n\nexport type SvgGroupDescriptor = {\n kind: \"g\"\n transformOps: SvgTransformOp[]\n opacity: number\n}\n\nexport type SvgShapeDescriptor = {\n kind: \"shape\"\n path: Gsk.Path | null\n fill: SvgPaintSpec | null\n fillOpacity: number\n fillRule: Gsk.FillRule\n stroke: SvgPaintSpec | null\n strokeOpacity: number\n strokeWidth: number\n strokeLinecap: Gsk.LineCap\n strokeLinejoin: Gsk.LineJoin\n strokeMiterlimit: number\n strokeDasharray: number[] | null\n strokeDashoffset: number\n opacity: number\n}\n\nexport type SvgDefsDescriptor = { kind: \"defs\" }\n\nexport type SvgLinearGradientDescriptor = {\n kind: \"gradient\"\n type: \"linear\"\n id: string\n units: SvgGradientUnits\n x1: number\n y1: number\n x2: number\n y2: number\n}\n\nexport type SvgRadialGradientDescriptor = {\n kind: \"gradient\"\n type: \"radial\"\n id: string\n units: SvgGradientUnits\n cx: number\n cy: number\n r: number\n}\n\nexport type SvgStopDescriptor = {\n kind: \"stop\"\n offset: number\n color: Gdk.RGBA\n}\n\nexport type SvgNodeDescriptor =\n | SvgSvgDescriptor\n | SvgGroupDescriptor\n | SvgShapeDescriptor\n | SvgDefsDescriptor\n | SvgLinearGradientDescriptor\n | SvgRadialGradientDescriptor\n | SvgStopDescriptor\n\nconst nodeDescriptors = new WeakMap<Gtk.Widget, SvgNodeDescriptor>()\n\nexport const setSvgNodeDescriptor = (\n widget: Gtk.Widget,\n descriptor: SvgNodeDescriptor,\n): void => {\n nodeDescriptors.set(widget, descriptor)\n}\n\nexport const getSvgNodeDescriptor = (\n widget: Gtk.Widget,\n): SvgNodeDescriptor | undefined => nodeDescriptors.get(widget)\n\n// --- paint resolution ----------------------------------------------------\n\n// `parseColor` also passes CSS variables (`var(--x)`) and legacy GTK named\n// colors (`@name`) through unchanged, for the CSS-cascade styling path\n// elsewhere in this codebase. Raw Gsk paint nodes have no cascade to resolve\n// those against — deliberate cut (epic.md): SVG fill/stroke only accepts\n// static CSS colors (hex/rgb/hsl/named/transparent), not PlatformColor.\nexport const resolveSvgColor = (spec: string | undefined): Gdk.RGBA | null => {\n if (!spec) {\n return null\n }\n const normalized = parseColor(spec)\n if (\n !normalized ||\n normalized.startsWith(\"var(\") ||\n normalized.startsWith(\"@\")\n ) {\n return null\n }\n const rgba = new Gdk.RGBA()\n return rgba.parse(normalized) ? rgba : null\n}\n\nconst URL_REF_PATTERN = /^url\\(#(.+)\\)$/\n\nexport const resolveSvgPaint = (\n spec: string | undefined,\n): SvgPaintSpec | null => {\n if (!spec || spec === \"none\") {\n return null\n }\n const match = URL_REF_PATTERN.exec(spec.trim())\n if (match) {\n return { kind: \"ref\", id: match[1]! }\n }\n const rgba = resolveSvgColor(spec)\n return rgba ? { kind: \"color\", rgba } : null\n}\n\nconst scaledAlpha = (rgba: Gdk.RGBA, factor: number): Gdk.RGBA =>\n factor >= 1\n ? rgba\n : new Gdk.RGBA({\n red: rgba.red,\n green: rgba.green,\n blue: rgba.blue,\n alpha: rgba.alpha * factor,\n })\n\nconst clamp01 = (value: number): number => Math.max(0, Math.min(1, value))\n\n// --- gradients -------------------------------------------------------------\n\ntype GradientEntry = {\n descriptor: SvgLinearGradientDescriptor | SvgRadialGradientDescriptor\n stops: Gsk.ColorStop[]\n}\n\nconst makeColorStop = (offset: number, color: Gdk.RGBA): Gsk.ColorStop =>\n new Gsk.ColorStop({ offset, color })\n\nconst collectStops = (gradientWidget: Gtk.Widget): Gsk.ColorStop[] => {\n const stops: Gsk.ColorStop[] = []\n let child = gradientWidget.getFirstChild()\n while (child) {\n const descriptor = nodeDescriptors.get(child)\n if (descriptor?.kind === \"stop\") {\n stops.push(makeColorStop(descriptor.offset, descriptor.color))\n }\n child = child.getNextSibling()\n }\n return stops\n}\n\n// Only DIRECT <Defs> children of <Svg> are scanned (a deliberate simplicity\n// cut — every real react-native-svg example keeps Defs at the top).\nconst collectGradients = (root: Gtk.Widget): Map<string, GradientEntry> => {\n const gradients = new Map<string, GradientEntry>()\n let child = root.getFirstChild()\n while (child) {\n if (nodeDescriptors.get(child)?.kind === \"defs\") {\n let gradientNode = child.getFirstChild()\n while (gradientNode) {\n const descriptor = nodeDescriptors.get(gradientNode)\n if (descriptor?.kind === \"gradient\") {\n gradients.set(descriptor.id, {\n descriptor,\n stops: collectStops(gradientNode),\n })\n }\n gradientNode = gradientNode.getNextSibling()\n }\n }\n child = child.getNextSibling()\n }\n return gradients\n}\n\nconst asBoundingBox = (rect: Graphene.Rect): BoundingBox => ({\n x: rect.origin.x,\n y: rect.origin.y,\n width: rect.size.width,\n height: rect.size.height,\n})\n\nconst appendGradient = (\n snapshot: Gtk.Snapshot,\n path: Gsk.Path,\n entry: GradientEntry,\n opacity: number,\n): void => {\n if (entry.stops.length === 0) {\n return\n }\n // fillOpacity/strokeOpacity < 1 on a gradient re-builds each stop with a\n // scaled alpha.\n const stops =\n opacity >= 1\n ? entry.stops\n : entry.stops.map((stop) =>\n makeColorStop(stop.offset, scaledAlpha(stop.color, opacity)),\n )\n const [hasBounds, tightBounds] = path.getBounds()\n const bounds = hasBounds ? tightBounds : Graphene.Rect.zero()\n const box = asBoundingBox(bounds)\n const { descriptor } = entry\n\n if (descriptor.type === \"linear\") {\n const start = resolveGradientPoint(\n box,\n descriptor.x1,\n descriptor.y1,\n descriptor.units,\n )\n const end = resolveGradientPoint(\n box,\n descriptor.x2,\n descriptor.y2,\n descriptor.units,\n )\n snapshot.appendLinearGradient(\n bounds,\n new Graphene.Point(start),\n new Graphene.Point(end),\n stops,\n )\n return\n }\n\n const center = resolveGradientPoint(\n box,\n descriptor.cx,\n descriptor.cy,\n descriptor.units,\n )\n const { hradius, vradius } = resolveGradientRadius(\n box,\n descriptor.r,\n descriptor.units,\n )\n snapshot.appendRadialGradient(\n bounds,\n new Graphene.Point(center),\n hradius,\n vradius,\n 0,\n 1,\n stops,\n )\n}\n\n// --- drawing ---------------------------------------------------------------\n\nconst applyTransformOps = (\n snapshot: Gtk.Snapshot,\n ops: SvgTransformOp[],\n): void => {\n for (const op of ops) {\n switch (op.type) {\n case \"translate\":\n snapshot.translate(new Graphene.Point({ x: op.x, y: op.y }))\n break\n case \"scale\":\n snapshot.scale(op.x, op.y)\n break\n case \"rotate\":\n snapshot.rotate(op.angleDeg)\n break\n case \"matrix\":\n snapshot.transform(\n Gsk.Transform.new().matrix2d(op.a, op.b, op.c, op.d, op.e, op.f),\n )\n break\n }\n }\n}\n\nconst paintFill = (\n snapshot: Gtk.Snapshot,\n path: Gsk.Path,\n paint: SvgPaintSpec,\n opacity: number,\n fillRule: Gsk.FillRule,\n gradients: Map<string, GradientEntry>,\n): void => {\n if (paint.kind === \"color\") {\n snapshot.appendFill(path, fillRule, scaledAlpha(paint.rgba, opacity))\n return\n }\n const gradient = gradients.get(paint.id)\n if (!gradient) {\n // url(#missing-id): SVG renders nothing for that paint, not an error.\n return\n }\n snapshot.pushFill(path, fillRule)\n appendGradient(snapshot, path, gradient, opacity)\n snapshot.pop()\n}\n\nconst paintStroke = (\n snapshot: Gtk.Snapshot,\n path: Gsk.Path,\n shape: SvgShapeDescriptor,\n paint: SvgPaintSpec,\n opacity: number,\n gradients: Map<string, GradientEntry>,\n): void => {\n const stroke = Gsk.Stroke.new(shape.strokeWidth)\n stroke.setLineCap(shape.strokeLinecap)\n stroke.setLineJoin(shape.strokeLinejoin)\n stroke.setMiterLimit(shape.strokeMiterlimit)\n if (shape.strokeDasharray && shape.strokeDasharray.length > 0) {\n stroke.setDash(shape.strokeDasharray)\n stroke.setDashOffset(shape.strokeDashoffset)\n }\n if (paint.kind === \"color\") {\n snapshot.appendStroke(path, stroke, scaledAlpha(paint.rgba, opacity))\n return\n }\n const gradient = gradients.get(paint.id)\n if (!gradient) {\n return\n }\n snapshot.pushStroke(path, stroke)\n appendGradient(snapshot, path, gradient, opacity)\n snapshot.pop()\n}\n\nconst drawShape = (\n snapshot: Gtk.Snapshot,\n shape: SvgShapeDescriptor,\n gradients: Map<string, GradientEntry>,\n): void => {\n const path = shape.path\n if (!path || path.isEmpty()) {\n return\n }\n const groupOpacity = clamp01(shape.opacity)\n const needsGroup = groupOpacity < 1\n if (needsGroup) {\n snapshot.pushOpacity(groupOpacity)\n }\n if (shape.fill) {\n paintFill(\n snapshot,\n path,\n shape.fill,\n clamp01(shape.fillOpacity),\n shape.fillRule,\n gradients,\n )\n }\n if (shape.stroke && shape.strokeWidth > 0) {\n paintStroke(\n snapshot,\n path,\n shape,\n shape.stroke,\n clamp01(shape.strokeOpacity),\n gradients,\n )\n }\n if (needsGroup) {\n snapshot.pop()\n }\n}\n\nconst drawChildren = (\n snapshot: Gtk.Snapshot,\n parent: Gtk.Widget,\n gradients: Map<string, GradientEntry>,\n): void => {\n let child = parent.getFirstChild()\n while (child) {\n drawNode(snapshot, child, gradients)\n child = child.getNextSibling()\n }\n}\n\nconst drawNode = (\n snapshot: Gtk.Snapshot,\n widget: Gtk.Widget,\n gradients: Map<string, GradientEntry>,\n): void => {\n const descriptor = nodeDescriptors.get(widget)\n if (!descriptor) {\n return\n }\n switch (descriptor.kind) {\n case \"shape\":\n drawShape(snapshot, descriptor, gradients)\n return\n case \"g\": {\n const opacity = clamp01(descriptor.opacity)\n const needsOpacity = opacity < 1\n snapshot.save()\n applyTransformOps(snapshot, descriptor.transformOps)\n if (needsOpacity) {\n snapshot.pushOpacity(opacity)\n }\n drawChildren(snapshot, widget, gradients)\n if (needsOpacity) {\n snapshot.pop()\n }\n snapshot.restore()\n return\n }\n // defs/gradient/stop are resources, not paint; a nested <Svg> is not a\n // supported composition (undocumented, no-op rather than a crash).\n case \"defs\":\n case \"gradient\":\n case \"stop\":\n case \"svg\":\n return\n }\n}\n\n// --- widget registration ---------------------------------------------------\n\nlet RnGtkxSvgNodeClass: (new () => Gtk.Widget) | null = null\n\nconst ensureRegistered = (): new () => Gtk.Widget => {\n if (RnGtkxSvgNodeClass) {\n return RnGtkxSvgNodeClass\n }\n\n // Box, not a bare Widget: the reconciler only auto-attaches JSX children\n // (generic set_parent/insert_after) for widget types that carry a\n // registered \"children\" behavior, resolved by walking the GType ancestry\n // chain (@gtkx/react's typeInfoFor/buildTypeInfo). Plain GtkWidget has no\n // such behavior — only concrete container types like Box do — which is\n // also why RnGtkxViewBox (view-box.ts) is a Box subclass, not a bare\n // Widget one. GtkBox's own default BoxLayout then measures/allocates\n // these children, but harmlessly: they report a natural size of 0x0 (no\n // style, no content) and their own snapshot() no-ops for anything that\n // is not the mounted <Svg> root (see below), so nothing is ever\n // double-painted through GTK's normal child-snapshot path.\n // gtkx 1.0 renamed Widget's vtable override slot from `snapshot` to\n // `vfuncSnapshot` (verified against node_modules/@gtkx/gi/gtk/gtk.d.ts and\n // gtk.js's registerWrapperClass(Widget, ...) registry — see\n // layout-manager.ts's RnGtkxLayout for the full mechanism writeup: a plain\n // `snapshot` override here would silently never reach the vtable).\n class RnGtkxSvgNode extends Gtk.Box {\n // Only ever invoked by GTK on the mounted <Svg> root (nothing calls\n // snapshotChild() on the inert descendant instances). Defensive no-op\n // otherwise, so a stray direct call never throws.\n override vfuncSnapshot(snapshot: Gtk.Snapshot): void {\n const descriptor = nodeDescriptors.get(this)\n if (!descriptor || descriptor.kind !== \"svg\") {\n return\n }\n const width = this.getWidth()\n const height = this.getHeight()\n if (width <= 0 || height <= 0) {\n return\n }\n const transform = resolveViewBoxTransform(\n descriptor.viewBox,\n width,\n height,\n descriptor.preserveAspectRatio,\n )\n const gradients = collectGradients(this)\n // SVG clips to the viewport by default (no overflow:visible opt-out\n // in this API — deliberate cut, see epic.md).\n snapshot.pushClip(\n new Graphene.Rect({\n origin: new Graphene.Point({ x: 0, y: 0 }),\n size: new Graphene.Size({ width, height }),\n }),\n )\n snapshot.save()\n snapshot.translate(\n new Graphene.Point({\n x: transform.translateX,\n y: transform.translateY,\n }),\n )\n snapshot.scale(transform.scaleX, transform.scaleY)\n drawChildren(snapshot, this, gradients)\n snapshot.restore()\n snapshot.pop()\n }\n }\n // Explicit typeName: bundlers minify class names (same reasoning as\n // RnGtkxLayout/RnGtkxViewBox).\n registerClass(RnGtkxSvgNode, { typeName: \"RnGtkxSvgNode\" })\n RnGtkxSvgNodeClass = RnGtkxSvgNode\n return RnGtkxSvgNode\n}\n\ntype SvgNodeComponent = ReturnType<typeof createElementComponent>\n\nlet component: SvgNodeComponent | null = null\n\nexport const getSvgNodeComponent = (): SvgNodeComponent => {\n if (component) {\n return component\n }\n ensureRegistered()\n component = createElementComponent(\"RnGtkxSvgNode\")\n return component\n}\n\n/** Imperative invalidation channel for SVG: paint-only changes (including\n * Animated-driven ones) call this instead of queueAllocate/queueResize —\n * nothing here ever touches Yoga. */\nexport const queueSvgRedraw = (rootWidget: Gtk.Widget): void => {\n rootWidget.queueDraw()\n}\n"]}
|
|
@@ -369,8 +369,19 @@ export const getViewBoxComponent = () => {
|
|
|
369
369
|
if (component) {
|
|
370
370
|
return component;
|
|
371
371
|
}
|
|
372
|
+
// gtkx 1.0 renamed Widget's vtable override slots to `vfunc`-prefixed
|
|
373
|
+
// methods (vfuncContains/vfuncSnapshot below — was contains/snapshot on
|
|
374
|
+
// rc.4, verified against node_modules/@gtkx/gi/gtk/gtk.d.ts and gtk.js's
|
|
375
|
+
// registerWrapperClass(Widget, ...) registry). registerClass() discovers
|
|
376
|
+
// overrides by exact method-name match, so the old names would silently
|
|
377
|
+
// stop being wired into the vtable rather than erroring — see
|
|
378
|
+
// layout-manager.ts's RnGtkxLayout for the full mechanism writeup (that
|
|
379
|
+
// one was the blank-content-pane root cause; this class's contains/
|
|
380
|
+
// snapshot were the same latent break, just not the one that broke
|
|
381
|
+
// rendering outright since GtkBox's own default snapshot still walks
|
|
382
|
+
// children in order).
|
|
372
383
|
class RnGtkxViewBox extends Gtk.Box {
|
|
373
|
-
|
|
384
|
+
vfuncContains(x, y) {
|
|
374
385
|
if (passthrough.has(this)) {
|
|
375
386
|
return false;
|
|
376
387
|
}
|
|
@@ -395,14 +406,12 @@ export const getViewBoxComponent = () => {
|
|
|
395
406
|
}
|
|
396
407
|
// GTK's own container snapshot is `gtk_widget_real_snapshot`, which walks
|
|
397
408
|
// first-to-last calling gtk_widget_snapshot_child — the loop below with
|
|
398
|
-
// nothing in front of it
|
|
399
|
-
// (
|
|
400
|
-
//
|
|
401
|
-
//
|
|
402
|
-
//
|
|
403
|
-
|
|
404
|
-
// missing from the shipped gtk.d.ts (same as in svg-node.ts).
|
|
405
|
-
snapshot(snapshot) {
|
|
409
|
+
// nothing in front of it reproduces that rather than delegating to it.
|
|
410
|
+
// (1.0's gtk.d.ts now types a chain-up path, `super.vfuncSnapshot()`,
|
|
411
|
+
// which would reach GtkBox's own default — untested here and out of
|
|
412
|
+
// this fix's scope; the manual loop below is unchanged and still
|
|
413
|
+
// correct, just renamed to the 1.0 vfunc slot.)
|
|
414
|
+
vfuncSnapshot(snapshot) {
|
|
406
415
|
if (raisedCount !== 0) {
|
|
407
416
|
const order = paintOrderFor(this);
|
|
408
417
|
if (order !== null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-box.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/view-box.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4EAA4E;AAC5E,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,4EAA4E;AAC5E,+DAA+D;AAC/D,EAAE;AACF,4EAA4E;AAC5E,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AAG,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;YACxC,IAAI,CAAC,MAAM,IAAI,WAAW,KAAK,CAAC,EAAE,CAAC;gBACjC,OAAO,MAAM,CAAA;YACf,CAAC;YACD,sEAAsE;YACtE,uCAAuC;YACvC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;QAChC,CAAC;QAED,0EAA0E;QAC1E,wEAAwE;QACxE,sEAAsE;QACtE,iEAAiE;QACjE,sEAAsE;QACtE,8CAA8C;QAC9C,EAAE;QACF,qEAAqE;QACrE,8DAA8D;QAC9D,QAAQ,CAAC,QAAsB;YAC7B,IAAI,WAAW,KAAK,CAAC,EAAE,CAAC;gBACtB,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;gBACjC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;oBACnB,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC;wBAC1B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;oBACrC,CAAC;oBACD,OAAM;gBACR,CAAC;YACH,CAAC;YACD,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrC,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;YACrC,CAAC;QACH,CAAC;KACF;IACD,kDAAkD;IAClD,aAAa,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAA;IAC3D,SAAS,GAAG,sBAAsB,CAAC,eAAe,CAAC,CAAA;IACnD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA","sourcesContent":["// RnGtkxViewBox — the GtkBox subclass every View renders — and the whole of\n// RN's pointerEvents, which is a picking question and therefore lives here.\n//\n// Two of the four modes are the box's own contains(): \"box-none\" makes it\n// invisible to GTK's pick while its children stay pickable, and hitSlop\n// grows the rect the check uses. The other two are can-target on the widget\n// (\"none\", the whole subtree) or on its children (\"box-only\").\n//\n// can-target is a single boolean per widget and TWO things want to write it\n// — the widget's own pointerEvents, and a box-only ancestor masking it — so\n// neither may write it directly. `setPointerTarget` records what the\n// widget's own prop wants and applies the combination; the mask is derived\n// from the live parent every time, so a widget that React moves elsewhere\n// cannot end up stuck untargetable. Blanket-restoring children to `true` is\n// what made nesting a pointerEvents inside a box-only view unsupported\n// before: the restore pass could not know that a child wanted to be\n// untargetable for its own reasons.\n//\n// `zIndex` is the other half of the same subject and lives here for the same\n// reason: RN's z-order is a PAINT order and a PICK order, and this widget is\n// the only thing that owns both. See the block above the zIndex section below.\n//\n// Registered lazily like RnGtkxLayout (registration needs GObject, class\n// identity must exist before the first instance).\nimport * as Graphene from \"@gtkx/gi/graphene\"\nimport * as Gtk from \"@gtkx/gi/gtk\"\nimport { createElementComponent } from \"@gtkx/react/internal\"\nimport { registerClass } from \"@gtkx/runtime\"\n\nconst passthrough = new WeakSet<object>()\n/** Widgets whose DIRECT children are masked — RN's pointerEvents=\"box-only\". */\nconst boxOnly = new WeakSet<object>()\n/** What each widget's own pointerEvents wants, before any mask. */\nconst ownTarget = new WeakMap<object, boolean>()\n\nexport type HitSlop = {\n top: number\n right: number\n bottom: number\n left: number\n}\n\nconst hitSlops = new WeakMap<object, HitSlop>()\n\n/** box-none toggle: picking consults this live, no invalidation needed. */\nexport const setBoxPassthrough = (\n widget: Gtk.Widget,\n enabled: boolean,\n): void => {\n if (enabled) {\n passthrough.add(widget)\n } else {\n passthrough.delete(widget)\n }\n}\n\n/**\n * Grows the rect this widget's contains() accepts. Only RnGtkxViewBox\n * consults it — RN's hitSlop is a picking change and nothing in JS can\n * substitute for one, because a press outside the widget is never delivered\n * to it in the first place.\n */\nexport const setHitSlop = (widget: Gtk.Widget, slop: HitSlop | null): void => {\n if (slop === null) {\n hitSlops.delete(widget)\n } else {\n hitSlops.set(widget, slop)\n }\n}\n\nconst isMasked = (widget: Gtk.Widget): boolean => {\n const parent = widget.getParent()\n return parent !== null && boxOnly.has(parent)\n}\n\nconst applyTarget = (widget: Gtk.Widget): void => {\n widget.setCanTarget(!isMasked(widget) && (ownTarget.get(widget) ?? true))\n}\n\n/**\n * What this widget's own `pointerEvents` wants its can-target to be. A\n * box-only ancestor still overrides it, and stops overriding it the moment\n * the ancestor's mode changes — without either of them having to know about\n * the other.\n */\nexport const setPointerTarget = (\n widget: Gtk.Widget,\n targetable: boolean,\n): void => {\n ownTarget.set(widget, targetable)\n applyTarget(widget)\n}\n\n/**\n * Masks or unmasks a widget's direct children — RN's\n * pointerEvents=\"box-only\". Re-applied every commit rather than only on\n * change, because the child set moves with the renders.\n */\nexport const setBoxOnly = (widget: Gtk.Widget, enabled: boolean): void => {\n if (enabled) {\n boxOnly.add(widget)\n } else {\n boxOnly.delete(widget)\n }\n for (\n let child = widget.getFirstChild();\n child !== null;\n child = child.getNextSibling()\n ) {\n applyTarget(child)\n }\n}\n\n// --- zIndex ---------------------------------------------------------------\n//\n// RN's `zIndex` reorders PAINT among siblings. GTK4 paints a container's\n// children in child order and has no z-order property, so the obvious fix —\n// reorder the widgets — is the wrong one: widget order is the order this\n// platform keeps its shadow tree in sync with (`syncChildOrder` in\n// components/use-layout-child.ts), so restacking for paint would silently\n// restack the LAYOUT.\n//\n// Paint order and layout order do not have to be the same, though, and we own\n// the widget: `allocate` stays in Yoga's order and `snapshot` walks the\n// children in zIndex order instead. That is what Android does too\n// (`ViewGroup.getChildDrawingOrder`) and for the same reason.\n//\n// The half that is easy to miss is that `gtk_widget_pick()` descends in\n// REVERSE child order, so sorting the paint alone leaves a raised view drawn\n// on top and still unclickable. GTK4 has no `pick` vfunc (GtkWidgetClass's\n// public vtable ends at `contains`, verified against gtk 4.22's header and\n// gtkx's generated registry), and the only per-point hook it offers is\n// `contains()` — which is exactly the vfunc this file already overrides. So\n// picking is made to agree by having a covered widget answer \"not me\" where a\n// higher-painting sibling of one of its ancestors would answer instead.\n//\n// Everything below is behind `raisedCount`, which is 0 in every app that never\n// writes the style: one integer comparison, and both vfuncs take the path they\n// took before any of this existed.\n\n/** Non-zero zIndex per widget. Absent means 0, which is RN's default. */\nconst zIndexes = new WeakMap<Gtk.Widget, number>()\n\n/**\n * How many widgets in the process currently carry a non-zero `zIndex`.\n *\n * The fast path's whole guard. `snapshot()` and `contains()` read this first,\n * so a tree that never raises anything pays one integer comparison per call\n * and no allocation, no sort, and no per-child work beyond what GTK's own\n * snapshot does.\n */\nlet raisedCount = 0\n\n/**\n * Cached paint order per container: an array in paint order, or `null` for\n * \"plain child order, nothing to do\". Recomputed on change (a zIndex write, a\n * commit that touched the container's children) rather than per snapshot —\n * `useSortable` puts `zIndex` in its style object every frame but changes its\n * VALUE about twice per drag.\n */\nconst paintOrders = new WeakMap<Gtk.Widget, Gtk.Widget[] | null>()\n\n/**\n * The container's live children, in child order, as the LAST ALLOCATE PASS\n * walked them.\n *\n * The snapshot vfunc has to visit every child either way, and walking the\n * sibling chain from JS is what costs: each `getNextSibling()` mints a fresh\n * native wrapper, measured at 1.9 µs per child against 1.0 µs for the\n * `snapshotChild()` that follows it (docs/research/z-index.md). The container's\n * `allocate()` hook already walks exactly this chain, so it hands the array\n * over instead and the paint pass reuses it.\n *\n * Safe because a child cannot appear, disappear or move without queueing a\n * resize on this container, and GTK runs the layout phase before the paint\n * phase — so an allocate always lands between a change and the snapshot that\n * would see it. A container whose allocate never ran (no RnGtkxLayout, e.g. a\n * bare slot host) simply has no entry, and the vfunc walks live.\n */\nconst childOrders = new WeakMap<Gtk.Widget, Gtk.Widget[]>()\n\nconst sameChildren = (a: Gtk.Widget[], b: Gtk.Widget[]): boolean => {\n if (a.length !== b.length) {\n return false\n }\n for (let index = 0; index < a.length; index += 1) {\n if (a[index] !== b[index]) {\n return false\n }\n }\n return true\n}\n\n/**\n * Publishes the child list the container's allocate pass just walked.\n *\n * Cheap on the hot path by construction: the array is one the caller built\n * anyway, and the paint order is only invalidated when the children actually\n * differ — an allocate for a pure move (which is most of them, one per\n * animated frame) leaves the cached sort alone.\n */\nexport const cacheChildOrder = (\n container: Gtk.Widget,\n children: Gtk.Widget[],\n): void => {\n const previous = childOrders.get(container)\n childOrders.set(container, children)\n if (previous === undefined || !sameChildren(previous, children)) {\n paintOrders.delete(container)\n }\n}\n\n/** Containers known to hold at least one raised child, for the picking walk. */\nconst zOrderedParents = new WeakSet<Gtk.Widget>()\n\n/**\n * Widgets that paint but are not touch targets of their own: the GtkLabel a\n * `Text` renders and the GtkPicture an `Image` renders. Neither component has\n * a press prop, so nothing is ever attached to them — but GTK targets them by\n * default, and `gtk_widget_pick()` reaches a child BEFORE it asks the parent's\n * `contains()`. That is the one hole in the occlusion check below: a covered\n * `View` can answer \"not me\", a bare GtkLabel inside it cannot.\n *\n * So while a container has a raised child, the paint-only leaves under it are\n * made untargetable and the pick lands on their nearest `View` instead — which\n * is the same widget the press would have propagated to anyway, and which does\n * answer the occlusion question. Restored the moment nothing is raised there,\n * because it is not free of consequence: `pointerEvents: \"box-none\"` on a View\n * whose only child is a `Text` would otherwise fall through to whatever is\n * behind it. Documented in docs/reference/components/index.md.\n */\nconst paintOnlyLeaves = new WeakSet<Gtk.Widget>()\n\n/**\n * Marks a widget as painting-only for picking purposes — see above. Called\n * once per widget by the components that own one (`Text`, `Image`).\n */\nexport const setPaintOnlyLeaf = (widget: Gtk.Widget): void => {\n paintOnlyLeaves.add(widget)\n}\n\nconst applyLeafTargeting = (container: Gtk.Widget, suppress: boolean): void => {\n for (\n let child = container.getFirstChild();\n child !== null;\n child = child.getNextSibling()\n ) {\n if (paintOnlyLeaves.has(child)) {\n setPointerTarget(child, !suppress)\n }\n // A nested container that is STILL raised keeps its own suppression: an\n // outer container coming back down must not restore leaves an inner one\n // is relying on.\n if (suppress || !zOrderedParents.has(child)) {\n applyLeafTargeting(child, suppress)\n }\n }\n}\n\n/**\n * Drops a container's cached paint order and asks for a redraw.\n *\n * Called from the zIndex writer and from the container's per-commit effect\n * (components/use-layout-child.ts), which is what covers a child mounting,\n * unmounting or being MOVED by React — the three ways the order can change\n * without any zIndex being written.\n */\nexport const invalidateZOrder = (container: Gtk.Widget): void => {\n // The child list too: a commit is the one thing that can change it, and the\n // allocate the commit queues puts a fresh one back before the next paint.\n childOrders.delete(container)\n if (!paintOrders.delete(container)) {\n return\n }\n container.queueDraw()\n if (zOrderedParents.has(container)) {\n // Recomputed now rather than at the next snapshot, for the same reason\n // setZIndex does it: a container that just lost its last raised child\n // (the commit that unmounted it) would otherwise never be asked again —\n // the fast path stops calling paintOrderFor once nothing is raised — and\n // would keep its paint-only leaves untargetable forever.\n paintOrderFor(container)\n }\n}\n\n/**\n * RN's `zIndex` for one child. `0` (the default, and `undefined`) clears it.\n *\n * RN applies `zIndex` unconditionally — unlike CSS, which ignores `z-index`\n * on a `position: static` box. Nothing here looks at `position` either.\n */\nexport const setZIndex = (widget: Gtk.Widget, value: number): void => {\n const previous = zIndexes.get(widget) ?? 0\n if (previous === value) {\n return\n }\n if (value === 0) {\n zIndexes.delete(widget)\n raisedCount -= 1\n } else {\n zIndexes.set(widget, value)\n if (previous === 0) {\n raisedCount += 1\n }\n }\n const parent = widget.getParent()\n if (parent === null) {\n return\n }\n paintOrders.delete(parent)\n // Unconditional, unlike invalidateZOrder's: the container may never have\n // had a cache to drop and its paint still just changed.\n parent.queueDraw()\n if (value === 0) {\n // Recomputed eagerly on the way DOWN, never lazily: once nothing is\n // raised the fast path stops calling paintOrderFor at all, so a container\n // that lost its last raised child would never get the chance to undo what\n // being raised did to it (paint order, leaf targeting).\n paintOrderFor(parent)\n }\n}\n\n/** The container's children, from the allocate pass if it has run. */\nconst childrenOf = (container: Gtk.Widget): Gtk.Widget[] => {\n const cached = childOrders.get(container)\n if (cached !== undefined) {\n return cached\n }\n const children: Gtk.Widget[] = []\n for (\n let child = container.getFirstChild();\n child !== null;\n child = child.getNextSibling()\n ) {\n children.push(child)\n }\n return children\n}\n\nconst paintOrderFor = (container: Gtk.Widget): Gtk.Widget[] | null => {\n if (paintOrders.has(container)) {\n return paintOrders.get(container) ?? null\n }\n const children = childrenOf(container)\n let raised = false\n for (const child of children) {\n if (zIndexes.has(child)) {\n raised = true\n break\n }\n }\n let order: Gtk.Widget[] | null = null\n if (raised) {\n zOrderedParents.add(container)\n // Once per recompute, not per frame, and only for a container that\n // actually has something raised: the walk is what catches a `Text` that\n // mounted into an already-raised container since the last one.\n applyLeafTargeting(container, true)\n // Stable by construction. RN keeps document order among equal zIndexes,\n // and an unstable sort would let equal siblings swap between frames —\n // flicker that is miserable to attribute. `Array.prototype.sort` has been\n // required to be stable since ES2019; the index tiebreak makes that\n // independent of the engine rather than assumed of it.\n order = children\n .map((widget, index) => ({\n widget,\n index,\n z: zIndexes.get(widget) ?? 0,\n }))\n .sort((a, b) => a.z - b.z || a.index - b.index)\n .map((entry) => entry.widget)\n } else if (zOrderedParents.delete(container)) {\n applyLeafTargeting(container, false)\n }\n paintOrders.set(container, order)\n return order\n}\n\n/**\n * Whether a higher-painting sibling of this widget — or of any of its\n * ancestors — would take the pick at this point.\n *\n * `pick()` on the sibling rather than a bounds test, because \"would GTK have\n * answered inside that subtree\" IS the question, and it comes with the rest of\n * RN's rules for free: a raised view with `pointerEvents: \"none\"` is not\n * targetable, so it does not occlude either.\n *\n * The recursion terminates because it only ever asks about siblings STRICTLY\n * higher in the same container's paint order.\n */\nconst isOccluded = (widget: Gtk.Widget, x: number, y: number): boolean => {\n let child = widget\n let parent = child.getParent()\n while (parent !== null) {\n if (zOrderedParents.has(parent)) {\n const order = paintOrderFor(parent)\n if (order !== null) {\n const index = order.indexOf(child)\n for (let above = index + 1; above < order.length; above += 1) {\n const sibling = order[above]!\n const [ok, point] = widget.computePoint(\n sibling,\n new Graphene.Point({ x, y }),\n )\n if (\n ok &&\n sibling.pick(point.x, point.y, Gtk.PickFlags.DEFAULT) !== null\n ) {\n return true\n }\n }\n }\n }\n child = parent\n parent = child.getParent()\n }\n return false\n}\n\ntype ViewBoxComponent = ReturnType<typeof createElementComponent>\n\nlet component: ViewBoxComponent | null = null\n\nexport const getViewBoxComponent = (): ViewBoxComponent => {\n if (component) {\n return component\n }\n\n class RnGtkxViewBox extends Gtk.Box {\n override contains(x: number, y: number): boolean {\n if (passthrough.has(this)) {\n return false\n }\n // GTK translates the point into this widget's coordinates before\n // asking, and does not pre-check the bounds, so a negative x or a y\n // past the height is a legitimate question — which is what lets\n // hitSlop answer yes to it.\n const slop = hitSlops.get(this)\n const inside =\n slop === undefined\n ? // The default widget behavior: inside the widget's own bounds.\n x >= 0 && y >= 0 && x < this.getWidth() && y < this.getHeight()\n : x >= -slop.left &&\n y >= -slop.top &&\n x < this.getWidth() + slop.right &&\n y < this.getHeight() + slop.bottom\n if (!inside || raisedCount === 0) {\n return inside\n }\n // Something in this process is raised: this widget only answers where\n // nothing painted above it would have.\n return !isOccluded(this, x, y)\n }\n\n // GTK's own container snapshot is `gtk_widget_real_snapshot`, which walks\n // first-to-last calling gtk_widget_snapshot_child — the loop below with\n // nothing in front of it. There is no way to chain up to it from here\n // (gtkx installs the vfunc but exposes no parent-class call, and\n // gtk_widget_snapshot() is not public C API either), so the fast path\n // reproduces it rather than delegating to it.\n //\n // No `override`: `snapshot` is a real vfunc in gtkx's codegen but is\n // missing from the shipped gtk.d.ts (same as in svg-node.ts).\n snapshot(snapshot: Gtk.Snapshot): void {\n if (raisedCount !== 0) {\n const order = paintOrderFor(this)\n if (order !== null) {\n for (const child of order) {\n this.snapshotChild(child, snapshot)\n }\n return\n }\n }\n for (const child of childrenOf(this)) {\n this.snapshotChild(child, snapshot)\n }\n }\n }\n // Explicit typeName: bundlers minify class names.\n registerClass(RnGtkxViewBox, { typeName: \"RnGtkxViewBox\" })\n component = createElementComponent(\"RnGtkxViewBox\")\n return component\n}\n"]}
|
|
1
|
+
{"version":3,"file":"view-box.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/view-box.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4EAA4E;AAC5E,EAAE;AACF,0EAA0E;AA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OAAO,SAAS,CAAA;AAClB,CAAC,CAAA","sourcesContent":["// RnGtkxViewBox — the GtkBox subclass every View renders — and the whole of\n// RN's pointerEvents, which is a picking question and therefore lives here.\n//\n// Two of the four modes are the box's own contains(): \"box-none\" makes it\n// invisible to GTK's pick while its children stay pickable, and hitSlop\n// grows the rect the check uses. The other two are can-target on the widget\n// (\"none\", the whole subtree) or on its children (\"box-only\").\n//\n// can-target is a single boolean per widget and TWO things want to write it\n// — the widget's own pointerEvents, and a box-only ancestor masking it — so\n// neither may write it directly. `setPointerTarget` records what the\n// widget's own prop wants and applies the combination; the mask is derived\n// from the live parent every time, so a widget that React moves elsewhere\n// cannot end up stuck untargetable. Blanket-restoring children to `true` is\n// what made nesting a pointerEvents inside a box-only view unsupported\n// before: the restore pass could not know that a child wanted to be\n// untargetable for its own reasons.\n//\n// `zIndex` is the other half of the same subject and lives here for the same\n// reason: RN's z-order is a PAINT order and a PICK order, and this widget is\n// the only thing that owns both. See the block above the zIndex section below.\n//\n// Registered lazily like RnGtkxLayout (registration needs GObject, class\n// identity must exist before the first instance).\nimport * as Graphene from \"@gtkx/gi/graphene\"\nimport * as Gtk from \"@gtkx/gi/gtk\"\nimport { createElementComponent } from \"@gtkx/react/internal\"\nimport { registerClass } from \"@gtkx/runtime\"\n\nconst passthrough = new WeakSet<object>()\n/** Widgets whose DIRECT children are masked — RN's pointerEvents=\"box-only\". */\nconst boxOnly = new WeakSet<object>()\n/** What each widget's own pointerEvents wants, before any mask. */\nconst ownTarget = new WeakMap<object, boolean>()\n\nexport type HitSlop = {\n top: number\n right: number\n bottom: number\n left: number\n}\n\nconst hitSlops = new WeakMap<object, HitSlop>()\n\n/** box-none toggle: picking consults this live, no invalidation needed. */\nexport const setBoxPassthrough = (\n widget: Gtk.Widget,\n enabled: boolean,\n): void => {\n if (enabled) {\n passthrough.add(widget)\n } else {\n passthrough.delete(widget)\n }\n}\n\n/**\n * Grows the rect this widget's contains() accepts. Only RnGtkxViewBox\n * consults it — RN's hitSlop is a picking change and nothing in JS can\n * substitute for one, because a press outside the widget is never delivered\n * to it in the first place.\n */\nexport const setHitSlop = (widget: Gtk.Widget, slop: HitSlop | null): void => {\n if (slop === null) {\n hitSlops.delete(widget)\n } else {\n hitSlops.set(widget, slop)\n }\n}\n\nconst isMasked = (widget: Gtk.Widget): boolean => {\n const parent = widget.getParent()\n return parent !== null && boxOnly.has(parent)\n}\n\nconst applyTarget = (widget: Gtk.Widget): void => {\n widget.setCanTarget(!isMasked(widget) && (ownTarget.get(widget) ?? true))\n}\n\n/**\n * What this widget's own `pointerEvents` wants its can-target to be. A\n * box-only ancestor still overrides it, and stops overriding it the moment\n * the ancestor's mode changes — without either of them having to know about\n * the other.\n */\nexport const setPointerTarget = (\n widget: Gtk.Widget,\n targetable: boolean,\n): void => {\n ownTarget.set(widget, targetable)\n applyTarget(widget)\n}\n\n/**\n * Masks or unmasks a widget's direct children — RN's\n * pointerEvents=\"box-only\". Re-applied every commit rather than only on\n * change, because the child set moves with the renders.\n */\nexport const setBoxOnly = (widget: Gtk.Widget, enabled: boolean): void => {\n if (enabled) {\n boxOnly.add(widget)\n } else {\n boxOnly.delete(widget)\n }\n for (\n let child = widget.getFirstChild();\n child !== null;\n child = child.getNextSibling()\n ) {\n applyTarget(child)\n }\n}\n\n// --- zIndex ---------------------------------------------------------------\n//\n// RN's `zIndex` reorders PAINT among siblings. GTK4 paints a container's\n// children in child order and has no z-order property, so the obvious fix —\n// reorder the widgets — is the wrong one: widget order is the order this\n// platform keeps its shadow tree in sync with (`syncChildOrder` in\n// components/use-layout-child.ts), so restacking for paint would silently\n// restack the LAYOUT.\n//\n// Paint order and layout order do not have to be the same, though, and we own\n// the widget: `allocate` stays in Yoga's order and `snapshot` walks the\n// children in zIndex order instead. That is what Android does too\n// (`ViewGroup.getChildDrawingOrder`) and for the same reason.\n//\n// The half that is easy to miss is that `gtk_widget_pick()` descends in\n// REVERSE child order, so sorting the paint alone leaves a raised view drawn\n// on top and still unclickable. GTK4 has no `pick` vfunc (GtkWidgetClass's\n// public vtable ends at `contains`, verified against gtk 4.22's header and\n// gtkx's generated registry), and the only per-point hook it offers is\n// `contains()` — which is exactly the vfunc this file already overrides. So\n// picking is made to agree by having a covered widget answer \"not me\" where a\n// higher-painting sibling of one of its ancestors would answer instead.\n//\n// Everything below is behind `raisedCount`, which is 0 in every app that never\n// writes the style: one integer comparison, and both vfuncs take the path they\n// took before any of this existed.\n\n/** Non-zero zIndex per widget. Absent means 0, which is RN's default. */\nconst zIndexes = new WeakMap<Gtk.Widget, number>()\n\n/**\n * How many widgets in the process currently carry a non-zero `zIndex`.\n *\n * The fast path's whole guard. `snapshot()` and `contains()` read this first,\n * so a tree that never raises anything pays one integer comparison per call\n * and no allocation, no sort, and no per-child work beyond what GTK's own\n * snapshot does.\n */\nlet raisedCount = 0\n\n/**\n * Cached paint order per container: an array in paint order, or `null` for\n * \"plain child order, nothing to do\". Recomputed on change (a zIndex write, a\n * commit that touched the container's children) rather than per snapshot —\n * `useSortable` puts `zIndex` in its style object every frame but changes its\n * VALUE about twice per drag.\n */\nconst paintOrders = new WeakMap<Gtk.Widget, Gtk.Widget[] | null>()\n\n/**\n * The container's live children, in child order, as the LAST ALLOCATE PASS\n * walked them.\n *\n * The snapshot vfunc has to visit every child either way, and walking the\n * sibling chain from JS is what costs: each `getNextSibling()` mints a fresh\n * native wrapper, measured at 1.9 µs per child against 1.0 µs for the\n * `snapshotChild()` that follows it (docs/research/z-index.md). The container's\n * `allocate()` hook already walks exactly this chain, so it hands the array\n * over instead and the paint pass reuses it.\n *\n * Safe because a child cannot appear, disappear or move without queueing a\n * resize on this container, and GTK runs the layout phase before the paint\n * phase — so an allocate always lands between a change and the snapshot that\n * would see it. A container whose allocate never ran (no RnGtkxLayout, e.g. a\n * bare slot host) simply has no entry, and the vfunc walks live.\n */\nconst childOrders = new WeakMap<Gtk.Widget, Gtk.Widget[]>()\n\nconst sameChildren = (a: Gtk.Widget[], b: Gtk.Widget[]): boolean => {\n if (a.length !== b.length) {\n return false\n }\n for (let index = 0; index < a.length; index += 1) {\n if (a[index] !== b[index]) {\n return false\n }\n }\n return true\n}\n\n/**\n * Publishes the child list the container's allocate pass just walked.\n *\n * Cheap on the hot path by construction: the array is one the caller built\n * anyway, and the paint order is only invalidated when the children actually\n * differ — an allocate for a pure move (which is most of them, one per\n * animated frame) leaves the cached sort alone.\n */\nexport const cacheChildOrder = (\n container: Gtk.Widget,\n children: Gtk.Widget[],\n): void => {\n const previous = childOrders.get(container)\n childOrders.set(container, children)\n if (previous === undefined || !sameChildren(previous, children)) {\n paintOrders.delete(container)\n }\n}\n\n/** Containers known to hold at least one raised child, for the picking walk. */\nconst zOrderedParents = new WeakSet<Gtk.Widget>()\n\n/**\n * Widgets that paint but are not touch targets of their own: the GtkLabel a\n * `Text` renders and the GtkPicture an `Image` renders. Neither component has\n * a press prop, so nothing is ever attached to them — but GTK targets them by\n * default, and `gtk_widget_pick()` reaches a child BEFORE it asks the parent's\n * `contains()`. That is the one hole in the occlusion check below: a covered\n * `View` can answer \"not me\", a bare GtkLabel inside it cannot.\n *\n * So while a container has a raised child, the paint-only leaves under it are\n * made untargetable and the pick lands on their nearest `View` instead — which\n * is the same widget the press would have propagated to anyway, and which does\n * answer the occlusion question. Restored the moment nothing is raised there,\n * because it is not free of consequence: `pointerEvents: \"box-none\"` on a View\n * whose only child is a `Text` would otherwise fall through to whatever is\n * behind it. Documented in docs/reference/components/index.md.\n */\nconst paintOnlyLeaves = new WeakSet<Gtk.Widget>()\n\n/**\n * Marks a widget as painting-only for picking purposes — see above. Called\n * once per widget by the components that own one (`Text`, `Image`).\n */\nexport const setPaintOnlyLeaf = (widget: Gtk.Widget): void => {\n paintOnlyLeaves.add(widget)\n}\n\nconst applyLeafTargeting = (container: Gtk.Widget, suppress: boolean): void => {\n for (\n let child = container.getFirstChild();\n child !== null;\n child = child.getNextSibling()\n ) {\n if (paintOnlyLeaves.has(child)) {\n setPointerTarget(child, !suppress)\n }\n // A nested container that is STILL raised keeps its own suppression: an\n // outer container coming back down must not restore leaves an inner one\n // is relying on.\n if (suppress || !zOrderedParents.has(child)) {\n applyLeafTargeting(child, suppress)\n }\n }\n}\n\n/**\n * Drops a container's cached paint order and asks for a redraw.\n *\n * Called from the zIndex writer and from the container's per-commit effect\n * (components/use-layout-child.ts), which is what covers a child mounting,\n * unmounting or being MOVED by React — the three ways the order can change\n * without any zIndex being written.\n */\nexport const invalidateZOrder = (container: Gtk.Widget): void => {\n // The child list too: a commit is the one thing that can change it, and the\n // allocate the commit queues puts a fresh one back before the next paint.\n childOrders.delete(container)\n if (!paintOrders.delete(container)) {\n return\n }\n container.queueDraw()\n if (zOrderedParents.has(container)) {\n // Recomputed now rather than at the next snapshot, for the same reason\n // setZIndex does it: a container that just lost its last raised child\n // (the commit that unmounted it) would otherwise never be asked again —\n // the fast path stops calling paintOrderFor once nothing is raised — and\n // would keep its paint-only leaves untargetable forever.\n paintOrderFor(container)\n }\n}\n\n/**\n * RN's `zIndex` for one child. `0` (the default, and `undefined`) clears it.\n *\n * RN applies `zIndex` unconditionally — unlike CSS, which ignores `z-index`\n * on a `position: static` box. Nothing here looks at `position` either.\n */\nexport const setZIndex = (widget: Gtk.Widget, value: number): void => {\n const previous = zIndexes.get(widget) ?? 0\n if (previous === value) {\n return\n }\n if (value === 0) {\n zIndexes.delete(widget)\n raisedCount -= 1\n } else {\n zIndexes.set(widget, value)\n if (previous === 0) {\n raisedCount += 1\n }\n }\n const parent = widget.getParent()\n if (parent === null) {\n return\n }\n paintOrders.delete(parent)\n // Unconditional, unlike invalidateZOrder's: the container may never have\n // had a cache to drop and its paint still just changed.\n parent.queueDraw()\n if (value === 0) {\n // Recomputed eagerly on the way DOWN, never lazily: once nothing is\n // raised the fast path stops calling paintOrderFor at all, so a container\n // that lost its last raised child would never get the chance to undo what\n // being raised did to it (paint order, leaf targeting).\n paintOrderFor(parent)\n }\n}\n\n/** The container's children, from the allocate pass if it has run. */\nconst childrenOf = (container: Gtk.Widget): Gtk.Widget[] => {\n const cached = childOrders.get(container)\n if (cached !== undefined) {\n return cached\n }\n const children: Gtk.Widget[] = []\n for (\n let child = container.getFirstChild();\n child !== null;\n child = child.getNextSibling()\n ) {\n children.push(child)\n }\n return children\n}\n\nconst paintOrderFor = (container: Gtk.Widget): Gtk.Widget[] | null => {\n if (paintOrders.has(container)) {\n return paintOrders.get(container) ?? null\n }\n const children = childrenOf(container)\n let raised = false\n for (const child of children) {\n if (zIndexes.has(child)) {\n raised = true\n break\n }\n }\n let order: Gtk.Widget[] | null = null\n if (raised) {\n zOrderedParents.add(container)\n // Once per recompute, not per frame, and only for a container that\n // actually has something raised: the walk is what catches a `Text` that\n // mounted into an already-raised container since the last one.\n applyLeafTargeting(container, true)\n // Stable by construction. RN keeps document order among equal zIndexes,\n // and an unstable sort would let equal siblings swap between frames —\n // flicker that is miserable to attribute. `Array.prototype.sort` has been\n // required to be stable since ES2019; the index tiebreak makes that\n // independent of the engine rather than assumed of it.\n order = children\n .map((widget, index) => ({\n widget,\n index,\n z: zIndexes.get(widget) ?? 0,\n }))\n .sort((a, b) => a.z - b.z || a.index - b.index)\n .map((entry) => entry.widget)\n } else if (zOrderedParents.delete(container)) {\n applyLeafTargeting(container, false)\n }\n paintOrders.set(container, order)\n return order\n}\n\n/**\n * Whether a higher-painting sibling of this widget — or of any of its\n * ancestors — would take the pick at this point.\n *\n * `pick()` on the sibling rather than a bounds test, because \"would GTK have\n * answered inside that subtree\" IS the question, and it comes with the rest of\n * RN's rules for free: a raised view with `pointerEvents: \"none\"` is not\n * targetable, so it does not occlude either.\n *\n * The recursion terminates because it only ever asks about siblings STRICTLY\n * higher in the same container's paint order.\n */\nconst isOccluded = (widget: Gtk.Widget, x: number, y: number): boolean => {\n let child = widget\n let parent = child.getParent()\n while (parent !== null) {\n if (zOrderedParents.has(parent)) {\n const order = paintOrderFor(parent)\n if (order !== null) {\n const index = order.indexOf(child)\n for (let above = index + 1; above < order.length; above += 1) {\n const sibling = order[above]!\n const [ok, point] = widget.computePoint(\n sibling,\n new Graphene.Point({ x, y }),\n )\n if (\n ok &&\n sibling.pick(point.x, point.y, Gtk.PickFlags.DEFAULT) !== null\n ) {\n return true\n }\n }\n }\n }\n child = parent\n parent = child.getParent()\n }\n return false\n}\n\ntype ViewBoxComponent = ReturnType<typeof createElementComponent>\n\nlet component: ViewBoxComponent | null = null\n\nexport const getViewBoxComponent = (): ViewBoxComponent => {\n if (component) {\n return component\n }\n\n // gtkx 1.0 renamed Widget's vtable override slots to `vfunc`-prefixed\n // methods (vfuncContains/vfuncSnapshot below — was contains/snapshot on\n // rc.4, verified against node_modules/@gtkx/gi/gtk/gtk.d.ts and gtk.js's\n // registerWrapperClass(Widget, ...) registry). registerClass() discovers\n // overrides by exact method-name match, so the old names would silently\n // stop being wired into the vtable rather than erroring — see\n // layout-manager.ts's RnGtkxLayout for the full mechanism writeup (that\n // one was the blank-content-pane root cause; this class's contains/\n // snapshot were the same latent break, just not the one that broke\n // rendering outright since GtkBox's own default snapshot still walks\n // children in order).\n class RnGtkxViewBox extends Gtk.Box {\n override vfuncContains(x: number, y: number): boolean {\n if (passthrough.has(this)) {\n return false\n }\n // GTK translates the point into this widget's coordinates before\n // asking, and does not pre-check the bounds, so a negative x or a y\n // past the height is a legitimate question — which is what lets\n // hitSlop answer yes to it.\n const slop = hitSlops.get(this)\n const inside =\n slop === undefined\n ? // The default widget behavior: inside the widget's own bounds.\n x >= 0 && y >= 0 && x < this.getWidth() && y < this.getHeight()\n : x >= -slop.left &&\n y >= -slop.top &&\n x < this.getWidth() + slop.right &&\n y < this.getHeight() + slop.bottom\n if (!inside || raisedCount === 0) {\n return inside\n }\n // Something in this process is raised: this widget only answers where\n // nothing painted above it would have.\n return !isOccluded(this, x, y)\n }\n\n // GTK's own container snapshot is `gtk_widget_real_snapshot`, which walks\n // first-to-last calling gtk_widget_snapshot_child — the loop below with\n // nothing in front of it reproduces that rather than delegating to it.\n // (1.0's gtk.d.ts now types a chain-up path, `super.vfuncSnapshot()`,\n // which would reach GtkBox's own default — untested here and out of\n // this fix's scope; the manual loop below is unchanged and still\n // correct, just renamed to the 1.0 vfunc slot.)\n override vfuncSnapshot(snapshot: Gtk.Snapshot): void {\n if (raisedCount !== 0) {\n const order = paintOrderFor(this)\n if (order !== null) {\n for (const child of order) {\n this.snapshotChild(child, snapshot)\n }\n return\n }\n }\n for (const child of childrenOf(this)) {\n this.snapshotChild(child, snapshot)\n }\n }\n }\n // Explicit typeName: bundlers minify class names.\n registerClass(RnGtkxViewBox, { typeName: \"RnGtkxViewBox\" })\n component = createElementComponent(\"RnGtkxViewBox\")\n return component\n}\n"]}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// is fine; gtkx/bridge/adw.ts (the seam app-registry.tsx/host.gtkx.ts use)
|
|
11
11
|
// reaches @gtkx/jsx/adw through require() instead, never through this file,
|
|
12
12
|
// so it stays reachable even when Adw was never generated. See
|
|
13
|
-
// .claude/epics/adw-optional/001.md and docs/gtkx-
|
|
13
|
+
// .claude/epics/adw-optional/001.md and docs/gtkx-1.2-notes.md for why
|
|
14
14
|
// @gtkx/jsx/adw cannot live in widgets.generated.ts alongside the GTK half.
|
|
15
15
|
export { AdwAboutDialog, AdwAboutWindow, AdwActionRow, AdwAlertDialog, AdwApplicationWindow, AdwAvatar, AdwBanner, AdwBin, AdwBottomSheet, AdwBreakpointBin, AdwButtonContent, AdwButtonRow, AdwCarousel, AdwCarouselIndicatorDots, AdwCarouselIndicatorLines, AdwClamp, AdwClampScrollable, AdwComboRow, AdwDialog, AdwEntryRow, AdwExpanderRow, AdwFlap, AdwHeaderBar, AdwInlineViewSwitcher, AdwLayoutSlot, AdwLeaflet, AdwMessageDialog, AdwMultiLayoutView, AdwNavigationPage, AdwNavigationSplitView, AdwNavigationView, AdwOverlaySplitView, AdwPasswordEntryRow, AdwPreferencesDialog, AdwPreferencesGroup, AdwPreferencesPage, AdwPreferencesRow, AdwPreferencesWindow, AdwShortcutLabel, AdwShortcutsDialog, AdwSidebar, AdwSpinRow, AdwSpinner, AdwSplitButton, AdwSqueezer, AdwStatusPage, AdwSwitchRow, AdwTabBar, AdwTabButton, AdwTabOverview, AdwTabView, AdwToastOverlay, AdwToggleGroup, AdwToolbarView, AdwViewStack, AdwViewSwitcher, AdwViewSwitcherBar, AdwViewSwitcherSidebar, AdwViewSwitcherTitle, AdwWindow, AdwWindowTitle, AdwWrapBox, } from "@gtkx/jsx/adw";
|
|
16
16
|
//# sourceMappingURL=widgets.generated.adw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets.generated.adw.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/widgets.generated.adw.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,0EAA0E;AAC1E,sDAAsD;AACtD,yEAAyE;AACzE,6DAA6D;AAC7D,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,+DAA+D;AAC/D,uEAAuE;AACvE,4EAA4E;AAE5E,OAAO,EACL,cAAc,EACd,cAAc,EACd,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,SAAS,EACT,MAAM,EACN,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,wBAAwB,EACxB,yBAAyB,EACzB,QAAQ,EACR,kBAAkB,EAClB,WAAW,EACX,SAAS,EACT,WAAW,EACX,cAAc,EACd,OAAO,EACP,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,aAAa,EACb,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,cAAc,EACd,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,UAAU,GACX,MAAM,eAAe,CAAA","sourcesContent":["// GENERATED FILE — do not edit by hand.\n// Produced by scripts/generate-widget-surface.ts. Re-run it inside the VM\n// after `npm run codegen` picks up a gtkx update; see\n// scripts/widget-surface/classification.json for the full classification\n// and .claude/epics/widget-surface/ for the rules behind it.\n//\n// Every Adwaita widget the classifier resolved to a Gtk.Widget subclass,\n// re-exported RAW. Imported ONLY by src/adw/widgets.generated.ts — that\n// subpath already requires Adw-1 unconditionally, so a static import here\n// is fine; gtkx/bridge/adw.ts (the seam app-registry.tsx/host.gtkx.ts use)\n// reaches @gtkx/jsx/adw through require() instead, never through this file,\n// so it stays reachable even when Adw was never generated. See\n// .claude/epics/adw-optional/001.md and docs/gtkx-
|
|
1
|
+
{"version":3,"file":"widgets.generated.adw.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/widgets.generated.adw.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,0EAA0E;AAC1E,sDAAsD;AACtD,yEAAyE;AACzE,6DAA6D;AAC7D,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,+DAA+D;AAC/D,uEAAuE;AACvE,4EAA4E;AAE5E,OAAO,EACL,cAAc,EACd,cAAc,EACd,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,SAAS,EACT,MAAM,EACN,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,wBAAwB,EACxB,yBAAyB,EACzB,QAAQ,EACR,kBAAkB,EAClB,WAAW,EACX,SAAS,EACT,WAAW,EACX,cAAc,EACd,OAAO,EACP,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,aAAa,EACb,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,cAAc,EACd,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,UAAU,GACX,MAAM,eAAe,CAAA","sourcesContent":["// GENERATED FILE — do not edit by hand.\n// Produced by scripts/generate-widget-surface.ts. Re-run it inside the VM\n// after `npm run codegen` picks up a gtkx update; see\n// scripts/widget-surface/classification.json for the full classification\n// and .claude/epics/widget-surface/ for the rules behind it.\n//\n// Every Adwaita widget the classifier resolved to a Gtk.Widget subclass,\n// re-exported RAW. Imported ONLY by src/adw/widgets.generated.ts — that\n// subpath already requires Adw-1 unconditionally, so a static import here\n// is fine; gtkx/bridge/adw.ts (the seam app-registry.tsx/host.gtkx.ts use)\n// reaches @gtkx/jsx/adw through require() instead, never through this file,\n// so it stays reachable even when Adw was never generated. See\n// .claude/epics/adw-optional/001.md and docs/gtkx-1.2-notes.md for why\n// @gtkx/jsx/adw cannot live in widgets.generated.ts alongside the GTK half.\n\nexport {\n AdwAboutDialog,\n AdwAboutWindow,\n AdwActionRow,\n AdwAlertDialog,\n AdwApplicationWindow,\n AdwAvatar,\n AdwBanner,\n AdwBin,\n AdwBottomSheet,\n AdwBreakpointBin,\n AdwButtonContent,\n AdwButtonRow,\n AdwCarousel,\n AdwCarouselIndicatorDots,\n AdwCarouselIndicatorLines,\n AdwClamp,\n AdwClampScrollable,\n AdwComboRow,\n AdwDialog,\n AdwEntryRow,\n AdwExpanderRow,\n AdwFlap,\n AdwHeaderBar,\n AdwInlineViewSwitcher,\n AdwLayoutSlot,\n AdwLeaflet,\n AdwMessageDialog,\n AdwMultiLayoutView,\n AdwNavigationPage,\n AdwNavigationSplitView,\n AdwNavigationView,\n AdwOverlaySplitView,\n AdwPasswordEntryRow,\n AdwPreferencesDialog,\n AdwPreferencesGroup,\n AdwPreferencesPage,\n AdwPreferencesRow,\n AdwPreferencesWindow,\n AdwShortcutLabel,\n AdwShortcutsDialog,\n AdwSidebar,\n AdwSpinRow,\n AdwSpinner,\n AdwSplitButton,\n AdwSqueezer,\n AdwStatusPage,\n AdwSwitchRow,\n AdwTabBar,\n AdwTabButton,\n AdwTabOverview,\n AdwTabView,\n AdwToastOverlay,\n AdwToggleGroup,\n AdwToolbarView,\n AdwViewStack,\n AdwViewSwitcher,\n AdwViewSwitcherBar,\n AdwViewSwitcherSidebar,\n AdwViewSwitcherTitle,\n AdwWindow,\n AdwWindowTitle,\n AdwWrapBox,\n} from \"@gtkx/jsx/adw\"\n"]}
|