@gjsify/adwaita-core 0.64.12-next.280 → 0.64.12-next.281
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/lib/esm/conformance/gobject.js +1 -1
- package/lib/esm/conformance/list.js +1 -1
- package/lib/esm/gobject.js +1 -1
- package/lib/esm/gtk-string-list.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/list.js +1 -1
- package/lib/esm/markup.js +1 -1
- package/lib/types/conformance/gobject.d.ts +23 -1
- package/lib/types/engine.d.ts +10 -0
- package/lib/types/gobject.d.ts +75 -4
- package/lib/types/gtk-string-list.d.ts +89 -44
- package/lib/types/index.d.ts +3 -3
- package/lib/types/list.d.ts +30 -2
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";const e=[`registerClass`,`field-form`,`ParamSpec`,`Signals`,`instance API`,`type_ensure`,`vfunc`,`binding engine`,`template`];function attempt(e){try{return e(),null}catch(e){return e instanceof Error?e.message:String(e)}}function count(e,t){let n={n:0};return e.connect(t,()=>{n.n++}),n}function boxTemplate(e,t=`onClicked`){return{className:e,tree:{tag:`GtkBox`,children:[{tag:`GtkSwitch`,id:`sw`,bindings:{active:{source:`template`,property:`enabled`,flags:[`bidirectional`]}}},{tag:`GtkButton`,id:`btn`,signals:[{name:`clicked`,handler:t}]}]},xml:`<interface><template class="${e}" parent="GtkBox"><child><object class="GtkSwitch" id="sw"><property name="active" bind-source="${e}" bind-property="enabled" bind-flags="bidirectional|sync-create"/></object></child><child><object class="GtkButton" id="btn"><signal name="clicked" handler="${t}"/></object></child></template></interface>`}}const t=[{row:`ParamSpec`,rule:`a generated accessor notifies once per change and not on an equal value (_generateAccessors)`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=new(t.registerClass({GTypeName:`GoVecNotify`,Properties:{code:n.string(`code`,``,``,r.READWRITE,``)}},class extends t.Object{})),a=count(i,`notify::code`),o=[];return i.code=`x`,o.push(a.n),i.code=`x`,o.push(a.n),i.code=`y`,o.push(a.n),o},shows:[1,1,2]},{row:`ParamSpec`,rule:`a property reads as its ParamSpec default until it is set, for all five kinds`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=new(t.registerClass({GTypeName:`GoVecDefaults`,Properties:{s:n.string(`s`,``,``,r.READWRITE,``),b:n.boolean(`b`,``,``,r.READWRITE,!0),n:n.int(`n`,``,``,r.READWRITE,0,10,3),d:n.double(`d`,``,``,r.READWRITE,0,1,.5),u:n.uint(`u`,``,``,r.READWRITE,0,10,2)}},class extends t.Object{}));return{s:i.s,b:i.b,n:i.n,d:i.d,u:i.u}},shows:{s:``,b:!0,n:3,d:.5,u:2}},{row:`ParamSpec`,rule:`an accessor the class defines is kept: its setter runs per assignment and decides when to notify`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=0,a=new(t.registerClass({GTypeName:`GoVecOwnAccessor`,Properties:{label:n.string(`label`,``,``,r.READWRITE,``)}},class extends t.Object{constructor(...e){super(...e),this.stored=`initial`}get label(){return this.stored}set label(e){i++,this.stored=e,this.notify(`label`)}})),o=count(a,`notify::label`);return a.label=`a`,a.label=`a`,{setterCalls:i,notifies:o.n,value:a.label}},shows:{setterCalls:2,notifies:2,value:`a`}},{row:`ParamSpec`,rule:`a dashed name is reachable as dash-name, dash_name and dashName, and one notify::dash-name serves all three`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=new(t.registerClass({GTypeName:`GoVecAliases`,Properties:{"dash-name":n.string(`dash-name`,``,``,r.READWRITE,`d`)}},class extends t.Object{})),a=[i[`dash-name`],i.dash_name,i.dashName],o=count(i,`notify::dash-name`);return i.dashName=`q`,i.dash_name=`q`,{read:a,notifies:o.n,value:i[`dash-name`]}},shows:{read:[`d`,`d`,`d`],notifies:1,value:`q`}},{row:`ParamSpec`,rule:`a CONSTRUCT_ONLY property gets no accessor on the class and keeps the value it was built with`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecConstructOnly`,Properties:{co:n.int(`co`,``,``,r.READWRITE|r.CONSTRUCT_ONLY,0,10,3)}},class extends t.Object{});return{given:new i({co:7}).co,dflt:new i().co,onPrototype:Object.getOwnPropertyDescriptor(i.prototype,`co`)!==void 0}},shows:{given:7,dflt:3,onPrototype:!1}},{row:`ParamSpec`,rule:`a CONSTRUCT property runs its own setter once at construction: with the default, or the given value`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=[],a=t.registerClass({GTypeName:`GoVecConstructSetter`,Properties:{size:n.int(`size`,``,``,r.READWRITE|r.CONSTRUCT,0,100,32)}},class extends t.Object{get size(){return this._size}set size(e){i.push(e),this._size=e,this.notify(`size`)}}),o=new a,s=i.splice(0),c=new a({size:5});return{dfltCalls:s,givenCalls:i,read:[o.size,c.size]}},shows:{dfltCalls:[32],givenCalls:[5],read:[32,5]}},{row:`ParamSpec`,rule:`construction sets a CONSTRUCT property, so writing its default afterwards is no change and notifies nothing`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecConstructDefault`,Properties:{c:n.int(`c`,``,``,r.READWRITE|r.CONSTRUCT,0,10,7),p:n.int(`p`,``,``,r.READWRITE,0,10,4)}},class extends t.Object{}),a=new i,o=[];return a.connect(`notify::c`,()=>o.push(`c`)),a.connect(`notify::p`,()=>o.push(`p`)),a.c=7,a.p=4,{read:[a.c,new i({c:3}).c],notified:o}},shows:{read:[7,3],notified:[`p`]}},{row:`Signals`,rule:`emit reaches a handler as (emitter, ...params); disconnect stops it; an undeclared name or wrong arity throws`,holds:`oracle`,observe(e){let{GObject:t}=e,n=new(t.registerClass({GTypeName:`GoVecSignals`,Signals:{changed:{param_types:[t.TYPE_STRING,t.TYPE_INT]}}},class extends t.Object{})),r=[],i=0,a=n.connect(`changed`,(...e)=>{i++,r=e});n.emit(`changed`,`s`,3);let o={argc:r.length,emitter:r[0]===n,s:r[1],n:r[2]};return n.disconnect(a),n.emit(`changed`,`t`,4),{...o,callsAfterDisconnect:i,undeclaredThrows:attempt(()=>n.emit(`nope`))!==null,shortThrows:attempt(()=>n.emit(`changed`,`s`))!==null}},shows:{argc:3,emitter:!0,s:`s`,n:3,callsAfterDisconnect:1,undeclaredThrows:!0,shortThrows:!0}},{row:`instance API`,rule:`signal_stop_emission_by_name stops the emission in progress: later handlers do not run, the next emission runs all`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=new(t.registerClass({GTypeName:`GoVecStopEmission`,Properties:{code:n.string(`code`,``,``,r.READWRITE,``)},Signals:{ping:{param_types:[]}}},class extends t.Object{})),a=[],o=!0;i.connect(`ping`,()=>{a.push(`a`),o&&t.signal_stop_emission_by_name(i,`ping`)}),i.connect(`ping`,()=>a.push(`b`)),i.emit(`ping`);let s=a.join(``);a.length=0,o=!1,i.emit(`ping`);let c=a.join(``),l=[];return i.connect(`notify::code`,()=>{l.push(`a`),t.signal_stop_emission_by_name(i,`notify::code`)}),i.connect(`notify::code`,()=>l.push(`b`)),i.code=`x`,{stopped:s,next:c,notified:l.join(``)}},shows:{stopped:`a`,next:`ab`,notified:`a`}},{row:`instance API`,rule:`signal_stop_emission_by_name stops only the innermost emission of ITS signal; with none in progress it does nothing and leaves nothing behind`,holds:`oracle`,observe(e){let{GObject:t}=e,n=new(t.registerClass({GTypeName:`GoVecStopNested`,Signals:{ping:{param_types:[]},pong:{param_types:[]}}},class extends t.Object{})),r=attempt(()=>t.signal_stop_emission_by_name(n,`ping`)),i=[],a=0;n.connect(`ping`,()=>{i.push(`a${a}`),a===0?(a=1,n.emit(`ping`),a=0):t.signal_stop_emission_by_name(n,`ping`)}),n.connect(`ping`,()=>i.push(`b${a}`)),n.emit(`ping`);let o=i.join(`,`);return i.length=0,n.connect(`pong`,()=>{i.push(`p`),t.signal_stop_emission_by_name(n,`ping`)}),n.connect(`pong`,()=>i.push(`q`)),n.emit(`pong`),{idleThrows:r!==null,nested:o,otherSignal:i.join(``)}},shows:{idleThrows:!1,nested:`a0,a1,b0`,otherSignal:`pq`}},{row:`field-form`,rule:`meta given as static symbol fields registers like the meta object (GJS only copies the object onto them)`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t;class Field extends t.Object{}Object.assign(Field,{[t.GTypeName]:`GoVecFieldForm`,[t.properties]:{code:n.string(`code`,``,``,r.READWRITE,``)},[t.signals]:{ping:{param_types:[]}}});let i=t.registerClass(Field),a=new i,o=count(a,`notify::code`),s=count(a,`ping`);return a.code=`x`,a.emit(`ping`),{typeName:i.$gtype.name,notifies:o.n,pings:s.n}},shows:{typeName:`GoVecFieldForm`,notifies:1,pings:1}},{row:`type_ensure`,rule:`$gtype is a token and type_ensure accepts it`,holds:`oracle`,observe(e){let{GObject:t}=e,n=t.registerClass({GTypeName:`GoVecToken`},class extends t.Object{}).$gtype;return{hasGtype:n!==void 0,ensured:attempt(()=>t.type_ensure(n))===null}},shows:{hasGtype:!0,ensured:!0}},{row:`binding engine`,rule:`SYNC_CREATE transfers once at bind time; without it the target keeps its own value`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecBindSync`,Properties:{on:n.boolean(`on`,``,``,r.READWRITE,!1)}},class extends t.Object{}),[a,o,s,c]=[new i,new i,new i,new i];return a.on=!0,s.on=!0,e.bind(a,`on`,o,`on`,[`sync-create`]),e.bind(s,`on`,c,`on`,[]),{withSync:o.on,withoutSync:c.on}},shows:{withSync:!0,withoutSync:!1}},{row:`binding engine`,rule:`the target follows every change of the source`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecBindFollow`,Properties:{on:n.boolean(`on`,``,``,r.READWRITE,!1)}},class extends t.Object{}),[a,o]=[new i,new i];e.bind(a,`on`,o,`on`,[`sync-create`]),a.on=!0;let s=o.on;return a.on=!1,{afterOn:s,afterOff:o.on}},shows:{afterOn:!0,afterOff:!1}},{row:`binding engine`,rule:`BIDIRECTIONAL makes the source follow the target back, without echoing`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecBindBoth`,Properties:{on:n.boolean(`on`,``,``,r.READWRITE,!1)}},class extends t.Object{}),[a,o]=[new i,new i];e.bind(a,`on`,o,`on`,[`bidirectional`,`sync-create`]),o.on=!0;let s=a.on;return a.on=!1,{back:s,forward:o.on}},shows:{back:!0,forward:!1}},{row:`binding engine`,rule:`INVERT_BOOLEAN negates what crosses, at creation and after`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecBindInvert`,Properties:{on:n.boolean(`on`,``,``,r.READWRITE,!1),off:n.boolean(`off`,``,``,r.READWRITE,!0)}},class extends t.Object{}),[a,o]=[new i,new i];a.on=!0,e.bind(a,`on`,o,`off`,[`sync-create`,`invert-boolean`]);let s=o.off;return a.on=!1,{created:s,after:o.off}},shows:{created:!1,after:!0}},{row:`template`,rule:`construction order: the template is built, construct properties are set (this._x is undefined inside a setter), then this._x is installed`,holds:`oracle`,widget:!0,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=[],a=new(t.registerClass({GTypeName:`GoVecOrder`,Template:e.template(boxTemplate(`GoVecOrder`)),InternalChildren:[`sw`,`btn`],Properties:{code:n.string(`code`,``,``,r.READWRITE,``),enabled:n.boolean(`enabled`,``,``,r.READWRITE,!1)}},class extends e.Widget{get code(){return this.stored}set code(e){i.push(`setter:${typeof this._sw}`),this.stored=e}onClicked(){}constructor(e){super(e),i.push(`after super:${typeof this._sw}`)}}))({code:`k`});return{log:i,code:a.code,child:typeof a._btn}},shows:{log:[`setter:undefined`,`after super:object`],code:`k`,child:`object`}},{row:`template`,rule:"a `bind template.x bidirectional` follows both ways between the template instance and its child",holds:`oracle`,widget:!0,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=new(t.registerClass({GTypeName:`GoVecTemplateBind`,Template:e.template(boxTemplate(`GoVecTemplateBind`)),InternalChildren:[`sw`,`btn`],Properties:{enabled:n.boolean(`enabled`,``,``,r.READWRITE,!1)}},class extends e.Widget{onClicked(){}})),a=i._sw.active;i.enabled=!0;let o=i._sw.active;return i._sw.active=!1,{initial:a,toChild:o,back:i.enabled}},shows:{initial:!1,toChild:!0,back:!1}},{row:`template`,rule:`a handler on the template instance runs bound to that instance and receives the emitter`,holds:`oracle`,widget:!0,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=[],a,o=new(t.registerClass({GTypeName:`GoVecHandler`,Template:e.template(boxTemplate(`GoVecHandler`)),InternalChildren:[`sw`,`btn`],Properties:{enabled:n.boolean(`enabled`,``,``,r.READWRITE,!1)}},class extends e.Widget{onClicked(e){i.push([this===a,e===this._btn])}}));return a=o,o._btn.emit(`clicked`),i},shows:[[!0,!0]]},{row:`template`,rule:"a handler the instance does not have throws `A handler called <name> was not defined` (GJS logs it as a Gtk-CRITICAL instead)",holds:`subset`,widget:!0,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecNoHandler`,Template:e.template(boxTemplate(`GoVecNoHandler`,`nope`)),InternalChildren:[`sw`,`btn`],Properties:{enabled:n.boolean(`enabled`,``,``,r.READWRITE,!1)}},class extends e.Widget{});return(attempt(()=>new i)??``).includes(`A handler called nope was not defined`)},shows:!0},...[`Children`,`Implements`,`Requires`,`GTypeFlags`].map(e=>({row:`registerClass`,rule:`the meta key ${e} is refused at registration, by name`,holds:`subset`,observe(t){let{GObject:n}=t;return(attempt(()=>n.registerClass({GTypeName:`GoVecRefuse${e}`,[e]:[]},class extends n.Object{}))??``).includes(e)},shows:!0})),{row:`vfunc`,rule:`a vfunc_* method is refused at registration, naming the method`,holds:`subset`,observe(e){let{GObject:t}=e;return(attempt(()=>t.registerClass({GTypeName:`GoVecVfunc`},class extends t.Object{vfunc_constructed(){}}))??``).includes(`vfunc_constructed`)},shows:!0},{row:`Signals`,rule:`a param type outside STRING, BOOLEAN, INT, UINT and DOUBLE is refused at registration, naming the signal`,holds:`subset`,observe(e){let{GObject:t}=e,n={name:`gint64`};return(attempt(()=>t.registerClass({GTypeName:`GoVecWideSignal`,Signals:{wide:{param_types:[n]}}},class extends t.Object{}))??``).includes(`Signals.wide.param_types`)},shows:!0}];async function driveGObjectVectors(e,n,r=t){let{describe:i,it:a,expect:o}=n;await i(`${e.name}: GObject subset (ADR 0096)`,async()=>{for(let t of r)t.holds===`subset`&&e.isOracle||t.widget&&e.Widget===void 0||await a(`${t.row}: ${t.rule}`,()=>{o(JSON.stringify(t.observe(e))).toBe(JSON.stringify(t.shows))})})}export{e as GOBJECT_ROWS,t as GOBJECT_VECTORS,driveGObjectVectors};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";const e=[`registerClass`,`field-form`,`ParamSpec`,`Signals`,`instance API`,`type_ensure`,`vfunc`,`binding engine`,`template`,`interface`,`object property`];function attempt(e){try{return e(),null}catch(e){return e instanceof Error?e.message:String(e)}}function count(e,t){let n={n:0};return e.connect(t,()=>{n.n++}),n}function boxTemplate(e,t=`onClicked`){return{className:e,tree:{tag:`GtkBox`,children:[{tag:`GtkSwitch`,id:`sw`,bindings:{active:{source:`template`,property:`enabled`,flags:[`bidirectional`]}}},{tag:`GtkButton`,id:`btn`,signals:[{name:`clicked`,handler:t}]}]},xml:`<interface><template class="${e}" parent="GtkBox"><child><object class="GtkSwitch" id="sw"><property name="active" bind-source="${e}" bind-property="enabled" bind-flags="bidirectional|sync-create"/></object></child><child><object class="GtkButton" id="btn"><signal name="clicked" handler="${t}"/></object></child></template></interface>`}}function listModelClass(e,t){let{GObject:n}=e;return n.registerClass({GTypeName:t,Implements:[e.ListModel]},class extends n.Object{vfunc_get_item_type(){return n.TYPE_OBJECT}vfunc_get_n_items(){return 3}vfunc_get_item(e){return e<3?this:null}})}function read(e){return e.model??null}function write(e,t){e.model=t}const t=[{row:`ParamSpec`,rule:`a generated accessor notifies once per change and not on an equal value (_generateAccessors)`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=new(t.registerClass({GTypeName:`GoVecNotify`,Properties:{code:n.string(`code`,``,``,r.READWRITE,``)}},class extends t.Object{})),a=count(i,`notify::code`),o=[];return i.code=`x`,o.push(a.n),i.code=`x`,o.push(a.n),i.code=`y`,o.push(a.n),o},shows:[1,1,2]},{row:`ParamSpec`,rule:`a property reads as its ParamSpec default until it is set, for all five kinds`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=new(t.registerClass({GTypeName:`GoVecDefaults`,Properties:{s:n.string(`s`,``,``,r.READWRITE,``),b:n.boolean(`b`,``,``,r.READWRITE,!0),n:n.int(`n`,``,``,r.READWRITE,0,10,3),d:n.double(`d`,``,``,r.READWRITE,0,1,.5),u:n.uint(`u`,``,``,r.READWRITE,0,10,2)}},class extends t.Object{}));return{s:i.s,b:i.b,n:i.n,d:i.d,u:i.u}},shows:{s:``,b:!0,n:3,d:.5,u:2}},{row:`ParamSpec`,rule:`an accessor the class defines is kept: its setter runs per assignment and decides when to notify`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=0,a=new(t.registerClass({GTypeName:`GoVecOwnAccessor`,Properties:{label:n.string(`label`,``,``,r.READWRITE,``)}},class extends t.Object{constructor(...e){super(...e),this.stored=`initial`}get label(){return this.stored}set label(e){i++,this.stored=e,this.notify(`label`)}})),o=count(a,`notify::label`);return a.label=`a`,a.label=`a`,{setterCalls:i,notifies:o.n,value:a.label}},shows:{setterCalls:2,notifies:2,value:`a`}},{row:`ParamSpec`,rule:`a dashed name is reachable as dash-name, dash_name and dashName, and one notify::dash-name serves all three`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=new(t.registerClass({GTypeName:`GoVecAliases`,Properties:{"dash-name":n.string(`dash-name`,``,``,r.READWRITE,`d`)}},class extends t.Object{})),a=[i[`dash-name`],i.dash_name,i.dashName],o=count(i,`notify::dash-name`);return i.dashName=`q`,i.dash_name=`q`,{read:a,notifies:o.n,value:i[`dash-name`]}},shows:{read:[`d`,`d`,`d`],notifies:1,value:`q`}},{row:`ParamSpec`,rule:`a CONSTRUCT_ONLY property gets no accessor on the class and keeps the value it was built with`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecConstructOnly`,Properties:{co:n.int(`co`,``,``,r.READWRITE|r.CONSTRUCT_ONLY,0,10,3)}},class extends t.Object{});return{given:new i({co:7}).co,dflt:new i().co,onPrototype:Object.getOwnPropertyDescriptor(i.prototype,`co`)!==void 0}},shows:{given:7,dflt:3,onPrototype:!1}},{row:`ParamSpec`,rule:`a CONSTRUCT property runs its own setter once at construction: with the default, or the given value`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=[],a=t.registerClass({GTypeName:`GoVecConstructSetter`,Properties:{size:n.int(`size`,``,``,r.READWRITE|r.CONSTRUCT,0,100,32)}},class extends t.Object{get size(){return this._size}set size(e){i.push(e),this._size=e,this.notify(`size`)}}),o=new a,s=i.splice(0),c=new a({size:5});return{dfltCalls:s,givenCalls:i,read:[o.size,c.size]}},shows:{dfltCalls:[32],givenCalls:[5],read:[32,5]}},{row:`ParamSpec`,rule:`construction sets a CONSTRUCT property, so writing its default afterwards is no change and notifies nothing`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecConstructDefault`,Properties:{c:n.int(`c`,``,``,r.READWRITE|r.CONSTRUCT,0,10,7),p:n.int(`p`,``,``,r.READWRITE,0,10,4)}},class extends t.Object{}),a=new i,o=[];return a.connect(`notify::c`,()=>o.push(`c`)),a.connect(`notify::p`,()=>o.push(`p`)),a.c=7,a.p=4,{read:[a.c,new i({c:3}).c],notified:o}},shows:{read:[7,3],notified:[`p`]}},{row:`Signals`,rule:`emit reaches a handler as (emitter, ...params); disconnect stops it; an undeclared name or wrong arity throws`,holds:`oracle`,observe(e){let{GObject:t}=e,n=new(t.registerClass({GTypeName:`GoVecSignals`,Signals:{changed:{param_types:[t.TYPE_STRING,t.TYPE_INT]}}},class extends t.Object{})),r=[],i=0,a=n.connect(`changed`,(...e)=>{i++,r=e});n.emit(`changed`,`s`,3);let o={argc:r.length,emitter:r[0]===n,s:r[1],n:r[2]};return n.disconnect(a),n.emit(`changed`,`t`,4),{...o,callsAfterDisconnect:i,undeclaredThrows:attempt(()=>n.emit(`nope`))!==null,shortThrows:attempt(()=>n.emit(`changed`,`s`))!==null}},shows:{argc:3,emitter:!0,s:`s`,n:3,callsAfterDisconnect:1,undeclaredThrows:!0,shortThrows:!0}},{row:`instance API`,rule:`signal_stop_emission_by_name stops the emission in progress: later handlers do not run, the next emission runs all`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=new(t.registerClass({GTypeName:`GoVecStopEmission`,Properties:{code:n.string(`code`,``,``,r.READWRITE,``)},Signals:{ping:{param_types:[]}}},class extends t.Object{})),a=[],o=!0;i.connect(`ping`,()=>{a.push(`a`),o&&t.signal_stop_emission_by_name(i,`ping`)}),i.connect(`ping`,()=>a.push(`b`)),i.emit(`ping`);let s=a.join(``);a.length=0,o=!1,i.emit(`ping`);let c=a.join(``),l=[];return i.connect(`notify::code`,()=>{l.push(`a`),t.signal_stop_emission_by_name(i,`notify::code`)}),i.connect(`notify::code`,()=>l.push(`b`)),i.code=`x`,{stopped:s,next:c,notified:l.join(``)}},shows:{stopped:`a`,next:`ab`,notified:`a`}},{row:`instance API`,rule:`signal_stop_emission_by_name stops only the innermost emission of ITS signal; with none in progress it does nothing and leaves nothing behind`,holds:`oracle`,observe(e){let{GObject:t}=e,n=new(t.registerClass({GTypeName:`GoVecStopNested`,Signals:{ping:{param_types:[]},pong:{param_types:[]}}},class extends t.Object{})),r=attempt(()=>t.signal_stop_emission_by_name(n,`ping`)),i=[],a=0;n.connect(`ping`,()=>{i.push(`a${a}`),a===0?(a=1,n.emit(`ping`),a=0):t.signal_stop_emission_by_name(n,`ping`)}),n.connect(`ping`,()=>i.push(`b${a}`)),n.emit(`ping`);let o=i.join(`,`);return i.length=0,n.connect(`pong`,()=>{i.push(`p`),t.signal_stop_emission_by_name(n,`ping`)}),n.connect(`pong`,()=>i.push(`q`)),n.emit(`pong`),{idleThrows:r!==null,nested:o,otherSignal:i.join(``)}},shows:{idleThrows:!1,nested:`a0,a1,b0`,otherSignal:`pq`}},{row:`field-form`,rule:`meta given as static symbol fields registers like the meta object (GJS only copies the object onto them)`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t;class Field extends t.Object{}Object.assign(Field,{[t.GTypeName]:`GoVecFieldForm`,[t.properties]:{code:n.string(`code`,``,``,r.READWRITE,``)},[t.signals]:{ping:{param_types:[]}}});let i=t.registerClass(Field),a=new i,o=count(a,`notify::code`),s=count(a,`ping`);return a.code=`x`,a.emit(`ping`),{typeName:i.$gtype.name,notifies:o.n,pings:s.n}},shows:{typeName:`GoVecFieldForm`,notifies:1,pings:1}},{row:`type_ensure`,rule:`$gtype is a token and type_ensure accepts it`,holds:`oracle`,observe(e){let{GObject:t}=e,n=t.registerClass({GTypeName:`GoVecToken`},class extends t.Object{}).$gtype;return{hasGtype:n!==void 0,ensured:attempt(()=>t.type_ensure(n))===null}},shows:{hasGtype:!0,ensured:!0}},{row:`binding engine`,rule:`SYNC_CREATE transfers once at bind time; without it the target keeps its own value`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecBindSync`,Properties:{on:n.boolean(`on`,``,``,r.READWRITE,!1)}},class extends t.Object{}),[a,o,s,c]=[new i,new i,new i,new i];return a.on=!0,s.on=!0,e.bind(a,`on`,o,`on`,[`sync-create`]),e.bind(s,`on`,c,`on`,[]),{withSync:o.on,withoutSync:c.on}},shows:{withSync:!0,withoutSync:!1}},{row:`binding engine`,rule:`the target follows every change of the source`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecBindFollow`,Properties:{on:n.boolean(`on`,``,``,r.READWRITE,!1)}},class extends t.Object{}),[a,o]=[new i,new i];e.bind(a,`on`,o,`on`,[`sync-create`]),a.on=!0;let s=o.on;return a.on=!1,{afterOn:s,afterOff:o.on}},shows:{afterOn:!0,afterOff:!1}},{row:`binding engine`,rule:`BIDIRECTIONAL makes the source follow the target back, without echoing`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecBindBoth`,Properties:{on:n.boolean(`on`,``,``,r.READWRITE,!1)}},class extends t.Object{}),[a,o]=[new i,new i];e.bind(a,`on`,o,`on`,[`bidirectional`,`sync-create`]),o.on=!0;let s=a.on;return a.on=!1,{back:s,forward:o.on}},shows:{back:!0,forward:!1}},{row:`binding engine`,rule:`INVERT_BOOLEAN negates what crosses, at creation and after`,holds:`oracle`,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecBindInvert`,Properties:{on:n.boolean(`on`,``,``,r.READWRITE,!1),off:n.boolean(`off`,``,``,r.READWRITE,!0)}},class extends t.Object{}),[a,o]=[new i,new i];a.on=!0,e.bind(a,`on`,o,`off`,[`sync-create`,`invert-boolean`]);let s=o.off;return a.on=!1,{created:s,after:o.off}},shows:{created:!1,after:!0}},{row:`template`,rule:`construction order: the template is built, construct properties are set (this._x is undefined inside a setter), then this._x is installed`,holds:`oracle`,widget:!0,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=[],a=new(t.registerClass({GTypeName:`GoVecOrder`,Template:e.template(boxTemplate(`GoVecOrder`)),InternalChildren:[`sw`,`btn`],Properties:{code:n.string(`code`,``,``,r.READWRITE,``),enabled:n.boolean(`enabled`,``,``,r.READWRITE,!1)}},class extends e.Widget{get code(){return this.stored}set code(e){i.push(`setter:${typeof this._sw}`),this.stored=e}onClicked(){}constructor(e){super(e),i.push(`after super:${typeof this._sw}`)}}))({code:`k`});return{log:i,code:a.code,child:typeof a._btn}},shows:{log:[`setter:undefined`,`after super:object`],code:`k`,child:`object`}},{row:`template`,rule:"a `bind template.x bidirectional` follows both ways between the template instance and its child",holds:`oracle`,widget:!0,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=new(t.registerClass({GTypeName:`GoVecTemplateBind`,Template:e.template(boxTemplate(`GoVecTemplateBind`)),InternalChildren:[`sw`,`btn`],Properties:{enabled:n.boolean(`enabled`,``,``,r.READWRITE,!1)}},class extends e.Widget{onClicked(){}})),a=i._sw.active;i.enabled=!0;let o=i._sw.active;return i._sw.active=!1,{initial:a,toChild:o,back:i.enabled}},shows:{initial:!1,toChild:!0,back:!1}},{row:`template`,rule:`a handler on the template instance runs bound to that instance and receives the emitter`,holds:`oracle`,widget:!0,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=[],a,o=new(t.registerClass({GTypeName:`GoVecHandler`,Template:e.template(boxTemplate(`GoVecHandler`)),InternalChildren:[`sw`,`btn`],Properties:{enabled:n.boolean(`enabled`,``,``,r.READWRITE,!1)}},class extends e.Widget{onClicked(e){i.push([this===a,e===this._btn])}}));return a=o,o._btn.emit(`clicked`),i},shows:[[!0,!0]]},{row:`template`,rule:"a handler the instance does not have throws `A handler called <name> was not defined` (GJS logs it as a Gtk-CRITICAL instead)",holds:`subset`,widget:!0,observe(e){let{GObject:t}=e,{ParamSpec:n,ParamFlags:r}=t,i=t.registerClass({GTypeName:`GoVecNoHandler`,Template:e.template(boxTemplate(`GoVecNoHandler`,`nope`)),InternalChildren:[`sw`,`btn`],Properties:{enabled:n.boolean(`enabled`,``,``,r.READWRITE,!1)}},class extends e.Widget{});return(attempt(()=>new i)??``).includes(`A handler called nope was not defined`)},shows:!0},...[`Children`,`Requires`,`GTypeFlags`].map(e=>({row:`registerClass`,rule:`the meta key ${e} is refused at registration, by name`,holds:`subset`,observe(t){let{GObject:n}=t;return(attempt(()=>n.registerClass({GTypeName:`GoVecRefuse${e}`,[e]:[]},class extends n.Object{}))??``).includes(e)},shows:!0})),{row:`vfunc`,rule:`a vfunc_* method is refused at registration, naming the method`,holds:`subset`,observe(e){let{GObject:t}=e;return(attempt(()=>t.registerClass({GTypeName:`GoVecVfunc`},class extends t.Object{vfunc_constructed(){}}))??``).includes(`vfunc_constructed`)},shows:!0},{row:`Signals`,rule:`a param type outside STRING, BOOLEAN, INT, UINT and DOUBLE is refused at registration, naming the signal`,holds:`subset`,observe(e){let{GObject:t}=e,n={name:`gint64`};return(attempt(()=>t.registerClass({GTypeName:`GoVecWideSignal`,Signals:{wide:{param_types:[n]}}},class extends t.Object{}))??``).includes(`Signals.wide.param_types`)},shows:!0},{row:`interface`,rule:`Implements installs the interface methods and the emitter on the prototype`,holds:`oracle`,iface:!0,observe(e){let t=new(listModelClass(e,`GoVecIfaceInstall`));return[`get_item`,`get_n_items`,`get_item_type`,`items_changed`].map(e=>typeof t[e])},shows:[`function`,`function`,`function`,`function`]},{row:`interface`,rule:`an implementor passes instanceof the interface, and a class without it does not`,holds:`oracle`,iface:!0,observe(e){let{GObject:t}=e,n=t.registerClass({GTypeName:`GoVecIfacePlain`},class extends t.Object{}),r=e.ListModel;return[new(listModelClass(e,`GoVecIfaceInstanceof`))instanceof r,new n instanceof r]},shows:[!0,!1]},{row:`interface`,rule:`the installed methods call through to the class’s own vfunc_*`,holds:`oracle`,iface:!0,observe(e){let t=new(listModelClass(e,`GoVecIfaceRoute`));return[t.get_n_items(),t.get_item(0)===t,t.get_item(9)]},shows:[3,!0,null]},{row:`interface`,rule:`the interface’s PROPERTIES are NOT installed — a JS implementor has no n_items`,holds:`oracle`,iface:!0,observe(e){let t=new(listModelClass(e,`GoVecIfaceNoProps`));return[t.n_items,t.item_type]},shows:[void 0,void 0]},{row:`interface`,rule:`an implementor is not iterable — a list model is read by position, not by spread`,holds:`oracle`,iface:!0,observe(e){let t=new(listModelClass(e,`GoVecIfaceSpread`));return attempt(()=>void[...t])!==null},shows:!0},{row:`interface`,rule:`items_changed emits the interface’s signal, which an implementor can connect to`,holds:`oracle`,iface:!0,observe(e){let t=new(listModelClass(e,`GoVecIfaceEmit`)),n=[];return t.connect(`items-changed`,(e,...t)=>void n.push(t)),t.items_changed(1,2,3),n},shows:[[1,2,3]]},{row:`interface`,rule:`a short items_changed call names the interface method and the arity it wanted`,holds:`oracle`,iface:!0,observe(e){let t=new(listModelClass(e,`GoVecIfaceArity`));return(attempt(()=>t.items_changed(0,0))??``).includes(`method Gio.ListModel.items_changed: At least 3 arguments required, but only 2 passed`)},shows:!0},{row:`interface`,rule:`an implementor that does not define every vfunc is refused, naming it and the interface`,holds:`subset`,iface:!0,observe(e){let{GObject:t}=e,n=attempt(()=>t.registerClass({GTypeName:`GoVecIfaceNoVfunc`,Implements:[e.ListModel]},class extends t.Object{vfunc_get_item_type(){return t.TYPE_OBJECT}vfunc_get_item(){return null}}));return[(n??``).includes(`vfunc_get_n_items`),(n??``).includes(`Gio.ListModel`)]},shows:[!0,!0]},{row:`interface`,rule:`an interface outside the subset is refused at registration, by name`,holds:`subset`,observe(e){let{GObject:t}=e,n={name:`Gtk.Buildable`},r=attempt(()=>t.registerClass({GTypeName:`GoVecIfaceOutside`,Implements:[n]},class extends t.Object{}));return[(r??``).includes(`Gtk.Buildable`),(r??``).includes(`Gio.ListModel`)]},shows:[!0,!0]},{row:`interface`,rule:`an Implements that is not an array is refused, naming the key`,holds:`subset`,observe(e){let{GObject:t}=e;return(attempt(()=>t.registerClass({GTypeName:`GoVecIfaceNotArray`,Implements:`Gio.ListModel`},class extends t.Object{}))??``).includes(`Implements`)},shows:!0},{row:`object property`,rule:`the default is null, which is the only default g_param_spec_object has`,holds:`oracle`,objectProperty:!0,observe(e){return read(e.objectProperty().instance)},shows:null},{row:`object property`,rule:`a model is stored and notified once; writing the SAME one again notifies nothing`,holds:`oracle`,objectProperty:!0,observe(e){let{instance:t,accepted:n}=e.objectProperty(),r=count(t,`notify::model`);write(t,n);let i=r.n;return write(t,n),[i,r.n,read(t)===n]},shows:[1,1,!0]},{row:`object property`,rule:`null clears it and notifies, because null is a value the property takes`,holds:`oracle`,objectProperty:!0,observe(e){let{instance:t,accepted:n}=e.objectProperty();write(t,n);let r=count(t,`notify::model`);return write(t,null),[r.n,read(t)]},shows:[1,null]},...[[`an array`,[`Blue`,`Teal`],`is not a subclass of GObject_Object, it's a Array`],[`a plain object`,{},`is not a subclass of GObject_Object, it's a Object`],[`a function`,()=>void 0,`is not a subclass of GObject_Object, it's a Function`],[`a string`,`abc`,`Wrong type string; object GListModel expected`],[`a number`,7,`Wrong type number; object GListModel expected`],[`a boolean`,!0,`Wrong type boolean; object GListModel expected`],[`undefined`,void 0,`Wrong type undefined; object GListModel expected`]].map(([e,t,n])=>({row:`object property`,rule:`${e} is refused, and the value stays what it was`,holds:`oracle`,objectProperty:!0,observe(e){let{instance:r,accepted:i}=e.objectProperty();return write(r,i),[(attempt(()=>write(r,t))??``).includes(n),read(r)===i]},shows:[!0,!0]})),{row:`object property`,rule:`a GObject that is not a list model is refused by the interface it does not implement`,holds:`oracle`,objectProperty:!0,observe(e){let{GObject:t}=e,n=t.registerClass({GTypeName:`GoVecObjPlain`},class extends t.Object{}),{instance:r}=e.objectProperty(),i=attempt(()=>write(r,new n));return[(i??``).startsWith(`Object is of type `),(i??``).includes(`cannot convert to GListModel`)]},shows:[!0,!0]}];async function driveGObjectVectors(e,n,r=t){let{describe:i,it:a,expect:o}=n;await i(`${e.name}: GObject subset (ADR 0096)`,async()=>{for(let t of r)t.holds===`subset`&&e.isOracle||t.widget&&e.Widget===void 0||t.iface&&e.ListModel===void 0||t.objectProperty&&e.objectProperty===void 0||await a(`${t.row}: ${t.rule}`,()=>{o(JSON.stringify(t.observe(e))).toBe(JSON.stringify(t.shows))})})}export{e as GOBJECT_ROWS,t as GOBJECT_VECTORS,driveGObjectVectors};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{tabViewItemsChanged as e}from"../tab-view.js";const t=[{input:[`Cyan`,`Magenta`],model:[{value:`Cyan`,label:`Cyan`},{value:`Magenta`,label:`Magenta`}],rule:"a bare string is both value and label — `Gtk.StringList`, which is what a combo row is fed in the common case"},{input:[{value:`a`,label:`One`}],model:[{value:`a`,label:`One`}],rule:`a full descriptor passes through unchanged`},{input:[{label:`Apple`}],model:[{value:`Apple`,label:`Apple`}],rule:"a label with no value is addressable BY that label — otherwise the item answers to `undefined` and `selectedValue` can never reach it"},{input:[{value:`k`}],model:[{value:`k`,label:`k`}],rule:`a value with no label draws its value, so an item is never blank by omission`},{input:[{value:7,label:42}],model:[{value:`7`,label:`42`}],rule:`both halves are stringified: the model is a string list on GTK, and a number that stayed a number would fail an === against the attribute it round-trips through`},{input:[{value:``,label:`blank`}],model:[{value:``,label:`blank`}],rule:`an EMPTY value is a value — it is not missing, so the label does not stand in for it`},{input:[],model:[],rule:`the empty model normalises to the empty model, which is the state a placeholder is drawn from`}],n=[{attribute:`["a","b"]`,model:[{value:`a`,label:`a`},{value:`b`,label:`b`}],rule:`the string-array form, which is what markup writes in the common case`},{attribute:`[{"value":"a","label":"A"}]`,model:[{value:`a`,label:`A`}],rule:`the descriptor form`},{attribute:`[not json`,model:[],rule:`unparseable JSON is an author slip and yields the empty model — it must not stop the element upgrading`},{attribute:`{"a":1}`,model:[],rule:"well-formed JSON that is not an ARRAY is the second, different slip, and it answers the same way rather than throwing on `.map`"},{attribute:``,model:[],rule:`an empty attribute is an empty model, not a parse attempt`}],r={value:`a`,label:`A`},i={value:`b`,label:`B`},a={value:`c`,label:`C`},o=[r,i,a],s=[{previous:[],next:o,change:{position:0,removed:0,added:3},survivors:0,rule:`the first assignment adds everything at 0 — there is nothing to carry over`},{previous:o,next:[...o,{value:`d`,label:`D`}],change:{position:3,removed:0,added:1},survivors:3,rule:`an APPEND touches one position: three views stand, and this is the row a rebuild fails while the model still reads correct`},{previous:o,next:[{value:`z`,label:`Z`},...o],change:{position:0,removed:0,added:1},survivors:3,rule:`a PREPEND is one insertion at 0, not a shift of everything after it — positions move, nodes do not`},{previous:o,next:[r,a],change:{position:1,removed:1,added:0},survivors:2,rule:`a removal from the middle: the shared suffix is what keeps it one item wide`},{previous:o,next:[r,{value:`b`,label:`Renamed`},a],change:{position:1,removed:1,added:1},survivors:2,rule:"a RELABELLED item at an unchanged value is inside the range — comparing by value alone would leave the old text on screen, which is what `selection_item_changed` exists for upstream"},{previous:o,next:o,change:null,survivors:3,rule:`an equal model emits NOTHING, as GTK does — a renderer that rebuilt here would discard three live views for no change at all`},{previous:o,next:[{value:`a`,label:`A`},{value:`b`,label:`B`},{value:`c`,label:`C`}],change:null,survivors:3,rule:`equality is STRUCTURAL, not by array identity: a caller that rebuilds its array every render must not force a rebuild here`},{previous:o,next:[],change:{position:0,removed:3,added:0},survivors:0,rule:`emptying the model removes everything from 0`},{previous:o,next:[a,i,r],change:{position:0,removed:3,added:3},survivors:0,rule:"a REVERSAL is the whole span: `items-changed` has no vocabulary for a move, and neither does `g_list_store_move`, which reports one the same way"}],c=[{initial:[r,i],source:`readback`,op:`append`,assign:!1,model:[r,i],itemsChanged:null,survivors:2,rule:`a model read back is the CALLER's array — pushing onto it moves nothing, because nothing was assigned`},{initial:[r,i],source:`readback`,op:`append`,assign:!0,model:[r,i,{value:`z`,label:`Z`}],itemsChanged:{position:2,removed:0,added:1},survivors:2,rule:`read, push, assign is one insertion at the end — the pattern a full rebuild used to serve and a splice over a shared array answers with nothing at all`},{initial:[r,i],source:`readback`,op:`relabel-first`,assign:!0,model:[{value:`a`,label:`Renamed`},i],itemsChanged:{position:0,removed:1,added:1},survivors:1,rule:`relabelling an item THROUGH the array read back is the same failure one level down: a shared descriptor changes the stored model too, so the comparison sees no change`},{initial:[r,i,a],source:`readback`,op:`remove-first`,assign:!0,model:[i,a],itemsChanged:{position:0,removed:1,added:0},survivors:2,rule:`the shrink direction, which a shared array reports as a model that got shorter on BOTH sides and therefore did not change`},{initial:[r,i],source:`input`,op:`append`,assign:!0,model:[r,i,{value:`z`,label:`Z`}],itemsChanged:{position:2,removed:0,added:1},survivors:2,rule:`the OTHER door — an array the caller ASSIGNED and kept a reference to. Closing only the read-back one leaves the same comparison reading the new value on both sides, by the other route`}];function applyListReadback(e,t){if(t===`append`)e.push({value:`z`,label:`Z`});else if(t===`relabel-first`){let t=e[0];t&&(t.label=`Renamed`)}else e.shift();return e}const l=[{selected:1,length:3,result:1,rule:`a position the new model has is kept`},{selected:5,length:3,result:0,rule:"a position past the end falls back to 0 — `GtkSingleSelection` autoselects rather than deselecting"},{selected:-1,length:3,result:0,rule:"the SENTINEL falls back to 0 too, which is how a widget recovers a selection when its model grows; a one-sided `selected >= length` would leave the -1 standing"},{selected:0,length:0,result:-1,rule:`an EMPTY model has no 0 to fall back to, so it lands on the sentinel and a placeholder becomes drawable`},{selected:NaN,length:3,result:0,rule:"a non-finite position addresses no item — the same answer as one past the end, so a `parseInt` of a malformed attribute cannot poison the index"}],u=[{change:{kind:`attached`,id:`C`,position:2,previousPosition:-1},itemsChanged:{position:2,removed:0,added:1},before:[`A`,`B`],after:[`A`,`B`,`C`],rule:"attached is one addition at the new position; `previousPosition` is -1 because the page had none"},{change:{kind:`detached`,id:`B`,position:1,previousPosition:1},itemsChanged:{position:1,removed:1,added:0},before:[`A`,`B`,`C`],after:[`A`,`C`],rule:`detached is one removal at the position it was removed FROM`},{change:{kind:`updated`,id:`B`,position:1,previousPosition:1},itemsChanged:{position:1,removed:1,added:1},before:[`A`,`B`,`C`],after:[`A`,`B`,`C`],rule:'a per-page notify is removed-1/added-1 at that position — `GListModel` has no other verb for "this item is different now" — and it moves nothing'},{change:{kind:`reordered`,id:`D`,position:1,previousPosition:3},itemsChanged:{position:1,removed:3,added:3},before:[`A`,`B`,`C`,`D`],after:[`A`,`D`,`B`,`C`],rule:`a move BACKWARDS is the span between the two positions, re-added in the new order`},{change:{kind:`reordered`,id:`A`,position:2,previousPosition:0},itemsChanged:{position:0,removed:3,added:3},before:[`A`,`B`,`C`,`D`],after:[`B`,`C`,`A`,`D`],rule:`a move FORWARDS spans the same way — the position is the LOWER of the two, so the range covers both ends`},{change:{kind:`pinned`,id:`C`,position:0,previousPosition:2},itemsChanged:{position:0,removed:3,added:3},before:[`A`,`B`,`C`],after:[`C`,`A`,`B`],rule:`pinning is a flip AND a re-order, so it reports as the move it is rather than as an update in place`}];function replayTabPagesAsSplices(t,n){let r=[...t];for(let t of n){let{position:n,removed:i,added:a}=e(t),o=r.splice(n,i);if(a===0)continue;if(t.kind===`attached`){r.splice(n,0,t.id);continue}if(t.kind===`updated`){r.splice(n,0,...o);continue}let s=o.filter(e=>e!==t.id);s.splice(t.position-n,0,t.id),r.splice(n,0,...s)}return r}export{s as LIST_ITEMS_CHANGED_VECTORS,c as LIST_MODEL_OWNERSHIP_VECTORS,t as LIST_NORMALIZE_VECTORS,n as LIST_PARSE_VECTORS,l as LIST_SELECTION_CLAMP_VECTORS,u as TAB_PAGES_ITEMS_CHANGED_VECTORS,applyListReadback,replayTabPagesAsSplices};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{tabViewItemsChanged as e}from"../tab-view.js";function stringItem(e){return{string:e}}function listSource(...e){return{get_n_items:()=>e.length,get_item:t=>e[t]??null}}const t=[{input:[`Cyan`,`Magenta`],model:[{value:`Cyan`,label:`Cyan`},{value:`Magenta`,label:`Magenta`}],rule:"a bare string is both value and label — `Gtk.StringList`, which is what a combo row is fed in the common case"},{input:[{value:`a`,label:`One`}],model:[{value:`a`,label:`One`}],rule:`a full descriptor passes through unchanged`},{input:[{label:`Apple`}],model:[{value:`Apple`,label:`Apple`}],rule:"a label with no value is addressable BY that label — otherwise the item answers to `undefined` and `selectedValue` can never reach it"},{input:[{value:`k`}],model:[{value:`k`,label:`k`}],rule:`a value with no label draws its value, so an item is never blank by omission`},{input:[{value:7,label:42}],model:[{value:`7`,label:`42`}],rule:`both halves are stringified: the model is a string list on GTK, and a number that stayed a number would fail an === against the attribute it round-trips through`},{input:[{value:``,label:`blank`}],model:[{value:``,label:`blank`}],rule:`an EMPTY value is a value — it is not missing, so the label does not stand in for it`},{input:[],model:[],rule:`the empty model normalises to the empty model, which is the state a placeholder is drawn from`},{input:listSource(stringItem(`Cyan`),stringItem(`Magenta`)),model:[{value:`Cyan`,label:`Cyan`},{value:`Magenta`,label:`Magenta`}],rule:"a model of `Gtk.StringObject`s reads as its strings — the same model an array of those strings makes"},{input:listSource(),model:[],rule:`an EMPTY model is the empty model, not a model the normaliser declines to read`},{input:listSource({value:`a`,label:`One`}),model:[{value:`a`,label:`One`}],rule:`an item that is no string object meets the descriptor rule, the one an array entry meets`},{input:listSource({}),model:[{value:``,label:``}],rule:"an item with neither half is the empty descriptor `{}` already is — drawing it would need `expression`, which ADR 0122 leaves out"}],n=[{attribute:`["a","b"]`,model:[{value:`a`,label:`a`},{value:`b`,label:`b`}],rule:`the string-array form, which is what markup writes in the common case`},{attribute:`[{"value":"a","label":"A"}]`,model:[{value:`a`,label:`A`}],rule:`the descriptor form`},{attribute:`[not json`,model:[],rule:`unparseable JSON is an author slip and yields the empty model — it must not stop the element upgrading`},{attribute:`{"a":1}`,model:[],rule:"well-formed JSON that is not an ARRAY is the second, different slip, and it answers the same way rather than throwing on `.map`"},{attribute:``,model:[],rule:`an empty attribute is an empty model, not a parse attempt`}],r={value:`a`,label:`A`},i={value:`b`,label:`B`},a={value:`c`,label:`C`},o=[r,i,a],s=[{previous:[],next:o,change:{position:0,removed:0,added:3},survivors:0,rule:`the first assignment adds everything at 0 — there is nothing to carry over`},{previous:o,next:[...o,{value:`d`,label:`D`}],change:{position:3,removed:0,added:1},survivors:3,rule:`an APPEND touches one position: three views stand, and this is the row a rebuild fails while the model still reads correct`},{previous:o,next:[{value:`z`,label:`Z`},...o],change:{position:0,removed:0,added:1},survivors:3,rule:`a PREPEND is one insertion at 0, not a shift of everything after it — positions move, nodes do not`},{previous:o,next:[r,a],change:{position:1,removed:1,added:0},survivors:2,rule:`a removal from the middle: the shared suffix is what keeps it one item wide`},{previous:o,next:[r,{value:`b`,label:`Renamed`},a],change:{position:1,removed:1,added:1},survivors:2,rule:"a RELABELLED item at an unchanged value is inside the range — comparing by value alone would leave the old text on screen, which is what `selection_item_changed` exists for upstream"},{previous:o,next:o,change:null,survivors:3,rule:`an equal model emits NOTHING, as GTK does — a renderer that rebuilt here would discard three live views for no change at all`},{previous:o,next:[{value:`a`,label:`A`},{value:`b`,label:`B`},{value:`c`,label:`C`}],change:null,survivors:3,rule:`equality is STRUCTURAL, not by array identity: a caller that rebuilds its array every render must not force a rebuild here`},{previous:o,next:[],change:{position:0,removed:3,added:0},survivors:0,rule:`emptying the model removes everything from 0`},{previous:o,next:[a,i,r],change:{position:0,removed:3,added:3},survivors:0,rule:"a REVERSAL is the whole span: `items-changed` has no vocabulary for a move, and neither does `g_list_store_move`, which reports one the same way"}],c=[{initial:[r,i],source:`readback`,op:`append`,assign:!1,model:[r,i],itemsChanged:null,survivors:2,rule:`a model read back is the CALLER's array — pushing onto it moves nothing, because nothing was assigned`},{initial:[r,i],source:`readback`,op:`append`,assign:!0,model:[r,i,{value:`z`,label:`Z`}],itemsChanged:{position:2,removed:0,added:1},survivors:2,rule:`read, push, assign is one insertion at the end — the pattern a full rebuild used to serve and a splice over a shared array answers with nothing at all`},{initial:[r,i],source:`readback`,op:`relabel-first`,assign:!0,model:[{value:`a`,label:`Renamed`},i],itemsChanged:{position:0,removed:1,added:1},survivors:1,rule:`relabelling an item THROUGH the array read back is the same failure one level down: a shared descriptor changes the stored model too, so the comparison sees no change`},{initial:[r,i,a],source:`readback`,op:`remove-first`,assign:!0,model:[i,a],itemsChanged:{position:0,removed:1,added:0},survivors:2,rule:`the shrink direction, which a shared array reports as a model that got shorter on BOTH sides and therefore did not change`},{initial:[r,i],source:`input`,op:`append`,assign:!0,model:[r,i,{value:`z`,label:`Z`}],itemsChanged:{position:2,removed:0,added:1},survivors:2,rule:`the OTHER door — an array the caller ASSIGNED and kept a reference to. Closing only the read-back one leaves the same comparison reading the new value on both sides, by the other route`}];function applyListReadback(e,t){if(t===`append`)e.push({value:`z`,label:`Z`});else if(t===`relabel-first`){let t=e[0];t&&(t.label=`Renamed`)}else e.shift();return e}const l=[{selected:1,length:3,result:1,rule:`a position the new model has is kept`},{selected:5,length:3,result:0,rule:"a position past the end falls back to 0 — `GtkSingleSelection` autoselects rather than deselecting"},{selected:-1,length:3,result:0,rule:"the SENTINEL falls back to 0 too, which is how a widget recovers a selection when its model grows; a one-sided `selected >= length` would leave the -1 standing"},{selected:0,length:0,result:-1,rule:`an EMPTY model has no 0 to fall back to, so it lands on the sentinel and a placeholder becomes drawable`},{selected:NaN,length:3,result:0,rule:"a non-finite position addresses no item — the same answer as one past the end, so a `parseInt` of a malformed attribute cannot poison the index"}],u=[{change:{kind:`attached`,id:`C`,position:2,previousPosition:-1},itemsChanged:{position:2,removed:0,added:1},before:[`A`,`B`],after:[`A`,`B`,`C`],rule:"attached is one addition at the new position; `previousPosition` is -1 because the page had none"},{change:{kind:`detached`,id:`B`,position:1,previousPosition:1},itemsChanged:{position:1,removed:1,added:0},before:[`A`,`B`,`C`],after:[`A`,`C`],rule:`detached is one removal at the position it was removed FROM`},{change:{kind:`updated`,id:`B`,position:1,previousPosition:1},itemsChanged:{position:1,removed:1,added:1},before:[`A`,`B`,`C`],after:[`A`,`B`,`C`],rule:'a per-page notify is removed-1/added-1 at that position — `GListModel` has no other verb for "this item is different now" — and it moves nothing'},{change:{kind:`reordered`,id:`D`,position:1,previousPosition:3},itemsChanged:{position:1,removed:3,added:3},before:[`A`,`B`,`C`,`D`],after:[`A`,`D`,`B`,`C`],rule:`a move BACKWARDS is the span between the two positions, re-added in the new order`},{change:{kind:`reordered`,id:`A`,position:2,previousPosition:0},itemsChanged:{position:0,removed:3,added:3},before:[`A`,`B`,`C`,`D`],after:[`B`,`C`,`A`,`D`],rule:`a move FORWARDS spans the same way — the position is the LOWER of the two, so the range covers both ends`},{change:{kind:`pinned`,id:`C`,position:0,previousPosition:2},itemsChanged:{position:0,removed:3,added:3},before:[`A`,`B`,`C`],after:[`C`,`A`,`B`],rule:`pinning is a flip AND a re-order, so it reports as the move it is rather than as an update in place`}];function replayTabPagesAsSplices(t,n){let r=[...t];for(let t of n){let{position:n,removed:i,added:a}=e(t),o=r.splice(n,i);if(a===0)continue;if(t.kind===`attached`){r.splice(n,0,t.id);continue}if(t.kind===`updated`){r.splice(n,0,...o);continue}let s=o.filter(e=>e!==t.id);s.splice(t.position-n,0,t.id),r.splice(n,0,...s)}return r}export{s as LIST_ITEMS_CHANGED_VECTORS,c as LIST_MODEL_OWNERSHIP_VECTORS,t as LIST_NORMALIZE_VECTORS,n as LIST_PARSE_VECTORS,l as LIST_SELECTION_CLAMP_VECTORS,u as TAB_PAGES_ITEMS_CHANGED_VECTORS,applyListReadback,replayTabPagesAsSplices};
|
package/lib/esm/gobject.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{registerGObjectEngine as e,registeredEngine as t}from"./engine.js";var UnsupportedGObjectError=class extends Error{constructor(e,t){super(t),this.name=`UnsupportedGObjectError`,this.feature=e}};const n=new WeakSet;function makeType(e){let t=Object.freeze({name:e});return n.add(t),t}const r=makeType(`gchararray`),i=makeType(`gboolean`),a=makeType(`gint`),o=makeType(`guint`),s=makeType(`gdouble`),c=new WeakMap;var Value=class{init(e){if(e!==r)throw new UnsupportedGObjectError(`GObject.Value of ${describeType(e)}`,`GObject.Value holds only TYPE_STRING in this subset (ADR 0096 Amendment 2); '${describeType(e)}' is not supported`);return c.set(this,{type:e,string:null}),this}set_string(e){let t=c.get(this);if(e!==null&&typeof e!=`string`)throw TypeError(`Expected type string for argument 'v_string' but got type ${typeof e}`);t&&(t.string=e)}get_string(){return c.get(this)?.string??null}};function readValue(e){let t=typeof e==`object`&&e?c.get(e):void 0;return t?{...t}:null}const l=[r,i,a,o,s],u={READABLE:1,WRITABLE:2,READWRITE:3,CONSTRUCT:4,CONSTRUCT_ONLY:8};var d=class ParamSpec{constructor(e,t,n,r,i,a,o,s){this.kind=e,this.name=t,this.nick=n,this.blurb=r,this.flags=i,this.defaultValue=a,this.minimum=o,this.maximum=s}static boolean(e,t,n,r,i){return new ParamSpec(`boolean`,e,t,n,r,i)}static string(e,t,n,r,i){return new ParamSpec(`string`,e,t,n,r,i)}static int(e,t,n,r,i,a,o){return new ParamSpec(`int`,e,t,n,r,o,i,a)}static uint(e,t,n,r,i,a,o){return new ParamSpec(`uint`,e,t,n,r,o,i,a)}static double(e,t,n,r,i,a,o){return new ParamSpec(`double`,e,t,n,r,o,i,a)}get_default_value(){return this.defaultValue}};const f={GTypeName:Symbol(`GType name`),GTypeFlags:Symbol(`GType flags`),interfaces:Symbol(`GType interfaces`),properties:Symbol(`GObject properties`),signals:Symbol(`GObject signals`),requires:Symbol(`GObject interface requires`),template:Symbol(`GTK widget template`),cssName:Symbol(`GTK widget CSS name`),children:Symbol(`GTK widget template children`),internalChildren:Symbol(`GTK widget template internal children`)},p={GTypeName:f.GTypeName,Template:f.template,InternalChildren:f.internalChildren,Properties:f.properties,Signals:f.signals,CssName:f.cssName},m={Children:f.children,Implements:f.interfaces,Requires:f.requires,GTypeFlags:f.GTypeFlags},h=new WeakMap;function registeredClassOf(e){return h.get(e)}function chainOf(e){let t=[];for(let n=e;typeof n==`function`;n=Object.getPrototypeOf(n)){let e=h.get(n);e&&t.push(e)}return t}function chainOfInstance(e){return chainOf(e.constructor)}function typeNameOf(e,t){return t[0]?.typeName??e.constructor.name}function aliasesOf(e){return[e,e.replace(/-/g,`_`),e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]}function findProperty(e,t){for(let n of e)for(let e of n.properties)if(aliasesOf(e.name).includes(t))return e}function findSignal(e,t){for(let n of e)if(Object.prototype.hasOwnProperty.call(n.signals,t))return n.signals[t]}function parseSignal(e){let t=e.indexOf(`::`);return t===-1?{name:e}:{name:e.slice(0,t),detail:e.slice(t+2)}}const g=new WeakMap;function stateOf(e){let t=g.get(e);return t||(t={values:new Map,handlers:new Map,connections:new Map,emissions:[]},g.set(e,t)),t}function runHandlers(e,t,n){let r=stateOf(e),i={key:t,stopped:!1};r.emissions.push(i);try{for(let{id:a,handler:o}of(r.handlers.get(t)??[]).slice()){if(i.stopped)break;r.connections.has(a)&&o(e,...n)}}finally{r.emissions.pop()}}const _={name:`pure-js`,supportsForeignParentClasses:!1,registerForeignClass(e,t){throw TypeError(`The pure-JS GObject engine cannot register '${t.GTypeName}' (${e.name??`anonymous`}) over a foreign parent class: there is no GType to register it as. Check supportsForeignParentClasses before calling — a caller that reaches this is one that would otherwise have fallen back silently, which is what ADR 0105 refuses.`)},register(){},getValue(e,t){let{values:n}=stateOf(e);return n.has(t.name)||n.set(t.name,t.get_default_value()),n.get(t.name)},setValue(e,t,n){let{values:r}=stateOf(e),i=n!==r.get(t.name);return r.set(t.name,n),i},addHandler(e,t,n,r){let i=stateOf(e),a=i.handlers.get(n)??[];a.push({id:t,handler:r}),i.handlers.set(n,a),i.connections.set(t,()=>{a.splice(a.findIndex(e=>e.id===t),1)})},removeHandler(e,t){let n=stateOf(e),r=n.connections.get(t);return r?(n.connections.delete(t),r(),!0):!1},emit(e,t,n){runHandlers(e,t,n)},notify(e,t){runHandlers(e,`notify::${t.name}`,[t])},stopEmission(e,t){let{emissions:n}=stateOf(e);for(let e=n.length-1;e>=0;e--){let r=n[e];if(r.key===t&&!r.stopped)return r.stopped=!0,!0}return!1},bind(e,t,n,r,i){return bindProperties(e,t,n,r,i)}};function usePureJsGObjectEngine(){return e(_),_}const v=new WeakMap;function engineOf(e){let t=v.get(e);return t||(t=chainOfInstance(e)[0]?.engine??_,v.set(e,t)),t}let y=0;const b=new WeakMap,x=Symbol.for(`@gjsify/adwaita-core/stop-emission`);function isStoppable(e){return typeof e[x]==`function`}function stopEmissionByName(e,t){if(typeof e!=`object`||!e)throw TypeError(`GObject.signal_stop_emission_by_name: not a GObject instance`);if(isStoppable(e)){e[x](t);return}let n=chainOfInstance(e),r=typeNameOf(e,n),{name:i,detail:a}=parseSignal(t),o;if(i===`notify`&&a!==void 0){let e=findProperty(n,a);e&&(o=`notify::${e.name}`)}else a===void 0&&findSignal(n,i)&&(o=i);if(o===void 0){if(!n[0])throw new UnsupportedGObjectError(`signal_stop_emission_by_name`,`'${t}' on '${r}' is not a signal of a registered class; only those can be stopped.`);console.warn(`signal '${t}' is invalid for instance of type '${r}'`);return}engineOf(e).stopEmission(e,o)||console.warn(`no emission of signal "${t}" to stop for instance of type '${r}'`)}function connectInstance(e,t,n){let r=chainOfInstance(e),i=typeNameOf(e,r),{name:a,detail:o}=parseSignal(t),own=t=>{let r=++y;return engineOf(e).addHandler(e,r,t,n),r},foreign=()=>{let a=r[0]?.door;if(!a)throw Error(`No signal '${t}' on object '${i}'`);let o=++y,s=a.listen(e,t,n),c=b.get(e);return c||b.set(e,c=new Map),c.set(o,s),o};if(a===`notify`){if(o===void 0)throw new UnsupportedGObjectError(`connect("notify")`,`connect('notify') without a property is outside the GObject subset; connect 'notify::<property>' on '${i}'.`);let e=findProperty(r,o);return e?own(`notify::${e.name}`):foreign()}if(findSignal(r,a)){if(o!==void 0)throw Error(`Signal '${a}' on object '${i}' has no detail`);return own(a)}return foreign()}function disconnectInstance(e,t){let n=b.get(e)?.get(t);if(n){b.get(e).delete(t),n();return}if(!engineOf(e).removeHandler(e,t))throw Error(`No handler with id ${t} is connected to ${String(e)}`)}function emitInstance(e,t,...n){let r=chainOfInstance(e),i=typeNameOf(e,r),a=findSignal(r,t);if(a){if(n.length!==a.length)throw Error(`Signal '${t}' on ${i} requires ${a.length} args got ${n.length}`);engineOf(e).emit(e,t,n);return}let o=r[0]?.door;if(!o)throw Error(`No signal '${t}' on object '${i}'`);o.dispatch(e,t,n)}function notifyInstance(e,t){let n=chainOfInstance(e),r=findProperty(n,t);if(r){engineOf(e).notify(e,r);return}let i=n[0]?.door;if(!i)throw Error(`No property ${t} on ${typeNameOf(e,n)}`);i.dispatch(e,`notify::${t}`,[])}function generateAccessors(e,t){let{name:n,flags:r}=e,i=r&u.READABLE,a=r&u.WRITABLE,o=t??{configurable:!0,enumerable:!0};return i&&a?!o.get&&!o.set?(o.get=function(){return engineOf(this).getValue(this,e)},o.set=function(t){engineOf(this).setValue(this,e,t)&&this.notify(n)}):o.get?o.set||=function(){throw Error(`getter defined without setter for property ${n}`)}:o.get=function(){throw Error(`setter defined without getter for property ${n}`)}:i&&!o.get?o.get=function(){throw Error(`missing getter for read-only property ${n}`)}:a&&!o.set&&(o.set=function(){throw Error(`missing setter for write-only property ${n}`)}),o}function checkAccessors(e,t){let{name:n,flags:r}=t;if(r&u.CONSTRUCT_ONLY)return;let[,i,a]=aliasesOf(n),own=t=>Object.getOwnPropertyDescriptor(e,t),o=own(n),s=o,c=n.includes(`-`),l,d;c&&(l=own(i),d=own(a),o??=l,o??=d);let f=r&u.READABLE,p=r&u.WRITABLE;(!o||f&&!o.get||p&&!o.set)&&(o=generateAccessors(t,o)),s||Object.defineProperty(e,n,o),c&&(l||Object.defineProperty(e,i,o),d||Object.defineProperty(e,a,o))}function defineConstructOnly(e,t,n){let r=engineOf(e);r.setValue(e,t,n);for(let n of new Set(aliasesOf(t.name)))Object.defineProperty(e,n,{get:()=>r.getValue(e,t),enumerable:!0,configurable:!0})}function bindProperties(e,t,n,r,i=[]){let a=i.includes(`invert-boolean`),o=!1,transfer=(e,t,n,r)=>()=>{if(!o){o=!0;try{let i=e[t];n[r]=a?!i:i}finally{o=!1}}},s=transfer(e,t,n,r),c=[[e,e.connect(`notify::${t}`,s)]];if(i.includes(`bidirectional`)){let i=transfer(n,r,e,t);c.push([n,n.connect(`notify::${r}`,i)])}return i.includes(`sync-create`)&&s(),{unbind(){for(let[e,t]of c.splice(0))e.disconnect(t)}}}function createClosure(e,t,n,r){let i=r??e;if(n)throw new UnsupportedGObjectError(`swapped`,`Unsupported template signal flag "swapped"`);let a=e[t];if(a===void 0)throw Error(`A handler called ${t} was not defined on ${String(e)}`);return a.bind(i)}function scopeOf(e){let t=engineOf(e);return{instance:e,handler:(t,n)=>createClosure(e,t,n?.flags?.includes(`swapped`)??!1,n?.object),bind:(e,n,r,i,a)=>t.bind(e,n,r,i,a??[])}}function constructRegistered(e,t={}){let n=chainOfInstance(e),r={},i=new Map;for(let[e,a]of Object.entries(t)){let t=findProperty(n,e);t?i.set(t,a):r[e]=a}let a=[];for(let t of[...n].reverse())t.template&&a.push([t,t.door.createFromTree(t.template,scopeOf(e),e)]);for(let t of n)for(let n of t.properties)n.flags&u.CONSTRUCT_ONLY&&defineConstructOnly(e,n,i.has(n)?i.get(n):n.get_default_value());for(let t of[...n].reverse())for(let n of t.properties)n.flags&u.CONSTRUCT&&!(n.flags&u.CONSTRUCT_ONLY)&&(e[n.name]=i.has(n)?i.get(n):n.get_default_value());for(let[t,n]of i)t.flags&(u.CONSTRUCT|u.CONSTRUCT_ONLY)||(e[t.name]=n);for(let[t,n]of a){for(let r of t.internalChildren){let i=n.objects[r];if(i===void 0)throw Error(`Template of ${t.typeName} has no child object '${r}' for InternalChildren`);e[`_${r.replace(/-/g,`_`)}`]=i}t.door.attach(e,n)}return r}const own=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),S=Symbol(`GIR type`),C={"Gio.Application":[`vfunc_startup`,`vfunc_activate`],"GtkSource.GutterRenderer":[`vfunc_query_data`]};function unlockedVfuncsOf(e){let t=new Set;for(let n=e;typeof n==`function`;n=Object.getPrototypeOf(n)){let e=own(n,S)?n[S]:void 0;if(typeof e==`string`)for(let n of C[e]??[])t.add(n)}return t}function refusal(e,t,n=``){return new UnsupportedGObjectError(t,`GObject.registerClass: ${e} uses '${t}'${n}, which is outside the GObject subset (ADR 0096 § 2).`)}function describeType(e){return e?.name?.toString()??String(e)}let w=0;function registerWith(e,t,n){let r=n.length===2?n[1]:n[0];if(typeof r!=`function`)throw TypeError(`GObject.registerClass() needs a class`);let i=r,a=i.name||`anonymous class`;if(n.length===2){let e=n[0];for(let t of Object.keys(e))if(!own(p,t))throw refusal(a,t);for(let[t,n]of Object.entries(p))t in e&&(i[n]=e[t])}for(let[e,t]of Object.entries(m))if(own(i,t))throw refusal(a,e);let o=unlockedVfuncsOf(i);for(let e of[i,i.prototype])for(let t of Object.getOwnPropertyNames(e))if(t.startsWith(`vfunc_`)&&typeof Object.getOwnPropertyDescriptor(e,t)?.value==`function`&&!o.has(t))throw refusal(a,t,` (a virtual function override that UNLOCKED_VFUNCS does not list, ADR 0098 § 1a)`);let declared=e=>own(i,e)?i[e]:void 0,s=declared(f.GTypeName),c=String(s??`Gjs_${i.name||`anonymous_${++w}`}`).replace(/[^a-z0-9+_-]/gi,`_`),u=Object.values(declared(f.properties)??{}).map(e=>{if(!(e instanceof d))throw TypeError(`GObject.registerClass: ${a} declares a property that is not a ParamSpec`);return e}),g={};for(let[e,t]of Object.entries(declared(f.signals)??{})){for(let n of Object.keys(t))if(n!==`param_types`)throw refusal(a,`Signals.${e}.${n}`);let n=t.param_types??[];for(let t of n)if(!l.includes(t))throw refusal(a,`Signals.${e}.param_types`,` with the type '${describeType(t)}' (only TYPE_STRING, TYPE_BOOLEAN, TYPE_INT, TYPE_UINT and TYPE_DOUBLE)`);g[e]=n}let _=declared(f.template);if(_!==void 0&&(typeof _!=`object`||!_))throw new UnsupportedGObjectError(`Template`,`GObject.registerClass: ${a} has a Template that is not a '?template' value; a string, URI or bytes stay GJS-only (ADR 0096 § 4).`);let v=makeType(c),y={klass:i,typeName:c,gtype:v,properties:u,signals:g,template:_,internalChildren:declared(f.internalChildren)??[],cssName:declared(f.cssName),door:e,engine:t};Object.defineProperty(i,"$gtype",{get:()=>v,enumerable:!1,configurable:!1});for(let e of u)checkAccessors(i.prototype,e);return installInstanceApi(i.prototype),h.set(i,y),t.register(y),e.register(y.klass,y),y.klass}function registerBaseClass(e,t,n,r=[],i=_){let missing=e=>{throw Error(`No signal '${e}' on object '${t}'`)},a=makeType(t);Object.defineProperty(e,"$gtype",{get:()=>a,enumerable:!1,configurable:!1});for(let t of r)checkAccessors(e.prototype,t);let o={klass:e,typeName:t,gtype:a,properties:r,signals:n,internalChildren:[],engine:i,door:{name:t,dispatch:(e,t)=>missing(t),listen:(e,t)=>missing(t),createFromTree:()=>missing(`template`),attach(){},register(){}}};h.set(e,o),i.register(o)}var GObjectObject=class{constructor(e){let t=constructRegistered(this,e),n=Object.keys(t)[0];if(n!==void 0)throw Error(`No property ${n} on ${typeNameOf(this,chainOfInstance(this))}`)}notify(e){notifyInstance(this,e)}connect(e,t){return connectInstance(this,e,t)}disconnect(e){disconnectInstance(this,e)}emit(e,...t){emitInstance(this,e,...t)}};function installInstanceApi(e){for(let t of[`notify`,`connect`,`disconnect`,`emit`])typeof e[t]!=`function`&&Object.defineProperty(e,t,{value:GObjectObject.prototype[t],writable:!0,configurable:!0,enumerable:!1})}function createGObject(e,t=_){return{engineName:t.name,Object:GObjectObject,registerClass:((...n)=>registerWith(e,t,n)),ParamSpec:d,ParamFlags:u,Value,TYPE_STRING:r,TYPE_BOOLEAN:i,TYPE_INT:a,TYPE_UINT:o,TYPE_DOUBLE:s,GTypeName:f.GTypeName,GTypeFlags:f.GTypeFlags,interfaces:f.interfaces,properties:f.properties,signals:f.signals,requires:f.requires,__gtkTemplate__:f.template,__gtkCssName__:f.cssName,__gtkChildren__:f.children,__gtkInternalChildren__:f.internalChildren,type_ensure(e){if(!n.has(e))throw TypeError(`GObject.type_ensure: not a GType of this GObject`)},signal_stop_emission_by_name:stopEmissionByName}}function gobjectEngineName(){return t()?.name??_.name}export{S as GIR_TYPE,GObjectObject,f as META_SYMBOLS,_ as PURE_JS_ENGINE,u as ParamFlags,d as ParamSpec,x as STOP_EMISSION,i as TYPE_BOOLEAN,s as TYPE_DOUBLE,a as TYPE_INT,r as TYPE_STRING,o as TYPE_UINT,C as UNLOCKED_VFUNCS,UnsupportedGObjectError,Value,bindProperties,connectInstance,constructRegistered,createClosure,createGObject,disconnectInstance,emitInstance,gobjectEngineName,notifyInstance,readValue,registerBaseClass,registeredClassOf,stopEmissionByName,usePureJsGObjectEngine};
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{registerGObjectEngine as e,registeredEngine as t}from"./engine.js";var UnsupportedGObjectError=class extends Error{constructor(e,t){super(t),this.name=`UnsupportedGObjectError`,this.feature=e}};const n=new WeakSet;function makeType(e){let t=Object.freeze({name:e});return n.add(t),t}const r=makeType(`gchararray`),i=makeType(`gboolean`),a=makeType(`gint`),o=makeType(`guint`),s=makeType(`gdouble`),c=makeType(`GObject`),l=new WeakSet;function makeInterface(e){let token=function(){throw TypeError(`${e.name} is an interface; it cannot be constructed`)};for(let[t,n]of Object.entries(e))Object.defineProperty(token,t,{value:n,enumerable:!0});return Object.defineProperty(token,Symbol.hasInstance,{value:e=>typeof e==`object`&&!!e&&implementsInterface(e,token)}),l.add(token),Object.freeze(token)}function isInterface(e){return typeof e==`function`&&l.has(e)}const u=makeInterface({name:`Gio.ListModel`,gtype:makeType(`GListModel`),vfuncs:[`vfunc_get_item_type`,`vfunc_get_n_items`,`vfunc_get_item`],methods:{get_item_type:`vfunc_get_item_type`,get_n_items:`vfunc_get_n_items`,get_item:`vfunc_get_item`},emitters:{items_changed:`items-changed`},signals:{"items-changed":[o,o,o]}}),d=[u];function implementsInterface(e,t){for(let n of chainOfInstance(e))if(n.interfaces.includes(t))return!0;return!1}function describeInterface(e){if(isInterface(e))return e.name;let t=e?.name;return typeof t==`string`&&t.length>0?t:String(e)}const f=new WeakMap;var Value=class{init(e){if(e!==r)throw new UnsupportedGObjectError(`GObject.Value of ${describeType(e)}`,`GObject.Value holds only TYPE_STRING in this subset (ADR 0096 Amendment 2); '${describeType(e)}' is not supported`);return f.set(this,{type:e,string:null}),this}set_string(e){let t=f.get(this);if(e!==null&&typeof e!=`string`)throw TypeError(`Expected type string for argument 'v_string' but got type ${typeof e}`);t&&(t.string=e)}get_string(){return f.get(this)?.string??null}};function readValue(e){let t=typeof e==`object`&&e?f.get(e):void 0;return t?{...t}:null}const p=[r,i,a,o,s],m={READABLE:1,WRITABLE:2,READWRITE:3,CONSTRUCT:4,CONSTRUCT_ONLY:8};var h=class ParamSpec{constructor(e,t,n,r,i,a,o,s,c){this.kind=e,this.name=t,this.nick=n,this.blurb=r,this.flags=i,this.defaultValue=a,this.minimum=o,this.maximum=s,this.valueType=c}static boolean(e,t,n,r,i){return new ParamSpec(`boolean`,e,t,n,r,i)}static string(e,t,n,r,i){return new ParamSpec(`string`,e,t,n,r,i)}static int(e,t,n,r,i,a,o){return new ParamSpec(`int`,e,t,n,r,o,i,a)}static uint(e,t,n,r,i,a,o){return new ParamSpec(`uint`,e,t,n,r,o,i,a)}static double(e,t,n,r,i,a,o){return new ParamSpec(`double`,e,t,n,r,o,i,a)}static object(e,t,n,r,i){if(i!==c&&!isInterface(i))throw new UnsupportedGObjectError(`ParamSpec.object`,`GObject.ParamSpec.object('${e}'): the value type '${describeInterface(i)}' is outside the GObject subset; an object property takes TYPE_OBJECT or one interface of the subset (ADR 0122 § 2).`);return new ParamSpec(`object`,e,t,n,r,null,void 0,void 0,i)}get_default_value(){return this.defaultValue}};function valueTypeName(e){return isInterface(e)?e.gtype.name:e.name}function checkPropertyValue(e,t){if(e.kind!==`object`||t===null)return;let n=valueTypeName(e.valueType??c);if(typeof t!=`object`&&typeof t!=`function`)throw TypeError(`Wrong type ${typeof t}; object ${n} expected`);let r=chainOfInstance(t);if(r.length===0){let e=t.constructor?.name??`Object`;throw TypeError(`Object is not a subclass of GObject_Object, it's a ${e}`)}let i=e.valueType??c;if(isInterface(i)&&!implementsInterface(t,i))throw TypeError(`Object is of type ${r[0].typeName} - cannot convert to ${n}`)}const g={GTypeName:Symbol(`GType name`),GTypeFlags:Symbol(`GType flags`),interfaces:Symbol(`GType interfaces`),properties:Symbol(`GObject properties`),signals:Symbol(`GObject signals`),requires:Symbol(`GObject interface requires`),template:Symbol(`GTK widget template`),cssName:Symbol(`GTK widget CSS name`),children:Symbol(`GTK widget template children`),internalChildren:Symbol(`GTK widget template internal children`)},_={GTypeName:g.GTypeName,Template:g.template,InternalChildren:g.internalChildren,Properties:g.properties,Signals:g.signals,CssName:g.cssName,Implements:g.interfaces},v={Children:g.children,Requires:g.requires,GTypeFlags:g.GTypeFlags},y=new WeakMap;function registeredClassOf(e){return y.get(e)}function chainOf(e){let t=[];for(let n=e;typeof n==`function`;n=Object.getPrototypeOf(n)){let e=y.get(n);e&&t.push(e)}return t}function chainOfInstance(e){return chainOf(e.constructor)}function typeNameOf(e,t){return t[0]?.typeName??e.constructor.name}function aliasesOf(e){return[e,e.replace(/-/g,`_`),e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]}function findProperty(e,t){for(let n of e)for(let e of n.properties)if(aliasesOf(e.name).includes(t))return e}function findSignal(e,t){for(let n of e)if(Object.prototype.hasOwnProperty.call(n.signals,t))return n.signals[t]}function parseSignal(e){let t=e.indexOf(`::`);return t===-1?{name:e}:{name:e.slice(0,t),detail:e.slice(t+2)}}const b=new WeakMap;function stateOf(e){let t=b.get(e);return t||(t={values:new Map,handlers:new Map,connections:new Map,emissions:[]},b.set(e,t)),t}function runHandlers(e,t,n){let r=stateOf(e),i={key:t,stopped:!1};r.emissions.push(i);try{for(let{id:a,handler:o}of(r.handlers.get(t)??[]).slice()){if(i.stopped)break;r.connections.has(a)&&o(e,...n)}}finally{r.emissions.pop()}}function refuseForeignInterfaces(e){if(e.Implements!==void 0)throw new UnsupportedGObjectError(`Implements`,`GObject.registerClass: ${e.GTypeName} uses 'Implements' over a foreign parent class, which route D does not have (ADR 0122 § 4): there is no GType of its own to add an interface to. A widget that needs a Gio.ListModel takes one as a property instead of implementing it.`)}const x={name:`pure-js`,supportsForeignParentClasses:!1,registerForeignClass(e,t){throw refuseForeignInterfaces(t),TypeError(`The pure-JS GObject engine cannot register '${t.GTypeName}' (${e.name??`anonymous`}) over a foreign parent class: there is no GType to register it as. Check supportsForeignParentClasses before calling — a caller that reaches this is one that would otherwise have fallen back silently, which is what ADR 0105 refuses.`)},register(){},getValue(e,t){let{values:n}=stateOf(e);return n.has(t.name)||n.set(t.name,t.get_default_value()),n.get(t.name)},setValue(e,t,n){let{values:r}=stateOf(e),i=n!==r.get(t.name);return r.set(t.name,n),i},addHandler(e,t,n,r){let i=stateOf(e),a=i.handlers.get(n)??[];a.push({id:t,handler:r}),i.handlers.set(n,a),i.connections.set(t,()=>{a.splice(a.findIndex(e=>e.id===t),1)})},removeHandler(e,t){let n=stateOf(e),r=n.connections.get(t);return r?(n.connections.delete(t),r(),!0):!1},emit(e,t,n){runHandlers(e,t,n)},notify(e,t){runHandlers(e,`notify::${t.name}`,[t])},stopEmission(e,t){let{emissions:n}=stateOf(e);for(let e=n.length-1;e>=0;e--){let r=n[e];if(r.key===t&&!r.stopped)return r.stopped=!0,!0}return!1},bind(e,t,n,r,i){return bindProperties(e,t,n,r,i)}};function usePureJsGObjectEngine(){return e(x),x}const S=new WeakMap;function engineOf(e){let t=S.get(e);return t||(t=chainOfInstance(e)[0]?.engine??x,S.set(e,t)),t}let C=0;const w=new WeakMap,T=Symbol.for(`@gjsify/adwaita-core/stop-emission`);function isStoppable(e){return typeof e[T]==`function`}function stopEmissionByName(e,t){if(typeof e!=`object`||!e)throw TypeError(`GObject.signal_stop_emission_by_name: not a GObject instance`);if(isStoppable(e)){e[T](t);return}let n=chainOfInstance(e),r=typeNameOf(e,n),{name:i,detail:a}=parseSignal(t),o;if(i===`notify`&&a!==void 0){let e=findProperty(n,a);e&&(o=`notify::${e.name}`)}else a===void 0&&findSignal(n,i)&&(o=i);if(o===void 0){if(!n[0])throw new UnsupportedGObjectError(`signal_stop_emission_by_name`,`'${t}' on '${r}' is not a signal of a registered class; only those can be stopped.`);console.warn(`signal '${t}' is invalid for instance of type '${r}'`);return}engineOf(e).stopEmission(e,o)||console.warn(`no emission of signal "${t}" to stop for instance of type '${r}'`)}function connectInstance(e,t,n){let r=chainOfInstance(e),i=typeNameOf(e,r),{name:a,detail:o}=parseSignal(t),own=t=>{let r=++C;return engineOf(e).addHandler(e,r,t,n),r},foreign=()=>{let a=r[0]?.door;if(!a)throw Error(`No signal '${t}' on object '${i}'`);let o=++C,s=a.listen(e,t,n),c=w.get(e);return c||w.set(e,c=new Map),c.set(o,s),o};if(a===`notify`){if(o===void 0)throw new UnsupportedGObjectError(`connect("notify")`,`connect('notify') without a property is outside the GObject subset; connect 'notify::<property>' on '${i}'.`);let e=findProperty(r,o);return e?own(`notify::${e.name}`):foreign()}if(findSignal(r,a)){if(o!==void 0)throw Error(`Signal '${a}' on object '${i}' has no detail`);return own(a)}return foreign()}function disconnectInstance(e,t){let n=w.get(e)?.get(t);if(n){w.get(e).delete(t),n();return}if(!engineOf(e).removeHandler(e,t))throw Error(`No handler with id ${t} is connected to ${String(e)}`)}function emitInstance(e,t,...n){let r=chainOfInstance(e),i=typeNameOf(e,r),a=findSignal(r,t);if(a){if(n.length!==a.length)throw Error(`Signal '${t}' on ${i} requires ${a.length} args got ${n.length}`);engineOf(e).emit(e,t,n);return}let o=r[0]?.door;if(!o)throw Error(`No signal '${t}' on object '${i}'`);o.dispatch(e,t,n)}function notifyInstance(e,t){let n=chainOfInstance(e),r=findProperty(n,t);if(r){engineOf(e).notify(e,r);return}let i=n[0]?.door;if(!i)throw Error(`No property ${t} on ${typeNameOf(e,n)}`);i.dispatch(e,`notify::${t}`,[])}function generateAccessors(e,t){let{name:n,flags:r}=e,i=r&m.READABLE,a=r&m.WRITABLE,o=t??{configurable:!0,enumerable:!0};return i&&a?!o.get&&!o.set?(o.get=function(){return engineOf(this).getValue(this,e)},o.set=function(t){checkPropertyValue(e,t),engineOf(this).setValue(this,e,t)&&this.notify(n)}):o.get?o.set||=function(){throw Error(`getter defined without setter for property ${n}`)}:o.get=function(){throw Error(`setter defined without getter for property ${n}`)}:i&&!o.get?o.get=function(){throw Error(`missing getter for read-only property ${n}`)}:a&&!o.set&&(o.set=function(){throw Error(`missing setter for write-only property ${n}`)}),o}function checkAccessors(e,t){let{name:n,flags:r}=t;if(r&m.CONSTRUCT_ONLY)return;let[,i,a]=aliasesOf(n),own=t=>Object.getOwnPropertyDescriptor(e,t),o=own(n),s=o,c=n.includes(`-`),l,u;c&&(l=own(i),u=own(a),o??=l,o??=u);let d=r&m.READABLE,f=r&m.WRITABLE;(!o||d&&!o.get||f&&!o.set)&&(o=generateAccessors(t,o)),s||Object.defineProperty(e,n,o),c&&(l||Object.defineProperty(e,i,o),u||Object.defineProperty(e,a,o))}function defineConstructOnly(e,t,n){let r=engineOf(e);checkPropertyValue(t,n),r.setValue(e,t,n);for(let n of new Set(aliasesOf(t.name)))Object.defineProperty(e,n,{get:()=>r.getValue(e,t),enumerable:!0,configurable:!0})}function bindProperties(e,t,n,r,i=[]){let a=i.includes(`invert-boolean`),o=!1,transfer=(e,t,n,r)=>()=>{if(!o){o=!0;try{let i=e[t];n[r]=a?!i:i}finally{o=!1}}},s=transfer(e,t,n,r),c=[[e,e.connect(`notify::${t}`,s)]];if(i.includes(`bidirectional`)){let i=transfer(n,r,e,t);c.push([n,n.connect(`notify::${r}`,i)])}return i.includes(`sync-create`)&&s(),{unbind(){for(let[e,t]of c.splice(0))e.disconnect(t)}}}function createClosure(e,t,n,r){let i=r??e;if(n)throw new UnsupportedGObjectError(`swapped`,`Unsupported template signal flag "swapped"`);let a=e[t];if(a===void 0)throw Error(`A handler called ${t} was not defined on ${String(e)}`);return a.bind(i)}function scopeOf(e){let t=engineOf(e);return{instance:e,handler:(t,n)=>createClosure(e,t,n?.flags?.includes(`swapped`)??!1,n?.object),bind:(e,n,r,i,a)=>t.bind(e,n,r,i,a??[])}}function constructRegistered(e,t={}){let n=chainOfInstance(e),r={},i=new Map;for(let[e,a]of Object.entries(t)){let t=findProperty(n,e);t?i.set(t,a):r[e]=a}let a=[];for(let t of[...n].reverse())t.template&&a.push([t,t.door.createFromTree(t.template,scopeOf(e),e)]);for(let t of n)for(let n of t.properties)n.flags&m.CONSTRUCT_ONLY&&defineConstructOnly(e,n,i.has(n)?i.get(n):n.get_default_value());for(let t of[...n].reverse())for(let n of t.properties)n.flags&m.CONSTRUCT&&!(n.flags&m.CONSTRUCT_ONLY)&&(e[n.name]=i.has(n)?i.get(n):n.get_default_value());for(let[t,n]of i)t.flags&(m.CONSTRUCT|m.CONSTRUCT_ONLY)||(e[t.name]=n);for(let[t,n]of a){for(let r of t.internalChildren){let i=n.objects[r];if(i===void 0)throw Error(`Template of ${t.typeName} has no child object '${r}' for InternalChildren`);e[`_${r.replace(/-/g,`_`)}`]=i}t.door.attach(e,n)}return r}const own=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),E=Symbol(`GIR type`),D={"Gio.Application":[`vfunc_startup`,`vfunc_activate`],"GtkSource.GutterRenderer":[`vfunc_query_data`]};function unlockedVfuncsOf(e){let t=new Set;for(let n=e;typeof n==`function`;n=Object.getPrototypeOf(n)){let e=own(n,E)?n[E]:void 0;if(typeof e==`string`)for(let n of D[e]??[])t.add(n)}return t}function refusal(e,t,n=``){return new UnsupportedGObjectError(t,`GObject.registerClass: ${e} uses '${t}'${n}, which is outside the GObject subset (ADR 0096 § 2).`)}function describeType(e){return e?.name?.toString()??String(e)}function readInterfaces(e,t){if(t===void 0)return[];if(!Array.isArray(t))throw refusal(e,`Implements`,` with a value that is not an array of interfaces`);let n=d.map(e=>e.name).join(`, `);return t.map(t=>{if(!d.includes(t))throw refusal(e,`Implements`,` with the interface '${describeInterface(t)}' (only ${n})`);return t})}function requireInterfaceVfuncs(e,t,n){for(let r of n)for(let n of r.vfuncs)if(typeof t[n]!=`function`)throw TypeError(`GObject.registerClass: ${e} implements ${r.name} without defining ${n}; every vfunc of an implemented interface must be defined (ADR 0122 § 2).`)}function installInterfaces(e,t){let define=(t,n)=>{own(e,t)||Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0,enumerable:!1})};for(let e of t){for(let[t,n]of Object.entries(e.methods))define(t,function(...e){return this[n].apply(this,e)});for(let[t,n]of Object.entries(e.emitters)){let r=e.signals[n]?.length??0;define(t,function(...i){if(i.length<r)throw Error(`method ${e.name}.${t}: At least ${r} arguments required, but only ${i.length} passed`);this.emit(n,...i.slice(0,r))})}}}let O=0;function registerWith(e,t,n){let r=n.length===2?n[1]:n[0];if(typeof r!=`function`)throw TypeError(`GObject.registerClass() needs a class`);let i=r,a=i.name||`anonymous class`;if(n.length===2){let e=n[0];for(let t of Object.keys(e))if(!own(_,t))throw refusal(a,t);for(let[t,n]of Object.entries(_))t in e&&(i[n]=e[t])}for(let[e,t]of Object.entries(v))if(own(i,t))throw refusal(a,e);let o=readInterfaces(a,own(i,g.interfaces)?i[g.interfaces]:void 0),s=unlockedVfuncsOf(i);for(let e of o)for(let t of e.vfuncs)s.add(t);for(let e of[i,i.prototype])for(let t of Object.getOwnPropertyNames(e))if(t.startsWith(`vfunc_`)&&typeof Object.getOwnPropertyDescriptor(e,t)?.value==`function`&&!s.has(t))throw refusal(a,t,` (a virtual function override that UNLOCKED_VFUNCS does not list, ADR 0098 § 1a)`);requireInterfaceVfuncs(a,i.prototype,o);let declared=e=>own(i,e)?i[e]:void 0,c=declared(g.GTypeName),l=String(c??`Gjs_${i.name||`anonymous_${++O}`}`).replace(/[^a-z0-9+_-]/gi,`_`),u=Object.values(declared(g.properties)??{}).map(e=>{if(!(e instanceof h))throw TypeError(`GObject.registerClass: ${a} declares a property that is not a ParamSpec`);return e}),d={};for(let e of o)Object.assign(d,e.signals);for(let[e,t]of Object.entries(declared(g.signals)??{})){for(let n of Object.keys(t))if(n!==`param_types`)throw refusal(a,`Signals.${e}.${n}`);let n=t.param_types??[];for(let t of n)if(!p.includes(t))throw refusal(a,`Signals.${e}.param_types`,` with the type '${describeType(t)}' (only TYPE_STRING, TYPE_BOOLEAN, TYPE_INT, TYPE_UINT and TYPE_DOUBLE)`);d[e]=n}let f=declared(g.template);if(f!==void 0&&(typeof f!=`object`||!f))throw new UnsupportedGObjectError(`Template`,`GObject.registerClass: ${a} has a Template that is not a '?template' value; a string, URI or bytes stay GJS-only (ADR 0096 § 4).`);let m=makeType(l),b={klass:i,typeName:l,gtype:m,properties:u,signals:d,interfaces:o,template:f,internalChildren:declared(g.internalChildren)??[],cssName:declared(g.cssName),door:e,engine:t};Object.defineProperty(i,"$gtype",{get:()=>m,enumerable:!1,configurable:!1});for(let e of u)checkAccessors(i.prototype,e);return installInstanceApi(i.prototype),installInterfaces(i.prototype,o),y.set(i,b),t.register(b),e.register(b.klass,b),b.klass}function registerBaseClass(e,t,n,r=[],i=[],a=x){let missing=e=>{throw Error(`No signal '${e}' on object '${t}'`)},o=makeType(t);Object.defineProperty(e,"$gtype",{get:()=>o,enumerable:!1,configurable:!1});let s=readInterfaces(t,i.length>0?i:void 0);requireInterfaceVfuncs(t,e.prototype,s);let c={};for(let e of s)Object.assign(c,e.signals);Object.assign(c,n);for(let t of r)checkAccessors(e.prototype,t);installInterfaces(e.prototype,s);let l={klass:e,typeName:t,gtype:o,properties:r,signals:c,interfaces:s,internalChildren:[],engine:a,door:{name:t,dispatch:(e,t)=>missing(t),listen:(e,t)=>missing(t),createFromTree:()=>missing(`template`),attach(){},register(){}}};y.set(e,l),a.register(l)}var GObjectObject=class{constructor(e){let t=constructRegistered(this,e),n=Object.keys(t)[0];if(n!==void 0)throw Error(`No property ${n} on ${typeNameOf(this,chainOfInstance(this))}`)}notify(e){notifyInstance(this,e)}connect(e,t){return connectInstance(this,e,t)}disconnect(e){disconnectInstance(this,e)}emit(e,...t){emitInstance(this,e,...t)}};function installInstanceApi(e){for(let t of[`notify`,`connect`,`disconnect`,`emit`])typeof e[t]!=`function`&&Object.defineProperty(e,t,{value:GObjectObject.prototype[t],writable:!0,configurable:!0,enumerable:!1})}function createGObject(e,t=x){return{engineName:t.name,Object:GObjectObject,registerClass:((...n)=>registerWith(e,t,n)),ParamSpec:h,ParamFlags:m,Value,TYPE_STRING:r,TYPE_BOOLEAN:i,TYPE_INT:a,TYPE_UINT:o,TYPE_DOUBLE:s,TYPE_OBJECT:c,GTypeName:g.GTypeName,GTypeFlags:g.GTypeFlags,interfaces:g.interfaces,properties:g.properties,signals:g.signals,requires:g.requires,__gtkTemplate__:g.template,__gtkCssName__:g.cssName,__gtkChildren__:g.children,__gtkInternalChildren__:g.internalChildren,type_ensure(e){if(!n.has(e))throw TypeError(`GObject.type_ensure: not a GType of this GObject`)},signal_stop_emission_by_name:stopEmissionByName}}function gobjectEngineName(){return t()?.name??x.name}export{E as GIR_TYPE,GObjectObject,u as ListModel,g as META_SYMBOLS,x as PURE_JS_ENGINE,m as ParamFlags,h as ParamSpec,T as STOP_EMISSION,i as TYPE_BOOLEAN,s as TYPE_DOUBLE,a as TYPE_INT,c as TYPE_OBJECT,r as TYPE_STRING,o as TYPE_UINT,D as UNLOCKED_VFUNCS,UnsupportedGObjectError,Value,bindProperties,checkPropertyValue,connectInstance,constructRegistered,createClosure,createGObject,disconnectInstance,emitInstance,gobjectEngineName,implementsInterface,notifyInstance,readValue,refuseForeignInterfaces,registerBaseClass,registeredClassOf,stopEmissionByName,usePureJsGObjectEngine};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{GIR_TYPE as e,GObjectObject as t,ListModel as n,ParamFlags as r,ParamSpec as i,TYPE_OBJECT as a,registerBaseClass as o}from"./gobject.js";import{MAXUINT32 as s}from"./glib-paths.js";const c=4294967295,l=new WeakMap,u=new WeakMap;function requireString(e){if(e==null)throw TypeError(`Argument string may not be null`);if(typeof e!=`string`)throw TypeError(`Expected type string for argument 'string' but got type ${typeof e}`);return e}function readStrv(e){let t=[];for(let n of e??[]){if(n==null)break;if(typeof n!=`string`)throw TypeError(`Invalid element in string array`);t.push(n)}return t}function notWritable(e,t){throw Error(`Property ${e}.${t} is not writable`)}var d=class GtkStringObject extends t{static{this[e]=`Gtk.StringObject`}constructor(e){super(e??void 0),l.has(this)||l.set(this,null)}static new(e){let t=new GtkStringObject;return l.set(t,requireString(e)),t}get string(){return l.get(this)??null}set string(e){notWritable(`GtkStringObject`,`string`)}get_string(){return this.string}};o(d,`GtkStringObject`,{},[i.string(`string`,``,``,r.READABLE,null)]);var f=class GtkStringList extends t{static{this[e]=`Gtk.StringList`}constructor(e){let t={...e};delete t.strings,super(t),u.set(this,readStrv(e?.strings??null).map(e=>d.new(e)))}static new(e){return new GtkStringList({strings:e})}get strings(){}set strings(e){console.warn(`GLib-GObject-CRITICAL: g_object_set_is_valid_property: construct property "strings" for object 'GtkStringList' can't be set after construction`)}get item_type(){return a}set item_type(e){notWritable(`GtkStringList`,`item-type`)}get itemType(){return this.item_type}set itemType(e){notWritable(`GtkStringList`,`item-type`)}get n_items(){return u.get(this).length}set n_items(e){notWritable(`GtkStringList`,`n-items`)}vfunc_get_item_type(){return a}vfunc_get_n_items(){return this.n_items}vfunc_get_item(e){return u.get(this)[e]??null}append(e){this.spliceItems(this.n_items,0,[d.new(requireString(e))])}take(e){this.append(e)}remove(e){this.spliceItems(e,1,[])}splice(e,t,n){let r=arguments.length;if(r<3)throw Error(`method Gtk.StringList.splice: At least 3 arguments required, but only ${r} passed`);if(typeof n==`string`)throw TypeError(`Cannot convert string to array of 'utf8'`);if(n===void 0)throw TypeError(`Expected type utf8 for Argument 'additions' but got type 'undefined'`);this.spliceItems(e,t,readStrv(n).map(e=>d.new(e)))}get_string(e){return u.get(this)[e]?.string??null}find(e){let t=requireString(e),n=u.get(this).findIndex(e=>e.string===t);return n===-1?c:n}spliceItems(e,t,n){let r=u.get(this);if(e+t>r.length){console.warn(`Gtk-CRITICAL: gtk_string_list_splice: assertion 'position + n_removals <= objects_get_size (&self->items)' failed`);return}t===0&&n.length===0||(r.splice(e,t,...n),this.items_changed(e,t,n.length),t!==n.length&&this.notify(`n-items`))}};o(f,`GtkStringList`,{},[i.uint(`n-items`,``,``,r.READABLE,0,s,0)],[n]);export{f as GtkStringList,d as GtkStringObject,c as INVALID_LIST_POSITION};
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{gStrStrip as e,glibClamp as t,stringIsNotEmpty as n,stripMnemonic as r}from"./glib.js";import{engineForTarget as i,registerGObjectEngine as a,registeredEngine as o,resetRegisteredEngine as s}from"./engine.js";import{GIR_TYPE as c,GObjectObject as l,META_SYMBOLS as u,PURE_JS_ENGINE as d,ParamFlags as f,ParamSpec as p,STOP_EMISSION as m,TYPE_BOOLEAN as h,TYPE_DOUBLE as g,TYPE_INT as _,TYPE_STRING as v,TYPE_UINT as y,UNLOCKED_VFUNCS as b,UnsupportedGObjectError as x,Value as S,bindProperties as C,connectInstance as w,constructRegistered as T,createClosure as E,createGObject as D,disconnectInstance as O,emitInstance as k,gobjectEngineName as A,notifyInstance as j,registerBaseClass as M,registeredClassOf as N,usePureJsGObjectEngine as P}from"./gobject.js";import{PANGO_MARKUP_TAGS as F,escapeMarkup as I,parsePangoMarkup as L,stripMarkup as R}from"./pango-markup.js";import{ADW_ABOUT_DIALOG_LABELS as z,ADW_CREDITS_SECTION_TITLES as B,ADW_LEGAL_DEFAULT_TITLE as V,ADW_LICENSES as H,ADW_LICENSE_ALIASES as U,ADW_LICENSE_DEFAULTS as W,ADW_LICENSE_WARRANTY_TEMPLATE as G,ADW_LINK_ROW_ICON_NAME as K,ADW_LINK_ROW_MAIL_ICON_NAME as q,ADW_TRANSLATOR_CREDITS_SENTINELS as J,GTK_LICENSE as Y,aboutDialogVisibility as X,acknowledgementSections as Z,creditsSections as Q,flatCardShowsWebsite as $,isLicenseType as ee,legalMarkupText as te,legalSectionVisible as ne,legalSections as re,legalVisible as ie,licenseText as ae,licenseTypeForNick as oe,licenseTypeForSpdxId as se,linkRowIconName as ce,linkRowTooltip as le,parseCreditPerson as ue,refuseNewFromAppdata as de,setLicense as fe,setLicenseType as pe,translatorCreditsPeople as me}from"./about-dialog.js";import{AcceleratorMap as he,ModifierMask as ge,acceleratorName as _e,parseAcceleratorKeyval as ve}from"./accelerators.js";import{ADW_ACCENT_BG_COLORS as ye,ADW_ACCENT_COLOR_NAMES as be,ADW_ACCENT_FG_COLOR as xe,ADW_DEFAULT_ACCENT_COLOR as Se,adwaitaAccent as Ce,adwaitaAccentBgColor as we,adwaitaAccentColor as Te,adwaitaStandaloneColor as Ee,formatAdwRgb as De,isAdwAccentColorName as Oe,nearestAccent as ke,onAdwaitaAccentChanged as Ae,parseAdwRgb as je,setAdwaitaAccent as Me}from"./accent.js";import{ActionRowState as Ne,BUTTON_ROW_ACTIVATABLE as Pe,ButtonRowState as Fe,SwitchRowState as Ie,WindowTitleState as Le,deriveRowLabels as Re}from"./action-row.js";import{ADW_ADJUSTMENT_DEFAULTS as ze,SpinState as Be,adjustmentRange as Ve,clampAdjustmentValue as He,normalizeAdjustment as Ue,parseAdjustment as We,snapAdjustmentValue as Ge}from"./adjustment.js";import{ADW_ACCENT_META as Ke,ADW_ACCENT_META_SYSTEM as qe,ADW_COLOR_SCHEME_META as Je,ADW_SYSTEM_COLOR_SCHEMES as Ye,appearanceFromMeta as Xe,isAdwSystemColorScheme as Ze,parseDesktopAppearance as Qe,renderAppearanceMeta as $e}from"./appearance.js";import{APPLE_ACCENT_COLORS as et,APPLE_MULTICOLOR_ACCENT as tt,adwAccentFromAppleAccentColor as nt}from"./apple-accent.js";import{ActionRegistry as rt,SimpleAction as it,SimpleActionGroup as at,actionRegistryOf as ot,activateWidgetAction as st,applicationOfWindow as ct,findActionGroup as lt,insertActionGroup as ut,installActionMap as dt,linkWindow as ft}from"./gio-actions.js";import{Bytes as pt}from"./glib-bytes.js";import{DialogError as mt,GLibError as ht,IOErrorEnum as gt,ResourceError as _t,asGLibError as vt}from"./glib-error.js";import{Resource as yt,ResourceLookupFlags as bt,resources_enumerate_children as xt,resources_get_info as St,resources_lookup_data as Ct,resources_register as wt,resources_unregister as Tt}from"./gio-resource.js";import{CURRENT_TIME as Et,CssProvider as Dt,EventControllerKey as Ot,GDK_KEYS as kt,GtkSettings as At,IconTheme as jt,STYLE_PROVIDER_PRIORITY_APPLICATION as Mt,STYLE_PROVIDER_PRIORITY_FALLBACK as Nt,STYLE_PROVIDER_PRIORITY_SETTINGS as Pt,STYLE_PROVIDER_PRIORITY_THEME as Ft,STYLE_PROVIDER_PRIORITY_USER as It,createGtkPlatform as Lt,keyvalOfKey as Rt,widgetControllerMembers as zt}from"./gtk-platform.js";import{ADW_MENU_SURFACE_NATIVESCRIPT as Bt,ADW_MENU_SURFACE_WEB as Vt,assertMenuRenderable as Ht,flattenMenu as Ut,menuItemAt as Wt,menuLabelText as Gt,menuNodeAt as Kt,menuRefusals as qt,normalizeMenuModel as Jt,parseDetailedAction as Yt,parseMenuModel as Xt,resolveMenuItemState as Zt}from"./menu.js";import{ApplicationFlags as Qt,ApplicationInhibitFlags as $t,GioApplicationBase as en,GtkApplicationBase as tn,defineWindowApplicationMembers as nn,dispatchAccelerator as rn,isValidApplicationId as an,withGtkApplication as on}from"./application.js";import{AVATAR_COLORS as sn,AVATAR_COLOR_COUNT as cn,avatarColor as ln,avatarColorClass as un,avatarFontSize as dn,avatarIconSize as fn,avatarInitials as pn,avatarMaxFontSize as mn,avatarMode as hn,flattenAvatarGradient as gn,gStrHash as _n,randomAvatarColorClass as vn}from"./avatar.js";import{ADW_BANNER_BUTTON_STYLES as yn,ADW_BANNER_BUTTON_STYLE_CLASSES as bn,ADW_BANNER_DEFAULTS as xn,bannerButtonStyleClasses as Sn,bannerButtonText as Cn,bannerButtonVisible as wn,bannerRenderState as Tn,isBannerButtonStyle as En,parseBannerButtonStyle as Dn}from"./banner.js";import{listBoxSelect as On,listBoxSelectAll as kn,listBoxSelectRow as An,listBoxUnselectAll as jn,listBoxUnselectRow as Mn,normalizeBoxSelectionMode as Nn}from"./box-selection.js";import{DEFAULT_BOX_SPACING as Pn,normalizeBoxOrientation as Fn,normalizeBoxSpacing as In}from"./box.js";import{AdwBreakpoint as Ln,evaluateBreakpointCondition as Rn,parseBreakpointCondition as zn}from"./breakpoint.js";import{BreakpointBinState as Bn}from"./breakpoint-bin.js";import{createBreakpointDriver as Vn}from"./breakpoint-driver.js";import{ADW_BUTTON_CONTENT_DEFAULTS as Hn,BUTTON_CONTENT_BOX_SPACING as Un,BUTTON_CONTENT_FALLBACK_ICON as Wn,BUTTON_CONTENT_STYLE_CLASS as Gn,buttonContentEllipsize as Kn,buttonContentIconExpands as qn,buttonContentIconIsEmpty as Jn,buttonContentIconName as Yn,buttonContentLabelText as Xn,buttonContentLabelVisible as Zn,buttonContentRenderState as Qn,buttonContentStyleTargetIndex as $n}from"./button-content.js";import{ADW_BUTTON_STYLE_ALIASES as er,ADW_BUTTON_STYLE_CLASSES as tr,buttonStyleClass as nr,buttonStyleClasses as rr}from"./button.js";import{CALENDAR_MARK_MAX as ir,CALENDAR_MARK_MIN as ar,CALENDAR_YEAR_MAX as or,CALENDAR_YEAR_MIN as sr,calendarClearMarks as cr,calendarDayIsMarked as lr,calendarDays as ur,calendarDaysInMonth as dr,calendarIsLeapYear as fr,calendarMarkDay as pr,calendarNavigationButtons as mr,calendarSelectDay as hr,calendarStep as gr,calendarWeekNumber as _r,calendarWeekStart as vr}from"./calendar.js";import{ADW_SWIPE_DECELERATION_TOUCH as yr,ADW_SWIPE_DECELERATION_TOUCHPAD as br,ADW_SWIPE_DRAG_THRESHOLD as xr,ADW_SWIPE_EPSILON as Sr,ADW_SWIPE_HISTORY_THRESHOLD_MS as Cr,ADW_SWIPE_PARABOLA_MULTIPLIER as wr,ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_H as Tr,ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_V as Er,ADW_SWIPE_VELOCITY_CURVE_THRESHOLD as Dr,ADW_SWIPE_VELOCITY_THRESHOLD_TOUCH as Or,ADW_SWIPE_VELOCITY_THRESHOLD_TOUCHPAD as kr,SwipeTracker as Ar,swipeBounds as jr,swipeClosestPointIndex as Mr,swipeEndProgress as Nr,swipeNextPointIndex as Pr,swipePreviousPointIndex as Fr,swipeProjectedPointIndex as Ir,swipeSlope as Lr,swipeVelocityThreshold as Rr}from"./swipe.js";import{CAROUSEL_SCROLL_TIMEOUT_MS as zr,CAROUSEL_SETTLE_EPSILON as Br,CarouselState as Vr,carouselClampPosition as Hr,carouselClosestSnapPoint as Ur,carouselNavigateTarget as Wr,carouselPageAllocation as Gr,carouselPageAtPosition as Kr,carouselRange as qr,carouselReorderShift as Jr,carouselSizesFromSnapPoints as Yr,carouselSnapPoints as Xr,carouselWheelStep as Zr}from"./carousel.js";import{checkActivationFlips as Qr,checkGroupNeighbours as $r,isRadioCheck as ei,setCheckGroup as ti}from"./check-group.js";import{RadioGroupState as ni,resolveCheckState as ri}from"./checks.js";import{adwLerp as ii,easeInOutSine as ai,easeOutCubic as oi,inverseLerp as si}from"./easing.js";import{ADW_CLAMP_DEFAULTS as ci,ADW_CLAMP_SIZE_CLASSES as li,ADW_SPINNER_MAX_SIZE as ui,ADW_SPINNER_MIN_SIZE as di,ADW_TOOLBAR_BAR_CLASSES as fi,ADW_TOOLBAR_VIEW_CLASSES as pi,ADW_TOOLBAR_VIEW_DEFAULTS as mi,clampAllocate as hi,clampChildSize as gi,clampSizeFromChild as _i,clampThresholds as vi,normalizeClampSize as yi,parseToolbarStyle as bi,resolveSpinnerSize as xi,spinnerGeometry as Si,toolbarBarStyleClasses as Ci,toolbarViewAllocate as wi,toolbarViewClasses as Ti,toolbarViewContentForSize as Ei,toolbarViewMeasure as Di}from"./chrome.js";import{DEFAULT_ICON_COLOR as Oi,DEFAULT_ICON_COLOR_DARK as ki,adwaitaColorScheme as Ai,isThemeIconColor as ji,onAdwaitaColorSchemeChanged as Mi,setAdwaitaColorScheme as Ni,themeIconColor as Pi,toggleAdwaitaColorScheme as Fi}from"./color-scheme.js";import{ViewStackState as Ii,normalizeIconName as Li,resolvePageTitle as Ri}from"./view-stack.js";import{DEFAULT_TAB_AUTOHIDE as zi,TabViewState as Bi,isDescendantOfPage as Vi,successorAfterClose as Hi,tabCloseVisible as Ui,tabIconState as Wi,tabSearchMatches as Gi,tabTooltip as Ki,tabTooltipIsMarkup as qi,tabViewItemsChanged as Ji,tabsRevealed as Yi}from"./tab-view.js";import{activateMenuItem as Xi,menuActionsFor as Zi}from"./menu-actions.js";import{ADW_DATA_GRID_ROW_VARIANTS as Qi,DATA_GRID_CELL_CLASS as $i,DATA_GRID_ROW_CLASS as ea,dataGridCellText as ta,dataGridColumnAlign as na,dataGridColumnClasses as ra,dataGridRowInteractive as ia,dataGridTrackTemplate as aa,dataGridTracks as oa,normalizeDataGridColumns as sa,normalizeDataGridVariant as ca}from"./data-grid.js";import{AdwAlertResponses as la,BottomSheetPresentation as ua,resolveBottomSheetChrome as da,resolveBottomSheetClose as fa,resolveBottomSheetOpen as pa,resolveBottomSheetSwipeTracker as ma}from"./dialog.js";import{CAPS_LOCK_ICON_NAME as ha,CAPS_LOCK_TOOLTIP as ga,EMPTY_ANIMATION_DURATION_MS as _a,ENTRY_ROW_APPLY_ICON_NAME as va,ENTRY_ROW_APPLY_TOOLTIP as ya,ENTRY_ROW_EDIT_ICON_NAME as ba,ENTRY_ROW_MAX_LENGTH_LIMIT as xa,ENTRY_ROW_TITLE_SPACING as Sa,EntryRowState as Ca,PASSWORD_CONCEAL_ICON_NAME as wa,PASSWORD_CONCEAL_LABEL as Ta,PASSWORD_REVEAL_ICON_NAME as Ea,PASSWORD_REVEAL_LABEL as Da,PasswordEntryRowState as Oa,clampEntryMaxLength as ka,clampEntryText as Aa,deriveEntryRowState as ja,entryRowLatches as Ma,entryTextLength as Na,resolveEntryRowActivation as Pa}from"./entry-row.js";import{FileCreateFlags as Fa,FileDialog as Ia,FileFilter as La,FileOutputStream as Ra,GioFile as za,GioListStore as Ba,OutputStream as Va,dialogFailedError as Ha,dismissedError as Ua,fileFilterAccepts as Wa,fileFilterSpec as Ga,fileForHandle as Ka,promisify as qa,registerFileChooserDriver as Ja}from"./file-chooser.js";import{AppLaunchContext as Ya,createAppInfo as Xa,uriPeekScheme as Za}from"./gio-app-info.js";import{AppLaunchContext as Qa,Clipboard as $a,ContentFormats as eo,ContentProvider as to,Display as no,createGdk as ro,widgetDisplayMembers as io}from"./gdk.js";import{GioMenu as ao,GioMenuItem as oo}from"./gio-menu.js";import{computeLanguageNames as so,languageNamesFromTags as co,localeFromLanguageTag as lo}from"./glib-language.js";import{MAXUINT32 as uo,buildFilenamev as fo,getCurrentDir as po,getSystemDataDirs as mo}from"./glib-paths.js";import{createGLibTimers as ho}from"./glib-timers.js";import{GLIB_UNICHAR_UNICODE_VERSION as go}from"./glib-unichar.generated.js";import{unicharIsalpha as _o}from"./glib-unichar.js";import{uriEscapeString as vo}from"./glib-uri.js";import{Variant as yo}from"./glib-variant.js";import{Point as bo,computePoint as xo}from"./graphene.js";import{gridColumns as So,gridNavigate as Co}from"./grid-navigation.js";import{GtkAdjustment as wo}from"./gtk-adjustment.js";import{GtkStringList as To}from"./gtk-string-list.js";import{HeaderBarState as Eo,resolveHeaderBarTitle as Do}from"./header-bar.js";import{iconLookupNames as Oo,lookupResourceIcon as ko}from"./icon-theme-resources.js";import{RELEASE_NOTES_LABELS as Ao,releaseNotesBuffer as jo}from"./release-notes.js";import{AdwToast as Mo,AdwToastQueue as No,DEFAULT_TOAST_TIMEOUT as Po}from"./toast.js";import{Toast as Fo,ToastOverlayQueue as Io,ToastPriority as Lo}from"./toast-object.js";import{ADW_COMBO_NO_SELECTION as Ro,clampListSelection as zo,listItemsChanged as Bo,normalizeComboOptions as Vo,parseListModel as Ho}from"./list.js";import{ADW_COLUMN_VIEW_NO_FIXED_WIDTH as Uo,ADW_GRID_VIEW_MAX_COLUMNS as Wo,ADW_GRID_VIEW_MIN_COLUMNS as Go,ListViewState as Ko,columnViewSort as qo,columnViewTracks as Jo,gridViewColumns as Yo,listItemField as Xo,listViewSelect as Zo,listViewSelectAll as Qo,normalizeColumnViewColumns as $o,normalizeListSelectionMode as es,parseColumnViewColumns as ts}from"./list-view.js";import{treeExpanderAction as ns,treeExpanderExpanded as rs,treeExpanderLayout as is}from"./tree-expander.js";import{ComboState as as,ExpanderState as os,ToggleGroupState as ss,keptToggles as cs,toggleIndexOfName as ls}from"./rows.js";import{DEFAULT_LABEL_ELLIPSIZE as us,DEFAULT_LABEL_LINES as ds,DEFAULT_LABEL_MAX_WIDTH_CHARS as fs,DEFAULT_LABEL_WIDTH_CHARS as ps,DEFAULT_LABEL_WRAP_MODE as ms,DEFAULT_LABEL_XALIGN as hs,DEFAULT_LABEL_YALIGN as gs,LABEL_ELLIPSIZE_MODES as _s,LABEL_JUSTIFICATIONS as vs,LABEL_WRAP_MODES as ys,labelDisplayText as bs,labelEffectiveLines as xs,labelEllipsizeOverflowValue as Ss,labelMarkupIsUnparseable as Cs,labelWidthCharsExtent as ws,labelYalignAlignItems as Ts,normalizeLabelEllipsize as Es,normalizeLabelJustify as Ds,normalizeLabelLines as Os,normalizeLabelMaxWidthChars as ks,normalizeLabelWidthChars as As,normalizeLabelWrapMode as js,normalizeLabelXalign as Ms,normalizeLabelYalign as Ns}from"./label.js";import{syncDirection as Ps,widgetTreeMembers as Fs}from"./widget-members.js";import{BACK_BUTTON_FALLBACK_TOOLTIP as Is,NavigationViewState as Ls,describeNavigationDiagnostic as Rs}from"./navigation-view.js";import{ADW_SIDEBAR_NO_SELECTION as zs,SidebarState as Bs,adjustSidebarSelection as Vs,clampSidebarSelection as Hs,flattenSidebarItems as Us,sidebarHeaders as Ws}from"./sidebar.js";import{ADW_SPINNER_CONTRACT_DISTANCE as Gs,ADW_SPINNER_CYCLES_PER_LOOP as Ks,ADW_SPINNER_CYCLE_LENGTH as qs,ADW_SPINNER_EXTEND_DISTANCE as Js,ADW_SPINNER_IDLE_DISTANCE as Ys,ADW_SPINNER_MAX_ARC_LENGTH as Xs,ADW_SPINNER_MIN_ARC_LENGTH as Zs,ADW_SPINNER_N_CYCLES as Qs,ADW_SPINNER_OVERLAP_DISTANCE as $s,ADW_SPINNER_SPIN_DURATION_MS as ec,ADW_SPINNER_START_ANGLE as tc,ADW_SPINNER_STILL_PROGRESS as nc,ADW_SPINNER_TRACK_OPACITY as rc,normalizeSpinnerAngle as ic,spinnerArc as ac,spinnerArcEnd as oc,spinnerArcStart as sc,spinnerProgressAt as cc}from"./spinner.js";import{parseAccelerator as lc,parseShortcutLabel as uc,shortcutKeycaps as dc}from"./shortcut-label.js";import{formatAcceleratorLabel as fc,formatManifestShortcut as pc}from"./shortcut-format.js";import{ADW_LENGTH_UNITS as mc,DEFAULT_DPI as hc,adwLengthToPx as gc,normalizeLengthUnit as _c}from"./length-unit.js";import{ADW_SWIPE_BORDER as vc,DEFAULT_MAX_SIDEBAR_WIDTH as yc,DEFAULT_MIN_SIDEBAR_WIDTH as bc,DEFAULT_SIDEBAR_WIDTH_FRACTION as xc,DEFAULT_SIDEBAR_WIDTH_UNIT as Sc,INSTANT_SPLIT_VIEW_ANIMATOR as Cc,NAVIGATION_SPLIT_VIEW_CRITICALS as wc,NavigationSplitViewState as Tc,OverlaySplitViewState as Ec,isSidebarAtVisualStart as Dc,layoutNavigationSplitView as Oc,layoutOverlaySplitView as kc,measureSplitViewHorizontal as Ac,resolveNaturalSidebarWidth as jc,resolveNavigationAction as Mc,resolveNavigationSidebarWidth as Nc,resolveNavigationStack as Pc,resolveOverlaySidebarWidth as Fc,resolveSidebarBounds as Ic,resolveSwipeArea as Lc,resolveSwipeRelease as Rc,resolveSwipeSnapPoints as zc,resolveSwipeStart as Bc,swipeCancelProgress as Vc,tagsConflict as Hc}from"./split-view.js";import{DEFAULT_DROPDOWN_TOOLTIP as Uc,SPLIT_BUTTON_DISABLED_OPACITY as Wc,SplitButtonState as Gc,isSplitButtonDirection as Kc,menuButtonArrowIcon as qc,menuButtonPopupDirection as Jc,resolveDropdownTooltip as Yc,splitButtonArrowIcon as Xc,splitButtonPopupDirection as Zc,splitButtonRootState as Qc,splitButtonStyleClasses as $c}from"./split-button.js";import{assertPopupMenuPlan as el,planPopupMenu as tl}from"./popup-menu-plan.js";import{menuAssignments as nl}from"./menu-tree.js";import{DEFAULT_INDICATOR_DESCRIPTION_STRINGS as rl,INLINE_VIEW_SWITCHER_DISPLAY_MODES as il,VIEW_SWITCHER_BADGE_LIMIT as al,VIEW_SWITCHER_DRAG_SWITCH_DELAY as ol,VIEW_SWITCHER_FALLBACK_ICON as sl,VIEW_SWITCHER_NO_SELECTION as cl,VIEW_SWITCHER_POLICIES as ll,ViewSwitcherBarState as ul,ViewSwitcherDragSwitch as dl,ViewSwitcherState as fl,buildInlineToggles as pl,buildViewSwitcherButtons as ml,createViewSwitcherPage as hl,inlineToggleTooltip as gl,isInlineViewSwitcherDisplayMode as _l,isViewSwitcherButtonVisible as vl,isViewSwitcherPolicy as yl,pageIndexForToggle as bl,shouldRevealViewSwitcherBar as xl,toggleIndexForPage as Sl,viewSwitcherBadgeLabel as Cl,viewSwitcherButtonOrientation as wl,viewSwitcherIconName as Tl,viewSwitcherIndicatorDescription as El,viewSwitcherLabel as Dl,viewSwitcherPageFromStackPage as Ol,viewSwitcherPagesFromStack as kl,viewSwitcherSidebarSections as Al}from"./view-switcher.js";import{UNTITLED_PAGE_LABEL as jl,collectSearchRows as Ml,countVisiblePages as Nl,createSearchRowSubtitle as Pl,defaultCaseFolder as Fl,derivePreferencesGroupHeader as Il,makeComparable as Ll,rowMatchesQuery as Rl,searchPreferences as zl}from"./preferences.js";import{ADW_MAX_OVERSHOOT_DISTANCE as Bl,ADW_OVERSHOOT_SETTLE_MS as Vl,ADW_UNDERSHOOT_CLASSES as Hl,ADW_UNDERSHOOT_SIZE as Ul,accumulateOvershoot as Wl,isScrolledFromEnd as Gl,isScrolledFromStart as Kl,overshootDistance as ql,scrollMaxValue as Jl,scrollUndershootClasses as Yl}from"./scrolling.js";import{POPOVER_ITEM_RADIUS as Xl,POPOVER_MENU_PADDING as Zl,POPOVER_PADDING as Ql,POPOVER_RADIUS as $l,PopoverState as eu,resolvePopoverKey as tu}from"./popover.js";import{ADW_WRAP_BOX_DEFAULT_ALIGN as nu,ADW_WRAP_BOX_DEFAULT_JUSTIFY as ru,ADW_WRAP_BOX_DEFAULT_JUSTIFY_LAST_LINE as iu,ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT as au,ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION as ou,ADW_WRAP_BOX_DEFAULT_SPACING as su,ADW_WRAP_BOX_DEFAULT_WRAP_POLICY as cu,ADW_WRAP_BOX_JUSTIFY_MODES as lu,ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET as uu,ADW_WRAP_BOX_PACK_DIRECTIONS as du,ADW_WRAP_POLICIES as fu,normalizeNaturalLineLength as pu,normalizeWrapBoxAlign as mu,normalizeWrapBoxJustify as hu,normalizeWrapBoxLengthUnit as gu,normalizeWrapBoxPackDirection as _u,normalizeWrapBoxSpacing as vu,normalizeWrapPolicy as yu,resolveWrapBoxChildOrder as bu,resolveWrapBoxLine as xu,wrapBoxChildFlex as Su,wrapBoxFlexStyle as Cu,wrapBoxLengthToPx as wu,wrapPolicyFlexShrink as Tu}from"./wrap-box.js";import{ADW_SOURCE_6502_DIRECTIVES as Eu,ADW_SOURCE_6502_LINE_COMMENT as Du,ADW_SOURCE_6502_OPCODES as Ou,ADW_SOURCE_6502_REGISTERS as ku,ADW_SOURCE_6502_TOKEN_ROLES as Au,ADW_SOURCE_HEX_STRIDE as ju,ADW_SOURCE_PALETTE_DARK as Mu,ADW_SOURCE_PALETTE_LIGHT as Nu,ADW_SOURCE_SYNTAX_ROLES as Pu,classifyAsm6502Word as Fu,formatHexAddress as Iu,formatLineNumber as Lu,stripSourceWhitespace as Ru,tokenizeAsm6502 as zu}from"./source.js";import{CloseRequestState as Bu,HandledAccumulator as Vu,WindowMemberState as Hu,stepDefaultSize as Uu}from"./window-members.js";import{RGBA as Wu}from"./rgba.js";import{AccentColor as Gu,ColorScheme as Ku,StyleManagerBase as qu}from"./style-manager.js";export{z as ADW_ABOUT_DIALOG_LABELS,ye as ADW_ACCENT_BG_COLORS,be as ADW_ACCENT_COLOR_NAMES,xe as ADW_ACCENT_FG_COLOR,Ke as ADW_ACCENT_META,qe as ADW_ACCENT_META_SYSTEM,ze as ADW_ADJUSTMENT_DEFAULTS,yn as ADW_BANNER_BUTTON_STYLES,bn as ADW_BANNER_BUTTON_STYLE_CLASSES,xn as ADW_BANNER_DEFAULTS,Hn as ADW_BUTTON_CONTENT_DEFAULTS,er as ADW_BUTTON_STYLE_ALIASES,tr as ADW_BUTTON_STYLE_CLASSES,ci as ADW_CLAMP_DEFAULTS,li as ADW_CLAMP_SIZE_CLASSES,Je as ADW_COLOR_SCHEME_META,Uo as ADW_COLUMN_VIEW_NO_FIXED_WIDTH,Ro as ADW_COMBO_NO_SELECTION,B as ADW_CREDITS_SECTION_TITLES,Qi as ADW_DATA_GRID_ROW_VARIANTS,Se as ADW_DEFAULT_ACCENT_COLOR,Wo as ADW_GRID_VIEW_MAX_COLUMNS,Go as ADW_GRID_VIEW_MIN_COLUMNS,V as ADW_LEGAL_DEFAULT_TITLE,mc as ADW_LENGTH_UNITS,H as ADW_LICENSES,U as ADW_LICENSE_ALIASES,W as ADW_LICENSE_DEFAULTS,G as ADW_LICENSE_WARRANTY_TEMPLATE,K as ADW_LINK_ROW_ICON_NAME,q as ADW_LINK_ROW_MAIL_ICON_NAME,Bl as ADW_MAX_OVERSHOOT_DISTANCE,Bt as ADW_MENU_SURFACE_NATIVESCRIPT,Vt as ADW_MENU_SURFACE_WEB,Vl as ADW_OVERSHOOT_SETTLE_MS,zs as ADW_SIDEBAR_NO_SELECTION,Eu as ADW_SOURCE_6502_DIRECTIVES,Du as ADW_SOURCE_6502_LINE_COMMENT,Ou as ADW_SOURCE_6502_OPCODES,ku as ADW_SOURCE_6502_REGISTERS,Au as ADW_SOURCE_6502_TOKEN_ROLES,ju as ADW_SOURCE_HEX_STRIDE,Mu as ADW_SOURCE_PALETTE_DARK,Nu as ADW_SOURCE_PALETTE_LIGHT,Pu as ADW_SOURCE_SYNTAX_ROLES,Gs as ADW_SPINNER_CONTRACT_DISTANCE,Ks as ADW_SPINNER_CYCLES_PER_LOOP,qs as ADW_SPINNER_CYCLE_LENGTH,Js as ADW_SPINNER_EXTEND_DISTANCE,Ys as ADW_SPINNER_IDLE_DISTANCE,Xs as ADW_SPINNER_MAX_ARC_LENGTH,ui as ADW_SPINNER_MAX_SIZE,Zs as ADW_SPINNER_MIN_ARC_LENGTH,di as ADW_SPINNER_MIN_SIZE,Qs as ADW_SPINNER_N_CYCLES,$s as ADW_SPINNER_OVERLAP_DISTANCE,ec as ADW_SPINNER_SPIN_DURATION_MS,tc as ADW_SPINNER_START_ANGLE,nc as ADW_SPINNER_STILL_PROGRESS,rc as ADW_SPINNER_TRACK_OPACITY,vc as ADW_SWIPE_BORDER,yr as ADW_SWIPE_DECELERATION_TOUCH,br as ADW_SWIPE_DECELERATION_TOUCHPAD,xr as ADW_SWIPE_DRAG_THRESHOLD,Sr as ADW_SWIPE_EPSILON,Cr as ADW_SWIPE_HISTORY_THRESHOLD_MS,wr as ADW_SWIPE_PARABOLA_MULTIPLIER,Tr as ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_H,Er as ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_V,Dr as ADW_SWIPE_VELOCITY_CURVE_THRESHOLD,Or as ADW_SWIPE_VELOCITY_THRESHOLD_TOUCH,kr as ADW_SWIPE_VELOCITY_THRESHOLD_TOUCHPAD,Ye as ADW_SYSTEM_COLOR_SCHEMES,fi as ADW_TOOLBAR_BAR_CLASSES,pi as ADW_TOOLBAR_VIEW_CLASSES,mi as ADW_TOOLBAR_VIEW_DEFAULTS,J as ADW_TRANSLATOR_CREDITS_SENTINELS,Hl as ADW_UNDERSHOOT_CLASSES,Ul as ADW_UNDERSHOOT_SIZE,nu as ADW_WRAP_BOX_DEFAULT_ALIGN,ru as ADW_WRAP_BOX_DEFAULT_JUSTIFY,iu as ADW_WRAP_BOX_DEFAULT_JUSTIFY_LAST_LINE,au as ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT,ou as ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION,su as ADW_WRAP_BOX_DEFAULT_SPACING,cu as ADW_WRAP_BOX_DEFAULT_WRAP_POLICY,lu as ADW_WRAP_BOX_JUSTIFY_MODES,uu as ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET,du as ADW_WRAP_BOX_PACK_DIRECTIONS,fu as ADW_WRAP_POLICIES,et as APPLE_ACCENT_COLORS,tt as APPLE_MULTICOLOR_ACCENT,sn as AVATAR_COLORS,cn as AVATAR_COLOR_COUNT,he as AcceleratorMap,Gu as AccentColor,rt as ActionRegistry,Ne as ActionRowState,la as AdwAlertResponses,Ln as AdwBreakpoint,Mo as AdwToast,No as AdwToastQueue,Qt as ApplicationFlags,$t as ApplicationInhibitFlags,Is as BACK_BUTTON_FALLBACK_TOOLTIP,Un as BUTTON_CONTENT_BOX_SPACING,Wn as BUTTON_CONTENT_FALLBACK_ICON,Gn as BUTTON_CONTENT_STYLE_CLASS,Pe as BUTTON_ROW_ACTIVATABLE,ua as BottomSheetPresentation,Bn as BreakpointBinState,Fe as ButtonRowState,ir as CALENDAR_MARK_MAX,ar as CALENDAR_MARK_MIN,or as CALENDAR_YEAR_MAX,sr as CALENDAR_YEAR_MIN,ha as CAPS_LOCK_ICON_NAME,ga as CAPS_LOCK_TOOLTIP,zr as CAROUSEL_SCROLL_TIMEOUT_MS,Br as CAROUSEL_SETTLE_EPSILON,Et as CURRENT_TIME,Vr as CarouselState,$a as Clipboard,Bu as CloseRequestState,Ku as ColorScheme,as as ComboState,eo as ContentFormats,to as ContentProvider,Dt as CssProvider,$i as DATA_GRID_CELL_CLASS,ea as DATA_GRID_ROW_CLASS,Pn as DEFAULT_BOX_SPACING,hc as DEFAULT_DPI,Uc as DEFAULT_DROPDOWN_TOOLTIP,Oi as DEFAULT_ICON_COLOR,ki as DEFAULT_ICON_COLOR_DARK,rl as DEFAULT_INDICATOR_DESCRIPTION_STRINGS,us as DEFAULT_LABEL_ELLIPSIZE,ds as DEFAULT_LABEL_LINES,fs as DEFAULT_LABEL_MAX_WIDTH_CHARS,ps as DEFAULT_LABEL_WIDTH_CHARS,ms as DEFAULT_LABEL_WRAP_MODE,hs as DEFAULT_LABEL_XALIGN,gs as DEFAULT_LABEL_YALIGN,yc as DEFAULT_MAX_SIDEBAR_WIDTH,bc as DEFAULT_MIN_SIDEBAR_WIDTH,xc as DEFAULT_SIDEBAR_WIDTH_FRACTION,Sc as DEFAULT_SIDEBAR_WIDTH_UNIT,zi as DEFAULT_TAB_AUTOHIDE,Po as DEFAULT_TOAST_TIMEOUT,mt as DialogError,no as Display,_a as EMPTY_ANIMATION_DURATION_MS,va as ENTRY_ROW_APPLY_ICON_NAME,ya as ENTRY_ROW_APPLY_TOOLTIP,ba as ENTRY_ROW_EDIT_ICON_NAME,xa as ENTRY_ROW_MAX_LENGTH_LIMIT,Sa as ENTRY_ROW_TITLE_SPACING,Ca as EntryRowState,Ot as EventControllerKey,os as ExpanderState,Fa as FileCreateFlags,kt as GDK_KEYS,c as GIR_TYPE,go as GLIB_UNICHAR_UNICODE_VERSION,pt as GLibBytes,ht as GLibError,yo as GLibVariant,l as GObjectObject,Y as GTK_LICENSE,Qa as GdkAppLaunchContext,Ya as GioAppLaunchContext,en as GioApplicationBase,za as GioFile,Ra as GioFileOutputStream,Ba as GioListStore,ao as GioMenu,oo as GioMenuItem,Va as GioOutputStream,yt as GioResource,wo as GtkAdjustment,tn as GtkApplicationBase,Ia as GtkFileDialog,La as GtkFileFilter,At as GtkSettings,To as GtkStringList,Vu as HandledAccumulator,Eo as HeaderBarState,il as INLINE_VIEW_SWITCHER_DISPLAY_MODES,Cc as INSTANT_SPLIT_VIEW_ANIMATOR,gt as IOErrorEnum,jt as IconTheme,_s as LABEL_ELLIPSIZE_MODES,vs as LABEL_JUSTIFICATIONS,ys as LABEL_WRAP_MODES,Ko as ListViewState,uo as MAXUINT32,u as META_SYMBOLS,ge as ModifierMask,wc as NAVIGATION_SPLIT_VIEW_CRITICALS,Tc as NavigationSplitViewState,Ls as NavigationViewState,Ec as OverlaySplitViewState,F as PANGO_MARKUP_TAGS,wa as PASSWORD_CONCEAL_ICON_NAME,Ta as PASSWORD_CONCEAL_LABEL,Ea as PASSWORD_REVEAL_ICON_NAME,Da as PASSWORD_REVEAL_LABEL,Xl as POPOVER_ITEM_RADIUS,Zl as POPOVER_MENU_PADDING,Ql as POPOVER_PADDING,$l as POPOVER_RADIUS,d as PURE_JS_ENGINE,f as ParamFlags,p as ParamSpec,Oa as PasswordEntryRowState,bo as Point,eu as PopoverState,Ao as RELEASE_NOTES_LABELS,Wu as RGBA,ni as RadioGroupState,_t as ResourceError,bt as ResourceLookupFlags,Wc as SPLIT_BUTTON_DISABLED_OPACITY,m as STOP_EMISSION,Mt as STYLE_PROVIDER_PRIORITY_APPLICATION,Nt as STYLE_PROVIDER_PRIORITY_FALLBACK,Pt as STYLE_PROVIDER_PRIORITY_SETTINGS,Ft as STYLE_PROVIDER_PRIORITY_THEME,It as STYLE_PROVIDER_PRIORITY_USER,Bs as SidebarState,it as SimpleAction,at as SimpleActionGroup,Be as SpinState,Gc as SplitButtonState,qu as StyleManagerBase,Ar as SwipeTracker,Ie as SwitchRowState,h as TYPE_BOOLEAN,g as TYPE_DOUBLE,_ as TYPE_INT,v as TYPE_STRING,y as TYPE_UINT,Bi as TabViewState,Fo as Toast,Io as ToastOverlayQueue,Lo as ToastPriority,ss as ToggleGroupState,b as UNLOCKED_VFUNCS,jl as UNTITLED_PAGE_LABEL,x as UnsupportedGObjectError,al as VIEW_SWITCHER_BADGE_LIMIT,ol as VIEW_SWITCHER_DRAG_SWITCH_DELAY,sl as VIEW_SWITCHER_FALLBACK_ICON,cl as VIEW_SWITCHER_NO_SELECTION,ll as VIEW_SWITCHER_POLICIES,S as Value,Ii as ViewStackState,ul as ViewSwitcherBarState,dl as ViewSwitcherDragSwitch,fl as ViewSwitcherState,Hu as WindowMemberState,Le as WindowTitleState,X as aboutDialogVisibility,_e as acceleratorName,Wl as accumulateOvershoot,Z as acknowledgementSections,ot as actionRegistryOf,Xi as activateMenuItem,st as activateWidgetAction,Vs as adjustSidebarSelection,Ve as adjustmentRange,nt as adwAccentFromAppleAccentColor,gc as adwLengthToPx,ii as adwLerp,Ce as adwaitaAccent,we as adwaitaAccentBgColor,Te as adwaitaAccentColor,Ai as adwaitaColorScheme,Ee as adwaitaStandaloneColor,Xe as appearanceFromMeta,ct as applicationOfWindow,vt as asGLibError,Ht as assertMenuRenderable,el as assertPopupMenuPlan,ln as avatarColor,un as avatarColorClass,dn as avatarFontSize,fn as avatarIconSize,pn as avatarInitials,mn as avatarMaxFontSize,hn as avatarMode,Sn as bannerButtonStyleClasses,Cn as bannerButtonText,wn as bannerButtonVisible,Tn as bannerRenderState,C as bindProperties,fo as buildFilenamev,pl as buildInlineToggles,ml as buildViewSwitcherButtons,Kn as buttonContentEllipsize,qn as buttonContentIconExpands,Jn as buttonContentIconIsEmpty,Yn as buttonContentIconName,Xn as buttonContentLabelText,Zn as buttonContentLabelVisible,Qn as buttonContentRenderState,$n as buttonContentStyleTargetIndex,nr as buttonStyleClass,rr as buttonStyleClasses,cr as calendarClearMarks,lr as calendarDayIsMarked,ur as calendarDays,dr as calendarDaysInMonth,fr as calendarIsLeapYear,pr as calendarMarkDay,mr as calendarNavigationButtons,hr as calendarSelectDay,gr as calendarStep,_r as calendarWeekNumber,vr as calendarWeekStart,Hr as carouselClampPosition,Ur as carouselClosestSnapPoint,Wr as carouselNavigateTarget,Gr as carouselPageAllocation,Kr as carouselPageAtPosition,qr as carouselRange,Jr as carouselReorderShift,Yr as carouselSizesFromSnapPoints,Xr as carouselSnapPoints,Zr as carouselWheelStep,Qr as checkActivationFlips,$r as checkGroupNeighbours,He as clampAdjustmentValue,hi as clampAllocate,gi as clampChildSize,ka as clampEntryMaxLength,Aa as clampEntryText,zo as clampListSelection,Hs as clampSidebarSelection,_i as clampSizeFromChild,vi as clampThresholds,Fu as classifyAsm6502Word,Ml as collectSearchRows,qo as columnViewSort,Jo as columnViewTracks,so as computeLanguageNames,xo as computePoint,w as connectInstance,T as constructRegistered,Nl as countVisiblePages,Xa as createAppInfo,Vn as createBreakpointDriver,E as createClosure,ho as createGLibTimers,D as createGObject,ro as createGdk,Lt as createGtkPlatform,Pl as createSearchRowSubtitle,hl as createViewSwitcherPage,Q as creditsSections,ta as dataGridCellText,na as dataGridColumnAlign,ra as dataGridColumnClasses,ia as dataGridRowInteractive,aa as dataGridTrackTemplate,oa as dataGridTracks,Fl as defaultCaseFolder,nn as defineWindowApplicationMembers,ja as deriveEntryRowState,Il as derivePreferencesGroupHeader,Re as deriveRowLabels,Rs as describeNavigationDiagnostic,Ha as dialogFailedError,O as disconnectInstance,Ua as dismissedError,rn as dispatchAccelerator,ai as easeInOutSine,oi as easeOutCubic,k as emitInstance,i as engineForTarget,Ma as entryRowLatches,Na as entryTextLength,I as escapeMarkup,Rn as evaluateBreakpointCondition,Wa as fileFilterAccepts,Ga as fileFilterSpec,Ka as fileForHandle,lt as findActionGroup,$ as flatCardShowsWebsite,gn as flattenAvatarGradient,Ut as flattenMenu,Us as flattenSidebarItems,fc as formatAcceleratorLabel,De as formatAdwRgb,Iu as formatHexAddress,Lu as formatLineNumber,pc as formatManifestShortcut,_n as gStrHash,e as gStrStrip,po as getCurrentDir,mo as getSystemDataDirs,t as glibClamp,A as gobjectEngineName,So as gridColumns,Co as gridNavigate,Yo as gridViewColumns,Oo as iconLookupNames,gl as inlineToggleTooltip,ut as insertActionGroup,dt as installActionMap,si as inverseLerp,Oe as isAdwAccentColorName,Ze as isAdwSystemColorScheme,En as isBannerButtonStyle,Vi as isDescendantOfPage,_l as isInlineViewSwitcherDisplayMode,ee as isLicenseType,ei as isRadioCheck,Gl as isScrolledFromEnd,Kl as isScrolledFromStart,Dc as isSidebarAtVisualStart,Kc as isSplitButtonDirection,ji as isThemeIconColor,an as isValidApplicationId,vl as isViewSwitcherButtonVisible,yl as isViewSwitcherPolicy,cs as keptToggles,Rt as keyvalOfKey,bs as labelDisplayText,xs as labelEffectiveLines,Ss as labelEllipsizeOverflowValue,Cs as labelMarkupIsUnparseable,ws as labelWidthCharsExtent,Ts as labelYalignAlignItems,co as languageNamesFromTags,Oc as layoutNavigationSplitView,kc as layoutOverlaySplitView,te as legalMarkupText,ne as legalSectionVisible,re as legalSections,ie as legalVisible,ae as licenseText,oe as licenseTypeForNick,se as licenseTypeForSpdxId,ce as linkRowIconName,le as linkRowTooltip,ft as linkWindow,On as listBoxSelect,kn as listBoxSelectAll,An as listBoxSelectRow,jn as listBoxUnselectAll,Mn as listBoxUnselectRow,Xo as listItemField,Bo as listItemsChanged,Zo as listViewSelect,Qo as listViewSelectAll,lo as localeFromLanguageTag,ko as lookupResourceIcon,Ll as makeComparable,Ac as measureSplitViewHorizontal,Zi as menuActionsFor,nl as menuAssignments,qc as menuButtonArrowIcon,Jc as menuButtonPopupDirection,Wt as menuItemAt,Gt as menuLabelText,Kt as menuNodeAt,qt as menuRefusals,ke as nearestAccent,Ue as normalizeAdjustment,Fn as normalizeBoxOrientation,Nn as normalizeBoxSelectionMode,In as normalizeBoxSpacing,yi as normalizeClampSize,$o as normalizeColumnViewColumns,Vo as normalizeComboOptions,sa as normalizeDataGridColumns,ca as normalizeDataGridVariant,Li as normalizeIconName,Es as normalizeLabelEllipsize,Ds as normalizeLabelJustify,Os as normalizeLabelLines,ks as normalizeLabelMaxWidthChars,As as normalizeLabelWidthChars,js as normalizeLabelWrapMode,Ms as normalizeLabelXalign,Ns as normalizeLabelYalign,_c as normalizeLengthUnit,es as normalizeListSelectionMode,Jt as normalizeMenuModel,pu as normalizeNaturalLineLength,ic as normalizeSpinnerAngle,mu as normalizeWrapBoxAlign,hu as normalizeWrapBoxJustify,gu as normalizeWrapBoxLengthUnit,_u as normalizeWrapBoxPackDirection,vu as normalizeWrapBoxSpacing,yu as normalizeWrapPolicy,j as notifyInstance,Ae as onAdwaitaAccentChanged,Mi as onAdwaitaColorSchemeChanged,ql as overshootDistance,bl as pageIndexForToggle,lc as parseAccelerator,ve as parseAcceleratorKeyval,We as parseAdjustment,je as parseAdwRgb,Dn as parseBannerButtonStyle,zn as parseBreakpointCondition,ts as parseColumnViewColumns,ue as parseCreditPerson,Qe as parseDesktopAppearance,Yt as parseDetailedAction,Ho as parseListModel,Xt as parseMenuModel,L as parsePangoMarkup,uc as parseShortcutLabel,bi as parseToolbarStyle,tl as planPopupMenu,qa as promisify,vn as randomAvatarColorClass,de as refuseNewFromAppdata,M as registerBaseClass,Ja as registerFileChooserDriver,a as registerGObjectEngine,N as registeredClassOf,o as registeredEngine,jo as releaseNotesBuffer,$e as renderAppearanceMeta,s as resetRegisteredEngine,da as resolveBottomSheetChrome,fa as resolveBottomSheetClose,pa as resolveBottomSheetOpen,ma as resolveBottomSheetSwipeTracker,ri as resolveCheckState,Yc as resolveDropdownTooltip,Pa as resolveEntryRowActivation,Do as resolveHeaderBarTitle,Zt as resolveMenuItemState,jc as resolveNaturalSidebarWidth,Mc as resolveNavigationAction,Nc as resolveNavigationSidebarWidth,Pc as resolveNavigationStack,Fc as resolveOverlaySidebarWidth,Ri as resolvePageTitle,tu as resolvePopoverKey,Ic as resolveSidebarBounds,xi as resolveSpinnerSize,Lc as resolveSwipeArea,Rc as resolveSwipeRelease,zc as resolveSwipeSnapPoints,Bc as resolveSwipeStart,bu as resolveWrapBoxChildOrder,xu as resolveWrapBoxLine,xt as resources_enumerate_children,St as resources_get_info,Ct as resources_lookup_data,wt as resources_register,Tt as resources_unregister,Rl as rowMatchesQuery,Jl as scrollMaxValue,Yl as scrollUndershootClasses,zl as searchPreferences,Me as setAdwaitaAccent,Ni as setAdwaitaColorScheme,ti as setCheckGroup,fe as setLicense,pe as setLicenseType,dc as shortcutKeycaps,xl as shouldRevealViewSwitcherBar,Ws as sidebarHeaders,Ge as snapAdjustmentValue,ac as spinnerArc,oc as spinnerArcEnd,sc as spinnerArcStart,Si as spinnerGeometry,cc as spinnerProgressAt,Xc as splitButtonArrowIcon,Zc as splitButtonPopupDirection,Qc as splitButtonRootState,$c as splitButtonStyleClasses,Uu as stepDefaultSize,n as stringIsNotEmpty,R as stripMarkup,r as stripMnemonic,Ru as stripSourceWhitespace,Hi as successorAfterClose,jr as swipeBounds,Vc as swipeCancelProgress,Mr as swipeClosestPointIndex,Nr as swipeEndProgress,Pr as swipeNextPointIndex,Fr as swipePreviousPointIndex,Ir as swipeProjectedPointIndex,Lr as swipeSlope,Rr as swipeVelocityThreshold,Ps as syncDirection,Ui as tabCloseVisible,Wi as tabIconState,Gi as tabSearchMatches,Ki as tabTooltip,qi as tabTooltipIsMarkup,Ji as tabViewItemsChanged,Yi as tabsRevealed,Hc as tagsConflict,Pi as themeIconColor,Fi as toggleAdwaitaColorScheme,Sl as toggleIndexForPage,ls as toggleIndexOfName,zu as tokenizeAsm6502,Ci as toolbarBarStyleClasses,wi as toolbarViewAllocate,Ti as toolbarViewClasses,Ei as toolbarViewContentForSize,Di as toolbarViewMeasure,me as translatorCreditsPeople,ns as treeExpanderAction,rs as treeExpanderExpanded,is as treeExpanderLayout,_o as unicharIsalpha,vo as uriEscapeString,Za as uriPeekScheme,P as usePureJsGObjectEngine,Cl as viewSwitcherBadgeLabel,wl as viewSwitcherButtonOrientation,Tl as viewSwitcherIconName,El as viewSwitcherIndicatorDescription,Dl as viewSwitcherLabel,Ol as viewSwitcherPageFromStackPage,kl as viewSwitcherPagesFromStack,Al as viewSwitcherSidebarSections,zt as widgetControllerMembers,io as widgetDisplayMembers,Fs as widgetTreeMembers,on as withGtkApplication,Su as wrapBoxChildFlex,Cu as wrapBoxFlexStyle,wu as wrapBoxLengthToPx,Tu as wrapPolicyFlexShrink};
|
|
1
|
+
import{gStrStrip as e,glibClamp as t,stringIsNotEmpty as n,stripMnemonic as r}from"./glib.js";import{engineForTarget as i,registerGObjectEngine as a,registeredEngine as o,resetRegisteredEngine as s}from"./engine.js";import{GIR_TYPE as c,GObjectObject as l,ListModel as u,META_SYMBOLS as d,PURE_JS_ENGINE as f,ParamFlags as p,ParamSpec as m,STOP_EMISSION as h,TYPE_BOOLEAN as g,TYPE_DOUBLE as _,TYPE_INT as v,TYPE_OBJECT as y,TYPE_STRING as b,TYPE_UINT as x,UNLOCKED_VFUNCS as S,UnsupportedGObjectError as C,Value as w,bindProperties as T,connectInstance as E,constructRegistered as D,createClosure as O,createGObject as k,disconnectInstance as A,emitInstance as j,gobjectEngineName as M,notifyInstance as N,refuseForeignInterfaces as P,registerBaseClass as F,registeredClassOf as I,usePureJsGObjectEngine as L}from"./gobject.js";import{PANGO_MARKUP_TAGS as R,escapeMarkup as z,parsePangoMarkup as B,stripMarkup as V}from"./pango-markup.js";import{ADW_ABOUT_DIALOG_LABELS as H,ADW_CREDITS_SECTION_TITLES as U,ADW_LEGAL_DEFAULT_TITLE as W,ADW_LICENSES as G,ADW_LICENSE_ALIASES as K,ADW_LICENSE_DEFAULTS as q,ADW_LICENSE_WARRANTY_TEMPLATE as J,ADW_LINK_ROW_ICON_NAME as Y,ADW_LINK_ROW_MAIL_ICON_NAME as X,ADW_TRANSLATOR_CREDITS_SENTINELS as Z,GTK_LICENSE as Q,aboutDialogVisibility as $,acknowledgementSections as ee,creditsSections as te,flatCardShowsWebsite as ne,isLicenseType as re,legalMarkupText as ie,legalSectionVisible as ae,legalSections as oe,legalVisible as se,licenseText as ce,licenseTypeForNick as le,licenseTypeForSpdxId as ue,linkRowIconName as de,linkRowTooltip as fe,parseCreditPerson as pe,refuseNewFromAppdata as me,setLicense as he,setLicenseType as ge,translatorCreditsPeople as _e}from"./about-dialog.js";import{AcceleratorMap as ve,ModifierMask as ye,acceleratorName as be,parseAcceleratorKeyval as xe}from"./accelerators.js";import{ADW_ACCENT_BG_COLORS as Se,ADW_ACCENT_COLOR_NAMES as Ce,ADW_ACCENT_FG_COLOR as we,ADW_DEFAULT_ACCENT_COLOR as Te,adwaitaAccent as Ee,adwaitaAccentBgColor as De,adwaitaAccentColor as Oe,adwaitaStandaloneColor as ke,formatAdwRgb as Ae,isAdwAccentColorName as je,nearestAccent as Me,onAdwaitaAccentChanged as Ne,parseAdwRgb as Pe,setAdwaitaAccent as Fe}from"./accent.js";import{ActionRowState as Ie,BUTTON_ROW_ACTIVATABLE as Le,ButtonRowState as Re,SwitchRowState as ze,WindowTitleState as Be,deriveRowLabels as Ve}from"./action-row.js";import{ADW_ADJUSTMENT_DEFAULTS as He,SpinState as Ue,adjustmentRange as We,clampAdjustmentValue as Ge,normalizeAdjustment as Ke,parseAdjustment as qe,snapAdjustmentValue as Je}from"./adjustment.js";import{ADW_ACCENT_META as Ye,ADW_ACCENT_META_SYSTEM as Xe,ADW_COLOR_SCHEME_META as Ze,ADW_SYSTEM_COLOR_SCHEMES as Qe,appearanceFromMeta as $e,isAdwSystemColorScheme as et,parseDesktopAppearance as tt,renderAppearanceMeta as nt}from"./appearance.js";import{APPLE_ACCENT_COLORS as rt,APPLE_MULTICOLOR_ACCENT as it,adwAccentFromAppleAccentColor as at}from"./apple-accent.js";import{ActionRegistry as ot,SimpleAction as st,SimpleActionGroup as ct,actionRegistryOf as lt,activateWidgetAction as ut,applicationOfWindow as dt,findActionGroup as ft,insertActionGroup as pt,installActionMap as mt,linkWindow as ht}from"./gio-actions.js";import{Bytes as gt}from"./glib-bytes.js";import{DialogError as _t,GLibError as vt,IOErrorEnum as yt,ResourceError as bt,asGLibError as xt}from"./glib-error.js";import{Resource as St,ResourceLookupFlags as Ct,resources_enumerate_children as wt,resources_get_info as Tt,resources_lookup_data as Et,resources_register as Dt,resources_unregister as Ot}from"./gio-resource.js";import{CURRENT_TIME as kt,CssProvider as At,EventControllerKey as jt,GDK_KEYS as Mt,GtkSettings as Nt,IconTheme as Pt,STYLE_PROVIDER_PRIORITY_APPLICATION as Ft,STYLE_PROVIDER_PRIORITY_FALLBACK as It,STYLE_PROVIDER_PRIORITY_SETTINGS as Lt,STYLE_PROVIDER_PRIORITY_THEME as Rt,STYLE_PROVIDER_PRIORITY_USER as zt,createGtkPlatform as Bt,keyvalOfKey as Vt,widgetControllerMembers as Ht}from"./gtk-platform.js";import{ADW_MENU_SURFACE_NATIVESCRIPT as Ut,ADW_MENU_SURFACE_WEB as Wt,assertMenuRenderable as Gt,flattenMenu as Kt,menuItemAt as qt,menuLabelText as Jt,menuNodeAt as Yt,menuRefusals as Xt,normalizeMenuModel as Zt,parseDetailedAction as Qt,parseMenuModel as $t,resolveMenuItemState as en}from"./menu.js";import{ApplicationFlags as tn,ApplicationInhibitFlags as nn,GioApplicationBase as rn,GtkApplicationBase as an,defineWindowApplicationMembers as on,dispatchAccelerator as sn,isValidApplicationId as cn,withGtkApplication as ln}from"./application.js";import{AVATAR_COLORS as un,AVATAR_COLOR_COUNT as dn,avatarColor as fn,avatarColorClass as pn,avatarFontSize as mn,avatarIconSize as hn,avatarInitials as gn,avatarMaxFontSize as _n,avatarMode as vn,flattenAvatarGradient as yn,gStrHash as bn,randomAvatarColorClass as xn}from"./avatar.js";import{ADW_BANNER_BUTTON_STYLES as Sn,ADW_BANNER_BUTTON_STYLE_CLASSES as Cn,ADW_BANNER_DEFAULTS as wn,bannerButtonStyleClasses as Tn,bannerButtonText as En,bannerButtonVisible as Dn,bannerRenderState as On,isBannerButtonStyle as kn,parseBannerButtonStyle as An}from"./banner.js";import{listBoxSelect as jn,listBoxSelectAll as Mn,listBoxSelectRow as Nn,listBoxUnselectAll as Pn,listBoxUnselectRow as Fn,normalizeBoxSelectionMode as In}from"./box-selection.js";import{DEFAULT_BOX_SPACING as Ln,normalizeBoxOrientation as Rn,normalizeBoxSpacing as zn}from"./box.js";import{AdwBreakpoint as Bn,evaluateBreakpointCondition as Vn,parseBreakpointCondition as Hn}from"./breakpoint.js";import{BreakpointBinState as Un}from"./breakpoint-bin.js";import{createBreakpointDriver as Wn}from"./breakpoint-driver.js";import{ADW_BUTTON_CONTENT_DEFAULTS as Gn,BUTTON_CONTENT_BOX_SPACING as Kn,BUTTON_CONTENT_FALLBACK_ICON as qn,BUTTON_CONTENT_STYLE_CLASS as Jn,buttonContentEllipsize as Yn,buttonContentIconExpands as Xn,buttonContentIconIsEmpty as Zn,buttonContentIconName as Qn,buttonContentLabelText as $n,buttonContentLabelVisible as er,buttonContentRenderState as tr,buttonContentStyleTargetIndex as nr}from"./button-content.js";import{ADW_BUTTON_STYLE_ALIASES as rr,ADW_BUTTON_STYLE_CLASSES as ir,buttonStyleClass as ar,buttonStyleClasses as or}from"./button.js";import{CALENDAR_MARK_MAX as sr,CALENDAR_MARK_MIN as cr,CALENDAR_YEAR_MAX as lr,CALENDAR_YEAR_MIN as ur,calendarClearMarks as dr,calendarDayIsMarked as fr,calendarDays as pr,calendarDaysInMonth as mr,calendarIsLeapYear as hr,calendarMarkDay as gr,calendarNavigationButtons as _r,calendarSelectDay as vr,calendarStep as yr,calendarWeekNumber as br,calendarWeekStart as xr}from"./calendar.js";import{ADW_SWIPE_DECELERATION_TOUCH as Sr,ADW_SWIPE_DECELERATION_TOUCHPAD as Cr,ADW_SWIPE_DRAG_THRESHOLD as wr,ADW_SWIPE_EPSILON as Tr,ADW_SWIPE_HISTORY_THRESHOLD_MS as Er,ADW_SWIPE_PARABOLA_MULTIPLIER as Dr,ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_H as Or,ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_V as kr,ADW_SWIPE_VELOCITY_CURVE_THRESHOLD as Ar,ADW_SWIPE_VELOCITY_THRESHOLD_TOUCH as jr,ADW_SWIPE_VELOCITY_THRESHOLD_TOUCHPAD as Mr,SwipeTracker as Nr,swipeBounds as Pr,swipeClosestPointIndex as Fr,swipeEndProgress as Ir,swipeNextPointIndex as Lr,swipePreviousPointIndex as Rr,swipeProjectedPointIndex as zr,swipeSlope as Br,swipeVelocityThreshold as Vr}from"./swipe.js";import{CAROUSEL_SCROLL_TIMEOUT_MS as Hr,CAROUSEL_SETTLE_EPSILON as Ur,CarouselState as Wr,carouselClampPosition as Gr,carouselClosestSnapPoint as Kr,carouselNavigateTarget as qr,carouselPageAllocation as Jr,carouselPageAtPosition as Yr,carouselRange as Xr,carouselReorderShift as Zr,carouselSizesFromSnapPoints as Qr,carouselSnapPoints as $r,carouselWheelStep as ei}from"./carousel.js";import{checkActivationFlips as ti,checkGroupNeighbours as ni,isRadioCheck as ri,setCheckGroup as ii}from"./check-group.js";import{RadioGroupState as ai,resolveCheckState as oi}from"./checks.js";import{adwLerp as si,easeInOutSine as ci,easeOutCubic as li,inverseLerp as ui}from"./easing.js";import{ADW_CLAMP_DEFAULTS as di,ADW_CLAMP_SIZE_CLASSES as fi,ADW_SPINNER_MAX_SIZE as pi,ADW_SPINNER_MIN_SIZE as mi,ADW_TOOLBAR_BAR_CLASSES as hi,ADW_TOOLBAR_VIEW_CLASSES as gi,ADW_TOOLBAR_VIEW_DEFAULTS as _i,clampAllocate as vi,clampChildSize as yi,clampSizeFromChild as bi,clampThresholds as xi,normalizeClampSize as Si,parseToolbarStyle as Ci,resolveSpinnerSize as wi,spinnerGeometry as Ti,toolbarBarStyleClasses as Ei,toolbarViewAllocate as Di,toolbarViewClasses as Oi,toolbarViewContentForSize as ki,toolbarViewMeasure as Ai}from"./chrome.js";import{DEFAULT_ICON_COLOR as ji,DEFAULT_ICON_COLOR_DARK as Mi,adwaitaColorScheme as Ni,isThemeIconColor as Pi,onAdwaitaColorSchemeChanged as Fi,setAdwaitaColorScheme as Ii,themeIconColor as Li,toggleAdwaitaColorScheme as Ri}from"./color-scheme.js";import{ViewStackState as zi,normalizeIconName as Bi,resolvePageTitle as Vi}from"./view-stack.js";import{DEFAULT_TAB_AUTOHIDE as Hi,TabViewState as Ui,isDescendantOfPage as Wi,successorAfterClose as Gi,tabCloseVisible as Ki,tabIconState as qi,tabSearchMatches as Ji,tabTooltip as Yi,tabTooltipIsMarkup as Xi,tabViewItemsChanged as Zi,tabsRevealed as Qi}from"./tab-view.js";import{activateMenuItem as $i,menuActionsFor as ea}from"./menu-actions.js";import{ADW_DATA_GRID_ROW_VARIANTS as ta,DATA_GRID_CELL_CLASS as na,DATA_GRID_ROW_CLASS as ra,dataGridCellText as ia,dataGridColumnAlign as aa,dataGridColumnClasses as oa,dataGridRowInteractive as sa,dataGridTrackTemplate as ca,dataGridTracks as la,normalizeDataGridColumns as ua,normalizeDataGridVariant as da}from"./data-grid.js";import{AdwAlertResponses as fa,BottomSheetPresentation as pa,resolveBottomSheetChrome as ma,resolveBottomSheetClose as ha,resolveBottomSheetOpen as ga,resolveBottomSheetSwipeTracker as _a}from"./dialog.js";import{CAPS_LOCK_ICON_NAME as va,CAPS_LOCK_TOOLTIP as ya,EMPTY_ANIMATION_DURATION_MS as ba,ENTRY_ROW_APPLY_ICON_NAME as xa,ENTRY_ROW_APPLY_TOOLTIP as Sa,ENTRY_ROW_EDIT_ICON_NAME as Ca,ENTRY_ROW_MAX_LENGTH_LIMIT as wa,ENTRY_ROW_TITLE_SPACING as Ta,EntryRowState as Ea,PASSWORD_CONCEAL_ICON_NAME as Da,PASSWORD_CONCEAL_LABEL as Oa,PASSWORD_REVEAL_ICON_NAME as ka,PASSWORD_REVEAL_LABEL as Aa,PasswordEntryRowState as ja,clampEntryMaxLength as Ma,clampEntryText as Na,deriveEntryRowState as Pa,entryRowLatches as Fa,entryTextLength as Ia,resolveEntryRowActivation as La}from"./entry-row.js";import{FileCreateFlags as Ra,FileDialog as za,FileFilter as Ba,FileOutputStream as Va,GioFile as Ha,GioListStore as Ua,OutputStream as Wa,dialogFailedError as Ga,dismissedError as Ka,fileFilterAccepts as qa,fileFilterSpec as Ja,fileForHandle as Ya,promisify as Xa,registerFileChooserDriver as Za}from"./file-chooser.js";import{AppLaunchContext as Qa,createAppInfo as $a,uriPeekScheme as eo}from"./gio-app-info.js";import{AppLaunchContext as to,Clipboard as no,ContentFormats as ro,ContentProvider as io,Display as ao,createGdk as oo,widgetDisplayMembers as so}from"./gdk.js";import{GioMenu as co,GioMenuItem as lo}from"./gio-menu.js";import{computeLanguageNames as uo,languageNamesFromTags as fo,localeFromLanguageTag as po}from"./glib-language.js";import{MAXUINT32 as mo,buildFilenamev as ho,getCurrentDir as go,getSystemDataDirs as _o}from"./glib-paths.js";import{createGLibTimers as vo}from"./glib-timers.js";import{GLIB_UNICHAR_UNICODE_VERSION as yo}from"./glib-unichar.generated.js";import{unicharIsalpha as bo}from"./glib-unichar.js";import{uriEscapeString as xo}from"./glib-uri.js";import{Variant as So}from"./glib-variant.js";import{Point as Co,computePoint as wo}from"./graphene.js";import{gridColumns as To,gridNavigate as Eo}from"./grid-navigation.js";import{GtkAdjustment as Do}from"./gtk-adjustment.js";import{GtkStringList as Oo,GtkStringObject as ko,INVALID_LIST_POSITION as Ao}from"./gtk-string-list.js";import{HeaderBarState as jo,resolveHeaderBarTitle as Mo}from"./header-bar.js";import{iconLookupNames as No,lookupResourceIcon as Po}from"./icon-theme-resources.js";import{RELEASE_NOTES_LABELS as Fo,releaseNotesBuffer as Io}from"./release-notes.js";import{AdwToast as Lo,AdwToastQueue as Ro,DEFAULT_TOAST_TIMEOUT as zo}from"./toast.js";import{Toast as Bo,ToastOverlayQueue as Vo,ToastPriority as Ho}from"./toast-object.js";import{ADW_COMBO_NO_SELECTION as Uo,clampListSelection as Wo,listItemsChanged as Go,normalizeComboOptions as Ko,parseListModel as qo}from"./list.js";import{ADW_COLUMN_VIEW_NO_FIXED_WIDTH as Jo,ADW_GRID_VIEW_MAX_COLUMNS as Yo,ADW_GRID_VIEW_MIN_COLUMNS as Xo,ListViewState as Zo,columnViewSort as Qo,columnViewTracks as $o,gridViewColumns as es,listItemField as ts,listViewSelect as ns,listViewSelectAll as rs,normalizeColumnViewColumns as is,normalizeListSelectionMode as as,parseColumnViewColumns as os}from"./list-view.js";import{treeExpanderAction as ss,treeExpanderExpanded as cs,treeExpanderLayout as ls}from"./tree-expander.js";import{ComboState as us,ExpanderState as ds,ToggleGroupState as fs,keptToggles as ps,toggleIndexOfName as ms}from"./rows.js";import{DEFAULT_LABEL_ELLIPSIZE as hs,DEFAULT_LABEL_LINES as gs,DEFAULT_LABEL_MAX_WIDTH_CHARS as _s,DEFAULT_LABEL_WIDTH_CHARS as vs,DEFAULT_LABEL_WRAP_MODE as ys,DEFAULT_LABEL_XALIGN as bs,DEFAULT_LABEL_YALIGN as xs,LABEL_ELLIPSIZE_MODES as Ss,LABEL_JUSTIFICATIONS as Cs,LABEL_WRAP_MODES as ws,labelDisplayText as Ts,labelEffectiveLines as Es,labelEllipsizeOverflowValue as Ds,labelMarkupIsUnparseable as Os,labelWidthCharsExtent as ks,labelYalignAlignItems as As,normalizeLabelEllipsize as js,normalizeLabelJustify as Ms,normalizeLabelLines as Ns,normalizeLabelMaxWidthChars as Ps,normalizeLabelWidthChars as Fs,normalizeLabelWrapMode as Is,normalizeLabelXalign as Ls,normalizeLabelYalign as Rs}from"./label.js";import{syncDirection as zs,widgetTreeMembers as Bs}from"./widget-members.js";import{BACK_BUTTON_FALLBACK_TOOLTIP as Vs,NavigationViewState as Hs,describeNavigationDiagnostic as Us}from"./navigation-view.js";import{ADW_SIDEBAR_NO_SELECTION as Ws,SidebarState as Gs,adjustSidebarSelection as Ks,clampSidebarSelection as qs,flattenSidebarItems as Js,sidebarHeaders as Ys}from"./sidebar.js";import{ADW_SPINNER_CONTRACT_DISTANCE as Xs,ADW_SPINNER_CYCLES_PER_LOOP as Zs,ADW_SPINNER_CYCLE_LENGTH as Qs,ADW_SPINNER_EXTEND_DISTANCE as $s,ADW_SPINNER_IDLE_DISTANCE as ec,ADW_SPINNER_MAX_ARC_LENGTH as tc,ADW_SPINNER_MIN_ARC_LENGTH as nc,ADW_SPINNER_N_CYCLES as rc,ADW_SPINNER_OVERLAP_DISTANCE as ic,ADW_SPINNER_SPIN_DURATION_MS as ac,ADW_SPINNER_START_ANGLE as oc,ADW_SPINNER_STILL_PROGRESS as sc,ADW_SPINNER_TRACK_OPACITY as cc,normalizeSpinnerAngle as lc,spinnerArc as uc,spinnerArcEnd as dc,spinnerArcStart as fc,spinnerProgressAt as pc}from"./spinner.js";import{parseAccelerator as mc,parseShortcutLabel as hc,shortcutKeycaps as gc}from"./shortcut-label.js";import{formatAcceleratorLabel as _c,formatManifestShortcut as vc}from"./shortcut-format.js";import{ADW_LENGTH_UNITS as yc,DEFAULT_DPI as bc,adwLengthToPx as xc,normalizeLengthUnit as Sc}from"./length-unit.js";import{ADW_SWIPE_BORDER as Cc,DEFAULT_MAX_SIDEBAR_WIDTH as wc,DEFAULT_MIN_SIDEBAR_WIDTH as Tc,DEFAULT_SIDEBAR_WIDTH_FRACTION as Ec,DEFAULT_SIDEBAR_WIDTH_UNIT as Dc,INSTANT_SPLIT_VIEW_ANIMATOR as Oc,NAVIGATION_SPLIT_VIEW_CRITICALS as kc,NavigationSplitViewState as Ac,OverlaySplitViewState as jc,isSidebarAtVisualStart as Mc,layoutNavigationSplitView as Nc,layoutOverlaySplitView as Pc,measureSplitViewHorizontal as Fc,resolveNaturalSidebarWidth as Ic,resolveNavigationAction as Lc,resolveNavigationSidebarWidth as Rc,resolveNavigationStack as zc,resolveOverlaySidebarWidth as Bc,resolveSidebarBounds as Vc,resolveSwipeArea as Hc,resolveSwipeRelease as Uc,resolveSwipeSnapPoints as Wc,resolveSwipeStart as Gc,swipeCancelProgress as Kc,tagsConflict as qc}from"./split-view.js";import{DEFAULT_DROPDOWN_TOOLTIP as Jc,SPLIT_BUTTON_DISABLED_OPACITY as Yc,SplitButtonState as Xc,isSplitButtonDirection as Zc,menuButtonArrowIcon as Qc,menuButtonPopupDirection as $c,resolveDropdownTooltip as el,splitButtonArrowIcon as tl,splitButtonPopupDirection as nl,splitButtonRootState as rl,splitButtonStyleClasses as il}from"./split-button.js";import{assertPopupMenuPlan as al,planPopupMenu as ol}from"./popup-menu-plan.js";import{menuAssignments as sl}from"./menu-tree.js";import{DEFAULT_INDICATOR_DESCRIPTION_STRINGS as cl,INLINE_VIEW_SWITCHER_DISPLAY_MODES as ll,VIEW_SWITCHER_BADGE_LIMIT as ul,VIEW_SWITCHER_DRAG_SWITCH_DELAY as dl,VIEW_SWITCHER_FALLBACK_ICON as fl,VIEW_SWITCHER_NO_SELECTION as pl,VIEW_SWITCHER_POLICIES as ml,ViewSwitcherBarState as hl,ViewSwitcherDragSwitch as gl,ViewSwitcherState as _l,buildInlineToggles as vl,buildViewSwitcherButtons as yl,createViewSwitcherPage as bl,inlineToggleTooltip as xl,isInlineViewSwitcherDisplayMode as Sl,isViewSwitcherButtonVisible as Cl,isViewSwitcherPolicy as wl,pageIndexForToggle as Tl,shouldRevealViewSwitcherBar as El,toggleIndexForPage as Dl,viewSwitcherBadgeLabel as Ol,viewSwitcherButtonOrientation as kl,viewSwitcherIconName as Al,viewSwitcherIndicatorDescription as jl,viewSwitcherLabel as Ml,viewSwitcherPageFromStackPage as Nl,viewSwitcherPagesFromStack as Pl,viewSwitcherSidebarSections as Fl}from"./view-switcher.js";import{UNTITLED_PAGE_LABEL as Il,collectSearchRows as Ll,countVisiblePages as Rl,createSearchRowSubtitle as zl,defaultCaseFolder as Bl,derivePreferencesGroupHeader as Vl,makeComparable as Hl,rowMatchesQuery as Ul,searchPreferences as Wl}from"./preferences.js";import{ADW_MAX_OVERSHOOT_DISTANCE as Gl,ADW_OVERSHOOT_SETTLE_MS as Kl,ADW_UNDERSHOOT_CLASSES as ql,ADW_UNDERSHOOT_SIZE as Jl,accumulateOvershoot as Yl,isScrolledFromEnd as Xl,isScrolledFromStart as Zl,overshootDistance as Ql,scrollMaxValue as $l,scrollUndershootClasses as eu}from"./scrolling.js";import{POPOVER_ITEM_RADIUS as tu,POPOVER_MENU_PADDING as nu,POPOVER_PADDING as ru,POPOVER_RADIUS as iu,PopoverState as au,resolvePopoverKey as ou}from"./popover.js";import{ADW_WRAP_BOX_DEFAULT_ALIGN as su,ADW_WRAP_BOX_DEFAULT_JUSTIFY as cu,ADW_WRAP_BOX_DEFAULT_JUSTIFY_LAST_LINE as lu,ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT as uu,ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION as du,ADW_WRAP_BOX_DEFAULT_SPACING as fu,ADW_WRAP_BOX_DEFAULT_WRAP_POLICY as pu,ADW_WRAP_BOX_JUSTIFY_MODES as mu,ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET as hu,ADW_WRAP_BOX_PACK_DIRECTIONS as gu,ADW_WRAP_POLICIES as _u,normalizeNaturalLineLength as vu,normalizeWrapBoxAlign as yu,normalizeWrapBoxJustify as bu,normalizeWrapBoxLengthUnit as xu,normalizeWrapBoxPackDirection as Su,normalizeWrapBoxSpacing as Cu,normalizeWrapPolicy as wu,resolveWrapBoxChildOrder as Tu,resolveWrapBoxLine as Eu,wrapBoxChildFlex as Du,wrapBoxFlexStyle as Ou,wrapBoxLengthToPx as ku,wrapPolicyFlexShrink as Au}from"./wrap-box.js";import{ADW_SOURCE_6502_DIRECTIVES as ju,ADW_SOURCE_6502_LINE_COMMENT as Mu,ADW_SOURCE_6502_OPCODES as Nu,ADW_SOURCE_6502_REGISTERS as Pu,ADW_SOURCE_6502_TOKEN_ROLES as Fu,ADW_SOURCE_HEX_STRIDE as Iu,ADW_SOURCE_PALETTE_DARK as Lu,ADW_SOURCE_PALETTE_LIGHT as Ru,ADW_SOURCE_SYNTAX_ROLES as zu,classifyAsm6502Word as Bu,formatHexAddress as Vu,formatLineNumber as Hu,stripSourceWhitespace as Uu,tokenizeAsm6502 as Wu}from"./source.js";import{CloseRequestState as Gu,HandledAccumulator as Ku,WindowMemberState as qu,stepDefaultSize as Ju}from"./window-members.js";import{RGBA as Yu}from"./rgba.js";import{AccentColor as Xu,ColorScheme as Zu,StyleManagerBase as Qu}from"./style-manager.js";export{H as ADW_ABOUT_DIALOG_LABELS,Se as ADW_ACCENT_BG_COLORS,Ce as ADW_ACCENT_COLOR_NAMES,we as ADW_ACCENT_FG_COLOR,Ye as ADW_ACCENT_META,Xe as ADW_ACCENT_META_SYSTEM,He as ADW_ADJUSTMENT_DEFAULTS,Sn as ADW_BANNER_BUTTON_STYLES,Cn as ADW_BANNER_BUTTON_STYLE_CLASSES,wn as ADW_BANNER_DEFAULTS,Gn as ADW_BUTTON_CONTENT_DEFAULTS,rr as ADW_BUTTON_STYLE_ALIASES,ir as ADW_BUTTON_STYLE_CLASSES,di as ADW_CLAMP_DEFAULTS,fi as ADW_CLAMP_SIZE_CLASSES,Ze as ADW_COLOR_SCHEME_META,Jo as ADW_COLUMN_VIEW_NO_FIXED_WIDTH,Uo as ADW_COMBO_NO_SELECTION,U as ADW_CREDITS_SECTION_TITLES,ta as ADW_DATA_GRID_ROW_VARIANTS,Te as ADW_DEFAULT_ACCENT_COLOR,Yo as ADW_GRID_VIEW_MAX_COLUMNS,Xo as ADW_GRID_VIEW_MIN_COLUMNS,W as ADW_LEGAL_DEFAULT_TITLE,yc as ADW_LENGTH_UNITS,G as ADW_LICENSES,K as ADW_LICENSE_ALIASES,q as ADW_LICENSE_DEFAULTS,J as ADW_LICENSE_WARRANTY_TEMPLATE,Y as ADW_LINK_ROW_ICON_NAME,X as ADW_LINK_ROW_MAIL_ICON_NAME,Gl as ADW_MAX_OVERSHOOT_DISTANCE,Ut as ADW_MENU_SURFACE_NATIVESCRIPT,Wt as ADW_MENU_SURFACE_WEB,Kl as ADW_OVERSHOOT_SETTLE_MS,Ws as ADW_SIDEBAR_NO_SELECTION,ju as ADW_SOURCE_6502_DIRECTIVES,Mu as ADW_SOURCE_6502_LINE_COMMENT,Nu as ADW_SOURCE_6502_OPCODES,Pu as ADW_SOURCE_6502_REGISTERS,Fu as ADW_SOURCE_6502_TOKEN_ROLES,Iu as ADW_SOURCE_HEX_STRIDE,Lu as ADW_SOURCE_PALETTE_DARK,Ru as ADW_SOURCE_PALETTE_LIGHT,zu as ADW_SOURCE_SYNTAX_ROLES,Xs as ADW_SPINNER_CONTRACT_DISTANCE,Zs as ADW_SPINNER_CYCLES_PER_LOOP,Qs as ADW_SPINNER_CYCLE_LENGTH,$s as ADW_SPINNER_EXTEND_DISTANCE,ec as ADW_SPINNER_IDLE_DISTANCE,tc as ADW_SPINNER_MAX_ARC_LENGTH,pi as ADW_SPINNER_MAX_SIZE,nc as ADW_SPINNER_MIN_ARC_LENGTH,mi as ADW_SPINNER_MIN_SIZE,rc as ADW_SPINNER_N_CYCLES,ic as ADW_SPINNER_OVERLAP_DISTANCE,ac as ADW_SPINNER_SPIN_DURATION_MS,oc as ADW_SPINNER_START_ANGLE,sc as ADW_SPINNER_STILL_PROGRESS,cc as ADW_SPINNER_TRACK_OPACITY,Cc as ADW_SWIPE_BORDER,Sr as ADW_SWIPE_DECELERATION_TOUCH,Cr as ADW_SWIPE_DECELERATION_TOUCHPAD,wr as ADW_SWIPE_DRAG_THRESHOLD,Tr as ADW_SWIPE_EPSILON,Er as ADW_SWIPE_HISTORY_THRESHOLD_MS,Dr as ADW_SWIPE_PARABOLA_MULTIPLIER,Or as ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_H,kr as ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_V,Ar as ADW_SWIPE_VELOCITY_CURVE_THRESHOLD,jr as ADW_SWIPE_VELOCITY_THRESHOLD_TOUCH,Mr as ADW_SWIPE_VELOCITY_THRESHOLD_TOUCHPAD,Qe as ADW_SYSTEM_COLOR_SCHEMES,hi as ADW_TOOLBAR_BAR_CLASSES,gi as ADW_TOOLBAR_VIEW_CLASSES,_i as ADW_TOOLBAR_VIEW_DEFAULTS,Z as ADW_TRANSLATOR_CREDITS_SENTINELS,ql as ADW_UNDERSHOOT_CLASSES,Jl as ADW_UNDERSHOOT_SIZE,su as ADW_WRAP_BOX_DEFAULT_ALIGN,cu as ADW_WRAP_BOX_DEFAULT_JUSTIFY,lu as ADW_WRAP_BOX_DEFAULT_JUSTIFY_LAST_LINE,uu as ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT,du as ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION,fu as ADW_WRAP_BOX_DEFAULT_SPACING,pu as ADW_WRAP_BOX_DEFAULT_WRAP_POLICY,mu as ADW_WRAP_BOX_JUSTIFY_MODES,hu as ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET,gu as ADW_WRAP_BOX_PACK_DIRECTIONS,_u as ADW_WRAP_POLICIES,rt as APPLE_ACCENT_COLORS,it as APPLE_MULTICOLOR_ACCENT,un as AVATAR_COLORS,dn as AVATAR_COLOR_COUNT,ve as AcceleratorMap,Xu as AccentColor,ot as ActionRegistry,Ie as ActionRowState,fa as AdwAlertResponses,Bn as AdwBreakpoint,Lo as AdwToast,Ro as AdwToastQueue,tn as ApplicationFlags,nn as ApplicationInhibitFlags,Vs as BACK_BUTTON_FALLBACK_TOOLTIP,Kn as BUTTON_CONTENT_BOX_SPACING,qn as BUTTON_CONTENT_FALLBACK_ICON,Jn as BUTTON_CONTENT_STYLE_CLASS,Le as BUTTON_ROW_ACTIVATABLE,pa as BottomSheetPresentation,Un as BreakpointBinState,Re as ButtonRowState,sr as CALENDAR_MARK_MAX,cr as CALENDAR_MARK_MIN,lr as CALENDAR_YEAR_MAX,ur as CALENDAR_YEAR_MIN,va as CAPS_LOCK_ICON_NAME,ya as CAPS_LOCK_TOOLTIP,Hr as CAROUSEL_SCROLL_TIMEOUT_MS,Ur as CAROUSEL_SETTLE_EPSILON,kt as CURRENT_TIME,Wr as CarouselState,no as Clipboard,Gu as CloseRequestState,Zu as ColorScheme,us as ComboState,ro as ContentFormats,io as ContentProvider,At as CssProvider,na as DATA_GRID_CELL_CLASS,ra as DATA_GRID_ROW_CLASS,Ln as DEFAULT_BOX_SPACING,bc as DEFAULT_DPI,Jc as DEFAULT_DROPDOWN_TOOLTIP,ji as DEFAULT_ICON_COLOR,Mi as DEFAULT_ICON_COLOR_DARK,cl as DEFAULT_INDICATOR_DESCRIPTION_STRINGS,hs as DEFAULT_LABEL_ELLIPSIZE,gs as DEFAULT_LABEL_LINES,_s as DEFAULT_LABEL_MAX_WIDTH_CHARS,vs as DEFAULT_LABEL_WIDTH_CHARS,ys as DEFAULT_LABEL_WRAP_MODE,bs as DEFAULT_LABEL_XALIGN,xs as DEFAULT_LABEL_YALIGN,wc as DEFAULT_MAX_SIDEBAR_WIDTH,Tc as DEFAULT_MIN_SIDEBAR_WIDTH,Ec as DEFAULT_SIDEBAR_WIDTH_FRACTION,Dc as DEFAULT_SIDEBAR_WIDTH_UNIT,Hi as DEFAULT_TAB_AUTOHIDE,zo as DEFAULT_TOAST_TIMEOUT,_t as DialogError,ao as Display,ba as EMPTY_ANIMATION_DURATION_MS,xa as ENTRY_ROW_APPLY_ICON_NAME,Sa as ENTRY_ROW_APPLY_TOOLTIP,Ca as ENTRY_ROW_EDIT_ICON_NAME,wa as ENTRY_ROW_MAX_LENGTH_LIMIT,Ta as ENTRY_ROW_TITLE_SPACING,Ea as EntryRowState,jt as EventControllerKey,ds as ExpanderState,Ra as FileCreateFlags,Mt as GDK_KEYS,c as GIR_TYPE,yo as GLIB_UNICHAR_UNICODE_VERSION,gt as GLibBytes,vt as GLibError,So as GLibVariant,l as GObjectObject,Q as GTK_LICENSE,to as GdkAppLaunchContext,Qa as GioAppLaunchContext,rn as GioApplicationBase,Ha as GioFile,Va as GioFileOutputStream,Ua as GioListStore,co as GioMenu,lo as GioMenuItem,Wa as GioOutputStream,St as GioResource,Do as GtkAdjustment,an as GtkApplicationBase,za as GtkFileDialog,Ba as GtkFileFilter,Nt as GtkSettings,Oo as GtkStringList,ko as GtkStringObject,Ku as HandledAccumulator,jo as HeaderBarState,ll as INLINE_VIEW_SWITCHER_DISPLAY_MODES,Oc as INSTANT_SPLIT_VIEW_ANIMATOR,Ao as INVALID_LIST_POSITION,yt as IOErrorEnum,Pt as IconTheme,Ss as LABEL_ELLIPSIZE_MODES,Cs as LABEL_JUSTIFICATIONS,ws as LABEL_WRAP_MODES,u as ListModel,Zo as ListViewState,mo as MAXUINT32,d as META_SYMBOLS,ye as ModifierMask,kc as NAVIGATION_SPLIT_VIEW_CRITICALS,Ac as NavigationSplitViewState,Hs as NavigationViewState,jc as OverlaySplitViewState,R as PANGO_MARKUP_TAGS,Da as PASSWORD_CONCEAL_ICON_NAME,Oa as PASSWORD_CONCEAL_LABEL,ka as PASSWORD_REVEAL_ICON_NAME,Aa as PASSWORD_REVEAL_LABEL,tu as POPOVER_ITEM_RADIUS,nu as POPOVER_MENU_PADDING,ru as POPOVER_PADDING,iu as POPOVER_RADIUS,f as PURE_JS_ENGINE,p as ParamFlags,m as ParamSpec,ja as PasswordEntryRowState,Co as Point,au as PopoverState,Fo as RELEASE_NOTES_LABELS,Yu as RGBA,ai as RadioGroupState,bt as ResourceError,Ct as ResourceLookupFlags,Yc as SPLIT_BUTTON_DISABLED_OPACITY,h as STOP_EMISSION,Ft as STYLE_PROVIDER_PRIORITY_APPLICATION,It as STYLE_PROVIDER_PRIORITY_FALLBACK,Lt as STYLE_PROVIDER_PRIORITY_SETTINGS,Rt as STYLE_PROVIDER_PRIORITY_THEME,zt as STYLE_PROVIDER_PRIORITY_USER,Gs as SidebarState,st as SimpleAction,ct as SimpleActionGroup,Ue as SpinState,Xc as SplitButtonState,Qu as StyleManagerBase,Nr as SwipeTracker,ze as SwitchRowState,g as TYPE_BOOLEAN,_ as TYPE_DOUBLE,v as TYPE_INT,y as TYPE_OBJECT,b as TYPE_STRING,x as TYPE_UINT,Ui as TabViewState,Bo as Toast,Vo as ToastOverlayQueue,Ho as ToastPriority,fs as ToggleGroupState,S as UNLOCKED_VFUNCS,Il as UNTITLED_PAGE_LABEL,C as UnsupportedGObjectError,ul as VIEW_SWITCHER_BADGE_LIMIT,dl as VIEW_SWITCHER_DRAG_SWITCH_DELAY,fl as VIEW_SWITCHER_FALLBACK_ICON,pl as VIEW_SWITCHER_NO_SELECTION,ml as VIEW_SWITCHER_POLICIES,w as Value,zi as ViewStackState,hl as ViewSwitcherBarState,gl as ViewSwitcherDragSwitch,_l as ViewSwitcherState,qu as WindowMemberState,Be as WindowTitleState,$ as aboutDialogVisibility,be as acceleratorName,Yl as accumulateOvershoot,ee as acknowledgementSections,lt as actionRegistryOf,$i as activateMenuItem,ut as activateWidgetAction,Ks as adjustSidebarSelection,We as adjustmentRange,at as adwAccentFromAppleAccentColor,xc as adwLengthToPx,si as adwLerp,Ee as adwaitaAccent,De as adwaitaAccentBgColor,Oe as adwaitaAccentColor,Ni as adwaitaColorScheme,ke as adwaitaStandaloneColor,$e as appearanceFromMeta,dt as applicationOfWindow,xt as asGLibError,Gt as assertMenuRenderable,al as assertPopupMenuPlan,fn as avatarColor,pn as avatarColorClass,mn as avatarFontSize,hn as avatarIconSize,gn as avatarInitials,_n as avatarMaxFontSize,vn as avatarMode,Tn as bannerButtonStyleClasses,En as bannerButtonText,Dn as bannerButtonVisible,On as bannerRenderState,T as bindProperties,ho as buildFilenamev,vl as buildInlineToggles,yl as buildViewSwitcherButtons,Yn as buttonContentEllipsize,Xn as buttonContentIconExpands,Zn as buttonContentIconIsEmpty,Qn as buttonContentIconName,$n as buttonContentLabelText,er as buttonContentLabelVisible,tr as buttonContentRenderState,nr as buttonContentStyleTargetIndex,ar as buttonStyleClass,or as buttonStyleClasses,dr as calendarClearMarks,fr as calendarDayIsMarked,pr as calendarDays,mr as calendarDaysInMonth,hr as calendarIsLeapYear,gr as calendarMarkDay,_r as calendarNavigationButtons,vr as calendarSelectDay,yr as calendarStep,br as calendarWeekNumber,xr as calendarWeekStart,Gr as carouselClampPosition,Kr as carouselClosestSnapPoint,qr as carouselNavigateTarget,Jr as carouselPageAllocation,Yr as carouselPageAtPosition,Xr as carouselRange,Zr as carouselReorderShift,Qr as carouselSizesFromSnapPoints,$r as carouselSnapPoints,ei as carouselWheelStep,ti as checkActivationFlips,ni as checkGroupNeighbours,Ge as clampAdjustmentValue,vi as clampAllocate,yi as clampChildSize,Ma as clampEntryMaxLength,Na as clampEntryText,Wo as clampListSelection,qs as clampSidebarSelection,bi as clampSizeFromChild,xi as clampThresholds,Bu as classifyAsm6502Word,Ll as collectSearchRows,Qo as columnViewSort,$o as columnViewTracks,uo as computeLanguageNames,wo as computePoint,E as connectInstance,D as constructRegistered,Rl as countVisiblePages,$a as createAppInfo,Wn as createBreakpointDriver,O as createClosure,vo as createGLibTimers,k as createGObject,oo as createGdk,Bt as createGtkPlatform,zl as createSearchRowSubtitle,bl as createViewSwitcherPage,te as creditsSections,ia as dataGridCellText,aa as dataGridColumnAlign,oa as dataGridColumnClasses,sa as dataGridRowInteractive,ca as dataGridTrackTemplate,la as dataGridTracks,Bl as defaultCaseFolder,on as defineWindowApplicationMembers,Pa as deriveEntryRowState,Vl as derivePreferencesGroupHeader,Ve as deriveRowLabels,Us as describeNavigationDiagnostic,Ga as dialogFailedError,A as disconnectInstance,Ka as dismissedError,sn as dispatchAccelerator,ci as easeInOutSine,li as easeOutCubic,j as emitInstance,i as engineForTarget,Fa as entryRowLatches,Ia as entryTextLength,z as escapeMarkup,Vn as evaluateBreakpointCondition,qa as fileFilterAccepts,Ja as fileFilterSpec,Ya as fileForHandle,ft as findActionGroup,ne as flatCardShowsWebsite,yn as flattenAvatarGradient,Kt as flattenMenu,Js as flattenSidebarItems,_c as formatAcceleratorLabel,Ae as formatAdwRgb,Vu as formatHexAddress,Hu as formatLineNumber,vc as formatManifestShortcut,bn as gStrHash,e as gStrStrip,go as getCurrentDir,_o as getSystemDataDirs,t as glibClamp,M as gobjectEngineName,To as gridColumns,Eo as gridNavigate,es as gridViewColumns,No as iconLookupNames,xl as inlineToggleTooltip,pt as insertActionGroup,mt as installActionMap,ui as inverseLerp,je as isAdwAccentColorName,et as isAdwSystemColorScheme,kn as isBannerButtonStyle,Wi as isDescendantOfPage,Sl as isInlineViewSwitcherDisplayMode,re as isLicenseType,ri as isRadioCheck,Xl as isScrolledFromEnd,Zl as isScrolledFromStart,Mc as isSidebarAtVisualStart,Zc as isSplitButtonDirection,Pi as isThemeIconColor,cn as isValidApplicationId,Cl as isViewSwitcherButtonVisible,wl as isViewSwitcherPolicy,ps as keptToggles,Vt as keyvalOfKey,Ts as labelDisplayText,Es as labelEffectiveLines,Ds as labelEllipsizeOverflowValue,Os as labelMarkupIsUnparseable,ks as labelWidthCharsExtent,As as labelYalignAlignItems,fo as languageNamesFromTags,Nc as layoutNavigationSplitView,Pc as layoutOverlaySplitView,ie as legalMarkupText,ae as legalSectionVisible,oe as legalSections,se as legalVisible,ce as licenseText,le as licenseTypeForNick,ue as licenseTypeForSpdxId,de as linkRowIconName,fe as linkRowTooltip,ht as linkWindow,jn as listBoxSelect,Mn as listBoxSelectAll,Nn as listBoxSelectRow,Pn as listBoxUnselectAll,Fn as listBoxUnselectRow,ts as listItemField,Go as listItemsChanged,ns as listViewSelect,rs as listViewSelectAll,po as localeFromLanguageTag,Po as lookupResourceIcon,Hl as makeComparable,Fc as measureSplitViewHorizontal,ea as menuActionsFor,sl as menuAssignments,Qc as menuButtonArrowIcon,$c as menuButtonPopupDirection,qt as menuItemAt,Jt as menuLabelText,Yt as menuNodeAt,Xt as menuRefusals,Me as nearestAccent,Ke as normalizeAdjustment,Rn as normalizeBoxOrientation,In as normalizeBoxSelectionMode,zn as normalizeBoxSpacing,Si as normalizeClampSize,is as normalizeColumnViewColumns,Ko as normalizeComboOptions,ua as normalizeDataGridColumns,da as normalizeDataGridVariant,Bi as normalizeIconName,js as normalizeLabelEllipsize,Ms as normalizeLabelJustify,Ns as normalizeLabelLines,Ps as normalizeLabelMaxWidthChars,Fs as normalizeLabelWidthChars,Is as normalizeLabelWrapMode,Ls as normalizeLabelXalign,Rs as normalizeLabelYalign,Sc as normalizeLengthUnit,as as normalizeListSelectionMode,Zt as normalizeMenuModel,vu as normalizeNaturalLineLength,lc as normalizeSpinnerAngle,yu as normalizeWrapBoxAlign,bu as normalizeWrapBoxJustify,xu as normalizeWrapBoxLengthUnit,Su as normalizeWrapBoxPackDirection,Cu as normalizeWrapBoxSpacing,wu as normalizeWrapPolicy,N as notifyInstance,Ne as onAdwaitaAccentChanged,Fi as onAdwaitaColorSchemeChanged,Ql as overshootDistance,Tl as pageIndexForToggle,mc as parseAccelerator,xe as parseAcceleratorKeyval,qe as parseAdjustment,Pe as parseAdwRgb,An as parseBannerButtonStyle,Hn as parseBreakpointCondition,os as parseColumnViewColumns,pe as parseCreditPerson,tt as parseDesktopAppearance,Qt as parseDetailedAction,qo as parseListModel,$t as parseMenuModel,B as parsePangoMarkup,hc as parseShortcutLabel,Ci as parseToolbarStyle,ol as planPopupMenu,Xa as promisify,xn as randomAvatarColorClass,P as refuseForeignInterfaces,me as refuseNewFromAppdata,F as registerBaseClass,Za as registerFileChooserDriver,a as registerGObjectEngine,I as registeredClassOf,o as registeredEngine,Io as releaseNotesBuffer,nt as renderAppearanceMeta,s as resetRegisteredEngine,ma as resolveBottomSheetChrome,ha as resolveBottomSheetClose,ga as resolveBottomSheetOpen,_a as resolveBottomSheetSwipeTracker,oi as resolveCheckState,el as resolveDropdownTooltip,La as resolveEntryRowActivation,Mo as resolveHeaderBarTitle,en as resolveMenuItemState,Ic as resolveNaturalSidebarWidth,Lc as resolveNavigationAction,Rc as resolveNavigationSidebarWidth,zc as resolveNavigationStack,Bc as resolveOverlaySidebarWidth,Vi as resolvePageTitle,ou as resolvePopoverKey,Vc as resolveSidebarBounds,wi as resolveSpinnerSize,Hc as resolveSwipeArea,Uc as resolveSwipeRelease,Wc as resolveSwipeSnapPoints,Gc as resolveSwipeStart,Tu as resolveWrapBoxChildOrder,Eu as resolveWrapBoxLine,wt as resources_enumerate_children,Tt as resources_get_info,Et as resources_lookup_data,Dt as resources_register,Ot as resources_unregister,Ul as rowMatchesQuery,$l as scrollMaxValue,eu as scrollUndershootClasses,Wl as searchPreferences,Fe as setAdwaitaAccent,Ii as setAdwaitaColorScheme,ii as setCheckGroup,he as setLicense,ge as setLicenseType,gc as shortcutKeycaps,El as shouldRevealViewSwitcherBar,Ys as sidebarHeaders,Je as snapAdjustmentValue,uc as spinnerArc,dc as spinnerArcEnd,fc as spinnerArcStart,Ti as spinnerGeometry,pc as spinnerProgressAt,tl as splitButtonArrowIcon,nl as splitButtonPopupDirection,rl as splitButtonRootState,il as splitButtonStyleClasses,Ju as stepDefaultSize,n as stringIsNotEmpty,V as stripMarkup,r as stripMnemonic,Uu as stripSourceWhitespace,Gi as successorAfterClose,Pr as swipeBounds,Kc as swipeCancelProgress,Fr as swipeClosestPointIndex,Ir as swipeEndProgress,Lr as swipeNextPointIndex,Rr as swipePreviousPointIndex,zr as swipeProjectedPointIndex,Br as swipeSlope,Vr as swipeVelocityThreshold,zs as syncDirection,Ki as tabCloseVisible,qi as tabIconState,Ji as tabSearchMatches,Yi as tabTooltip,Xi as tabTooltipIsMarkup,Zi as tabViewItemsChanged,Qi as tabsRevealed,qc as tagsConflict,Li as themeIconColor,Ri as toggleAdwaitaColorScheme,Dl as toggleIndexForPage,ms as toggleIndexOfName,Wu as tokenizeAsm6502,Ei as toolbarBarStyleClasses,Di as toolbarViewAllocate,Oi as toolbarViewClasses,ki as toolbarViewContentForSize,Ai as toolbarViewMeasure,_e as translatorCreditsPeople,ss as treeExpanderAction,cs as treeExpanderExpanded,ls as treeExpanderLayout,bo as unicharIsalpha,xo as uriEscapeString,eo as uriPeekScheme,L as usePureJsGObjectEngine,Ol as viewSwitcherBadgeLabel,kl as viewSwitcherButtonOrientation,Al as viewSwitcherIconName,jl as viewSwitcherIndicatorDescription,Ml as viewSwitcherLabel,Nl as viewSwitcherPageFromStackPage,Pl as viewSwitcherPagesFromStack,Fl as viewSwitcherSidebarSections,Ht as widgetControllerMembers,so as widgetDisplayMembers,Bs as widgetTreeMembers,ln as withGtkApplication,Du as wrapBoxChildFlex,Ou as wrapBoxFlexStyle,ku as wrapBoxLengthToPx,Au as wrapPolicyFlexShrink};
|
package/lib/esm/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";function normalizeComboOptions(e){return
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";function readListModel(e){let t=e;if(typeof t?.get_n_items!=`function`||typeof t.get_item!=`function`)return[];let n=[],r=t.get_n_items();for(let e=0;e<r;e++){let r=t.get_item(e);n.push(typeof r?.string==`string`?r.string:r??{})}return n}function normalizeComboOptions(e){return(Array.isArray(e)?e:readListModel(e)).map(e=>{if(typeof e==`string`)return{value:e,label:e};let t=e?.value===void 0?String(e?.label??``):String(e.value);return{value:t,label:e?.label===void 0?t:String(e.label)}})}function parseListModel(e){if(!e)return[];try{return normalizeComboOptions(JSON.parse(e))}catch{return[]}}const e=-1;function clampListSelection(e,t){return Number.isFinite(e)&&e>=0&&e<t?e:t===0?-1:0}function sameItem(e,t){return e!==void 0&&t!==void 0&&e.value===t.value&&e.label===t.label}function listItemsChanged(e,t){let n=e??[],r=t??[],i=Math.min(n.length,r.length),a=0;for(;a<i&&sameItem(n[a],r[a]);)a++;let o=0;for(;o<i-a&&sameItem(n[n.length-1-o],r[r.length-1-o]);)o++;let s=n.length-a-o,c=r.length-a-o;return s===0&&c===0?null:{position:a,removed:s,added:c}}export{e as ADW_COMBO_NO_SELECTION,clampListSelection,listItemsChanged,normalizeComboOptions,parseListModel};
|
package/lib/esm/markup.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import"./_virtual/_rolldown/runtime.js";import{GTK_WIDGET_EXPAND as e,attributeOf as t,hostTagOf as n,isValueBasedBooleanAttr as r,propertyOf as i,widgetLengthStyle as a}from"./tags.js";function element(e,t,n,r,i,a){let o=` `.repeat(e),s=n.map(([e,t])=>t===null?e:`${e}=${r(t)}`),c=i.length===0,l=c?a?` />`:`></${t}>`:`>`,u=`${o}<${[t,...s].join(` `)}${l}`,d=u.length<=80||s.length===0?u:[`${o}<${t}`,...s.map(e=>`${o} ${e}`),`${o}${c?a?`/>`:`></${t}>`:`>`}`].join(`
|
|
2
2
|
`);return c?d:[d,...i,`${o}</${t}>`].join(`
|
|
3
|
-
`)}const htmlText=e=>e.replace(/&/g,`&`).replace(/</g,`<`),htmlQuote=e=>{let t=e.includes(`"`)&&!e.includes(`'`)?`'`:`"`;return`${t}${e.replace(/&/g,`&`).replace(t===`"`?/"/g:/'/g,t===`"`?`"`:`'`)}${t}`};function refuseBehaviour(e,t=`sharedTreeHtml`){let n=[e.bindings&&`bindings`,e.breakpoints&&`breakpoints`].filter(Boolean);if(n.length>0)throw Error(`${t} has no markup for \`${e.tag}\`'s ${n.join(` and `)} (ADR 0093); a bound property and a breakpoint are behaviour, and a renderer has to observe them.`)}function htmlElement(i,o){refuseBehaviour(i);let s=[];i.id!==void 0&&s.push([`id`,i.id]);let c=[],l=n(i.tag);for(let[n,o]of Object.entries(i.props??{})){let i=t(n);typeof o==`boolean`?r(l,i)?s.push([i,o?`true`:`false`]):o?s.push([i,null]):e.some(e=>e===i)&&s.push([i,`false`]):s.push([i,String(o)]);let u=a(i,o);u!==void 0&&u[1]!==null&&c.push(`${u[0]}: ${u[1]};`)}c.length>0&&s.push([`style`,c.join(` `)]),i.styleClasses!==void 0&&i.styleClasses.length>0&&s.push([`class`,i.styleClasses.join(` `)]);let u=i.extensions?.strings;u!==void 0&&s.push([`strings`,JSON.stringify(u.map(e=>e.value))]),i.slot!==void 0&&s.push([`slot`,i.slot]);let d=[...(i.extensions?.responses??[]).map(e=>{let t=[`id=${htmlQuote(e.id)}`];e.appearance!==void 0&&t.push(`appearance=${htmlQuote(e.appearance)}`),e.enabled===!1&&t.push(`enabled="false"`);let n=htmlText(e.label);return`${` `.repeat(o+1)}<adw-alert-response ${t.join(` `)}>${n}</adw-alert-response>`}),...(i.children??[]).map(e=>htmlElement(e,o+1))];return element(o,n(i.tag),s,htmlQuote,d,!1)}function sharedTreeHtml(e){return htmlElement(e,0)}function xmlNameOf(e){let t=/^(Adw|Gtk)([A-Z]\w*)$/.exec(e);if(t===null)throw Error(`sharedTreeNativeScriptXml: ${e} is not an Adw or Gtk class name`);return{prefix:t[1].toLowerCase(),member:t[2]}}const xmlQuote=e=>{let t=e.includes(`"`)?`'`:`"`;return`${t}${e.replace(/&/g,`&`).replace(/</g,`<`).replace(t===`"`?/"/g:/'/g,t===`"`?`"`:`'`)}${t}`};function prefixesOf(e,t){t.add(xmlNameOf(e.tag).prefix);for(let n of e.children??[])prefixesOf(n,t);return t}const o=[`columns`,`cssClasses`,`direction`,`modal`,`rows`,`visibility`];function xmlElement(e,t,n){refuseBehaviour(e,`sharedTreeNativeScriptXml`);let{prefix:r,member:a}=xmlNameOf(e.tag),s=`${r}:${a}`,c=[...n];e.id!==void 0&&c.push([`id`,e.id]);for(let[t,n]of Object.entries(e.props??{})){let r=i(t);if(o.includes(r))throw Error(`sharedTreeNativeScriptXml: \`${e.tag}\`'s '${t}' has no XML spelling — the attribute would reach NativeScript's own \`${r}\` (ADR 0112). Set it from Blueprint, a .ui file or \`set_${t.replace(/-/g,`_`)}()\`.`);c.push([r,String(n)])}e.styleClasses!==void 0&&e.styleClasses.length>0&&c.push([`styleClasses`,e.styleClasses.join(` `)]);let l=e.extensions?.strings;
|
|
3
|
+
`)}const htmlText=e=>e.replace(/&/g,`&`).replace(/</g,`<`),htmlQuote=e=>{let t=e.includes(`"`)&&!e.includes(`'`)?`'`:`"`;return`${t}${e.replace(/&/g,`&`).replace(t===`"`?/"/g:/'/g,t===`"`?`"`:`'`)}${t}`};function refuseBehaviour(e,t=`sharedTreeHtml`){let n=[e.bindings&&`bindings`,e.breakpoints&&`breakpoints`].filter(Boolean);if(n.length>0)throw Error(`${t} has no markup for \`${e.tag}\`'s ${n.join(` and `)} (ADR 0093); a bound property and a breakpoint are behaviour, and a renderer has to observe them.`)}function htmlElement(i,o){refuseBehaviour(i);let s=[];i.id!==void 0&&s.push([`id`,i.id]);let c=[],l=n(i.tag);for(let[n,o]of Object.entries(i.props??{})){let i=t(n);typeof o==`boolean`?r(l,i)?s.push([i,o?`true`:`false`]):o?s.push([i,null]):e.some(e=>e===i)&&s.push([i,`false`]):s.push([i,String(o)]);let u=a(i,o);u!==void 0&&u[1]!==null&&c.push(`${u[0]}: ${u[1]};`)}c.length>0&&s.push([`style`,c.join(` `)]),i.styleClasses!==void 0&&i.styleClasses.length>0&&s.push([`class`,i.styleClasses.join(` `)]);let u=i.extensions?.strings;u!==void 0&&s.push([`strings`,JSON.stringify(u.map(e=>e.value))]),i.slot!==void 0&&s.push([`slot`,i.slot]);let d=[...(i.extensions?.responses??[]).map(e=>{let t=[`id=${htmlQuote(e.id)}`];e.appearance!==void 0&&t.push(`appearance=${htmlQuote(e.appearance)}`),e.enabled===!1&&t.push(`enabled="false"`);let n=htmlText(e.label);return`${` `.repeat(o+1)}<adw-alert-response ${t.join(` `)}>${n}</adw-alert-response>`}),...(i.children??[]).map(e=>htmlElement(e,o+1))];return element(o,n(i.tag),s,htmlQuote,d,!1)}function sharedTreeHtml(e){return htmlElement(e,0)}function xmlNameOf(e){let t=/^(Adw|Gtk)([A-Z]\w*)$/.exec(e);if(t===null)throw Error(`sharedTreeNativeScriptXml: ${e} is not an Adw or Gtk class name`);return{prefix:t[1].toLowerCase(),member:t[2]}}const xmlQuote=e=>{let t=e.includes(`"`)?`'`:`"`;return`${t}${e.replace(/&/g,`&`).replace(/</g,`<`).replace(t===`"`?/"/g:/'/g,t===`"`?`"`:`'`)}${t}`};function isModelAttribute(e){return e.tag===`GtkStringList`&&e.slot===`model`&&e.id===void 0&&e.extensions?.strings!==void 0}function prefixesOf(e,t){t.add(xmlNameOf(e.tag).prefix);for(let n of e.children??[])isModelAttribute(n)||prefixesOf(n,t);return t}const o=[`columns`,`cssClasses`,`direction`,`modal`,`rows`,`visibility`];function xmlElement(e,t,n){refuseBehaviour(e,`sharedTreeNativeScriptXml`);let{prefix:r,member:a}=xmlNameOf(e.tag),s=`${r}:${a}`,c=[...n];e.id!==void 0&&c.push([`id`,e.id]);for(let[t,n]of Object.entries(e.props??{})){let r=i(t);if(o.includes(r))throw Error(`sharedTreeNativeScriptXml: \`${e.tag}\`'s '${t}' has no XML spelling — the attribute would reach NativeScript's own \`${r}\` (ADR 0112). Set it from Blueprint, a .ui file or \`set_${t.replace(/-/g,`_`)}()\`.`);c.push([r,String(n)])}e.styleClasses!==void 0&&e.styleClasses.length>0&&c.push([`styleClasses`,e.styleClasses.join(` `)]);let l=[];for(let t of e.children??[]){let e=t.extensions?.strings;if(e===void 0){l.push(t);continue}if(!isModelAttribute(t))throw Error(`sharedTreeNativeScriptXml: \`${t.tag}\`'s strings have no XML spelling — \`strings\` is construct-only (ADR 0122); only a \`GtkStringList\` without an id at a \`model\` slot is written, as the parent's \`model\` attribute.`);c.push([`model`,JSON.stringify(e.map(e=>e.value))])}if(e.extensions?.strings!==void 0)throw Error(`sharedTreeNativeScriptXml: \`${e.tag}\`'s strings have no XML spelling — \`strings\` is construct-only (ADR 0122), so a list is written as its parent's \`model\` attribute.`);let u=l.map(e=>{if(e.slot===void 0)return xmlElement(e,t+1,[]);let n=` `.repeat(t+1),r=`${s}.${e.slot}`;return[`${n}<${r}>`,xmlElement(e,t+2,[]),`${n}</${r}>`].join(`
|
|
4
4
|
`)});return element(t,s,c,xmlQuote,u,!0)}function sharedTreeNativeScriptXml(e){return xmlElement(e,0,[[`xmlns`,`http://schemas.nativescript.org/tns.xsd`],...[...prefixesOf(e,new Set)].sort().map(e=>[`xmlns:${e}`,`~/${e}`])])}export{o as NATIVESCRIPT_HOST_MEMBERS,sharedTreeHtml,sharedTreeNativeScriptXml};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BindingFlag, BlueprintTemplate, GObjectConstructor, GObjectInstance, GObjectNamespace } from '../gobject.js';
|
|
2
2
|
import type { ConstructHarness } from './constructs.js';
|
|
3
3
|
/** The rows of ADR 0096 § 2 that carry a claim; every one needs a vector. */
|
|
4
|
-
export declare const GOBJECT_ROWS: readonly ["registerClass", "field-form", "ParamSpec", "Signals", "instance API", "type_ensure", "vfunc", "binding engine", "template"];
|
|
4
|
+
export declare const GOBJECT_ROWS: readonly ["registerClass", "field-form", "ParamSpec", "Signals", "instance API", "type_ensure", "vfunc", "binding engine", "template", "interface", "object property"];
|
|
5
5
|
export type GObjectRow = (typeof GOBJECT_ROWS)[number];
|
|
6
6
|
/** A template, in both spellings: GtkBuilder XML for GJS, the projected tree for a port. */
|
|
7
7
|
export interface GObjectTemplateSource {
|
|
@@ -19,6 +19,24 @@ export interface GObjectSubject {
|
|
|
19
19
|
readonly Widget?: GObjectConstructor;
|
|
20
20
|
/** The value to put in `Template`. */
|
|
21
21
|
template(source: GObjectTemplateSource): unknown;
|
|
22
|
+
/**
|
|
23
|
+
* The `Gio.ListModel` token a vector puts in `Implements` — the real interface on an oracle,
|
|
24
|
+
* the core's token on the subset. Absent where no Gio is reachable, which skips those rows.
|
|
25
|
+
*/
|
|
26
|
+
readonly ListModel?: unknown;
|
|
27
|
+
/**
|
|
28
|
+
* Something carrying a READ-WRITE object-kind property called `model` whose value type is
|
|
29
|
+
* `Gio.ListModel`, and a value that property accepts.
|
|
30
|
+
*
|
|
31
|
+
* A REAL C object (`Gtk.DropDown` + `Gtk.StringList`) on the oracles, because a JS-registered
|
|
32
|
+
* class is not one for this row: GJS's auto-accessors store without a GValue conversion, so a
|
|
33
|
+
* JS class would accept every value the C property refuses and the refusal vectors would
|
|
34
|
+
* measure nothing. It needs a display, so an oracle offers it only where Gtk initialised.
|
|
35
|
+
*/
|
|
36
|
+
objectProperty?(): {
|
|
37
|
+
readonly instance: GObjectInstance;
|
|
38
|
+
readonly accepted: GObjectInstance;
|
|
39
|
+
};
|
|
22
40
|
/** The binding engine; `bind_property` on GJS, which is not exported by the ports. */
|
|
23
41
|
bind(source: GObjectInstance, sourceProperty: string, target: GObjectInstance, targetProperty: string, flags: readonly BindingFlag[]): void;
|
|
24
42
|
}
|
|
@@ -27,6 +45,10 @@ export interface GObjectVector {
|
|
|
27
45
|
readonly rule: string;
|
|
28
46
|
readonly holds: 'oracle' | 'subset';
|
|
29
47
|
readonly widget?: true;
|
|
48
|
+
/** Needs {@link GObjectSubject.ListModel}; skipped where the subject has no Gio. */
|
|
49
|
+
readonly iface?: true;
|
|
50
|
+
/** Needs {@link GObjectSubject.objectProperty}; skipped where the subject cannot build one. */
|
|
51
|
+
readonly objectProperty?: true;
|
|
30
52
|
readonly observe: (subject: GObjectSubject) => unknown;
|
|
31
53
|
readonly shows: unknown;
|
|
32
54
|
}
|
package/lib/types/engine.d.ts
CHANGED
|
@@ -20,6 +20,16 @@ export interface ForeignClassMeta {
|
|
|
20
20
|
readonly GTypeName: string;
|
|
21
21
|
readonly Properties?: Readonly<Record<string, ForeignProperty>>;
|
|
22
22
|
readonly Signals?: Readonly<Record<string, ForeignSignal>>;
|
|
23
|
+
/**
|
|
24
|
+
* REFUSED, by name, and declared here so the refusal is findable from the call site.
|
|
25
|
+
*
|
|
26
|
+
* `Implements` is the one meta key route D cannot carry (ADR 0122 § 4): a foreign-parent class
|
|
27
|
+
* is registered over a `@nativescript/core` base that is not a GObject, so there is no GType
|
|
28
|
+
* to add an interface to. A widget that needs `Gio.ListModel` holds one instead of being one —
|
|
29
|
+
* which is what `Adw.ComboRow:model` does. Ignoring the key would leave a class that says it
|
|
30
|
+
* implements the interface and does not, which is the silent outcome ADR 0105 refuses.
|
|
31
|
+
*/
|
|
32
|
+
readonly Implements?: readonly unknown[];
|
|
23
33
|
}
|
|
24
34
|
export interface GObjectEngine {
|
|
25
35
|
/** Names the engine in a diagnostic; `'pure-js'` for the default one. */
|
package/lib/types/gobject.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SharedTreeNode } from './conformance/shared-trees.js';
|
|
2
|
-
import type { GObjectEngine } from './engine.js';
|
|
2
|
+
import type { ForeignClassMeta, GObjectEngine } from './engine.js';
|
|
3
3
|
/** What `registerClass` accepts as `Template`: the projected tree of a `?template` import (ADR 0096 § 4). */
|
|
4
4
|
export type BlueprintTemplate = SharedTreeNode;
|
|
5
5
|
/** The subset asked for something it does not list. `feature` is the name that was refused. */
|
|
@@ -16,6 +16,44 @@ export declare const TYPE_BOOLEAN: GType;
|
|
|
16
16
|
export declare const TYPE_INT: GType;
|
|
17
17
|
export declare const TYPE_UINT: GType;
|
|
18
18
|
export declare const TYPE_DOUBLE: GType;
|
|
19
|
+
/**
|
|
20
|
+
* `G_TYPE_OBJECT` — the value type of an object-kind property that takes ANY GObject
|
|
21
|
+
* ({@link ParamSpec.object}). A property that takes one interface names the interface instead.
|
|
22
|
+
*/
|
|
23
|
+
export declare const TYPE_OBJECT: GType;
|
|
24
|
+
/** What an interface token carries; the token itself is {@link GInterface}. */
|
|
25
|
+
export interface GInterfaceInfo {
|
|
26
|
+
/** The GIR spelling, as it reads in a refusal and in `items_changed`'s arity message. */
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly gtype: GType;
|
|
29
|
+
/** The `vfunc_*` an implementor MUST define. */
|
|
30
|
+
readonly vfuncs: readonly string[];
|
|
31
|
+
/** Instance method → the `vfunc_*` it calls through. */
|
|
32
|
+
readonly methods: Readonly<Record<string, string>>;
|
|
33
|
+
/** Instance method → the signal it emits, with that signal's arity enforced. */
|
|
34
|
+
readonly emitters: Readonly<Record<string, string>>;
|
|
35
|
+
/** The signals the interface brings into the implementor's own signal table. */
|
|
36
|
+
readonly signals: Readonly<Record<string, readonly GType[]>>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* One interface of the subset — the value a class puts in `Implements`, and the right-hand side
|
|
40
|
+
* of `instanceof`.
|
|
41
|
+
*
|
|
42
|
+
* It is callable-shaped so `x instanceof ListModel` type-checks like any other `instanceof`;
|
|
43
|
+
* calling or constructing it throws, because an interface is not a class.
|
|
44
|
+
*/
|
|
45
|
+
export type GInterface = GInterfaceInfo & (abstract new (...args: never[]) => object);
|
|
46
|
+
/**
|
|
47
|
+
* `Gio.ListModel` — the portable list model's interface, and the whole of the subset's interface
|
|
48
|
+
* support (ADR 0122 § 2).
|
|
49
|
+
*
|
|
50
|
+
* `items-changed` is an ordinary declared signal of every implementor, so an engine that knows
|
|
51
|
+
* nothing about interfaces registers and emits it like any other; `items_changed()` is the
|
|
52
|
+
* emitter GIR gives it, down to the arity message real GJS produces for a short call.
|
|
53
|
+
*/
|
|
54
|
+
export declare const ListModel: GInterface;
|
|
55
|
+
/** Whether `instance`'s class chain declares `iface` — what `instanceof ListModel` answers. */
|
|
56
|
+
export declare function implementsInterface(instance: object, iface: GInterface): boolean;
|
|
19
57
|
/**
|
|
20
58
|
* `GObject.Value`, string-only (ADR 0096 Amendment 2). `init` takes `TYPE_STRING`; any other type
|
|
21
59
|
* is refused by name. Real GObject logs a CRITICAL for `get_*`/`set_*` on an uninitialised value and
|
|
@@ -38,7 +76,7 @@ export declare const ParamFlags: {
|
|
|
38
76
|
readonly CONSTRUCT: 4;
|
|
39
77
|
readonly CONSTRUCT_ONLY: 8;
|
|
40
78
|
};
|
|
41
|
-
export type ParamKind = 'boolean' | 'string' | 'int' | 'uint' | 'double';
|
|
79
|
+
export type ParamKind = 'boolean' | 'string' | 'int' | 'uint' | 'double' | 'object';
|
|
42
80
|
export declare class ParamSpec {
|
|
43
81
|
readonly kind: ParamKind;
|
|
44
82
|
readonly name: string;
|
|
@@ -47,6 +85,8 @@ export declare class ParamSpec {
|
|
|
47
85
|
readonly flags: number;
|
|
48
86
|
readonly minimum?: number;
|
|
49
87
|
readonly maximum?: number;
|
|
88
|
+
/** An object-kind property's value type: {@link TYPE_OBJECT} or the one interface it takes. */
|
|
89
|
+
readonly valueType?: GType | GInterface;
|
|
50
90
|
private readonly defaultValue;
|
|
51
91
|
private constructor();
|
|
52
92
|
static boolean(name: string, nick: string, blurb: string, flags: number, defaultValue: boolean): ParamSpec;
|
|
@@ -54,8 +94,30 @@ export declare class ParamSpec {
|
|
|
54
94
|
static int(name: string, nick: string, blurb: string, flags: number, minimum: number, maximum: number, defaultValue: number): ParamSpec;
|
|
55
95
|
static uint(name: string, nick: string, blurb: string, flags: number, minimum: number, maximum: number, defaultValue: number): ParamSpec;
|
|
56
96
|
static double(name: string, nick: string, blurb: string, flags: number, minimum: number, maximum: number, defaultValue: number): ParamSpec;
|
|
97
|
+
/**
|
|
98
|
+
* `GObject.ParamSpec.object` — a property that holds another GObject, or `null`.
|
|
99
|
+
*
|
|
100
|
+
* `valueType` is {@link TYPE_OBJECT} for "any GObject" or an interface token for a property
|
|
101
|
+
* that takes only implementors of it (`Adw.ComboRow:model`, which takes a `Gio.ListModel`).
|
|
102
|
+
* The default is ALWAYS `null`: `g_param_spec_object` has no other, and a write that does
|
|
103
|
+
* not satisfy `valueType` throws rather than being stored (ADR 0122 § 6).
|
|
104
|
+
*/
|
|
105
|
+
static object(name: string, nick: string, blurb: string, flags: number, valueType: GType | GInterface): ParamSpec;
|
|
57
106
|
get_default_value(): unknown;
|
|
58
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* The type check `g_object_set_property` does before a value reaches the store — the ONE place a
|
|
110
|
+
* declared property refuses a value, so every object-kind property refuses the same way.
|
|
111
|
+
*
|
|
112
|
+
* Only object-kind specs have anything to check: the other five kinds take what GJS's generated
|
|
113
|
+
* accessors take, which is anything (`_generateAccessors` stores without converting, and the
|
|
114
|
+
* subset's vectors hold it to that). The messages are the ones real GJS produces for a C object
|
|
115
|
+
* property, measured on `Gtk.DropDown:model` under GJS 1.88.01 / GTK 4.22.5 — a JS-registered
|
|
116
|
+
* class is NOT an oracle for them, because GJS's auto-accessors skip the GValue conversion that
|
|
117
|
+
* raises them. The pointer GJS prints in the "not a subclass" message is left out; nothing can
|
|
118
|
+
* match it.
|
|
119
|
+
*/
|
|
120
|
+
export declare function checkPropertyValue(spec: ParamSpec, value: unknown): void;
|
|
59
121
|
/** GJS's own symbols, so a class written in the field form (`static [GObject.properties] = …`) registers. */
|
|
60
122
|
export declare const META_SYMBOLS: {
|
|
61
123
|
readonly GTypeName: symbol;
|
|
@@ -111,8 +173,10 @@ export interface RegisteredClass {
|
|
|
111
173
|
readonly typeName: string;
|
|
112
174
|
readonly gtype: GType;
|
|
113
175
|
readonly properties: readonly ParamSpec[];
|
|
114
|
-
/** Signal name → its parameter types. */
|
|
176
|
+
/** Signal name → its parameter types; an implemented interface's are merged in. */
|
|
115
177
|
readonly signals: Readonly<Record<string, readonly GType[]>>;
|
|
178
|
+
/** The interfaces of `Implements`, each one of {@link ACCEPTED_INTERFACES}. */
|
|
179
|
+
readonly interfaces: readonly GInterface[];
|
|
116
180
|
readonly template?: BlueprintTemplate;
|
|
117
181
|
readonly internalChildren: readonly string[];
|
|
118
182
|
readonly cssName?: string;
|
|
@@ -130,6 +194,12 @@ export interface GObjectInstance {
|
|
|
130
194
|
disconnect(id: number): void;
|
|
131
195
|
emit(signal: string, ...args: unknown[]): void;
|
|
132
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* `Implements` on a foreign-parent class: refused by name, on EVERY engine (ADR 0122 § 4). It is
|
|
199
|
+
* the core's refusal rather than each engine's so that route D says the same thing on the engine
|
|
200
|
+
* that could never do it and on the one that merely does not.
|
|
201
|
+
*/
|
|
202
|
+
export declare function refuseForeignInterfaces(meta: ForeignClassMeta): void;
|
|
133
203
|
/**
|
|
134
204
|
* The default {@link GObjectEngine}: per-instance `Map`s behind a `WeakMap`, the only one the
|
|
135
205
|
* browser can have. Registration needs nothing of it — a `$gtype` here is a token, not a GType.
|
|
@@ -213,7 +283,7 @@ export declare const UNLOCKED_VFUNCS: Readonly<Record<string, readonly string[]>
|
|
|
213
283
|
* resolve through the registry like a registered class's own. The door is one that names the
|
|
214
284
|
* missing widget model: such a class has no event system to fall through to.
|
|
215
285
|
*/
|
|
216
|
-
export declare function registerBaseClass(klass: ClassLike, typeName: string, signals: Readonly<Record<string, readonly GType[]>>, properties?: readonly ParamSpec[], engine?: GObjectEngine): void;
|
|
286
|
+
export declare function registerBaseClass(klass: ClassLike, typeName: string, signals: Readonly<Record<string, readonly GType[]>>, properties?: readonly ParamSpec[], interfaces?: readonly GInterface[], engine?: GObjectEngine): void;
|
|
217
287
|
export type GObjectConstructor = new (params?: Record<string, unknown>) => GObjectInstance;
|
|
218
288
|
/** `GObject.Object` for a registered class with no widget model beneath it. */
|
|
219
289
|
export declare class GObjectObject {
|
|
@@ -241,6 +311,7 @@ export interface GObjectNamespace {
|
|
|
241
311
|
readonly TYPE_INT: GType;
|
|
242
312
|
readonly TYPE_UINT: GType;
|
|
243
313
|
readonly TYPE_DOUBLE: GType;
|
|
314
|
+
readonly TYPE_OBJECT: GType;
|
|
244
315
|
readonly GTypeName: symbol;
|
|
245
316
|
readonly GTypeFlags: symbol;
|
|
246
317
|
readonly interfaces: symbol;
|
|
@@ -1,72 +1,117 @@
|
|
|
1
|
+
import { GIR_TYPE, GObjectObject, type GType } from './gobject.js';
|
|
2
|
+
/** `gtk_string_list_find`'s "not found" — `GTK_INVALID_LIST_POSITION`, a `guint` of all ones. */
|
|
3
|
+
export declare const INVALID_LIST_POSITION = 4294967295;
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
* construct-time properties.
|
|
5
|
+
* `Gtk.StringObject` — one string, as the `GObject` a `GListModel` is allowed to hand out.
|
|
4
6
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
7
|
+
* It exists for the reason it exists in GTK: `g_list_model_get_item` returns a `GObject`, and a
|
|
8
|
+
* string is not one. Two objects holding the same string are NOT equal (measured), so identity
|
|
9
|
+
* here means "this entry of this list", never "this text".
|
|
10
|
+
*/
|
|
11
|
+
export declare class GtkStringObject extends GObjectObject {
|
|
12
|
+
static [GIR_TYPE]: string;
|
|
13
|
+
constructor(props?: Record<string, unknown> | null);
|
|
14
|
+
/** `gtk_string_object_new` — the only way to put a string in one. */
|
|
15
|
+
static new(string: string): GtkStringObject;
|
|
16
|
+
/**
|
|
17
|
+
* `Gtk.StringObject:string`.
|
|
18
|
+
*
|
|
19
|
+
* `null` on one built without a string: `new Gtk.StringObject().string` is `null`, measured,
|
|
20
|
+
* and the GIR's non-null typing describes only the items a list hands out.
|
|
21
|
+
*/
|
|
22
|
+
get string(): string | null;
|
|
23
|
+
set string(_value: string);
|
|
24
|
+
/** `gtk_string_object_get_string`. */
|
|
25
|
+
get_string(): string | null;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* What `new Gtk.StringList({ … })` takes.
|
|
29
|
+
*
|
|
30
|
+
* `strings` only, and CONSTRUCT-ONLY, as GTK declares it. The other two the type has —
|
|
31
|
+
* `item-type` and `n-items` — are `GListModel`'s read-only pair.
|
|
8
32
|
*/
|
|
9
33
|
export interface GtkStringListProps {
|
|
10
34
|
/** The strings the list starts with. */
|
|
11
|
-
strings?: readonly string[] | null;
|
|
35
|
+
strings?: readonly (string | null)[] | null;
|
|
12
36
|
}
|
|
13
37
|
/**
|
|
14
|
-
*
|
|
15
|
-
* JS array.
|
|
38
|
+
* `Gtk.StringList` — a `Gio.ListModel` of {@link GtkStringObject}s.
|
|
16
39
|
*
|
|
17
|
-
* `new GtkStringList()` is empty, as `gtk_string_list_new(NULL)` is, and the instance
|
|
18
|
-
*
|
|
40
|
+
* `new GtkStringList()` is empty, as `gtk_string_list_new(NULL)` is, and the instance is what
|
|
41
|
+
* every `model` property takes. It is NOT an array and nothing array-shaped reaches it.
|
|
19
42
|
*/
|
|
20
|
-
export declare class GtkStringList extends
|
|
21
|
-
|
|
22
|
-
|
|
43
|
+
export declare class GtkStringList extends GObjectObject {
|
|
44
|
+
static [GIR_TYPE]: string;
|
|
45
|
+
/** Installed by the core from {@link ListModel}; declared here for the type alone. */
|
|
46
|
+
readonly get_item: (position: number) => GtkStringObject | null;
|
|
47
|
+
readonly get_item_type: () => GType;
|
|
48
|
+
readonly get_n_items: () => number;
|
|
49
|
+
readonly items_changed: (position: number, removed: number, added: number) => void;
|
|
23
50
|
constructor(props?: GtkStringListProps | null);
|
|
24
51
|
/** `gtk_string_list_new`: a list holding `strings`, or an empty one for `null`. */
|
|
25
|
-
static new(strings: readonly string[] | null): GtkStringList;
|
|
52
|
+
static new(strings: readonly (string | null)[] | null): GtkStringList;
|
|
26
53
|
/**
|
|
27
|
-
* `Gtk.StringList:strings
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
54
|
+
* `Gtk.StringList:strings` as GTK leaves it after construction: unreadable, and unwritable
|
|
55
|
+
* without saying so.
|
|
56
|
+
*
|
|
57
|
+
* Both halves are measured, not chosen. The property is construct-only, so GJS installs a
|
|
58
|
+
* getter that answers `undefined` and a setter GObject refuses — with a CRITICAL on stderr
|
|
59
|
+
* and NO exception, leaving the list exactly as it was. Omitting the pair would turn
|
|
60
|
+
* `list.strings = […]` into a silent own-property write that looks like it worked.
|
|
32
61
|
*/
|
|
33
|
-
get strings():
|
|
34
|
-
set strings(
|
|
62
|
+
get strings(): undefined;
|
|
63
|
+
set strings(_value: readonly string[] | undefined);
|
|
64
|
+
/** `Gtk.StringList:item-type` — see the file header on why it is `GObject`. */
|
|
65
|
+
get item_type(): GType;
|
|
66
|
+
set item_type(_value: GType);
|
|
67
|
+
get itemType(): GType;
|
|
68
|
+
set itemType(_value: GType);
|
|
69
|
+
/** `Gtk.StringList:n-items` — the `ParamSpec`'s reader, and `get_n_items`'s answer. */
|
|
70
|
+
get n_items(): number;
|
|
71
|
+
set n_items(_value: number);
|
|
72
|
+
/** `vfunc_get_item_type` — what the interface's `get_item_type()` calls through to. */
|
|
73
|
+
vfunc_get_item_type(): GType;
|
|
74
|
+
/** `vfunc_get_n_items`. */
|
|
75
|
+
vfunc_get_n_items(): number;
|
|
76
|
+
/** `vfunc_get_item` — `null` past the end, as `g_list_model_get_item` returns `NULL`. */
|
|
77
|
+
vfunc_get_item(position: number): GtkStringObject | null;
|
|
35
78
|
/** `gtk_string_list_append`. */
|
|
36
79
|
append(string: string): void;
|
|
37
80
|
/**
|
|
38
81
|
* `gtk_string_list_take` — `append` without the copy.
|
|
39
82
|
*
|
|
40
|
-
* The copy is what the two differ by in C ("this variant … is convenient for
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* something `append` does not.
|
|
83
|
+
* The copy is what the two differ by in C ("this variant … is convenient for formatting
|
|
84
|
+
* strings"), and JS strings are immutable, so here the two are one function. It exists so
|
|
85
|
+
* code ported from GJS keeps working rather than to say something `append` does not.
|
|
44
86
|
*/
|
|
45
87
|
take(string: string): void;
|
|
46
88
|
/** `gtk_string_list_remove` — the string at `position`, which must be in range. */
|
|
47
89
|
remove(position: number): void;
|
|
48
90
|
/**
|
|
49
|
-
* `gtk_string_list_splice
|
|
91
|
+
* `gtk_string_list_splice(position, n_removals, additions)` — the C signature, all three
|
|
92
|
+
* arguments, additions as ONE array.
|
|
50
93
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* the
|
|
54
|
-
*
|
|
55
|
-
* strings instead of silently inserting one array as an element.
|
|
56
|
-
*
|
|
57
|
-
* `nRemovals` omitted is `Array.prototype.splice`'s "to the end", which is a different
|
|
58
|
-
* thing from passing `undefined` — so it is spelled as the count that reaches the end,
|
|
59
|
-
* which `splice` clamps the same way for a negative `position` as the one-argument form
|
|
60
|
-
* does.
|
|
61
|
-
*
|
|
62
|
-
* Flattened by hand, not `Array.prototype.flatMap` (ES2019): this source is also
|
|
63
|
-
* type-checked through `@gjsify/gtk-host`'s type-surface gate, whose `tsconfig`s
|
|
64
|
-
* pin `lib` to ES2017 for reasons of their own (`type-tests/{jsx,react}/tsconfig.json`)
|
|
65
|
-
* — a method this file alone would happily target ES2020 for is invisible there.
|
|
94
|
+
* Not `Array.prototype.splice`'s rest-argument form: this class is no longer an array, so the
|
|
95
|
+
* overload that used to serve both spellings would now be the subset inventing one. Each of
|
|
96
|
+
* the three refusals below is GJS's own, measured: a short call, a bare string where a strv
|
|
97
|
+
* belongs, and `undefined` in a slot that takes `null`.
|
|
66
98
|
*/
|
|
67
|
-
splice(position: number, nRemovals
|
|
99
|
+
splice(position: number, nRemovals: number, additions: readonly (string | null)[] | null): void;
|
|
68
100
|
/** `gtk_string_list_get_string` — `null` past the end, as C returns `NULL`. */
|
|
69
101
|
get_string(position: number): string | null;
|
|
70
|
-
/**
|
|
71
|
-
|
|
102
|
+
/**
|
|
103
|
+
* `gtk_string_list_find` — the POSITION of the first equal string, GTK's meaning of the name,
|
|
104
|
+
* not `Array.prototype.find`'s. {@link INVALID_LIST_POSITION} when there is none.
|
|
105
|
+
*/
|
|
106
|
+
find(string: string): number;
|
|
107
|
+
/**
|
|
108
|
+
* The one mutation, so the emission rule is written once: `items-changed` first, then
|
|
109
|
+
* `notify::n-items` and only when the count actually moved, and NEITHER when the splice
|
|
110
|
+
* removes nothing and adds nothing. All three measured; GTK's own
|
|
111
|
+
* `gtk_string_list_items_changed` is the same two lines.
|
|
112
|
+
*
|
|
113
|
+
* Out of range is a CRITICAL and a no-op, not an exception — `remove` past the end lands on
|
|
114
|
+
* the same assertion, because `gtk_string_list_remove` IS a splice in C.
|
|
115
|
+
*/
|
|
116
|
+
private spliceItems;
|
|
72
117
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export { ADW_ADJUSTMENT_DEFAULTS, adjustmentRange, clampAdjustmentValue, normali
|
|
|
46
46
|
export type { AdwAdjustment, AdwAdjustmentInput, SpinStateChange, SpinStateListener, SpinStateRangeListener, } from './adjustment.js';
|
|
47
47
|
export { GtkAdjustment } from './gtk-adjustment.js';
|
|
48
48
|
export type { GtkAdjustmentProps } from './gtk-adjustment.js';
|
|
49
|
-
export { GtkStringList } from './gtk-string-list.js';
|
|
49
|
+
export { GtkStringList, GtkStringObject, INVALID_LIST_POSITION } from './gtk-string-list.js';
|
|
50
50
|
export type { GtkStringListProps } from './gtk-string-list.js';
|
|
51
51
|
export { ComboState, ExpanderState, ToggleGroupState, keptToggles, toggleIndexOfName } from './rows.js';
|
|
52
52
|
export type { ComboItemsListener, ComboStateChange, ComboStateListener, ExpanderStateListener, ToggleGroupStateChange, ToggleGroupStateListener, } from './rows.js';
|
|
@@ -130,7 +130,7 @@ export { ADW_WRAP_BOX_DEFAULT_ALIGN, ADW_WRAP_BOX_DEFAULT_JUSTIFY, ADW_WRAP_BOX_
|
|
|
130
130
|
export type { AdwWrapBoxJustify, AdwWrapBoxOrientation, AdwWrapBoxPackDirection, AdwWrapPolicy, WrapBoxChildFlex, WrapBoxChildOrderOp, WrapBoxFlexInput, WrapBoxFlexStyle, WrapBoxLineLayout, } from './wrap-box.js';
|
|
131
131
|
export { ADW_SOURCE_6502_DIRECTIVES, ADW_SOURCE_6502_LINE_COMMENT, ADW_SOURCE_6502_OPCODES, ADW_SOURCE_6502_REGISTERS, ADW_SOURCE_6502_TOKEN_ROLES, ADW_SOURCE_HEX_STRIDE, ADW_SOURCE_PALETTE_DARK, ADW_SOURCE_PALETTE_LIGHT, ADW_SOURCE_SYNTAX_ROLES, classifyAsm6502Word, formatHexAddress, formatLineNumber, stripSourceWhitespace, tokenizeAsm6502, } from './source.js';
|
|
132
132
|
export type { AdwSourcePalette, AdwSourceSyntaxRole, AdwSourceTokenClass, AdwSourceTokenStream } from './source.js';
|
|
133
|
-
export { GObjectObject, META_SYMBOLS, ParamFlags, ParamSpec, Value, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_INT, TYPE_STRING, TYPE_UINT, UnsupportedGObjectError, bindProperties, connectInstance, constructRegistered, createClosure, createGObject, disconnectInstance, emitInstance, gobjectEngineName, notifyInstance, PURE_JS_ENGINE, registeredClassOf, registerBaseClass, STOP_EMISSION, usePureJsGObjectEngine, type StoppableEmitter, UNLOCKED_VFUNCS, GIR_TYPE, } from './gobject.js';
|
|
133
|
+
export { GObjectObject, ListModel, META_SYMBOLS, ParamFlags, ParamSpec, Value, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_INT, TYPE_OBJECT, TYPE_STRING, TYPE_UINT, UnsupportedGObjectError, bindProperties, connectInstance, constructRegistered, createClosure, createGObject, disconnectInstance, emitInstance, gobjectEngineName, notifyInstance, PURE_JS_ENGINE, refuseForeignInterfaces, registeredClassOf, registerBaseClass, STOP_EMISSION, usePureJsGObjectEngine, type StoppableEmitter, UNLOCKED_VFUNCS, GIR_TYPE, } from './gobject.js';
|
|
134
134
|
export { ApplicationFlags, ApplicationInhibitFlags, GioApplicationBase, GtkApplicationBase, withGtkApplication, defineWindowApplicationMembers, dispatchAccelerator, isValidApplicationId, } from './application.js';
|
|
135
135
|
export { CloseRequestState, HandledAccumulator, WindowMemberState, stepDefaultSize } from './window-members.js';
|
|
136
136
|
export type { CloseOutcome, CloseRequestSteps, DefaultSizeProperty, DefaultSizeStep, WindowCommon, WindowMemberInit, WindowMemberProperty, } from './window-members.js';
|
|
@@ -139,7 +139,7 @@ export type { Accelerator } from './accelerators.js';
|
|
|
139
139
|
export type { ApplicationHost, GtkApplicationMembers, GtkApplicationConstructor } from './application.js';
|
|
140
140
|
export { ActionRegistry, SimpleAction, actionRegistryOf, activateWidgetAction, applicationOfWindow, findActionGroup, insertActionGroup, installActionMap, linkWindow, SimpleActionGroup, } from './gio-actions.js';
|
|
141
141
|
export type { ActionActivateHandler, ActionGroupLike, ActionLike, SimpleActionProps } from './gio-actions.js';
|
|
142
|
-
export type { Binding, BindingFlag, BlueprintTemplate, BuiltTemplate, ClassLike, ClassMeta, GObjectConstructor, GObjectDoor, GObjectInstance, GObjectNamespace, GType, ParamKind, RegisterClass, RegisteredClass, SignalHandler, SignalMeta, TemplateScope, } from './gobject.js';
|
|
142
|
+
export type { Binding, BindingFlag, BlueprintTemplate, BuiltTemplate, ClassLike, ClassMeta, GInterface, GObjectConstructor, GObjectDoor, GObjectInstance, GObjectNamespace, GType, ParamKind, RegisterClass, RegisteredClass, SignalHandler, SignalMeta, TemplateScope, } from './gobject.js';
|
|
143
143
|
export { engineForTarget, registerGObjectEngine, registeredEngine, resetRegisteredEngine } from './engine.js';
|
|
144
144
|
export type { EngineTarget, ForeignClassMeta, ForeignProperty, ForeignPropertyKind, ForeignSignal, GObjectEngine, } from './engine.js';
|
|
145
145
|
export { MAXUINT32, buildFilenamev, getCurrentDir, getSystemDataDirs } from './glib-paths.js';
|
package/lib/types/list.d.ts
CHANGED
|
@@ -16,8 +16,31 @@ export type AdwComboOptionInput = string | {
|
|
|
16
16
|
};
|
|
17
17
|
/** A normalised portable list model — what a `model` property holds on every surface. */
|
|
18
18
|
export type AdwListModel = ReadonlyArray<AdwComboOption>;
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* The two methods this module needs off a REAL model — `g_list_model_get_n_items` and
|
|
21
|
+
* `g_list_model_get_item`, nothing else.
|
|
22
|
+
*
|
|
23
|
+
* Duck-typed on purpose. This module is pure data and must not import `Gtk.StringList`, which
|
|
24
|
+
* is a GObject and would drag the whole object system into every surface that only wants to
|
|
25
|
+
* normalise items. `Gio.ListModel` IS these two methods, so matching them is matching the
|
|
26
|
+
* interface rather than guessing at a class.
|
|
27
|
+
*/
|
|
28
|
+
export interface AdwListModelSource {
|
|
29
|
+
/** `g_list_model_get_n_items`. */
|
|
30
|
+
get_n_items(): number;
|
|
31
|
+
/** `g_list_model_get_item` — `null` past the end. */
|
|
32
|
+
get_item(position: number): unknown;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* What a `model` property ACCEPTS: the widened form of {@link AdwListModel}, plus a real
|
|
36
|
+
* {@link AdwListModelSource}.
|
|
37
|
+
*
|
|
38
|
+
* The model arm is new in ADR 0122, which made `Gtk.StringList` a `Gio.ListModel` instead of
|
|
39
|
+
* an `Array` subclass — the one value that used to satisfy BOTH arms at once. It is not a
|
|
40
|
+
* permanent widening: ADR 0122 § 6 narrows `Adw.ComboRow:model` to `Gio.ListModel` alone, and
|
|
41
|
+
* the array arm goes with the widget that still reads a markup attribute.
|
|
42
|
+
*/
|
|
43
|
+
export type AdwListModelInput = ReadonlyArray<AdwComboOptionInput> | AdwListModelSource;
|
|
21
44
|
/**
|
|
22
45
|
* Raw authored items → the stable `{ value, label }` descriptors every list surface
|
|
23
46
|
* works with.
|
|
@@ -28,6 +51,11 @@ export type AdwListModelInput = ReadonlyArray<AdwComboOptionInput>;
|
|
|
28
51
|
* by `undefined`. ONE home for the rule, so no two list widgets can accept two different
|
|
29
52
|
* item vocabularies.
|
|
30
53
|
*
|
|
54
|
+
* A REAL `Gio.ListModel` is read through {@link AdwListModelSource}, and its items through the
|
|
55
|
+
* same three rules as any other entry: a `Gtk.StringObject` arrives as the string it holds,
|
|
56
|
+
* anything else falls to the descriptor rule it already matches or does not. There is no
|
|
57
|
+
* fourth vocabulary for items that came out of a model rather than out of an array.
|
|
58
|
+
*
|
|
31
59
|
* TOTAL — it throws for no input. The doors this reaches are a property assignment and a
|
|
32
60
|
* markup attribute, and an author's typo must not take the widget down.
|
|
33
61
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/adwaita-core",
|
|
3
|
-
"version": "0.64.12-next.
|
|
3
|
+
"version": "0.64.12-next.281",
|
|
4
4
|
"description": "Headless Adwaita widget behavior (breakpoint condition grammar + apply/unapply state machine, color-scheme observable, avatar derivation) shared by the web and NativeScript Adwaita renderers — pure TS, no platform imports",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"headless"
|
|
68
68
|
],
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@gjsify/cli": "0.64.12-next.
|
|
70
|
+
"@gjsify/cli": "0.64.12-next.281",
|
|
71
71
|
"@gjsify/node-gi": "file:../../../packages/node-gi/node-gi",
|
|
72
|
-
"@gjsify/unit": "0.64.12-next.
|
|
72
|
+
"@gjsify/unit": "0.64.12-next.281",
|
|
73
73
|
"@types/node": "^25.9.2",
|
|
74
74
|
"typescript": "^6.0.3"
|
|
75
75
|
},
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"url": "https://github.com/gjsify/gjsify/issues"
|
|
94
94
|
},
|
|
95
95
|
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/web/adwaita-core#readme",
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "c4d2e266c0d9849860b9828c14ebfe37b6d493b8"
|
|
97
97
|
}
|