@gtkx/runtime 1.4.0 → 1.6.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/README.md +1 -1
- package/dist/descriptors.d.ts +36 -7
- package/dist/descriptors.d.ts.map +1 -1
- package/dist/descriptors.js +18 -5
- package/dist/descriptors.js.map +1 -1
- package/dist/element-metadata.d.ts +9 -0
- package/dist/element-metadata.d.ts.map +1 -0
- package/dist/element-metadata.js +14 -0
- package/dist/element-metadata.js.map +1 -0
- package/dist/fn.d.ts +8 -2
- package/dist/fn.d.ts.map +1 -1
- package/dist/fn.js +20 -4
- package/dist/fn.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +4 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +4 -1
- package/dist/internal.js.map +1 -1
- package/dist/native-value.d.ts.map +1 -1
- package/dist/native-value.js +21 -2
- package/dist/native-value.js.map +1 -1
- package/dist/register-class.d.ts +2 -2
- package/dist/register-class.d.ts.map +1 -1
- package/dist/register-class.js +38 -1
- package/dist/register-class.js.map +1 -1
- package/dist/registry.d.ts +26 -3
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +75 -20
- package/dist/registry.js.map +1 -1
- package/dist/type.d.ts +10 -1
- package/dist/type.d.ts.map +1 -1
- package/dist/type.js +14 -1
- package/dist/type.js.map +1 -1
- package/dist/value.d.ts.map +1 -1
- package/dist/value.js +19 -3
- package/dist/value.js.map +1 -1
- package/package.json +10 -5
- package/src/descriptors.ts +55 -9
- package/src/element-metadata.ts +24 -0
- package/src/fn.ts +33 -5
- package/src/index.ts +3 -0
- package/src/internal.ts +8 -1
- package/src/native-value.ts +30 -2
- package/src/register-class.ts +61 -2
- package/src/registry.ts +110 -19
- package/src/type.ts +25 -0
- package/src/value.ts +28 -4
|
@@ -1 +1 @@
|
|
|
1
|
-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AiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,UAAU,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC;AAED,OAAO,EAAkB,aAAa,EAAqC,CAAC","sourcesContent":["import type { Descriptor } from \"@gtkx/native\";\nimport {\n registerClass as nativeRegisterClass,\n type RegisterClassInterface as NativeRegisterClassInterface,\n type RegisterClassOptions as NativeRegisterClassOptions,\n type RegisterClassSignal as NativeRegisterClassSignal,\n type RegisterClassVfunc as NativeRegisterClassVfunc,\n} from \"@gtkx/native\";\nimport { type AnyClass, getParentClass, kebabCase, walkClassChain } from \"@gtkx/utils\";\nimport { wrapCallback } from \"./callback.js\";\nimport { insertMixinLayer } from \"./mixin.js\";\nimport {\n buildPropertyDispatch,\n GET_PROPERTY_VFUNC,\n makeGetProperty,\n makeSetProperty,\n type PropertyDispatch,\n type PropertySpec,\n SET_PROPERTY_VFUNC,\n toNativeProperties,\n} from \"./properties.js\";\nimport {\n getClassStructClass,\n getClassType,\n getInterfaceMixin,\n getTypeClassHandle,\n markDerivedClass,\n registerClassType,\n type VfuncDescriptor,\n wrapHandle,\n} from \"./registry.js\";\nimport {\n connectClosureSignal,\n type DeclaredSignalTypes,\n emitDeclaredSignal,\n getSignalBaseName,\n overrideSignalClassClosure,\n signalForHandlerName,\n type SignalHandler,\n signalIdFor,\n} from \"./signal.js\";\nimport {\n TYPE_INTERFACE,\n TYPE_INVALID,\n TYPE_NONE,\n type TypedClass,\n typeFundamental,\n typeInterfaces,\n typeIsA,\n typeName,\n} from \"./type.js\";\nimport { findClassVfuncDescriptor, findInterfaceVfuncDescriptor } from \"./vfunc.js\";\n\n/**\n * A generated interface value, such as `Gio.ListModel`, in the form {@link registerClass} takes it.\n * `__impl__` exists only in the type system: it carries the interface's `Impl` type, of which a class\n * has to match every member it declares itself, which rejects a class value and a member whose\n * signature does not fit the slot it fills. Leaving a slot to the interface is not rejected,\n * because `registerClass` does not reject it either: every member of an `Impl` type is optional,\n * and the `Partial` holds that open whatever the type declares. The `object` beside it keeps\n * TypeScript from also demanding one member in common. An interface that introspection describes\n * no vtable for carries `unknown`, since it has no slot a class could fill.\n */\ntype Interface<TImpl> = AnyClass & {\n /** Type-level slot holding the interface's `Impl` type; no value ever carries it. */\n __impl__: (impl: Partial<TImpl> & object) => void;\n};\n\n/**\n * One key of `RegisterClassOptions.properties` with every underscore turned into the dash a canonical\n * GObject property name separates its words with.\n */\ntype Dashed<TName extends string> = TName extends `${infer THead}_${infer TTail}`\n ? Dashed<`${THead}-${TTail}`>\n : TName;\n\n/**\n * One dashed key in the camelCase spelling the accessors {@link registerClass} installs carry, which is\n * the spelling the hooks that address a property by name take.\n */\ntype Camelized<TName extends string> = TName extends `${infer THead}-${infer TTail}`\n ? `${THead}${Capitalize<Camelized<TTail>>}`\n : TName;\n\n/**\n * The names a registered class carries in its property map: every key of\n * `RegisterClassOptions.properties` in camelCase, whichever spelling it was written in.\n * A `properties` object given a type of its own rather than left to inference has `string` for its key\n * type and names nothing, because a name only known as `string` addresses no member in particular.\n */\ntype InstalledNames<TProperties> = string extends keyof TProperties\n ? never\n : Camelized<Dashed<keyof TProperties & string>>;\n\n/**\n * The base names the signal surface takes for the signals `RegisterClassOptions.signals` declares:\n * each name as written, plus its canonical spelling with underscores turned into dashes, which\n * GObject knows the signal by too.\n */\ntype DeclaredSignalBase<TSignals> = (keyof TSignals & string) | Dashed<keyof TSignals & string>;\n/**\n * The names `connect` and `emit` take for one of the signals `RegisterClassOptions.signals`\n * declares: each spelling of each name, plus its detailed form for a signal emitted with a\n * `::detail` suffix.\n */\ntype DeclaredSignalName<TSignals> = DeclaredSignalBase<TSignals> | `${DeclaredSignalBase<TSignals>}::${string}`;\n\n/**\n * The `connect` and `emit` signatures instances gain for the signals\n * `RegisterClassOptions.signals` declares, widening the inherited ones, which take only the names\n * introspection knows. A class declaring no signals gains nothing, since no name reaches the\n * added signatures.\n */\ntype DeclaredSignalMethods<TSignals> = {\n /**\n * Type-level map from declared signal name to handler signature, feeding the hooks that\n * address a signal by name, such as `useSignal` from `@gtkx/react`; no value ever carries it.\n */\n __signals__?: Record<DeclaredSignalBase<TSignals>, (...args: never[]) => unknown>;\n /** Connects a handler to a signal `RegisterClassOptions.signals` declared. */\n connect(\n signal: DeclaredSignalName<TSignals>,\n handler: (...args: never[]) => unknown,\n isAfter?: boolean,\n ): number;\n /** Emits a signal `RegisterClassOptions.signals` declared. */\n emit(sigName: DeclaredSignalName<TSignals>, ...args: unknown[]): unknown;\n /** Connects a handler to a signal `RegisterClassOptions.signals` declared, for `off` to take off. */\n on(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown, isAfter?: boolean): unknown;\n /** Connects a handler to a signal `RegisterClassOptions.signals` declared for one emission. */\n once(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown, isAfter?: boolean): unknown;\n /** Disconnects a handler `on` or `once` connected to a signal `RegisterClassOptions.signals` declared. */\n off(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown): unknown;\n};\n\n/**\n * An instance of a registered class: everything the class itself declares, plus the property map the\n * hooks that address a property by name, such as `useProperty` from `@gtkx/react`, read the installed\n * names off. Each name is typed with the value type the class declares for the member of that name,\n * so a property the class does not `declare` contributes nothing.\n */\ntype RegisteredInstance<TInstance, TProperties, TSignals> = TInstance &\n DeclaredSignalMethods<TSignals> & {\n /** Type-level map from installed property name to value type; no value ever carries it. */\n __properties__: Pick<TInstance, InstalledNames<TProperties> & keyof TInstance>;\n };\n\n/**\n * The construct signature and prototype a registered class carries, both giving\n * {@link RegisteredInstance}. The signature stays abstract for as long as the class itself is, so\n * registering an abstract base leaves it as impossible to construct as it was.\n */\ntype RegisteredConstructor<TClass, TArgs extends unknown[], TInstance> = {\n /** Object the class's instances inherit from. */\n prototype: TInstance;\n} & (TClass extends new (...args: never) => unknown\n ? new (...args: TArgs) => TInstance\n : abstract new (...args: TArgs) => TInstance);\n\n/** The statics a registered class keeps from the class it was, joined with {@link RegisteredConstructor}. */\ntype RegisteredParts<TClass, TArgs extends unknown[], TInstance> = Omit<TClass, \"prototype\"> &\n RegisteredConstructor<TClass, TArgs, TInstance>;\n\n/**\n * The class {@link registerClass} hands back: the same class, with the same statics, whose instances\n * carry the properties `RegisterClassOptions.properties` installed and take the signals\n * `RegisterClassOptions.signals` declares by name. Binding the call to a name, rather than\n * discarding it, is what carries those names into the type system.\n */\ntype RegisteredClass<TClass extends AnyClass, TProperties, TSignals> =\n TClass extends abstract new (...args: infer TArgs) => infer TInstance\n ? RegisteredParts<TClass, TArgs, RegisteredInstance<TInstance, TProperties, TSignals>>\n : never;\n\n/**\n * A GType in the form `RegisterClassOptions.signals` takes one: the numeric GType itself, such as\n * `TYPE_STRING` from `@gtkx/gi/gobject`, or a class carrying one, which is any generated wrapper\n * class and any class an earlier {@link registerClass} call registered.\n */\ntype SignalGType = bigint | AnyClass<TypedClass>;\n\n/**\n * One signal `RegisterClassOptions.signals` creates on the new type, sitting under the signal's\n * name. Every part is optional: `{}` declares a signal with no arguments and no return value that\n * runs its handlers in the default `RUN_FIRST` stage.\n */\ntype SignalSpec = {\n /**\n * `GObject.SignalFlags` bit mask for the signal, defaulting to `RUN_FIRST`. `DETAILED` lets\n * handlers connect to and emissions name a `::detail` suffix.\n */\n flags?: number;\n /** GType of each argument an emission carries, defaulting to none. */\n paramTypes?: SignalGType[];\n /** GType of the value an emission returns, defaulting to none. */\n returnType?: SignalGType;\n /**\n * How the emission combines what its handlers return, limited to the two accumulators GObject\n * ships: `\"first-wins\"` stops the emission at the first handler and keeps its result, and\n * `\"true-handled\"` runs handlers until one returns `true`, which requires a boolean\n * `returnType`. Without one, every handler runs and the last result stands.\n */\n accumulator?: \"first-wins\" | \"true-handled\";\n};\n\n/** What {@link registerClass} adds to the new GType beyond the vtable slots it discovers on the class. */\ntype RegisterClassOptions<\n TInstance extends object,\n TProperties extends Record<string, PropertySpec>,\n TSignals extends Record<string, SignalSpec>,\n> = {\n /**\n * Name to register the new GType under, defaulting to the class's own name. Either way the\n * name has to be a valid GType name: at least three characters, starting with a letter or\n * underscore, the rest letters, digits, `-`, `_` or `+`. Any other name throws a `TypeError`.\n */\n typeName?: string;\n /**\n * Registers the new GType abstract, the way `G_TYPE_FLAG_ABSTRACT` marks a C type: the class\n * still serves as a parent for further registered subclasses, which instantiate as usual, but\n * constructing it directly throws, whether from JavaScript or from a native caller.\n */\n abstract?: boolean;\n /**\n * Name instances of the new type carry in CSS, applied through `gtk_widget_class_set_css_name`\n * from inside the type's `class_init`, so every instance is born with it, wherever it is\n * created from. Requires the class to extend `Gtk.Widget`; registering a non-widget with a\n * `cssName` throws.\n */\n cssName?: string;\n /**\n * Hook run once, synchronously, while `registerClass` registers the type, after its\n * `class_init` has installed the vfuncs, properties and signals declared here. It receives the\n * new type's class struct wrapped in its generated GTypeStruct wrapper, so class-level setup\n * calls such as `Gtk.WidgetClass.installAction`, `Gtk.WidgetClass.addShortcut` and\n * `Gtk.WidgetClass.setLayoutManagerType` have somewhere to land. The wrapper serves the\n * members of every struct in the parent chain on one object: a widget subclass sees\n * `Gtk.WidgetClass` and `GObject.ObjectClass` members alike, so the parameter can be declared\n * as whichever of those types the hook needs. The class struct belongs to the type system for\n * the life of the process, so keeping the wrapper around past the hook is safe, if rarely\n * useful. An exception the hook throws propagates out of `registerClass`, with the type\n * already registered: GObject offers no way to unregister a static type.\n */\n classInit?(typeStruct: object): void;\n /**\n * Interfaces the new type implements on top of the ones it inherits, given as the interface values\n * themselves, such as `Gio.ListModel`. Their vtable slots are filled from the `vfunc`-prefixed methods on\n * the class's prototype chain, each of which has to match the interface's `Impl` type, such as\n * `Gio.ListModelImpl`.\n */\n implements?: Interface<TInstance>[];\n /**\n * Properties to install on the new type, keyed by the name JavaScript addresses each one by and\n * valued with the `GObject.ParamSpec` describing it. A key is read in camelCase however it is\n * written, so `dewPoint`, `dew_point` and `dew-point` all name the same member, and the ParamSpec\n * has to carry a name that reads back as that same member, such as `dew-point`, or registration\n * throws: the ParamSpec's name is the one GObject emits `notify` with, and a name the key does\n * not spell reaches nothing that listens for it. A word starting with a digit is a word of its\n * own on either side of that reading, so `level2Depth` takes a ParamSpec named `level-2-depth`\n * as readily as one named `level2-depth`, the way `WebKit.Settings` names\n * `enable-2d-canvas-acceleration` for its `enable2dCanvasAcceleration` member. An uppercase\n * letter in the ParamSpec's own name is refused, since GObject notifies under that spelling\n * and nothing else reads it back. Every property gains prototype accessors, one for the key as\n * written, one for it with dashes turned into underscores and one for it in camelCase, each\n * unless the class already defines that name. They serve the value from storage of their own on\n * the instance, which is also what the type's `get_property` and `set_property` slots read and\n * write, so a value set from JavaScript, from `g_object_set_property` and at construction all\n * land in the same place.\n *\n * A write the ParamSpec would refuse throws rather than reaching GObject, which reports such a\n * write as a GLib critical and drops it: a `TypeError` for a read-only or construct-only\n * property and for a value of a type the property cannot hold, and a `RangeError` for a value\n * the ParamSpec rejects. The same checks run over a value handed to the constructor, where\n * a construct-only property is the one that is writable. An accepted write emits one `notify`,\n * which a `freeze_notify` batch collects; a write of the value the property already holds is\n * dropped and emits none.\n *\n * `null` and `undefined` both mean NULL, and mean it only where the ParamSpec's own type holds\n * NULL, which is a string, string-array, boxed, object, interface, param, variant or pointer\n * property. Such a property holds the `null` either spelling wrote, so the member, the type's\n * `get_property` slot and `g_object_get_property` serve the same thing, and writing the other\n * spelling over it emits no `notify`. Every other property, so every integer, floating-point,\n * boolean, enum, flags and GType one, refuses both with the same `TypeError` it refuses a\n * string with, and keeps the value it already holds. It refuses them for what it holds rather\n * than for its range, whatever that range is: the type is checked before the range, so a\n * `gint` whose range excludes 0 answers a nullish with that same `TypeError` and never with\n * the `RangeError` that names the value GObject would put in its place. The one place\n * `undefined` means something else is the constructor, which reads it as the property not\n * being given at all and leaves it at the ParamSpec's default, so a property is never handed a\n * value it cannot serve back.\n *\n * A floating-point property takes every JavaScript number, `NaN` and both infinities\n * included, and its ParamSpec alone rules on which of them the range admits: a `gdouble`\n * bounded by `-Infinity` and `Infinity` holds either infinity, and a magnitude a bounded\n * one excludes, like any `NaN`, comes back as the `RangeError` that names what GObject\n * would put in its place rather than as the `TypeError` a type the property cannot hold\n * earns. A `gfloat` property holds what GObject narrows the double to, so it serves `0.1`\n * back as `0.10000000149011612` and a finite magnitude no `gfloat` reaches as an infinity,\n * which the range then rules on in turn. That narrowing belongs to the property alone: the\n * same magnitude written to a `gfloat` through a generated binding, a signal argument or a\n * closure return is refused outright rather than narrowed.\n *\n * A generated property of a wrapped type answers a nullish differently, and the two halves of\n * the API disagree here: that property marshals what it is written through its descriptor\n * rather than through the checks above, so `new Gtk.Label({ widthRequest: null })` and a later\n * write of `null` to that member both land 0, where a `gint` installed here refuses both.\n *\n * A class that defines the camelCase member itself owns the property: its own accessor decides\n * what a write means, the other spellings forward to it, and the type's property slots read\n * and write it rather than the generated storage.\n */\n properties?: TProperties;\n /**\n * Signals to create on the new type, keyed by signal name and valued with the\n * {@link SignalSpec} describing each one. A name has to start with a lowercase letter, continue\n * in lowercase letters, digits, `-` and `_`, and be new to the type: one an ancestor type or a\n * listed interface already carries throws, and so does one carrying an uppercase letter, which\n * GObject would carry under that exact spelling, out of reach of both its dashed spelling and\n * its `on<SignalName>` default handler. The two word separators spell the same signal, so a\n * signal declared as `data_changed` is connected to and emitted as `data-changed` too.\n *\n * Instances connect and emit by name through the same `connect`, `on`, `once`, `off` and\n * `emit` surface inherited signals use: `registerClass` wraps `connect` and `emit` on the\n * class's prototype to serve the declared names, unless the class defines the member itself,\n * and hands every other name to the inherited implementation. A handler receives the\n * emission's arguments without the leading emitter, matching a generated signal, and what it\n * returns becomes the emission's return value when the signal declares one.\n *\n * The declared parameter GTypes rule the emission: `emit` takes exactly one argument per\n * declared parameter, throwing a `TypeError` for any other count, and converts each argument\n * into a `GValue` of the declared type, throwing for a value that type cannot hold. The signals\n * are created with no class closure of their own, but a method named `on<SignalName>`\n * becomes the signal's default handler, the way every `on`-prefixed method that names a\n * signal the type carries does; see {@link registerClass}.\n */\n signals?: TSignals;\n};\n\n/** {@link RegisterClassOptions} with the widest instance and property types {@link registerClass} accepts. */\ntype AnyRegisterClassOptions = RegisterClassOptions<object, Record<string, PropertySpec>, Record<string, SignalSpec>>;\ntype VfuncFn = NativeRegisterClassVfunc[\"fn\"];\ntype DiscoveredVfunc = VfuncDescriptor & { methodName: string; fn: VfuncFn };\ntype MethodTable = Map<string, VfuncFn>;\ntype InstanceMembers = { methods: MethodTable; names: Set<string>; inheritedNames: Set<string> };\n\ntype InterfaceVfuncBinding = {\n gtype: bigint;\n vfuncs: DiscoveredVfunc[];\n};\n\ntype PropertyVfuncSource = {\n klass: AnyClass;\n methods: MethodTable;\n dispatch: PropertyDispatch;\n adoptedTypes: bigint[];\n};\n\ntype PropertyVfuncSpec = {\n methodName: string;\n isValueOut: boolean;\n makeDispatch: (dispatch: PropertyDispatch) => VfuncFn;\n};\n\ntype ArgPatch = { isCallerAllocated: true } | { isCallScoped: true };\ntype DeclaredSignals = { native: NativeRegisterClassSignal[]; table: Map<string, DeclaredSignalTypes> };\n\ntype SignalMethodHost = {\n connect?: (signal: string, handler: SignalHandler, isAfter?: boolean) => number;\n emit?: (sigName: string, ...args: unknown[]) => unknown;\n};\n\nconst INSTANCE_ARG_INDEX = 0;\nconst VALUE_ARG_INDEX = 2;\nconst TEARDOWN_VFUNC_NAMES: Set<string> = new Set([\"dispose\", \"finalize\"]);\nconst ASYNC_INITABLE_TYPE_NAME = \"GAsyncInitable\";\nconst INIT_ASYNC_METHOD_NAME = \"vfuncInitAsync\";\n\nconst PROPERTY_VFUNC_SPECS: PropertyVfuncSpec[] = [\n { methodName: GET_PROPERTY_VFUNC, isValueOut: true, makeDispatch: makeGetProperty },\n { methodName: SET_PROPERTY_VFUNC, isValueOut: false, makeDispatch: makeSetProperty },\n];\n\nconst PROPERTY_VFUNC_NAMES: Set<string> = new Set(PROPERTY_VFUNC_SPECS.map((spec) => spec.methodName));\nconst TYPE_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9\\-_+]{2,}$/;\nconst UPPER_CASE_PATTERN = /[A-Z]/;\nconst SIGNAL_OVERRIDE_PATTERN = /^on[A-Z]/;\n\n/**\n * Registers a subclass of a wrapper class as a new GType, wiring up any class and interface\n * virtual functions it overrides, both for the interfaces it inherits and for the ones\n * `RegisterClassOptions.implements` names.\n *\n * Throws when the class does not extend a registered wrapper class, when it has no derivable type\n * name or the name is not a valid GType name, when an entry in\n * `RegisterClassOptions.implements` is not a registered interface, when a\n * listed interface has a prerequisite that neither the parent type nor another listed interface meets,\n * when the list names `Gio.AsyncInitable` as an interface the parent type does not already\n * implement and no method on the chain fills `vfuncInitAsync`, since the default `init_async`\n * would run `vfuncInit` on a worker thread, when an entry in\n * `RegisterClassOptions.properties` names its `GObject.ParamSpec` something the key it sits under\n * does not spell, when an entry in `RegisterClassOptions.signals` carries an invalid name, a name\n * spelled with an uppercase letter rather than dashed, a name the type already knows, a GType\n * that cannot hold a value, or an accumulator the spec does not admit, and when\n * `RegisterClassOptions.cssName` is\n * given for a class that does not extend `Gtk.Widget`. An exception thrown by\n * `RegisterClassOptions.classInit` also propagates, after the type has already been registered.\n *\n * A slot is filled from the `vfunc`-prefixed methods on the class's prototype chain, up to but not\n * including the registered ancestor the class extends, so a method an intermediate base class\n * declares fills a slot the same way one the class itself declares does. A slot nothing on that\n * chain fills is left untouched.\n *\n * Declare every slot as a method: a class field holding a function, such as `vfuncGetNItems = () => 1`,\n * is assigned to each instance after registration and never reaches the vtable.\n *\n * A method named `on<SignalName>` — the signal's name in camelCase after the `on`, so `onClicked`\n * for `clicked` and `onItemsChanged` for `items-changed` — becomes that signal's default handler\n * when the type carries the signal, whether an ancestor type or an implemented interface brings it\n * or `RegisterClassOptions.signals` declares it. The method is installed as a class-closure\n * override, so it runs on every emission, on the instances a native caller creates included, in\n * the stage the signal's flags name rather than alongside connected handlers. It receives the\n * emission's arguments without the leading emitter, with `this` bound to the emitter, and what it\n * returns becomes the emission's result when the signal declares one. The same discovery walks the\n * prototype chain vfunc discovery walks, and a subclass registering its own `on<SignalName>`\n * replaces the handler for its instances, where `super.on<SignalName>()` reaches the replaced one.\n * An `on`-prefixed method naming no signal the type carries is left alone as the ordinary method\n * it is.\n *\n * An override of `vfuncConstructed` runs from inside the base constructor, before JavaScript\n * installs the subclass's field initializers and runs its constructor body, so a field still\n * reads `undefined` there and reading a `#private` field throws. Declare state the override\n * touches without an initializer, and assign private state from the constructor body after\n * `super()`. An instance a native caller creates, through `GObject.newv` or `Gtk.Builder`,\n * never runs the subclass constructor at all, so its declared fields stay uninitialized for\n * the object's whole life.\n *\n * @param klass The subclass to register.\n * @param options What the new GType gains beyond the vtable slots the class overrides.\n * @returns The same class, now registered, with every name in `options.properties` in its property map.\n */\nfunction registerClass<\n T extends AnyClass,\n TProperties extends Record<string, PropertySpec> = Record<never, PropertySpec>,\n TSignals extends Record<string, SignalSpec> = Record<never, SignalSpec>,\n>(\n klass: T,\n options?: RegisterClassOptions<T[\"prototype\"], TProperties, TSignals>,\n): RegisteredClass<T, TProperties, TSignals>;\n\nfunction registerClass(klass: AnyClass, options: AnyRegisterClassOptions = {}): AnyClass {\n const parentType = resolveParentType(klass);\n\n if (parentType === TYPE_INVALID) {\n throw new TypeError(`registerClass: ${klass.name} must extend a registered wrapper class`);\n }\n\n const name = resolveTypeName(klass, options);\n const declaredTypes = resolveInterfaceTypes(klass, options.implements ?? []);\n const adoptedTypes = declaredTypes.filter((gtype) => !typeIsA(parentType, gtype));\n const properties = options.properties ?? {};\n const signals = resolveDeclaredSignals(klass, options.signals ?? {});\n const members = collectInstanceMembers(klass);\n const { methods, inheritedNames } = members;\n checkAsyncInitable(klass, adoptedTypes, methods);\n const dispatch = buildPropertyDispatch({ klass, properties, adoptedTypes });\n\n const classVfuncs = [\n ...discoverClassVfuncs(klass, methods),\n ...propertyVfuncs({ klass, methods, dispatch, adoptedTypes }),\n ];\n\n const claimedMethodNames = new Set(classVfuncs.map((vfunc) => vfunc.methodName));\n const interfaceBindings = discoverInterfaceBindings(methods, parentType, declaredTypes, claimedMethodNames);\n\n const nativeOptions = withNativeSignals(\n toNativeOptions(classVfuncs, interfaceBindings, properties, options),\n signals.native,\n );\n\n const newType: bigint = nativeRegisterClass(name, parentType, nativeOptions);\n registerClassType(klass, newType);\n markDerivedClass(klass);\n installSignalOverrides(newType, methods);\n applyInterfaceMixins(klass, adoptedTypes, inheritedNames);\n installDeclaredSignalMethods(klass, signals.table, members.names);\n invokeClassInit(options, newType);\n\n return klass;\n}\n\nfunction invokeClassInit(options: AnyRegisterClassOptions, newType: bigint): void {\n if (options.classInit === undefined) {\n return;\n }\n\n const structClass = getClassStructClass(newType);\n\n if (structClass === undefined) {\n throw new Error(\"registerClass: no ancestor of the new type registers a class struct wrapper\");\n }\n\n options.classInit(wrapHandle(getTypeClassHandle(newType), structClass));\n}\n\nfunction resolveTypeName(klass: AnyClass, options: AnyRegisterClassOptions): string {\n const name = options.typeName ?? klass.name;\n\n if (!name) {\n throw new TypeError(\"registerClass: cannot derive a GType name (anonymous class with no typeName option)\");\n }\n\n if (!TYPE_NAME_PATTERN.test(name)) {\n throw new TypeError(\n `registerClass: '${name}' is not a valid GType name (a letter or underscore, then at ` +\n \"least two more characters, all from A-Z, a-z, 0-9, '-', '_' and '+')\",\n );\n }\n\n return name;\n}\n\nfunction resolveInterfaceType(klass: AnyClass, entry: AnyClass): bigint {\n const gtype = getClassType(entry);\n\n if (typeFundamental(gtype) !== TYPE_INTERFACE) {\n const label = typeof entry === \"function\" ? entry.name : String(entry);\n\n throw new TypeError(\n `registerClass: ${klass.name} lists '${label}' in implements, which is not a registered interface`,\n );\n }\n\n return gtype;\n}\n\nfunction resolveInterfaceTypes(klass: AnyClass, entries: AnyClass[]): bigint[] {\n return [...new Set(entries.map((entry) => resolveInterfaceType(klass, entry)))];\n}\n\nfunction checkAsyncInitable(klass: AnyClass, adoptedTypes: bigint[], methods: MethodTable): void {\n const isAsyncInitable = adoptedTypes.some((gtype) => typeName(gtype) === ASYNC_INITABLE_TYPE_NAME);\n\n if (isAsyncInitable && !methods.has(INIT_ASYNC_METHOD_NAME)) {\n throw new TypeError(\n `registerClass: ${klass.name} implements Gio.AsyncInitable without overriding 'vfuncInitAsync'; ` +\n \"the default 'init_async' would run 'vfuncInit' on a worker thread\",\n );\n }\n}\n\nfunction applyInterfaceMixins(klass: AnyClass, adoptedTypes: bigint[], inheritedNames: Set<string>): void {\n for (const gtype of adoptedTypes) {\n const mixin = getInterfaceMixin(gtype);\n\n if (mixin !== undefined) {\n insertMixinLayer(klass, mixin, inheritedNames);\n }\n }\n}\n\nfunction resolveParentType(klass: AnyClass): bigint {\n return (\n walkClassChain(getParentClass(klass), (cls) => {\n const gtype = getClassType(cls);\n\n return gtype === TYPE_INVALID ? undefined : gtype;\n }) ?? TYPE_INVALID\n );\n}\n\nfunction addOwnMember(members: InstanceMembers, proto: object, name: string, isInherited: boolean): void {\n if (name === \"constructor\") {\n return;\n }\n\n if (isInherited) {\n members.inheritedNames.add(name);\n }\n\n if (members.names.has(name)) {\n return;\n }\n\n members.names.add(name);\n const descriptor = Object.getOwnPropertyDescriptor(proto, name);\n\n if (typeof descriptor?.value === \"function\") {\n members.methods.set(name, descriptor.value as VfuncFn);\n }\n}\n\nfunction addOwnMembers(members: InstanceMembers, klass: AnyClass, isInherited: boolean): void {\n const proto = (klass as { prototype?: object }).prototype;\n\n if (proto === undefined) {\n return;\n }\n\n for (const name of Object.getOwnPropertyNames(proto)) {\n addOwnMember(members, proto, name, isInherited);\n }\n}\n\nfunction collectInstanceMembers(klass: AnyClass): InstanceMembers {\n const members: InstanceMembers = { methods: new Map(), names: new Set(), inheritedNames: new Set() };\n let cls: AnyClass | null = klass;\n\n while (cls !== null && getClassType(cls) === TYPE_INVALID) {\n addOwnMembers(members, cls, cls !== klass);\n cls = getParentClass(cls);\n }\n\n return members;\n}\n\nfunction buildDiscoveredVfunc(\n fn: VfuncFn,\n methodName: string,\n resolveDescriptor: (methodName: string) => VfuncDescriptor | undefined,\n skip: Set<string> | undefined,\n): DiscoveredVfunc | undefined {\n if (skip?.has(methodName)) {\n return undefined;\n }\n\n const descriptor = resolveDescriptor(methodName);\n\n if (!descriptor) {\n return undefined;\n }\n\n const argDescriptors = slotArgDescriptors(descriptor);\n\n return {\n ...descriptor,\n methodName,\n argDescriptors,\n fn: wrapVfunc(fn, argDescriptors, descriptor),\n };\n}\n\nfunction collectDiscoveredVfuncs(\n methods: MethodTable,\n resolveDescriptor: (methodName: string) => VfuncDescriptor | undefined,\n skip?: Set<string>,\n): DiscoveredVfunc[] {\n const result: DiscoveredVfunc[] = [];\n\n for (const [methodName, fn] of methods) {\n const discovered = buildDiscoveredVfunc(fn, methodName, resolveDescriptor, skip);\n\n if (discovered) {\n result.push(discovered);\n }\n }\n\n return result;\n}\n\nfunction discoverClassVfuncs(klass: AnyClass, methods: MethodTable): DiscoveredVfunc[] {\n return collectDiscoveredVfuncs(\n methods,\n (methodName) => findClassVfuncDescriptor(klass, methodName) ?? undefined,\n PROPERTY_VFUNC_NAMES,\n );\n}\n\nfunction wrapVfunc(\n fn: VfuncFn,\n argDescriptors: NativeRegisterClassVfunc[\"argDescriptors\"],\n descriptor: VfuncDescriptor,\n): VfuncFn {\n return wrapCallback(\n fn as (...args: unknown[]) => unknown,\n { argDescriptors, returnDescriptor: descriptor.returnDescriptor },\n \"vfunc\",\n );\n}\n\nfunction discoverInterfaceBindings(\n methods: MethodTable,\n parentGtype: bigint,\n declaredTypes: bigint[],\n claimedMethodNames: Set<string>,\n): InterfaceVfuncBinding[] {\n const declared: Set<bigint> = new Set(declaredTypes);\n const gtypes: Set<bigint> = new Set([...typeInterfaces(parentGtype), ...declaredTypes]);\n const bindings: InterfaceVfuncBinding[] = [];\n\n for (const gtype of gtypes) {\n const vfuncs = discoverInterfaceVfuncs(methods, gtype, claimedMethodNames);\n\n if (vfuncs.length > 0 || declared.has(gtype)) {\n bindings.push({ gtype, vfuncs });\n }\n }\n\n return bindings;\n}\n\nfunction discoverInterfaceVfuncs(\n methods: MethodTable,\n interfaceGtype: bigint,\n claimedMethodNames: Set<string>,\n): DiscoveredVfunc[] {\n return collectDiscoveredVfuncs(\n methods,\n (methodName) => findInterfaceVfuncDescriptor(interfaceGtype, methodName),\n claimedMethodNames,\n );\n}\n\nconst hasDispatchedProperties = (dispatch: PropertyDispatch, adoptedTypes: bigint[]): boolean =>\n dispatch.accessors.length > 0 || adoptedTypes.length > 0;\n\nfunction propertyVfuncFor(\n source: PropertyVfuncSource,\n spec: PropertyVfuncSpec,\n): DiscoveredVfunc | undefined {\n const { klass, methods, dispatch, adoptedTypes } = source;\n\n const dispatched = hasDispatchedProperties(dispatch, adoptedTypes)\n ? spec.makeDispatch(dispatch)\n : undefined;\n\n const fn = methods.get(spec.methodName) ?? dispatched;\n\n return fn === undefined ? undefined : buildPropertyVfunc(klass, spec.methodName, fn, spec.isValueOut);\n}\n\nfunction propertyVfuncs(source: PropertyVfuncSource): DiscoveredVfunc[] {\n return PROPERTY_VFUNC_SPECS.map((spec) => propertyVfuncFor(source, spec)).filter(\n (vfunc) => vfunc !== undefined,\n );\n}\n\nfunction markArg(argDescriptors: Descriptor[], index: number, patch: ArgPatch): Descriptor[] {\n return argDescriptors.map((arg, at) => (at === index ? { ...arg, ...patch } : arg));\n}\n\nfunction isTeardownSlot(descriptor: VfuncDescriptor): boolean {\n return (\n TEARDOWN_VFUNC_NAMES.has(descriptor.vfuncName) &&\n descriptor.argDescriptors[INSTANCE_ARG_INDEX]?.kind === \"object\"\n );\n}\n\nfunction slotArgDescriptors(descriptor: VfuncDescriptor): Descriptor[] {\n if (!isTeardownSlot(descriptor)) {\n return descriptor.argDescriptors;\n }\n\n return markArg(descriptor.argDescriptors, INSTANCE_ARG_INDEX, { isCallScoped: true });\n}\n\nfunction buildPropertyVfunc(\n klass: AnyClass,\n methodName: string,\n fn: VfuncFn,\n isValueOut: boolean,\n): DiscoveredVfunc {\n const descriptor = findClassVfuncDescriptor(klass, methodName);\n\n if (!descriptor) {\n throw new Error(`registerClass: the parent class exposes no '${methodName}' vtable slot`);\n }\n\n const argDescriptors = isValueOut\n ? markArg(descriptor.argDescriptors, VALUE_ARG_INDEX, { isCallerAllocated: true })\n : descriptor.argDescriptors;\n\n return {\n ...descriptor,\n methodName,\n argDescriptors,\n fn: wrapVfunc(fn, argDescriptors, descriptor),\n };\n}\n\nconst canonicalSignalName = (name: string): string => name.replaceAll(\"_\", \"-\");\n\nfunction assertLowerCaseSignalName(klass: AnyClass, name: string): void {\n if (!UPPER_CASE_PATTERN.test(name)) {\n return;\n }\n\n throw new TypeError(\n `registerClass: ${klass.name} declares the signal '${name}'; GObject would carry it under that ` +\n \"exact spelling, out of reach of both its dashed spelling and its default handler; \" +\n `declare it as '${kebabCase(name)}'`,\n );\n}\n\nfunction overriddenSignalId(type: bigint, methodName: string): number {\n if (!SIGNAL_OVERRIDE_PATTERN.test(methodName)) {\n return 0;\n }\n\n const signal = signalForHandlerName(type, methodName);\n\n return signal === undefined ? 0 : signalIdFor(type, signal);\n}\n\nfunction installSignalOverrides(newType: bigint, methods: MethodTable): void {\n for (const [methodName, fn] of methods) {\n const signalId = overriddenSignalId(newType, methodName);\n\n if (signalId === 0) {\n continue;\n }\n\n const handler = fn as (...args: unknown[]) => unknown;\n\n overrideSignalClassClosure(newType, signalId, (...args: unknown[]) =>\n handler.apply(args[0], args.slice(1)),\n );\n }\n}\n\nfunction resolveSignalGType(klass: AnyClass, signalName: string, role: string, entry: SignalGType): bigint {\n if (typeof entry === \"bigint\") {\n return entry;\n }\n\n const gtype = getClassType(entry);\n\n if (gtype === TYPE_INVALID) {\n throw new TypeError(\n `registerClass: signal '${signalName}' of ${klass.name} names a class with no registered ` +\n `GType as its ${role}`,\n );\n }\n\n return gtype;\n}\n\nfunction resolveSignalReturnType(klass: AnyClass, name: string, spec: SignalSpec): bigint | undefined {\n if (spec.returnType === undefined) {\n return undefined;\n }\n\n const returnType = resolveSignalGType(klass, name, \"return type\", spec.returnType);\n\n return returnType === TYPE_NONE ? undefined : returnType;\n}\n\nfunction resolveDeclaredSignal(\n klass: AnyClass,\n name: string,\n spec: SignalSpec,\n): { native: NativeRegisterClassSignal; declared: DeclaredSignalTypes } {\n const paramTypes = (spec.paramTypes ?? []).map((entry, index) =>\n resolveSignalGType(klass, name, `parameter ${String(index)}`, entry),\n );\n\n const returnType = resolveSignalReturnType(klass, name, spec);\n const native: NativeRegisterClassSignal = { name, paramTypes };\n const declared: DeclaredSignalTypes = { paramTypes };\n\n if (spec.flags !== undefined) {\n native.flags = spec.flags;\n }\n\n if (spec.accumulator !== undefined) {\n native.accumulator = spec.accumulator;\n }\n\n if (returnType !== undefined) {\n native.returnType = returnType;\n declared.returnType = returnType;\n }\n\n return { native, declared };\n}\n\nfunction resolveDeclaredSignals(klass: AnyClass, signals: Record<string, SignalSpec>): DeclaredSignals {\n const native: NativeRegisterClassSignal[] = [];\n const table: Map<string, DeclaredSignalTypes> = new Map();\n\n for (const [name, spec] of Object.entries(signals)) {\n assertLowerCaseSignalName(klass, name);\n const resolved = resolveDeclaredSignal(klass, name, spec);\n native.push(resolved.native);\n table.set(canonicalSignalName(name), resolved.declared);\n }\n\n return { native, table };\n}\n\nfunction inheritedSignalMethod<T>(inherited: T | undefined, signal: string): T {\n if (inherited === undefined) {\n throw new Error(`Unknown signal '${signal}'`);\n }\n\n return inherited;\n}\n\nfunction installDeclaredConnect(\n proto: SignalMethodHost,\n findDeclared: (signal: string) => DeclaredSignalTypes | undefined,\n): void {\n const inheritedConnect = proto.connect;\n\n proto.connect = function connect(\n this: object,\n signal: string,\n handler: SignalHandler,\n isAfter?: boolean,\n ): number {\n if (findDeclared(signal) === undefined) {\n return inheritedSignalMethod(inheritedConnect, signal).call(this, signal, handler, isAfter);\n }\n\n return connectClosureSignal(this, signal, handler, isAfter ?? false);\n };\n}\n\nfunction installDeclaredEmit(\n proto: SignalMethodHost,\n findDeclared: (signal: string) => DeclaredSignalTypes | undefined,\n): void {\n const inheritedEmit = proto.emit;\n\n proto.emit = function emit(this: object, sigName: string, ...args: unknown[]): unknown {\n const declared = findDeclared(sigName);\n\n if (declared === undefined) {\n return inheritedSignalMethod(inheritedEmit, sigName).call(this, sigName, ...args);\n }\n\n return emitDeclaredSignal(this, sigName, declared, args);\n };\n}\n\nfunction installDeclaredSignalMethods(\n klass: AnyClass,\n table: Map<string, DeclaredSignalTypes>,\n definedNames: Set<string>,\n): void {\n if (table.size === 0) {\n return;\n }\n\n const proto = klass.prototype as SignalMethodHost;\n\n const findDeclared = (signal: string): DeclaredSignalTypes | undefined =>\n table.get(canonicalSignalName(getSignalBaseName(signal)));\n\n if (!definedNames.has(\"connect\")) {\n installDeclaredConnect(proto, findDeclared);\n }\n\n if (!definedNames.has(\"emit\")) {\n installDeclaredEmit(proto, findDeclared);\n }\n}\n\nfunction toNativeInterface(binding: InterfaceVfuncBinding): NativeRegisterClassInterface {\n const nativeInterface: NativeRegisterClassInterface = {\n type: binding.gtype,\n vfuncs: [...binding.vfuncs],\n };\n\n const vtableSize = binding.vfuncs[0]?.vtableSize;\n\n if (vtableSize !== undefined) {\n nativeInterface.vtableSize = vtableSize;\n }\n\n return nativeInterface;\n}\n\nfunction withNativeSignals(\n options: NativeRegisterClassOptions | undefined,\n signals: NativeRegisterClassSignal[],\n): NativeRegisterClassOptions | undefined {\n if (signals.length === 0) {\n return options;\n }\n\n return { ...options, signals };\n}\n\nfunction applyNativeTypeOptions(options: NativeRegisterClassOptions, source: AnyRegisterClassOptions): void {\n if (source.abstract ?? false) {\n options.abstract = true;\n }\n\n if (source.cssName !== undefined) {\n options.cssName = source.cssName;\n }\n}\n\nfunction toNativeOptions(\n classVfuncs: DiscoveredVfunc[],\n interfaceBindings: InterfaceVfuncBinding[],\n properties: Record<string, PropertySpec>,\n source: AnyRegisterClassOptions,\n): NativeRegisterClassOptions | undefined {\n const options: NativeRegisterClassOptions = {};\n applyNativeTypeOptions(options, source);\n\n if (Object.keys(properties).length > 0) {\n options.properties = toNativeProperties(properties);\n }\n\n if (classVfuncs.length > 0) {\n options.vfuncs = [...classVfuncs];\n }\n\n if (interfaceBindings.length > 0) {\n options.interfaces = interfaceBindings.map((binding) => toNativeInterface(binding));\n }\n\n return Object.keys(options).length > 0 ? options : undefined;\n}\n\nexport { type Interface, registerClass, type SignalGType, type SignalSpec };\n"]}
|
|
1
|
+
{"version":3,"file":"register-class.js","sourceRoot":"","sources":["../src/register-class.ts"],"names":[],"mappings":"AACA,OAAO,EACH,aAAa,IAAI,mBAAmB,GAKvC,MAAM,cAAc,CAAC;AACtB,OAAO,EAAiB,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EACH,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,eAAe,EAGf,kBAAkB,EAClB,kBAAkB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACH,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAEjB,UAAU,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,oBAAoB,EAEpB,kBAAkB,EAClB,iBAAiB,EACjB,0BAA0B,EAC1B,oBAAoB,EAEpB,WAAW,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACH,cAAc,EACd,YAAY,EACZ,SAAS,EAET,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,OAAO,EACP,QAAQ,GACX,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,wBAAwB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,CAAC,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC;AAED,OAAO,EAAkB,aAAa,EAAqC,CAAC","sourcesContent":["import type { Descriptor } from \"@gtkx/native\";\nimport {\n registerClass as nativeRegisterClass,\n type RegisterClassInterface as NativeRegisterClassInterface,\n type RegisterClassOptions as NativeRegisterClassOptions,\n type RegisterClassSignal as NativeRegisterClassSignal,\n type RegisterClassVfunc as NativeRegisterClassVfunc,\n} from \"@gtkx/native\";\nimport { type AnyClass, getParentClass, kebabCase, walkClassChain } from \"@gtkx/utils\";\nimport { wrapCallback } from \"./callback.js\";\nimport { insertMixinLayer } from \"./mixin.js\";\nimport {\n buildPropertyDispatch,\n GET_PROPERTY_VFUNC,\n makeGetProperty,\n makeSetProperty,\n type PropertyDispatch,\n type PropertySpec,\n SET_PROPERTY_VFUNC,\n toNativeProperties,\n} from \"./properties.js\";\nimport {\n getClassStructClass,\n getClassType,\n getInterfaceMixin,\n getTypeClassHandle,\n markDerivedClass,\n registerClassType,\n type VfuncDescriptor,\n wrapHandle,\n} from \"./registry.js\";\nimport {\n connectClosureSignal,\n type DeclaredSignalTypes,\n emitDeclaredSignal,\n getSignalBaseName,\n overrideSignalClassClosure,\n signalForHandlerName,\n type SignalHandler,\n signalIdFor,\n} from \"./signal.js\";\nimport {\n TYPE_INTERFACE,\n TYPE_INVALID,\n TYPE_NONE,\n type TypedClass,\n typeFundamental,\n typeInterfacePrerequisites,\n typeInterfaces,\n typeIsA,\n typeName,\n} from \"./type.js\";\nimport { findClassVfuncDescriptor, findInterfaceVfuncDescriptor } from \"./vfunc.js\";\n\n/**\n * A generated interface value, such as `Gio.ListModel`, in the form {@link registerClass} takes it.\n * `__impl__` exists only in the type system: it carries the interface's `Impl` type, of which a class\n * has to match every member it declares itself, which rejects a class value and a member whose\n * signature does not fit the slot it fills. Leaving a slot to the interface is not rejected,\n * because `registerClass` does not reject it either: every member of an `Impl` type is optional,\n * and the `Partial` holds that open whatever the type declares. The `object` beside it keeps\n * TypeScript from also demanding one member in common. An interface that introspection describes\n * no vtable for carries `unknown`, since it has no slot a class could fill.\n */\ntype Interface<TImpl> = AnyClass & {\n /** Type-level slot holding the interface's `Impl` type; no value ever carries it. */\n __impl__: (impl: Partial<TImpl> & object) => void;\n};\n\n/**\n * One key of `RegisterClassOptions.properties` with every underscore turned into the dash a canonical\n * GObject property name separates its words with.\n */\ntype Dashed<TName extends string> = TName extends `${infer THead}_${infer TTail}`\n ? Dashed<`${THead}-${TTail}`>\n : TName;\n\n/**\n * One dashed key in the camelCase spelling the accessors {@link registerClass} installs carry, which is\n * the spelling the hooks that address a property by name take.\n */\ntype Camelized<TName extends string> = TName extends `${infer THead}-${infer TTail}`\n ? `${THead}${Capitalize<Camelized<TTail>>}`\n : TName;\n\n/**\n * The names a registered class carries in its property map: every key of\n * `RegisterClassOptions.properties` in camelCase, whichever spelling it was written in.\n * A `properties` object given a type of its own rather than left to inference has `string` for its key\n * type and names nothing, because a name only known as `string` addresses no member in particular.\n */\ntype InstalledNames<TProperties> = string extends keyof TProperties\n ? never\n : Camelized<Dashed<keyof TProperties & string>>;\n\n/**\n * The base names the signal surface takes for the signals `RegisterClassOptions.signals` declares:\n * each name as written, plus its canonical spelling with underscores turned into dashes, which\n * GObject knows the signal by too.\n */\ntype DeclaredSignalBase<TSignals> = (keyof TSignals & string) | Dashed<keyof TSignals & string>;\n/**\n * The names `connect` and `emit` take for one of the signals `RegisterClassOptions.signals`\n * declares: each spelling of each name, plus its detailed form for a signal emitted with a\n * `::detail` suffix.\n */\ntype DeclaredSignalName<TSignals> = DeclaredSignalBase<TSignals> | `${DeclaredSignalBase<TSignals>}::${string}`;\n\n/**\n * The `connect` and `emit` signatures instances gain for the signals\n * `RegisterClassOptions.signals` declares, widening the inherited ones, which take only the names\n * introspection knows. A class declaring no signals gains nothing, since no name reaches the\n * added signatures.\n */\ntype DeclaredSignalMethods<TSignals> = {\n /**\n * Type-level map from declared signal name to handler signature, feeding the hooks that\n * address a signal by name, such as `useSignal` from `@gtkx/react`; no value ever carries it.\n */\n __signals__?: Record<DeclaredSignalBase<TSignals>, (...args: never[]) => unknown>;\n /** Connects a handler to a signal `RegisterClassOptions.signals` declared. */\n connect(\n signal: DeclaredSignalName<TSignals>,\n handler: (...args: never[]) => unknown,\n isAfter?: boolean,\n ): number;\n /** Emits a signal `RegisterClassOptions.signals` declared. */\n emit(sigName: DeclaredSignalName<TSignals>, ...args: unknown[]): unknown;\n /** Connects a handler to a signal `RegisterClassOptions.signals` declared, for `off` to take off. */\n on(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown, isAfter?: boolean): unknown;\n /** Connects a handler to a signal `RegisterClassOptions.signals` declared for one emission. */\n once(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown, isAfter?: boolean): unknown;\n /** Disconnects a handler `on` or `once` connected to a signal `RegisterClassOptions.signals` declared. */\n off(sigName: DeclaredSignalName<TSignals>, callback: (...args: unknown[]) => unknown): unknown;\n};\n\n/**\n * An instance of a registered class: everything the class itself declares, plus the property map the\n * hooks that address a property by name, such as `useProperty` from `@gtkx/react`, read the installed\n * names off. Each name is typed with the value type the class declares for the member of that name,\n * so a property the class does not `declare` contributes nothing.\n */\ntype RegisteredInstance<TInstance, TProperties, TSignals> = TInstance &\n DeclaredSignalMethods<TSignals> & {\n /** Type-level map from installed property name to value type; no value ever carries it. */\n __properties__: Pick<TInstance, InstalledNames<TProperties> & keyof TInstance>;\n };\n\n/**\n * The construct signature and prototype a registered class carries, both giving\n * {@link RegisteredInstance}. The signature stays abstract for as long as the class itself is, so\n * registering an abstract base leaves it as impossible to construct as it was.\n */\ntype RegisteredConstructor<TClass, TArgs extends unknown[], TInstance> = {\n /** Object the class's instances inherit from. */\n prototype: TInstance;\n} & (TClass extends new (...args: never) => unknown\n ? new (...args: TArgs) => TInstance\n : abstract new (...args: TArgs) => TInstance);\n\n/** The statics a registered class keeps from the class it was, joined with {@link RegisteredConstructor}. */\ntype RegisteredParts<TClass, TArgs extends unknown[], TInstance> = Omit<TClass, \"prototype\"> &\n RegisteredConstructor<TClass, TArgs, TInstance>;\n\n/**\n * The class {@link registerClass} hands back: the same class, with the same statics, whose instances\n * carry the properties `RegisterClassOptions.properties` installed and take the signals\n * `RegisterClassOptions.signals` declares by name. Binding the call to a name, rather than\n * discarding it, is what carries those names into the type system.\n */\ntype RegisteredClass<TClass extends AnyClass, TProperties, TSignals> =\n TClass extends abstract new (...args: infer TArgs) => infer TInstance\n ? RegisteredParts<TClass, TArgs, RegisteredInstance<TInstance, TProperties, TSignals>>\n : never;\n\n/**\n * A GType in the form `RegisterClassOptions.signals` takes one: the numeric GType itself, such as\n * `TYPE_STRING` from `@gtkx/gi/gobject`, or a class carrying one, which is any generated wrapper\n * class and any class an earlier {@link registerClass} call registered.\n */\ntype SignalGType = bigint | AnyClass<TypedClass>;\n\n/**\n * One signal `RegisterClassOptions.signals` creates on the new type, sitting under the signal's\n * name. Every part is optional: `{}` declares a signal with no arguments and no return value that\n * runs its handlers in the default `RUN_FIRST` stage.\n */\ntype SignalSpec = {\n /**\n * `GObject.SignalFlags` bit mask for the signal, defaulting to `RUN_FIRST`. `DETAILED` lets\n * handlers connect to and emissions name a `::detail` suffix.\n */\n flags?: number;\n /** GType of each argument an emission carries, defaulting to none. */\n paramTypes?: SignalGType[];\n /** GType of the value an emission returns, defaulting to none. */\n returnType?: SignalGType;\n /**\n * How the emission combines what its handlers return, limited to the accumulators GObject\n * ships: `\"first-wins\"` stops the emission at the first handler and keeps its result, and\n * `\"true-handled\"` runs handlers until one returns `true`, which requires a boolean\n * `returnType`. Without one, every handler runs and the last result stands.\n */\n accumulator?: \"first-wins\" | \"true-handled\";\n};\n\n/** What {@link registerClass} adds to the new GType beyond the vtable slots it discovers on the class. */\ntype RegisterClassOptions<\n TInstance extends object,\n TProperties extends Record<string, PropertySpec>,\n TSignals extends Record<string, SignalSpec>,\n> = {\n /**\n * Name to register the new GType under, defaulting to the class's own name. Either way the\n * name has to be a valid GType name: at least three characters, starting with a letter or\n * underscore, the rest letters, digits, `-`, `_` or `+`. Any other name throws a `TypeError`.\n */\n typeName?: string;\n /**\n * Registers the new GType abstract, the way `G_TYPE_FLAG_ABSTRACT` marks a C type: the class\n * still serves as a parent for further registered subclasses, which instantiate as usual, but\n * constructing it directly throws, whether from JavaScript or from a native caller.\n */\n abstract?: boolean;\n /**\n * Name instances of the new type carry in CSS, applied through `gtk_widget_class_set_css_name`\n * from inside the type's `class_init`, so every instance is born with it, wherever it is\n * created from. Requires the class to extend `Gtk.Widget`; registering a non-widget with a\n * `cssName` throws.\n */\n cssName?: string;\n /**\n * Hook run once, synchronously, while `registerClass` registers the type, after its\n * `class_init` has installed the vfuncs, properties and signals declared here. It receives the\n * new type's class struct wrapped in its generated GTypeStruct wrapper, so class-level setup\n * calls such as `Gtk.WidgetClass.installAction`, `Gtk.WidgetClass.addShortcut` and\n * `Gtk.WidgetClass.setLayoutManagerType` have somewhere to land. The wrapper serves the\n * members of every struct in the parent chain on one object: a widget subclass sees\n * `Gtk.WidgetClass` and `GObject.ObjectClass` members alike, so the parameter can be declared\n * as whichever of those types the hook needs. The class struct belongs to the type system for\n * the life of the process, so keeping the wrapper around past the hook is safe, if rarely\n * useful. An exception the hook throws propagates out of `registerClass`, with the type\n * already registered: GObject offers no way to unregister a static type.\n */\n classInit?(typeStruct: object): void;\n /**\n * Interfaces the new type implements on top of the ones it inherits, given as the interface values\n * themselves, such as `Gio.ListModel`. Their vtable slots are filled from the `vfunc`-prefixed methods on\n * the class's prototype chain, each of which has to match the interface's `Impl` type, such as\n * `Gio.ListModelImpl`.\n */\n implements?: Interface<TInstance>[];\n /**\n * Properties to install on the new type, keyed by the name JavaScript addresses each one by and\n * valued with the `GObject.ParamSpec` describing it. A key is read in camelCase however it is\n * written, so `dewPoint`, `dew_point` and `dew-point` all name the same member, and the ParamSpec\n * has to carry a name that reads back as that same member, such as `dew-point`, or registration\n * throws: the ParamSpec's name is the one GObject emits `notify` with, and a name the key does\n * not spell reaches nothing that listens for it. A word starting with a digit is a word of its\n * own on either side of that reading, so `level2Depth` takes a ParamSpec named `level-2-depth`\n * as readily as one named `level2-depth`, the way `WebKit.Settings` names\n * `enable-2d-canvas-acceleration` for its `enable2dCanvasAcceleration` member. An uppercase\n * letter in the ParamSpec's own name is refused, since GObject notifies under that spelling\n * and nothing else reads it back. Every property gains prototype accessors, one for the key as\n * written, one for it with dashes turned into underscores and one for it in camelCase, each\n * unless the class already defines that name. They serve the value from storage of their own on\n * the instance, which is also what the type's `get_property` and `set_property` slots read and\n * write, so a value set from JavaScript, from `g_object_set_property` and at construction all\n * land in the same place.\n *\n * A write the ParamSpec would refuse throws rather than reaching GObject, which reports such a\n * write as a GLib critical and drops it: a `TypeError` for a read-only or construct-only\n * property and for a value of a type the property cannot hold, and a `RangeError` for a value\n * the ParamSpec rejects. The same checks run over a value handed to the constructor, where\n * a construct-only property is the one that is writable. An accepted write emits one `notify`,\n * which a `freeze_notify` batch collects; a write of the value the property already holds is\n * dropped and emits none.\n *\n * `null` and `undefined` both mean NULL, and mean it only where the ParamSpec's own type holds\n * NULL, which is a string, string-array, boxed, object, interface, param, variant or pointer\n * property. Such a property holds the `null` either spelling wrote, so the member, the type's\n * `get_property` slot and `g_object_get_property` serve the same thing, and writing the other\n * spelling over it emits no `notify`. Every other property, so every integer, floating-point,\n * boolean, enum, flags and GType one, refuses both with the same `TypeError` it refuses a\n * string with, and keeps the value it already holds. It refuses them for what it holds rather\n * than for its range, whatever that range is: the type is checked before the range, so a\n * `gint` whose range excludes 0 answers a nullish with that same `TypeError` and never with\n * the `RangeError` that names the value GObject would put in its place. The one place\n * `undefined` means something else is the constructor, which reads it as the property not\n * being given at all and leaves it at the ParamSpec's default, so a property is never handed a\n * value it cannot serve back.\n *\n * A floating-point property takes every JavaScript number, `NaN` and both infinities\n * included, and its ParamSpec alone rules on which of them the range admits: a `gdouble`\n * bounded by `-Infinity` and `Infinity` holds either infinity, and a magnitude a bounded\n * one excludes, like any `NaN`, comes back as the `RangeError` that names what GObject\n * would put in its place rather than as the `TypeError` a type the property cannot hold\n * earns. A `gfloat` property holds what GObject narrows the double to, so it serves `0.1`\n * back as `0.10000000149011612` and a finite magnitude no `gfloat` reaches as an infinity,\n * which the range then rules on in turn. That narrowing belongs to the property alone: the\n * same magnitude written to a `gfloat` through a generated binding, a signal argument or a\n * closure return is refused outright rather than narrowed.\n *\n * A generated property of a wrapped type answers a nullish differently, and the two halves of\n * the API disagree here: that property marshals what it is written through its descriptor\n * rather than through the checks above, so `new Gtk.Label({ widthRequest: null })` and a later\n * write of `null` to that member both land 0, where a `gint` installed here refuses both.\n *\n * A class that defines the camelCase member itself owns the property: its own accessor decides\n * what a write means, the other spellings forward to it, and the type's property slots read\n * and write it rather than the generated storage.\n */\n properties?: TProperties;\n /**\n * Signals to create on the new type, keyed by signal name and valued with the\n * {@link SignalSpec} describing each one. A name has to start with a lowercase letter, continue\n * in lowercase letters, digits, `-` and `_`, and be new to the type: one an ancestor type or a\n * listed interface already carries throws, and so does one carrying an uppercase letter, which\n * GObject would carry under that exact spelling, out of reach of both its dashed spelling and\n * its `on<SignalName>` default handler. Either word separator spells the same signal, so a\n * signal declared as `data_changed` is connected to and emitted as `data-changed` too.\n *\n * Instances connect and emit by name through the same `connect`, `on`, `once`, `off` and\n * `emit` surface inherited signals use: `registerClass` wraps `connect` and `emit` on the\n * class's prototype to serve the declared names, unless the class defines the member itself,\n * and hands every other name to the inherited implementation. A handler receives the\n * emission's arguments without the leading emitter, matching a generated signal, and what it\n * returns becomes the emission's return value when the signal declares one.\n *\n * The declared parameter GTypes rule the emission: `emit` takes exactly one argument per\n * declared parameter, throwing a `TypeError` for any other count, and converts each argument\n * into a `GValue` of the declared type, throwing for a value that type cannot hold. The signals\n * are created with no class closure of their own, but a method named `on<SignalName>`\n * becomes the signal's default handler, the way every `on`-prefixed method that names a\n * signal the type carries does; see {@link registerClass}.\n */\n signals?: TSignals;\n};\n\n/** {@link RegisterClassOptions} with the widest instance and property types {@link registerClass} accepts. */\ntype AnyRegisterClassOptions = RegisterClassOptions<object, Record<string, PropertySpec>, Record<string, SignalSpec>>;\ntype VfuncFn = NativeRegisterClassVfunc[\"fn\"];\ntype DiscoveredVfunc = VfuncDescriptor & { methodName: string; fn: VfuncFn };\ntype MethodTable = Map<string, VfuncFn>;\ntype InstanceMembers = { methods: MethodTable; names: Set<string>; inheritedNames: Set<string> };\n\ntype InterfaceVfuncBinding = {\n gtype: bigint;\n vfuncs: DiscoveredVfunc[];\n};\n\ntype PropertyVfuncSource = {\n klass: AnyClass;\n methods: MethodTable;\n dispatch: PropertyDispatch;\n adoptedTypes: bigint[];\n};\n\ntype PropertyVfuncSpec = {\n methodName: string;\n isValueOut: boolean;\n makeDispatch: (dispatch: PropertyDispatch) => VfuncFn;\n};\n\ntype ArgPatch = { isCallerAllocated: true } | { isCallScoped: true };\ntype DeclaredSignals = { native: NativeRegisterClassSignal[]; table: Map<string, DeclaredSignalTypes> };\n\ntype SignalMethodHost = {\n connect?: (signal: string, handler: SignalHandler, isAfter?: boolean) => number;\n emit?: (sigName: string, ...args: unknown[]) => unknown;\n};\n\nconst INSTANCE_ARG_INDEX = 0;\nconst VALUE_ARG_INDEX = 2;\nconst TEARDOWN_VFUNC_NAMES: Set<string> = new Set([\"dispose\", \"finalize\"]);\nconst ASYNC_INITABLE_TYPE_NAME = \"GAsyncInitable\";\nconst INIT_ASYNC_METHOD_NAME = \"vfuncInitAsync\";\n\nconst PROPERTY_VFUNC_SPECS: PropertyVfuncSpec[] = [\n { methodName: GET_PROPERTY_VFUNC, isValueOut: true, makeDispatch: makeGetProperty },\n { methodName: SET_PROPERTY_VFUNC, isValueOut: false, makeDispatch: makeSetProperty },\n];\n\nconst PROPERTY_VFUNC_NAMES: Set<string> = new Set(PROPERTY_VFUNC_SPECS.map((spec) => spec.methodName));\nconst VFUNC_METHOD_PATTERN = /^vfunc[A-Z0-9]/;\nconst TYPE_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9\\-_+]{2,}$/;\nconst UPPER_CASE_PATTERN = /[A-Z]/;\nconst SIGNAL_OVERRIDE_PATTERN = /^on[A-Z]/;\n\n/**\n * Registers a subclass of a wrapper class as a new GType, wiring up any class and interface\n * virtual functions it overrides, both for the interfaces it inherits and for the ones\n * `RegisterClassOptions.implements` names.\n *\n * Throws when the class does not extend a registered wrapper class, when it has no derivable type\n * name or the name is not a valid GType name, when an entry in\n * `RegisterClassOptions.implements` is not a registered interface, when a\n * listed interface has a prerequisite that neither the parent type nor another listed interface meets,\n * when the list names `Gio.AsyncInitable` as an interface the parent type does not already\n * implement and no method on the chain fills `vfuncInitAsync`, since the default `init_async`\n * would run `vfuncInit` on a worker thread, when an entry in\n * `RegisterClassOptions.properties` names its `GObject.ParamSpec` something the key it sits under\n * does not spell, when an entry in `RegisterClassOptions.signals` carries an invalid name, a name\n * spelled with an uppercase letter rather than dashed, a name the type already knows, a GType\n * that cannot hold a value, or an accumulator the spec does not admit, and when\n * `RegisterClassOptions.cssName` is\n * given for a class that does not extend `Gtk.Widget`. An exception thrown by\n * `RegisterClassOptions.classInit` also propagates, after the type has already been registered.\n *\n * A slot is filled from the `vfunc`-prefixed methods on the class's prototype chain, up to but not\n * including the registered ancestor the class extends, so a method an intermediate base class\n * declares fills a slot the same way one the class itself declares does. A slot nothing on that\n * chain fills is left untouched.\n *\n * Declare every slot as a method: a class field holding a function, such as `vfuncGetNItems = () => 1`,\n * is assigned to each instance after registration and never reaches the vtable.\n *\n * A method named `on<SignalName>` — the signal's name in camelCase after the `on`, so `onClicked`\n * for `clicked` and `onItemsChanged` for `items-changed` — becomes that signal's default handler\n * when the type carries the signal, whether an ancestor type or an implemented interface brings it\n * or `RegisterClassOptions.signals` declares it. The method is installed as a class-closure\n * override, so it runs on every emission, on the instances a native caller creates included, in\n * the stage the signal's flags name rather than alongside connected handlers. It receives the\n * emission's arguments without the leading emitter, with `this` bound to the emitter, and what it\n * returns becomes the emission's result when the signal declares one. The same discovery walks the\n * prototype chain vfunc discovery walks, and a subclass registering its own `on<SignalName>`\n * replaces the handler for its instances, where `super.on<SignalName>()` reaches the replaced one.\n * An `on`-prefixed method naming no signal the type carries is left alone as the ordinary method\n * it is.\n *\n * An override of `vfuncConstructed` runs from inside the base constructor, before JavaScript\n * installs the subclass's field initializers and runs its constructor body, so a field still\n * reads `undefined` there and reading a `#private` field throws. Declare state the override\n * touches without an initializer, and assign private state from the constructor body after\n * `super()`. An instance a native caller creates, through `GObject.newv` or `Gtk.Builder`,\n * never runs the subclass constructor at all, so its declared fields stay uninitialized for\n * the object's whole life.\n *\n * @param klass The subclass to register.\n * @param options What the new GType gains beyond the vtable slots the class overrides.\n * @returns The same class, now registered, with every name in `options.properties` in its property map.\n */\nfunction registerClass<\n T extends AnyClass,\n TProperties extends Record<string, PropertySpec> = Record<never, PropertySpec>,\n TSignals extends Record<string, SignalSpec> = Record<never, SignalSpec>,\n>(\n klass: T,\n options?: RegisterClassOptions<T[\"prototype\"], TProperties, TSignals>,\n): RegisteredClass<T, TProperties, TSignals>;\n\nfunction registerClass(klass: AnyClass, options: AnyRegisterClassOptions = {}): AnyClass {\n const parentType = resolveParentType(klass);\n\n if (parentType === TYPE_INVALID) {\n throw new TypeError(`registerClass: ${klass.name} must extend a registered wrapper class`);\n }\n\n const name = resolveTypeName(klass, options);\n const declaredTypes = resolveInterfaceTypes(klass, options.implements ?? []);\n assertInterfacePrerequisites(klass, parentType, declaredTypes);\n const adoptedTypes = declaredTypes.filter((gtype) => !typeIsA(parentType, gtype));\n const properties = options.properties ?? {};\n const signals = resolveDeclaredSignals(klass, options.signals ?? {});\n const members = collectInstanceMembers(klass);\n const { methods, inheritedNames } = members;\n checkAsyncInitable(klass, adoptedTypes, methods);\n const dispatch = buildPropertyDispatch({ klass, properties, adoptedTypes });\n\n const classVfuncs = [\n ...discoverClassVfuncs(klass, methods),\n ...propertyVfuncs({ klass, methods, dispatch, adoptedTypes }),\n ];\n\n const claimedMethodNames = new Set(classVfuncs.map((vfunc) => vfunc.methodName));\n const interfaceBindings = discoverInterfaceBindings(methods, parentType, declaredTypes, claimedMethodNames);\n assertClaimedVfuncs(klass, methods, claimedMethodNames, interfaceBindings);\n\n const nativeOptions = withNativeSignals(\n toNativeOptions(classVfuncs, interfaceBindings, properties, options),\n signals.native,\n );\n\n const newType: bigint = nativeRegisterClass(name, parentType, nativeOptions);\n registerClassType(klass, newType);\n markDerivedClass(klass);\n installSignalOverrides(newType, methods);\n applyInterfaceMixins(klass, adoptedTypes, inheritedNames);\n installDeclaredSignalMethods(klass, signals.table, members.names);\n invokeClassInit(options, newType);\n\n return klass;\n}\n\nfunction invokeClassInit(options: AnyRegisterClassOptions, newType: bigint): void {\n if (options.classInit === undefined) {\n return;\n }\n\n const structClass = getClassStructClass(newType);\n\n if (structClass === undefined) {\n throw new Error(\"registerClass: no ancestor of the new type registers a class struct wrapper\");\n }\n\n options.classInit(wrapHandle(getTypeClassHandle(newType), structClass));\n}\n\nfunction resolveTypeName(klass: AnyClass, options: AnyRegisterClassOptions): string {\n const name = options.typeName ?? klass.name;\n\n if (!name) {\n throw new TypeError(\"registerClass: cannot derive a GType name (anonymous class with no typeName option)\");\n }\n\n if (!TYPE_NAME_PATTERN.test(name)) {\n throw new TypeError(\n `registerClass: '${name}' is not a valid GType name (a letter or underscore, then at ` +\n \"least two more characters, all from A-Z, a-z, 0-9, '-', '_' and '+')\",\n );\n }\n\n return name;\n}\n\nfunction resolveInterfaceType(klass: AnyClass, entry: AnyClass): bigint {\n const gtype = getClassType(entry);\n\n if (typeFundamental(gtype) !== TYPE_INTERFACE) {\n const label = typeof entry === \"function\" ? entry.name : String(entry);\n\n throw new TypeError(\n `registerClass: ${klass.name} lists '${label}' in implements, which is not a registered interface`,\n );\n }\n\n return gtype;\n}\n\nfunction resolveInterfaceTypes(klass: AnyClass, entries: AnyClass[]): bigint[] {\n return [...new Set(entries.map((entry) => resolveInterfaceType(klass, entry)))];\n}\n\nfunction checkAsyncInitable(klass: AnyClass, adoptedTypes: bigint[], methods: MethodTable): void {\n const isAsyncInitable = adoptedTypes.some((gtype) => typeName(gtype) === ASYNC_INITABLE_TYPE_NAME);\n\n if (isAsyncInitable && !methods.has(INIT_ASYNC_METHOD_NAME)) {\n throw new TypeError(\n `registerClass: ${klass.name} implements Gio.AsyncInitable without overriding 'vfuncInitAsync'; ` +\n \"the default 'init_async' would run 'vfuncInit' on a worker thread\",\n );\n }\n}\n\nfunction applyInterfaceMixins(klass: AnyClass, adoptedTypes: bigint[], inheritedNames: Set<string>): void {\n for (const gtype of adoptedTypes) {\n const mixin = getInterfaceMixin(gtype);\n\n if (mixin !== undefined) {\n insertMixinLayer(klass, mixin, inheritedNames);\n }\n }\n}\n\nfunction resolveParentType(klass: AnyClass): bigint {\n return (\n walkClassChain(getParentClass(klass), (cls) => {\n const gtype = getClassType(cls);\n\n return gtype === TYPE_INVALID ? undefined : gtype;\n }) ?? TYPE_INVALID\n );\n}\n\nfunction addOwnMember(members: InstanceMembers, proto: object, name: string, isInherited: boolean): void {\n if (name === \"constructor\") {\n return;\n }\n\n if (isInherited) {\n members.inheritedNames.add(name);\n }\n\n if (members.names.has(name)) {\n return;\n }\n\n members.names.add(name);\n const descriptor = Object.getOwnPropertyDescriptor(proto, name);\n\n if (typeof descriptor?.value === \"function\") {\n members.methods.set(name, descriptor.value as VfuncFn);\n }\n}\n\nfunction addOwnMembers(members: InstanceMembers, klass: AnyClass, isInherited: boolean): void {\n const proto = (klass as { prototype?: object }).prototype;\n\n if (proto === undefined) {\n return;\n }\n\n for (const name of Object.getOwnPropertyNames(proto)) {\n addOwnMember(members, proto, name, isInherited);\n }\n}\n\nfunction collectInstanceMembers(klass: AnyClass): InstanceMembers {\n const members: InstanceMembers = { methods: new Map(), names: new Set(), inheritedNames: new Set() };\n let cls: AnyClass | null = klass;\n\n while (cls !== null && getClassType(cls) === TYPE_INVALID) {\n addOwnMembers(members, cls, cls !== klass);\n cls = getParentClass(cls);\n }\n\n return members;\n}\n\nfunction buildDiscoveredVfunc(\n fn: VfuncFn,\n methodName: string,\n resolveDescriptor: (methodName: string) => VfuncDescriptor | undefined,\n skip: Set<string> | undefined,\n): DiscoveredVfunc | undefined {\n if (skip?.has(methodName)) {\n return undefined;\n }\n\n const descriptor = resolveDescriptor(methodName);\n\n if (!descriptor) {\n return undefined;\n }\n\n const argDescriptors = slotArgDescriptors(descriptor);\n\n return {\n ...descriptor,\n methodName,\n argDescriptors,\n fn: wrapVfunc(fn, argDescriptors, descriptor),\n };\n}\n\nfunction collectDiscoveredVfuncs(\n methods: MethodTable,\n resolveDescriptor: (methodName: string) => VfuncDescriptor | undefined,\n skip?: Set<string>,\n): DiscoveredVfunc[] {\n const result: DiscoveredVfunc[] = [];\n\n for (const [methodName, fn] of methods) {\n const discovered = buildDiscoveredVfunc(fn, methodName, resolveDescriptor, skip);\n\n if (discovered) {\n result.push(discovered);\n }\n }\n\n return result;\n}\n\nfunction discoverClassVfuncs(klass: AnyClass, methods: MethodTable): DiscoveredVfunc[] {\n return collectDiscoveredVfuncs(\n methods,\n (methodName) => findClassVfuncDescriptor(klass, methodName) ?? undefined,\n PROPERTY_VFUNC_NAMES,\n );\n}\n\nfunction wrapVfunc(\n fn: VfuncFn,\n argDescriptors: NativeRegisterClassVfunc[\"argDescriptors\"],\n descriptor: VfuncDescriptor,\n): VfuncFn {\n return wrapCallback(\n fn as (...args: unknown[]) => unknown,\n { argDescriptors, returnDescriptor: descriptor.returnDescriptor },\n \"vfunc\",\n );\n}\n\nconst claimedVfuncNames = (\n claimedMethodNames: Set<string>,\n interfaceBindings: InterfaceVfuncBinding[],\n): Set<string> => {\n const claimed = new Set(claimedMethodNames);\n\n for (const binding of interfaceBindings) {\n for (const vfunc of binding.vfuncs) {\n claimed.add(vfunc.methodName);\n }\n }\n\n return claimed;\n};\n\nconst isPrerequisiteMet = (parentType: bigint, declaredTypes: bigint[], prerequisite: bigint): boolean =>\n typeIsA(parentType, prerequisite) || declaredTypes.includes(prerequisite);\n\nfunction assertPrerequisitesFor(klass: AnyClass, parentType: bigint, declaredTypes: bigint[], iface: bigint): void {\n for (const prerequisite of typeInterfacePrerequisites(iface)) {\n if (!isPrerequisiteMet(parentType, declaredTypes, prerequisite)) {\n throw new TypeError(\n `registerClass: ${klass.name} does not meet prerequisite ` +\n `'${typeName(prerequisite) ?? String(prerequisite)}' of interface ` +\n `'${typeName(iface) ?? String(iface)}'`,\n );\n }\n }\n}\n\nfunction assertInterfacePrerequisites(klass: AnyClass, parentType: bigint, declaredTypes: bigint[]): void {\n for (const iface of declaredTypes) {\n assertPrerequisitesFor(klass, parentType, declaredTypes, iface);\n }\n}\n\nfunction assertClaimedVfuncs(\n klass: AnyClass,\n methods: MethodTable,\n claimedMethodNames: Set<string>,\n interfaceBindings: InterfaceVfuncBinding[],\n): void {\n const claimed = claimedVfuncNames(claimedMethodNames, interfaceBindings);\n\n for (const methodName of methods.keys()) {\n if (VFUNC_METHOD_PATTERN.test(methodName) && !claimed.has(methodName)) {\n throw new Error(\n `registerClass: ${klass.name}.${methodName} matches no vtable slot on any ancestor ` +\n \"or implemented interface, so the override would never be called; check the name against \" +\n \"the parent class's virtual methods\",\n );\n }\n }\n}\n\nfunction discoverInterfaceBindings(\n methods: MethodTable,\n parentGtype: bigint,\n declaredTypes: bigint[],\n claimedMethodNames: Set<string>,\n): InterfaceVfuncBinding[] {\n const declared: Set<bigint> = new Set(declaredTypes);\n const gtypes: Set<bigint> = new Set([...typeInterfaces(parentGtype), ...declaredTypes]);\n const bindings: InterfaceVfuncBinding[] = [];\n\n for (const gtype of gtypes) {\n const vfuncs = discoverInterfaceVfuncs(methods, gtype, claimedMethodNames);\n\n if (vfuncs.length > 0 || declared.has(gtype)) {\n bindings.push({ gtype, vfuncs });\n }\n }\n\n return bindings;\n}\n\nfunction discoverInterfaceVfuncs(\n methods: MethodTable,\n interfaceGtype: bigint,\n claimedMethodNames: Set<string>,\n): DiscoveredVfunc[] {\n return collectDiscoveredVfuncs(\n methods,\n (methodName) => findInterfaceVfuncDescriptor(interfaceGtype, methodName),\n claimedMethodNames,\n );\n}\n\nconst hasDispatchedProperties = (dispatch: PropertyDispatch, adoptedTypes: bigint[]): boolean =>\n dispatch.accessors.length > 0 || adoptedTypes.length > 0;\n\nfunction propertyVfuncFor(\n source: PropertyVfuncSource,\n spec: PropertyVfuncSpec,\n): DiscoveredVfunc | undefined {\n const { klass, methods, dispatch, adoptedTypes } = source;\n\n const dispatched = hasDispatchedProperties(dispatch, adoptedTypes)\n ? spec.makeDispatch(dispatch)\n : undefined;\n\n const fn = methods.get(spec.methodName) ?? dispatched;\n\n return fn === undefined ? undefined : buildPropertyVfunc(klass, spec.methodName, fn, spec.isValueOut);\n}\n\nfunction propertyVfuncs(source: PropertyVfuncSource): DiscoveredVfunc[] {\n return PROPERTY_VFUNC_SPECS.map((spec) => propertyVfuncFor(source, spec)).filter(\n (vfunc) => vfunc !== undefined,\n );\n}\n\nfunction markArg(argDescriptors: Descriptor[], index: number, patch: ArgPatch): Descriptor[] {\n return argDescriptors.map((arg, at) => (at === index ? { ...arg, ...patch } : arg));\n}\n\nfunction isTeardownSlot(descriptor: VfuncDescriptor): boolean {\n return (\n TEARDOWN_VFUNC_NAMES.has(descriptor.vfuncName) &&\n descriptor.argDescriptors[INSTANCE_ARG_INDEX]?.kind === \"object\"\n );\n}\n\nfunction slotArgDescriptors(descriptor: VfuncDescriptor): Descriptor[] {\n if (!isTeardownSlot(descriptor)) {\n return descriptor.argDescriptors;\n }\n\n return markArg(descriptor.argDescriptors, INSTANCE_ARG_INDEX, { isCallScoped: true });\n}\n\nfunction buildPropertyVfunc(\n klass: AnyClass,\n methodName: string,\n fn: VfuncFn,\n isValueOut: boolean,\n): DiscoveredVfunc {\n const descriptor = findClassVfuncDescriptor(klass, methodName);\n\n if (!descriptor) {\n throw new Error(`registerClass: the parent class exposes no '${methodName}' vtable slot`);\n }\n\n const argDescriptors = isValueOut\n ? markArg(descriptor.argDescriptors, VALUE_ARG_INDEX, { isCallerAllocated: true })\n : descriptor.argDescriptors;\n\n return {\n ...descriptor,\n methodName,\n argDescriptors,\n fn: wrapVfunc(fn, argDescriptors, descriptor),\n };\n}\n\nconst canonicalSignalName = (name: string): string => name.replaceAll(\"_\", \"-\");\n\nfunction assertLowerCaseSignalName(klass: AnyClass, name: string): void {\n if (!UPPER_CASE_PATTERN.test(name)) {\n return;\n }\n\n throw new TypeError(\n `registerClass: ${klass.name} declares the signal '${name}'; GObject would carry it under that ` +\n \"exact spelling, out of reach of both its dashed spelling and its default handler; \" +\n `declare it as '${kebabCase(name)}'`,\n );\n}\n\nfunction overriddenSignalId(type: bigint, methodName: string): number {\n if (!SIGNAL_OVERRIDE_PATTERN.test(methodName)) {\n return 0;\n }\n\n const signal = signalForHandlerName(type, methodName);\n\n return signal === undefined ? 0 : signalIdFor(type, signal);\n}\n\nfunction installSignalOverrides(newType: bigint, methods: MethodTable): void {\n for (const [methodName, fn] of methods) {\n const signalId = overriddenSignalId(newType, methodName);\n\n if (signalId === 0) {\n continue;\n }\n\n const handler = fn as (...args: unknown[]) => unknown;\n\n overrideSignalClassClosure(newType, signalId, (...args: unknown[]) =>\n handler.apply(args[0], args.slice(1)),\n );\n }\n}\n\nfunction resolveSignalGType(klass: AnyClass, signalName: string, role: string, entry: SignalGType): bigint {\n if (typeof entry === \"bigint\") {\n return entry;\n }\n\n const gtype = getClassType(entry);\n\n if (gtype === TYPE_INVALID) {\n throw new TypeError(\n `registerClass: signal '${signalName}' of ${klass.name} names a class with no registered ` +\n `GType as its ${role}`,\n );\n }\n\n return gtype;\n}\n\nfunction resolveSignalReturnType(klass: AnyClass, name: string, spec: SignalSpec): bigint | undefined {\n if (spec.returnType === undefined) {\n return undefined;\n }\n\n const returnType = resolveSignalGType(klass, name, \"return type\", spec.returnType);\n\n return returnType === TYPE_NONE ? undefined : returnType;\n}\n\nfunction resolveDeclaredSignal(\n klass: AnyClass,\n name: string,\n spec: SignalSpec,\n): { native: NativeRegisterClassSignal; declared: DeclaredSignalTypes } {\n const paramTypes = (spec.paramTypes ?? []).map((entry, index) =>\n resolveSignalGType(klass, name, `parameter ${String(index)}`, entry),\n );\n\n const returnType = resolveSignalReturnType(klass, name, spec);\n const native: NativeRegisterClassSignal = { name, paramTypes };\n const declared: DeclaredSignalTypes = { paramTypes };\n\n if (spec.flags !== undefined) {\n native.flags = spec.flags;\n }\n\n if (spec.accumulator !== undefined) {\n native.accumulator = spec.accumulator;\n }\n\n if (returnType !== undefined) {\n native.returnType = returnType;\n declared.returnType = returnType;\n }\n\n return { native, declared };\n}\n\nfunction resolveDeclaredSignals(klass: AnyClass, signals: Record<string, SignalSpec>): DeclaredSignals {\n const native: NativeRegisterClassSignal[] = [];\n const table: Map<string, DeclaredSignalTypes> = new Map();\n\n for (const [name, spec] of Object.entries(signals)) {\n assertLowerCaseSignalName(klass, name);\n const resolved = resolveDeclaredSignal(klass, name, spec);\n native.push(resolved.native);\n table.set(canonicalSignalName(name), resolved.declared);\n }\n\n return { native, table };\n}\n\nfunction inheritedSignalMethod<T>(inherited: T | undefined, signal: string): T {\n if (inherited === undefined) {\n throw new Error(`Unknown signal '${signal}'`);\n }\n\n return inherited;\n}\n\nfunction installDeclaredConnect(\n proto: SignalMethodHost,\n findDeclared: (signal: string) => DeclaredSignalTypes | undefined,\n): void {\n const inheritedConnect = proto.connect;\n\n proto.connect = function connect(\n this: object,\n signal: string,\n handler: SignalHandler,\n isAfter?: boolean,\n ): number {\n if (findDeclared(signal) === undefined) {\n return inheritedSignalMethod(inheritedConnect, signal).call(this, signal, handler, isAfter);\n }\n\n return connectClosureSignal(this, signal, handler, isAfter ?? false);\n };\n}\n\nfunction installDeclaredEmit(\n proto: SignalMethodHost,\n findDeclared: (signal: string) => DeclaredSignalTypes | undefined,\n): void {\n const inheritedEmit = proto.emit;\n\n proto.emit = function emit(this: object, sigName: string, ...args: unknown[]): unknown {\n const declared = findDeclared(sigName);\n\n if (declared === undefined) {\n return inheritedSignalMethod(inheritedEmit, sigName).call(this, sigName, ...args);\n }\n\n return emitDeclaredSignal(this, sigName, declared, args);\n };\n}\n\nfunction installDeclaredSignalMethods(\n klass: AnyClass,\n table: Map<string, DeclaredSignalTypes>,\n definedNames: Set<string>,\n): void {\n if (table.size === 0) {\n return;\n }\n\n const proto = klass.prototype as SignalMethodHost;\n\n const findDeclared = (signal: string): DeclaredSignalTypes | undefined =>\n table.get(canonicalSignalName(getSignalBaseName(signal)));\n\n if (!definedNames.has(\"connect\")) {\n installDeclaredConnect(proto, findDeclared);\n }\n\n if (!definedNames.has(\"emit\")) {\n installDeclaredEmit(proto, findDeclared);\n }\n}\n\nfunction toNativeInterface(binding: InterfaceVfuncBinding): NativeRegisterClassInterface {\n const nativeInterface: NativeRegisterClassInterface = {\n type: binding.gtype,\n vfuncs: [...binding.vfuncs],\n };\n\n const vtableSize = binding.vfuncs[0]?.vtableSize;\n\n if (vtableSize !== undefined) {\n nativeInterface.vtableSize = vtableSize;\n }\n\n return nativeInterface;\n}\n\nfunction withNativeSignals(\n options: NativeRegisterClassOptions | undefined,\n signals: NativeRegisterClassSignal[],\n): NativeRegisterClassOptions | undefined {\n if (signals.length === 0) {\n return options;\n }\n\n return { ...options, signals };\n}\n\nfunction applyNativeTypeOptions(options: NativeRegisterClassOptions, source: AnyRegisterClassOptions): void {\n if (source.abstract ?? false) {\n options.abstract = true;\n }\n\n if (source.cssName !== undefined) {\n options.cssName = source.cssName;\n }\n}\n\nfunction toNativeOptions(\n classVfuncs: DiscoveredVfunc[],\n interfaceBindings: InterfaceVfuncBinding[],\n properties: Record<string, PropertySpec>,\n source: AnyRegisterClassOptions,\n): NativeRegisterClassOptions | undefined {\n const options: NativeRegisterClassOptions = {};\n applyNativeTypeOptions(options, source);\n\n if (Object.keys(properties).length > 0) {\n options.properties = toNativeProperties(properties);\n }\n\n if (classVfuncs.length > 0) {\n options.vfuncs = [...classVfuncs];\n }\n\n if (interfaceBindings.length > 0) {\n options.interfaces = interfaceBindings.map((binding) => toNativeInterface(binding));\n }\n\n return Object.keys(options).length > 0 ? options : undefined;\n}\n\nexport { type Interface, registerClass, type SignalGType, type SignalSpec };\n"]}
|
package/dist/registry.d.ts
CHANGED
|
@@ -10,6 +10,16 @@ import { type TypedClass } from "./type.js";
|
|
|
10
10
|
* which statics reach it.
|
|
11
11
|
*/
|
|
12
12
|
type StaticBase<C, K extends PropertyKey> = Omit<C, K> & (C extends abstract new (...args: infer A) => infer R ? abstract new (...args: A) => R : never);
|
|
13
|
+
/**
|
|
14
|
+
* Static side of class `C` with its construct signature retargeted to produce `I`. A generated
|
|
15
|
+
* wrapper class is declared locally and exported as a registered constant; its instance type is
|
|
16
|
+
* exported as an interface extending the local class so declaration merging and module
|
|
17
|
+
* augmentation keep working, and this type makes constructing the constant produce that interface.
|
|
18
|
+
*/
|
|
19
|
+
type WrapperClass<C, I> = Omit<C, "prototype"> & {
|
|
20
|
+
/** Prototype retyped to the exported instance interface, so `instanceof` narrows to it. */
|
|
21
|
+
prototype: I;
|
|
22
|
+
} & (C extends new (...args: infer A) => unknown ? new (...args: A) => I : C extends abstract new (...args: infer A) => unknown ? abstract new (...args: A) => I : never);
|
|
13
23
|
/** One overridable vtable slot: where it sits in the vtable struct and how it is marshalled. */
|
|
14
24
|
type VfuncDescriptor = {
|
|
15
25
|
/** GIR name of the type struct holding the slot, without its namespace, such as `WidgetClass`. */
|
|
@@ -148,6 +158,18 @@ declare function resolveWrapperType(instance: object): bigint;
|
|
|
148
158
|
* implementing class overrides and take over the ones it leaves alone.
|
|
149
159
|
*/
|
|
150
160
|
declare function registerInterface(cls: AnyClass, type: bigint, mixin: Mixin, layout?: InterfaceLayout): void;
|
|
161
|
+
/**
|
|
162
|
+
* Copies the members of registered interfaces onto a wrapper class, resolving each interface's
|
|
163
|
+
* mixin through the registry rather than taking the mixin itself, so a class states which
|
|
164
|
+
* interfaces it implements by referencing their classes. The interfaces must already be
|
|
165
|
+
* registered through `registerInterface`; generated code guarantees that by declaring interfaces
|
|
166
|
+
* ahead of the classes that implement them.
|
|
167
|
+
*
|
|
168
|
+
* @param cls Wrapper class adopting the interfaces.
|
|
169
|
+
* @param interfaces Registered interface classes to adopt, in order.
|
|
170
|
+
* @throws If an entry is not a registered interface.
|
|
171
|
+
*/
|
|
172
|
+
declare function installInterfaces(cls: AnyClass, interfaces: AnyClass[]): void;
|
|
151
173
|
/**
|
|
152
174
|
* Wraps a native handle in a JS wrapper instance. With no class, resolves and
|
|
153
175
|
* reuses the wrapper for the handle's runtime GType (composing interface mixins),
|
|
@@ -169,10 +191,11 @@ declare function wrapFundamentalHandle(handle: ExternalObject<Handle> | null | u
|
|
|
169
191
|
* and throws if none is registered.
|
|
170
192
|
*/
|
|
171
193
|
declare function getWrapperClass(type: bigint): AnyClass;
|
|
194
|
+
declare function getExactWrapperClass(type: bigint, label?: string): AnyClass;
|
|
172
195
|
declare function resolveWrapperClass(type: bigint): AnyClass | null;
|
|
173
196
|
declare function getInterfaceMixin(type: bigint): Mixin | undefined;
|
|
174
|
-
declare function wrapObject(value: unknown): object | null;
|
|
175
|
-
declare function wrapCallScopedObject(value: unknown): object | null;
|
|
197
|
+
declare function wrapObject(value: unknown, fallbackClass?: () => AnyClass): object | null;
|
|
198
|
+
declare function wrapCallScopedObject(value: unknown, fallbackClass?: () => AnyClass): object | null;
|
|
176
199
|
declare function instanceClassName(instance: object): string;
|
|
177
200
|
declare function describeValueKind(value: unknown): string;
|
|
178
201
|
/** Returns the native handle bound to a wrapper instance, throwing if none is set. */
|
|
@@ -183,5 +206,5 @@ declare function registerWrapper(handle: ExternalObject<Handle>, instance: objec
|
|
|
183
206
|
declare function getVfuncRegistry(cls: object): VfuncRegistry | undefined;
|
|
184
207
|
declare function getInterfaceVfuncRegistry(type: bigint): VfuncRegistry | undefined;
|
|
185
208
|
declare function getInterfaceProperties(type: bigint): Record<string, InterfaceProperty> | undefined;
|
|
186
|
-
export { coerceGType, describeValueKind, getClassStructClass, getClassType, getInstanceType, getTypeClassHandle, markDerivedClass, peekTypeClass, registerClassStruct, registerClassType, registerWrapperClass, registerWrapperClassResolver, registerInterface, wrapFundamentalHandle, wrapHandle, getWrapperClass, resolveWrapperClass, getHandle, setHandle, getVfuncRegistry, getInterfaceMixin, getInterfaceProperties, getInterfaceVfuncRegistry, instanceClassName, registerWrapper, resolveWrapperType, wrapCallScopedObject, wrapObject, type InterfaceProperty, type StaticBase, type VfuncDescriptor, type WrapperClassResolver, };
|
|
209
|
+
export { coerceGType, describeValueKind, getClassStructClass, getClassType, getInstanceType, getTypeClassHandle, markDerivedClass, peekTypeClass, registerClassStruct, registerClassType, registerWrapperClass, registerWrapperClassResolver, registerInterface, installInterfaces, wrapFundamentalHandle, wrapHandle, getExactWrapperClass, getWrapperClass, resolveWrapperClass, getHandle, setHandle, getVfuncRegistry, getInterfaceMixin, getInterfaceProperties, getInterfaceVfuncRegistry, instanceClassName, registerWrapper, resolveWrapperType, wrapCallScopedObject, wrapObject, type InterfaceProperty, type StaticBase, type VfuncDescriptor, type WrapperClass, type WrapperClassResolver, };
|
|
187
210
|
//# sourceMappingURL=registry.d.ts.map
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,cAAc,EAKnB,KAAK,MAAM,EACX,KAAK,kBAAkB,IAAI,wBAAwB,EAGtD,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,aAAa,CAAC;AAC5D,OAAO,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,cAAc,EAKnB,KAAK,MAAM,EACX,KAAK,kBAAkB,IAAI,w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AQ3D;AAED,0DAA0D;AAC1D,iBAAS,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,IAAI,CAEzE;AAMD,iBAAS,eAAe,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAG/E;AAMD,iBAAS,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEhE;AAED,iBAAS,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAE1E;AAED,iBAAS,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,SAAS,CAE3F;AAED,OAAO,EACH,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,4BAA4B,EAC5B,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,oBAAoB,GAC5B,CAAC"}
|
package/dist/registry.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getFundamentalWrapper, getType, getTypeClass, getWrapper, setFundamentalWrapper, setWrapper, } from "@gtkx/native";
|
|
2
2
|
import { walkClassChain } from "@gtkx/utils";
|
|
3
|
-
import { copyLayerMembers } from "./mixin.js";
|
|
4
|
-
import { TYPE_INVALID, TYPE_OBJECT, typeInterfaces, typeIsA, typeName, typeParent, } from "./type.js";
|
|
3
|
+
import { copyLayerMembers, installMixins } from "./mixin.js";
|
|
4
|
+
import { TYPE_INVALID, TYPE_OBJECT, typeFundamental, typeInterfaces, typeIsA, typeName, typeParent, } from "./type.js";
|
|
5
5
|
const classRegistry = new Map();
|
|
6
6
|
const classStructRegistry = new Map();
|
|
7
7
|
const composedClassStructRegistry = new Map();
|
|
@@ -214,6 +214,27 @@ function registerInterface(cls, type, mixin, layout) {
|
|
|
214
214
|
interfaceLayoutRegistry.set(type, layout);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Copies the members of registered interfaces onto a wrapper class, resolving each interface's
|
|
219
|
+
* mixin through the registry rather than taking the mixin itself, so a class states which
|
|
220
|
+
* interfaces it implements by referencing their classes. The interfaces must already be
|
|
221
|
+
* registered through `registerInterface`; generated code guarantees that by declaring interfaces
|
|
222
|
+
* ahead of the classes that implement them.
|
|
223
|
+
*
|
|
224
|
+
* @param cls Wrapper class adopting the interfaces.
|
|
225
|
+
* @param interfaces Registered interface classes to adopt, in order.
|
|
226
|
+
* @throws If an entry is not a registered interface.
|
|
227
|
+
*/
|
|
228
|
+
function installInterfaces(cls, interfaces) {
|
|
229
|
+
const mixins = interfaces.map((iface) => {
|
|
230
|
+
const mixin = getInterfaceMixin(getClassType(iface));
|
|
231
|
+
if (mixin === undefined) {
|
|
232
|
+
throw new Error(`installInterfaces: ${iface.name} is not a registered interface`);
|
|
233
|
+
}
|
|
234
|
+
return mixin;
|
|
235
|
+
});
|
|
236
|
+
installMixins(cls, mixins);
|
|
237
|
+
}
|
|
217
238
|
function wrapHandle(handle, cls) {
|
|
218
239
|
if (handle === null || handle === undefined) {
|
|
219
240
|
return null;
|
|
@@ -250,6 +271,17 @@ function getWrapperClass(type) {
|
|
|
250
271
|
}
|
|
251
272
|
return cls;
|
|
252
273
|
}
|
|
274
|
+
function getExactWrapperClass(type, label) {
|
|
275
|
+
if (type === TYPE_INVALID) {
|
|
276
|
+
throw new Error(`No GType is registered under '${label ?? String(type)}'`);
|
|
277
|
+
}
|
|
278
|
+
const cls = classRegistry.get(type);
|
|
279
|
+
if (cls === undefined) {
|
|
280
|
+
throw new Error(`No wrapper class is registered for '${label ?? typeName(type) ?? String(type)}': ` +
|
|
281
|
+
"its module was dropped from the bundle or never imported");
|
|
282
|
+
}
|
|
283
|
+
return cls;
|
|
284
|
+
}
|
|
253
285
|
function resolveWrapperClass(type) {
|
|
254
286
|
let currentType = type;
|
|
255
287
|
while (currentType !== TYPE_INVALID) {
|
|
@@ -284,7 +316,28 @@ function createComposedClass(base, runtimeType) {
|
|
|
284
316
|
}
|
|
285
317
|
return applied.size === 0 ? base : cls;
|
|
286
318
|
}
|
|
287
|
-
function
|
|
319
|
+
function isWrappableBase(fallbackType) {
|
|
320
|
+
return fallbackType === TYPE_INVALID || typeFundamental(fallbackType) === TYPE_OBJECT;
|
|
321
|
+
}
|
|
322
|
+
function isBetweenWalkAndRuntime(fallbackType, walkedType, runtimeType) {
|
|
323
|
+
return fallbackType !== walkedType && typeIsA(fallbackType, walkedType) && typeIsA(runtimeType, fallbackType);
|
|
324
|
+
}
|
|
325
|
+
function chooseWrapBase(walked, fallback, runtimeType) {
|
|
326
|
+
if (fallback === undefined || !isWrappableBase(getClassType(fallback))) {
|
|
327
|
+
return walked;
|
|
328
|
+
}
|
|
329
|
+
if (walked === null || isBetweenWalkAndRuntime(getClassType(fallback), getClassType(walked), runtimeType)) {
|
|
330
|
+
return fallback;
|
|
331
|
+
}
|
|
332
|
+
return walked;
|
|
333
|
+
}
|
|
334
|
+
function stampComposedClass(composed, runtimeType) {
|
|
335
|
+
setClassType(composed, runtimeType);
|
|
336
|
+
wrapperClasses.add(composed);
|
|
337
|
+
composedClassRegistry.set(runtimeType, composed);
|
|
338
|
+
return composed;
|
|
339
|
+
}
|
|
340
|
+
function resolveComposedClass(runtimeType, fallbackClass) {
|
|
288
341
|
const exact = classRegistry.get(runtimeType);
|
|
289
342
|
if (exact) {
|
|
290
343
|
return exact;
|
|
@@ -293,50 +346,52 @@ function resolveComposedClass(runtimeType) {
|
|
|
293
346
|
if (cached) {
|
|
294
347
|
return cached;
|
|
295
348
|
}
|
|
296
|
-
const
|
|
349
|
+
const walked = resolveWrapperClass(runtimeType);
|
|
350
|
+
const base = chooseWrapBase(walked, fallbackClass?.(), runtimeType);
|
|
297
351
|
if (base === null) {
|
|
298
352
|
return null;
|
|
299
353
|
}
|
|
300
354
|
const composed = createComposedClass(base, runtimeType);
|
|
301
|
-
if (composed
|
|
355
|
+
if (composed !== base) {
|
|
356
|
+
return stampComposedClass(composed, runtimeType);
|
|
357
|
+
}
|
|
358
|
+
if (base === walked) {
|
|
302
359
|
return base;
|
|
303
360
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
composedClassRegistry.set(runtimeType, composed);
|
|
307
|
-
return composed;
|
|
361
|
+
return stampComposedClass(class extends base {
|
|
362
|
+
}, runtimeType);
|
|
308
363
|
}
|
|
309
|
-
function wrapObject(value) {
|
|
310
|
-
return value == null ? null : getOrCreateWrapper(value);
|
|
364
|
+
function wrapObject(value, fallbackClass) {
|
|
365
|
+
return value == null ? null : getOrCreateWrapper(value, fallbackClass);
|
|
311
366
|
}
|
|
312
|
-
function wrapCallScopedObject(value) {
|
|
313
|
-
return value == null ? null : wrapperFor(value, bindCallScopedWrapper);
|
|
367
|
+
function wrapCallScopedObject(value, fallbackClass) {
|
|
368
|
+
return value == null ? null : wrapperFor(value, bindCallScopedWrapper, fallbackClass);
|
|
314
369
|
}
|
|
315
370
|
function existingWrapperFor(handle) {
|
|
316
371
|
return handleMap.has(handle) ? handle : getWrapper(handle);
|
|
317
372
|
}
|
|
318
|
-
function createWrapper(handle) {
|
|
373
|
+
function createWrapper(handle, fallbackClass) {
|
|
319
374
|
const runtimeType = getType(handle);
|
|
320
375
|
if (runtimeType === TYPE_INVALID) {
|
|
321
376
|
throw new Error("Cannot resolve runtime GLib type from handle");
|
|
322
377
|
}
|
|
323
|
-
const cls = resolveComposedClass(runtimeType);
|
|
378
|
+
const cls = resolveComposedClass(runtimeType, fallbackClass);
|
|
324
379
|
if (!cls) {
|
|
325
380
|
throw new Error(`Expected registered GLib type, got type ${String(runtimeType)}`);
|
|
326
381
|
}
|
|
327
382
|
return Object.create(cls.prototype);
|
|
328
383
|
}
|
|
329
|
-
function wrapperFor(handle, bind) {
|
|
384
|
+
function wrapperFor(handle, bind, fallbackClass) {
|
|
330
385
|
const existing = existingWrapperFor(handle);
|
|
331
386
|
if (existing) {
|
|
332
387
|
return existing;
|
|
333
388
|
}
|
|
334
|
-
const instance = createWrapper(handle);
|
|
389
|
+
const instance = createWrapper(handle, fallbackClass);
|
|
335
390
|
bind(handle, instance);
|
|
336
391
|
return instance;
|
|
337
392
|
}
|
|
338
|
-
function getOrCreateWrapper(handle) {
|
|
339
|
-
return wrapperFor(handle, registerWrapper);
|
|
393
|
+
function getOrCreateWrapper(handle, fallbackClass) {
|
|
394
|
+
return wrapperFor(handle, registerWrapper, fallbackClass);
|
|
340
395
|
}
|
|
341
396
|
function instanceClassName(instance) {
|
|
342
397
|
return instance.constructor?.name ?? "object";
|
|
@@ -381,5 +436,5 @@ function getInterfaceVfuncRegistry(type) {
|
|
|
381
436
|
function getInterfaceProperties(type) {
|
|
382
437
|
return interfaceLayoutRegistry.get(type)?.properties;
|
|
383
438
|
}
|
|
384
|
-
export { coerceGType, describeValueKind, getClassStructClass, getClassType, getInstanceType, getTypeClassHandle, markDerivedClass, peekTypeClass, registerClassStruct, registerClassType, registerWrapperClass, registerWrapperClassResolver, registerInterface, wrapFundamentalHandle, wrapHandle, getWrapperClass, resolveWrapperClass, getHandle, setHandle, getVfuncRegistry, getInterfaceMixin, getInterfaceProperties, getInterfaceVfuncRegistry, instanceClassName, registerWrapper, resolveWrapperType, wrapCallScopedObject, wrapObject, };
|
|
439
|
+
export { coerceGType, describeValueKind, getClassStructClass, getClassType, getInstanceType, getTypeClassHandle, markDerivedClass, peekTypeClass, registerClassStruct, registerClassType, registerWrapperClass, registerWrapperClassResolver, registerInterface, installInterfaces, wrapFundamentalHandle, wrapHandle, getExactWrapperClass, getWrapperClass, resolveWrapperClass, getHandle, setHandle, getVfuncRegistry, getInterfaceMixin, getInterfaceProperties, getInterfaceVfuncRegistry, instanceClassName, registerWrapper, resolveWrapperType, wrapCallScopedObject, wrapObject, };
|
|
385
440
|
//# sourceMappingURL=registry.js.map
|