@gjsify/adwaita-core 0.30.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/about-dialog.js +3 -0
- package/lib/esm/action-row.js +1 -0
- package/lib/esm/avatar.js +1 -0
- package/lib/esm/banner.js +1 -0
- package/lib/esm/button-content.js +1 -0
- package/lib/esm/carousel.js +1 -0
- package/lib/esm/checks.js +1 -0
- package/lib/esm/chrome.js +1 -0
- package/lib/esm/conformance/about-dialog.js +6 -0
- package/lib/esm/conformance/action-row.js +1 -0
- package/lib/esm/conformance/avatar.js +1 -0
- package/lib/esm/conformance/banner.js +1 -0
- package/lib/esm/conformance/button-content.js +1 -0
- package/lib/esm/conformance/carousel.js +1 -0
- package/lib/esm/conformance/checks.js +1 -0
- package/lib/esm/conformance/chrome.js +1 -0
- package/lib/esm/conformance/data-grid.js +1 -0
- package/lib/esm/conformance/dialog.js +1 -0
- package/lib/esm/conformance/entry-row.js +1 -0
- package/lib/esm/conformance/index.js +1 -0
- package/lib/esm/conformance/navigation-view.js +1 -0
- package/lib/esm/conformance/popover.js +1 -0
- package/lib/esm/conformance/preferences.js +1 -0
- package/lib/esm/conformance/rows.js +1 -0
- package/lib/esm/conformance/sidebar.js +1 -0
- package/lib/esm/conformance/split-button.js +1 -0
- package/lib/esm/conformance/split-view.js +1 -0
- package/lib/esm/conformance/tab-view.js +1 -0
- package/lib/esm/conformance/view-stack.js +1 -0
- package/lib/esm/conformance/view-switcher.js +1 -0
- package/lib/esm/conformance/wrap-box.js +1 -0
- package/lib/esm/data-grid.js +1 -0
- package/lib/esm/dialog.js +1 -1
- package/lib/esm/entry-row.js +1 -0
- package/lib/esm/glib.js +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/navigation-view.js +1 -0
- package/lib/esm/popover.js +1 -0
- package/lib/esm/preferences.js +1 -0
- package/lib/esm/rows.js +1 -1
- package/lib/esm/sidebar.js +1 -0
- package/lib/esm/split-button.js +1 -0
- package/lib/esm/split-view.js +1 -0
- package/lib/esm/tab-view.js +1 -0
- package/lib/esm/view-stack.js +1 -0
- package/lib/esm/view-switcher.js +1 -0
- package/lib/types/about-dialog.d.ts +391 -0
- package/lib/types/about-dialog.spec.d.ts +2 -0
- package/lib/types/action-row.d.ts +270 -0
- package/lib/types/action-row.spec.d.ts +2 -0
- package/lib/types/avatar.d.ts +112 -0
- package/lib/types/avatar.spec.d.ts +2 -0
- package/lib/types/banner.d.ts +104 -0
- package/lib/types/banner.spec.d.ts +2 -0
- package/lib/types/button-content.d.ts +141 -0
- package/lib/types/button-content.spec.d.ts +2 -0
- package/lib/types/carousel.d.ts +535 -0
- package/lib/types/carousel.spec.d.ts +2 -0
- package/lib/types/checks.d.ts +63 -0
- package/lib/types/checks.spec.d.ts +2 -0
- package/lib/types/chrome.d.ts +355 -0
- package/lib/types/chrome.spec.d.ts +2 -0
- package/lib/types/conformance/about-dialog.d.ts +300 -0
- package/lib/types/conformance/action-row.d.ts +186 -0
- package/lib/types/conformance/avatar.d.ts +61 -0
- package/lib/types/conformance/banner.d.ts +91 -0
- package/lib/types/conformance/button-content.d.ts +110 -0
- package/lib/types/conformance/carousel.d.ts +284 -0
- package/lib/types/conformance/checks.d.ts +29 -0
- package/lib/types/conformance/chrome.d.ts +195 -0
- package/lib/types/conformance/data-grid.d.ts +134 -0
- package/lib/types/conformance/dialog.d.ts +97 -0
- package/lib/types/conformance/entry-row.d.ts +185 -0
- package/lib/types/conformance/index.d.ts +44 -0
- package/lib/types/conformance/navigation-view.d.ts +235 -0
- package/lib/types/conformance/popover.d.ts +56 -0
- package/lib/types/conformance/preferences.d.ts +170 -0
- package/lib/types/conformance/rows.d.ts +51 -0
- package/lib/types/conformance/sidebar.d.ts +182 -0
- package/lib/types/conformance/split-button.d.ts +189 -0
- package/lib/types/conformance/split-view.d.ts +290 -0
- package/lib/types/conformance/tab-view.d.ts +441 -0
- package/lib/types/conformance/view-stack.d.ts +121 -0
- package/lib/types/conformance/view-switcher.d.ts +443 -0
- package/lib/types/conformance/wrap-box.d.ts +134 -0
- package/lib/types/data-grid.d.ts +140 -0
- package/lib/types/data-grid.spec.d.ts +2 -0
- package/lib/types/dialog.d.ts +144 -0
- package/lib/types/entry-row.d.ts +308 -0
- package/lib/types/entry-row.spec.d.ts +2 -0
- package/lib/types/glib.d.ts +49 -0
- package/lib/types/index.d.ts +43 -4
- package/lib/types/navigation-view.d.ts +343 -0
- package/lib/types/navigation-view.spec.d.ts +2 -0
- package/lib/types/popover.d.ts +155 -0
- package/lib/types/popover.spec.d.ts +2 -0
- package/lib/types/preferences.d.ts +349 -0
- package/lib/types/preferences.spec.d.ts +2 -0
- package/lib/types/rows.d.ts +49 -2
- package/lib/types/sidebar.d.ts +308 -0
- package/lib/types/sidebar.spec.d.ts +2 -0
- package/lib/types/split-button.d.ts +316 -0
- package/lib/types/split-button.spec.d.ts +2 -0
- package/lib/types/split-view.d.ts +714 -0
- package/lib/types/split-view.spec.d.ts +2 -0
- package/lib/types/tab-view.d.ts +616 -0
- package/lib/types/tab-view.spec.d.ts +2 -0
- package/lib/types/view-stack.d.ts +266 -0
- package/lib/types/view-stack.spec.d.ts +2 -0
- package/lib/types/view-switcher.d.ts +521 -0
- package/lib/types/view-switcher.spec.d.ts +2 -0
- package/package.json +8 -4
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
/** One `LicenseInfo` row — the struct at adw-about-dialog.c:206-210. */
|
|
2
|
+
export interface AdwLicenseInfo {
|
|
3
|
+
/** The translatable licence name, `null` for `unknown` and `custom`. */
|
|
4
|
+
name: string | null;
|
|
5
|
+
/** The canonical licence URL, hardcoded (never translated). */
|
|
6
|
+
url: string | null;
|
|
7
|
+
/** The SPDX identifier AppStream metadata is matched against. */
|
|
8
|
+
spdxId: string | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* `GtkLicense` as the INDEX into {@link ADW_LICENSES}, which is what the C
|
|
12
|
+
* actually uses it as (`gtk_license_info[license_type]`, :649-650).
|
|
13
|
+
*
|
|
14
|
+
* The order and the row contents come from the vendored table
|
|
15
|
+
* (adw-about-dialog.c:215-252) plus its static assertion that the last index is
|
|
16
|
+
* `GTK_LICENSE_0BSD` (:256). The member SPELLINGS come from the `Gtk.License`
|
|
17
|
+
* enum in `@girs/gtk-4.0`, generated from the GTK GIR — `refs/gtk` is not
|
|
18
|
+
* vendored in this repo, so there is no GTK C file to cite for them.
|
|
19
|
+
*/
|
|
20
|
+
export declare const GTK_LICENSE: {
|
|
21
|
+
readonly UNKNOWN: 0;
|
|
22
|
+
readonly CUSTOM: 1;
|
|
23
|
+
readonly GPL_2_0: 2;
|
|
24
|
+
readonly GPL_3_0: 3;
|
|
25
|
+
readonly LGPL_2_1: 4;
|
|
26
|
+
readonly LGPL_3_0: 5;
|
|
27
|
+
readonly BSD: 6;
|
|
28
|
+
readonly MIT_X11: 7;
|
|
29
|
+
readonly ARTISTIC: 8;
|
|
30
|
+
readonly GPL_2_0_ONLY: 9;
|
|
31
|
+
readonly GPL_3_0_ONLY: 10;
|
|
32
|
+
readonly LGPL_2_1_ONLY: 11;
|
|
33
|
+
readonly LGPL_3_0_ONLY: 12;
|
|
34
|
+
readonly AGPL_3_0: 13;
|
|
35
|
+
readonly AGPL_3_0_ONLY: 14;
|
|
36
|
+
readonly BSD_3: 15;
|
|
37
|
+
readonly APACHE_2_0: 16;
|
|
38
|
+
readonly MPL_2_0: 17;
|
|
39
|
+
readonly '0BSD': 18;
|
|
40
|
+
};
|
|
41
|
+
/** A `GtkLicense` value, i.e. a valid index into {@link ADW_LICENSES}. */
|
|
42
|
+
export type AdwLicenseType = (typeof GTK_LICENSE)[keyof typeof GTK_LICENSE];
|
|
43
|
+
/**
|
|
44
|
+
* The 19 `gtk_license_info` rows in enum order (adw-about-dialog.c:215-252).
|
|
45
|
+
*
|
|
46
|
+
* Indices 0 and 1 are all-`null` on purpose: `unknown` shows nothing and
|
|
47
|
+
* `custom` takes its text from the `license` property, so neither has a name,
|
|
48
|
+
* a URL or an SPDX id to match. A renderer that skipped them would shift every
|
|
49
|
+
* later licence by two.
|
|
50
|
+
*/
|
|
51
|
+
export declare const ADW_LICENSES: ReadonlyArray<AdwLicenseInfo>;
|
|
52
|
+
/** One deprecated-SPDX alias — the `LicenseAlias` struct at :258-261. */
|
|
53
|
+
export interface AdwLicenseAlias {
|
|
54
|
+
/** The retired SPDX id apps still ship in their AppStream metadata. */
|
|
55
|
+
spdxId: string;
|
|
56
|
+
/** The `GtkLicense` it resolves to. */
|
|
57
|
+
licenseType: AdwLicenseType;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The two deprecated SPDX ids (:264-267).
|
|
61
|
+
*
|
|
62
|
+
* Both map to the `-only` variant, not the `-or-later` one — the bare
|
|
63
|
+
* `GPL-2.0` predates the split and meant "version 2", so resolving it to
|
|
64
|
+
* `GPL-2.0-or-later` would silently widen an app's stated licence.
|
|
65
|
+
*/
|
|
66
|
+
export declare const ADW_LICENSE_ALIASES: ReadonlyArray<AdwLicenseAlias>;
|
|
67
|
+
/**
|
|
68
|
+
* The licence preamble (:648), with `%s` for the URL and `%s` for the name, in
|
|
69
|
+
* that order.
|
|
70
|
+
*
|
|
71
|
+
* Translatable as a whole; the two `%s` are filled with a HARDCODED url and a
|
|
72
|
+
* SEPARATELY translated name (:645-647). It contains Pango markup, which the
|
|
73
|
+
* Legal page renders as such — a renderer that escapes it shows the user raw
|
|
74
|
+
* `<a href=…>`.
|
|
75
|
+
*/
|
|
76
|
+
export declare const ADW_LICENSE_WARRANTY_TEMPLATE = "This application comes with absolutely no warranty. See the <a href=\"%s\">%s</a> for details.";
|
|
77
|
+
/**
|
|
78
|
+
* Whether `value` is inside the `gtk_license_info` bounds — the setter's
|
|
79
|
+
* `g_return_if_fail` (:3401-3402).
|
|
80
|
+
*
|
|
81
|
+
* The integer test has no counterpart in the C, where the parameter is already
|
|
82
|
+
* a `GtkLicense`; here the value arrives from an attribute or JSON, and a
|
|
83
|
+
* fractional index would read `undefined` out of the table instead of being
|
|
84
|
+
* rejected.
|
|
85
|
+
*/
|
|
86
|
+
export declare function isLicenseType(value: number): value is AdwLicenseType;
|
|
87
|
+
/**
|
|
88
|
+
* The `GtkLicense` an AppStream `project_license` SPDX id resolves to, or
|
|
89
|
+
* `null` when nothing matches — the two lookup loops at :1226-1239.
|
|
90
|
+
*
|
|
91
|
+
* The exact-match loop runs over the WHOLE table including indices 0 and 1,
|
|
92
|
+
* whose `spdxId` is `null` and therefore never equal to a real id. The alias
|
|
93
|
+
* loop runs afterwards and can override the first, which only matters for ids
|
|
94
|
+
* that are in both lists — today none are.
|
|
95
|
+
*
|
|
96
|
+
* The caller's remaining step is NOT folded in here because it is stateful:
|
|
97
|
+
* `populate_from_appdata` falls back to `custom` only when the dialog's licence
|
|
98
|
+
* type is still `unknown` after both loops (:1241-1242), which depends on what
|
|
99
|
+
* was set before, not on the id.
|
|
100
|
+
*/
|
|
101
|
+
export declare function licenseTypeForSpdxId(spdxId: string): AdwLicenseType | null;
|
|
102
|
+
/**
|
|
103
|
+
* `get_license_text` (:635-651) — the text the Legal page shows for a licence.
|
|
104
|
+
*
|
|
105
|
+
* Three cases, and the difference between the first two is what a renderer gets
|
|
106
|
+
* wrong: `unknown` returns NULL, meaning the Legal page shows NO licence at all,
|
|
107
|
+
* while `custom` returns the raw `license` string, which may itself be empty.
|
|
108
|
+
* Both look like "nothing" on screen; only the second still contributes a legal
|
|
109
|
+
* section when a copyright is set.
|
|
110
|
+
*/
|
|
111
|
+
export declare function licenseText(licenseType: AdwLicenseType, license: string): string | null;
|
|
112
|
+
/** The `license` / `license-type` pair, as a renderer holds it. */
|
|
113
|
+
export interface AdwLicenseState {
|
|
114
|
+
/** `license` — the custom licence text. Empty string, never null (:2044). */
|
|
115
|
+
license: string;
|
|
116
|
+
/** `license-type` — the `GtkLicense`. */
|
|
117
|
+
licenseType: AdwLicenseType;
|
|
118
|
+
}
|
|
119
|
+
/** The `GParamSpec` defaults: `""` (:2044) and `unknown` (:2032). */
|
|
120
|
+
export declare const ADW_LICENSE_DEFAULTS: Readonly<AdwLicenseState>;
|
|
121
|
+
/** The GObject property names the two licence setters notify. */
|
|
122
|
+
export type AdwLicenseNotify = 'license' | 'license-type';
|
|
123
|
+
/** What one licence setter did: the new state, and what it notified. */
|
|
124
|
+
export interface AdwLicenseTransition {
|
|
125
|
+
/** The state after the call — the same object contents when nothing changed. */
|
|
126
|
+
state: AdwLicenseState;
|
|
127
|
+
/** Whether the setter got past its early-out. */
|
|
128
|
+
changed: boolean;
|
|
129
|
+
/** The `g_object_notify_by_pspec` calls, in emission order. */
|
|
130
|
+
notify: ReadonlyArray<AdwLicenseNotify>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* `adw_about_dialog_set_license_type` (:3396-3416).
|
|
134
|
+
*
|
|
135
|
+
* Setting any type other than `custom` CLEARS the custom licence text to `""`
|
|
136
|
+
* (:3407-3408) — the two properties are one state, not two. Both are notified
|
|
137
|
+
* (:3414-3415) whether or not the string actually moved.
|
|
138
|
+
*
|
|
139
|
+
* An out-of-range value is rejected outright (`g_return_if_fail`, :3401-3402),
|
|
140
|
+
* which is a no-op, not a clamp: the state keeps whatever it had.
|
|
141
|
+
*/
|
|
142
|
+
export declare function setLicenseType(state: AdwLicenseState, licenseType: number): AdwLicenseTransition;
|
|
143
|
+
/**
|
|
144
|
+
* `adw_about_dialog_set_license` (:3459-3480).
|
|
145
|
+
*
|
|
146
|
+
* Setting a licence text forces the type to `custom` (:3472) — but only after
|
|
147
|
+
* the early-out on an UNCHANGED string (:3466-3467), which makes the pair
|
|
148
|
+
* asymmetric in a way that is easy to miss: with the text already `""`, setting
|
|
149
|
+
* `""` again does NOT switch the type to `custom`, so an app trying to clear a
|
|
150
|
+
* `GPL-3.0` licence by assigning the empty string keeps the GPL text on screen.
|
|
151
|
+
*/
|
|
152
|
+
export declare function setLicense(state: AdwLicenseState, license: string): AdwLicenseTransition;
|
|
153
|
+
/** One parsed credit line — `parse_person`'s three out-parameters, plus the URI. */
|
|
154
|
+
export interface AdwCreditPerson {
|
|
155
|
+
/** The displayed row title: everything before the link, `g_strstrip`ped. */
|
|
156
|
+
name: string;
|
|
157
|
+
/**
|
|
158
|
+
* The link as it appears in the source string, or `null` when the line has
|
|
159
|
+
* none.
|
|
160
|
+
*
|
|
161
|
+
* `''` and `null` are DIFFERENT states: the C tests `if (link)` on a
|
|
162
|
+
* pointer, so the empty string produced by `"Ada <>"` is still a link and
|
|
163
|
+
* still makes the row an `AdwLinkRow`.
|
|
164
|
+
*/
|
|
165
|
+
link: string | null;
|
|
166
|
+
/** `*q1 == '<'` (:521) — whether the link came out of angle brackets. */
|
|
167
|
+
isEmail: boolean;
|
|
168
|
+
/** `add_credits_section`'s final URI (:571-580): `mailto:` + link, or the link. */
|
|
169
|
+
uri: string | null;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* `parse_person` (:490-534) — split one credit line into a name and a link.
|
|
173
|
+
*
|
|
174
|
+
* Every index here is compared with `>= 0`, never for truthiness: a `<` or a
|
|
175
|
+
* `http://` at position 0 is a valid non-NULL pointer in the C and a falsy `0`
|
|
176
|
+
* in JS, so `"<ada@x.org>"` and `"https://x.org"` — a person with no name — are
|
|
177
|
+
* exactly where a truthiness port silently produces the unparsed line instead.
|
|
178
|
+
*/
|
|
179
|
+
export declare function parseCreditPerson(person: string): AdwCreditPerson;
|
|
180
|
+
/**
|
|
181
|
+
* The two untranslated `translator-credits` sentinels (:604-605).
|
|
182
|
+
*
|
|
183
|
+
* Apps mark the literal string `"translator-credits"` as translatable and each
|
|
184
|
+
* locale replaces it with its own translator list; in an untranslated locale it
|
|
185
|
+
* comes back unchanged, and showing THAT to the user is the bug this guards.
|
|
186
|
+
* The underscore spelling is the older gettext convention and is still checked.
|
|
187
|
+
*/
|
|
188
|
+
export declare const ADW_TRANSLATOR_CREDITS_SENTINELS: ReadonlyArray<string>;
|
|
189
|
+
/**
|
|
190
|
+
* The translator names for a `translator-credits` value — `g_strsplit (…, "\n",
|
|
191
|
+
* 0)` past the sentinel guard (:603-608).
|
|
192
|
+
*
|
|
193
|
+
* `g_strsplit` returns an EMPTY vector for the empty string, where JS
|
|
194
|
+
* `''.split('\n')` returns `['']`. The difference is visible: the C shows no
|
|
195
|
+
* "Translated by" section at all, a `split()`-based port shows the section with
|
|
196
|
+
* one blank row in it. Blank INTERIOR lines are kept, because `g_strsplit` keeps
|
|
197
|
+
* them and `add_credits_section` only skips NULL pointers, not empty strings
|
|
198
|
+
* (:557-558).
|
|
199
|
+
*/
|
|
200
|
+
export declare function translatorCreditsPeople(value: string | null | undefined): string[];
|
|
201
|
+
/** The five built-in credit section titles, in `update_credits` order (:610-619). */
|
|
202
|
+
export declare const ADW_CREDITS_SECTION_TITLES: {
|
|
203
|
+
readonly developers: "Code by";
|
|
204
|
+
readonly designers: "Design by";
|
|
205
|
+
readonly artists: "Artwork by";
|
|
206
|
+
readonly documenters: "Documentation by";
|
|
207
|
+
readonly translators: "Translated by";
|
|
208
|
+
};
|
|
209
|
+
/** An app-provided extra section (`add_credit_section`, :3239-3259). */
|
|
210
|
+
export interface AdwCreditsSectionInput {
|
|
211
|
+
/** The section heading. Nullable in the C signature (:3240). */
|
|
212
|
+
title: string | null;
|
|
213
|
+
/** The raw credit lines, each in `parse_person` syntax. */
|
|
214
|
+
people: ReadonlyArray<string>;
|
|
215
|
+
}
|
|
216
|
+
/** One assembled credits group. */
|
|
217
|
+
export interface AdwCreditsSection {
|
|
218
|
+
/** The `AdwPreferencesGroup` title (:549). */
|
|
219
|
+
title: string | null;
|
|
220
|
+
/** The parsed rows, in source order. */
|
|
221
|
+
people: ReadonlyArray<AdwCreditPerson>;
|
|
222
|
+
}
|
|
223
|
+
/** The credit inputs `update_credits` reads (:593-627). */
|
|
224
|
+
export interface AdwCreditsInput {
|
|
225
|
+
developers?: ReadonlyArray<string>;
|
|
226
|
+
designers?: ReadonlyArray<string>;
|
|
227
|
+
artists?: ReadonlyArray<string>;
|
|
228
|
+
documenters?: ReadonlyArray<string>;
|
|
229
|
+
/** The raw `translator-credits` string, sentinels and all. */
|
|
230
|
+
translatorCredits?: string | null;
|
|
231
|
+
/** Extra sections, in `add_credit_section` call order (:3252). */
|
|
232
|
+
creditSections?: ReadonlyArray<AdwCreditsSectionInput>;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* `update_credits` (:593-633) — the Credits page, as a list of groups.
|
|
236
|
+
*
|
|
237
|
+
* A section with no people is not "an empty group", it is NO group:
|
|
238
|
+
* `add_credits_section` returns before creating one (:545-546). The order is
|
|
239
|
+
* fixed — developers, designers, artists, documenters, translators, then the
|
|
240
|
+
* app's own sections in the order they were added — and it is not alphabetical
|
|
241
|
+
* or configurable.
|
|
242
|
+
*
|
|
243
|
+
* One C quirk is deliberately NOT reproduced: `add_credit_section` sets
|
|
244
|
+
* `credits_box` visible unconditionally (:3256), even when the section it just
|
|
245
|
+
* tried to add was empty and nothing was created — so an
|
|
246
|
+
* `add_credit_section ("Backers", {NULL})` leaves GTK with a Credits row that
|
|
247
|
+
* opens a blank page. That is an artefact of mutating a widget tree
|
|
248
|
+
* incrementally, not a derivation; recomputing from the sections, as
|
|
249
|
+
* `update_credits` itself does (:629-630), is the same rule without the stale
|
|
250
|
+
* flag.
|
|
251
|
+
*/
|
|
252
|
+
export declare function creditsSections(input?: AdwCreditsInput): AdwCreditsSection[];
|
|
253
|
+
/**
|
|
254
|
+
* The row and page labels from the template, mnemonic markers intact.
|
|
255
|
+
*
|
|
256
|
+
* They are here because the visibility table below names these exact widgets
|
|
257
|
+
* and a renderer has to be able to draw them. `_` is a GTK accelerator marker
|
|
258
|
+
* in every ROW title (`use-underline=True` on each) and NOT in the page titles;
|
|
259
|
+
* a renderer without an accelerator layer runs the row titles through
|
|
260
|
+
* `stripMnemonic`.
|
|
261
|
+
*
|
|
262
|
+
* `dialogTitle` is the one that gets invented: the main page's title is bound
|
|
263
|
+
* to `AdwDialog:title`, whose template default is the bare word "About"
|
|
264
|
+
* (adw-about-dialog.ui:6, :19) — not "About <app name>". The application NAME
|
|
265
|
+
* appears separately, in the header revealer that fades in on scroll (:29-31).
|
|
266
|
+
*/
|
|
267
|
+
export declare const ADW_ABOUT_DIALOG_LABELS: {
|
|
268
|
+
readonly dialogTitle: "About";
|
|
269
|
+
readonly whatsNewRow: "What’s _New";
|
|
270
|
+
readonly detailsRow: "_Details";
|
|
271
|
+
readonly websiteRow: "_Website";
|
|
272
|
+
readonly supportRow: "_Support Questions";
|
|
273
|
+
readonly issueRow: "_Report an Issue";
|
|
274
|
+
readonly troubleshootingRow: "_Troubleshooting";
|
|
275
|
+
readonly creditsRow: "_Credits";
|
|
276
|
+
readonly legalRow: "_Legal";
|
|
277
|
+
readonly acknowledgementsRow: "_Acknowledgements";
|
|
278
|
+
readonly whatsNewPage: "What’s New";
|
|
279
|
+
readonly detailsPage: "Details";
|
|
280
|
+
readonly troubleshootingPage: "Troubleshooting";
|
|
281
|
+
readonly creditsPage: "Credits";
|
|
282
|
+
readonly legalPage: "Legal";
|
|
283
|
+
readonly acknowledgementsPage: "Acknowledgements";
|
|
284
|
+
};
|
|
285
|
+
/** Everything the visibility derivation reads. */
|
|
286
|
+
export interface AdwAboutDialogProps {
|
|
287
|
+
/** `application-icon` (:2313-2314). */
|
|
288
|
+
applicationIcon: string;
|
|
289
|
+
/** `application-name` (:2376-2377). */
|
|
290
|
+
applicationName: string;
|
|
291
|
+
/** `developer-name` (:2426-2427). */
|
|
292
|
+
developerName: string;
|
|
293
|
+
/** `version` (:2476). */
|
|
294
|
+
version: string;
|
|
295
|
+
/** `comments` — Details-page body text. */
|
|
296
|
+
comments: string;
|
|
297
|
+
/** `website` — shown on the MAIN page or the Details page, never both. */
|
|
298
|
+
website: string;
|
|
299
|
+
/** `support-url` — a MAIN-page row (:1128). */
|
|
300
|
+
supportUrl: string;
|
|
301
|
+
/** `issue-url` — a MAIN-page row (:1129). */
|
|
302
|
+
issueUrl: string;
|
|
303
|
+
/** `debug-info` — an app-supplied blob; only its emptiness is derived (:1126). */
|
|
304
|
+
debugInfo: string;
|
|
305
|
+
/** `release-notes`; non-empty is the whole `whats_new_row` rule (:1020-1021). */
|
|
306
|
+
releaseNotes: string;
|
|
307
|
+
/** Whether `add_link` was ever called (:2820). */
|
|
308
|
+
hasCustomLinks: boolean;
|
|
309
|
+
/** Whether `credits_box` ended up with children (:629-630). */
|
|
310
|
+
hasCredits: boolean;
|
|
311
|
+
/** Whether `legal_box` ended up with children (:745-746). */
|
|
312
|
+
hasLegal: boolean;
|
|
313
|
+
/** Whether `add_acknowledgement_section` was ever called (:3297). */
|
|
314
|
+
hasAcknowledgements: boolean;
|
|
315
|
+
}
|
|
316
|
+
/** Which widgets `update_details`/`update_support`/`update_credits_legal_group` show. */
|
|
317
|
+
export interface AdwAboutDialogVisibility {
|
|
318
|
+
/** Main page: the 128px app icon (:2313-2314). */
|
|
319
|
+
appIcon: boolean;
|
|
320
|
+
/** Main page: the title-1 app name (:2376-2377). */
|
|
321
|
+
appName: boolean;
|
|
322
|
+
/** Main page: the developer line (:2426-2427). */
|
|
323
|
+
developerName: boolean;
|
|
324
|
+
/** Main page: the version pill (:2476). */
|
|
325
|
+
version: boolean;
|
|
326
|
+
/** Main page: the first group (:1116-1118). */
|
|
327
|
+
detailsGroup: boolean;
|
|
328
|
+
/** Main page: "What's New" (:1020-1021, :1087, :1099). */
|
|
329
|
+
whatsNewRow: boolean;
|
|
330
|
+
/** Main page: "Details", the row that pushes the subpage (:1115). */
|
|
331
|
+
detailsRow: boolean;
|
|
332
|
+
/** Main page: "Website", shown only when the Details page has nothing else (:1112). */
|
|
333
|
+
websiteRow: boolean;
|
|
334
|
+
/** Main page: the support group (:1131-1132). */
|
|
335
|
+
supportGroup: boolean;
|
|
336
|
+
/** Main page: "Support Questions" (:1128). */
|
|
337
|
+
supportRow: boolean;
|
|
338
|
+
/** Main page: "Report an Issue" (:1129). */
|
|
339
|
+
issueRow: boolean;
|
|
340
|
+
/** Main page: "Troubleshooting" (:1130). */
|
|
341
|
+
troubleshootingRow: boolean;
|
|
342
|
+
/** Main page: the Credits/Legal/Acknowledgements group (:483-486). */
|
|
343
|
+
creditsLegalGroup: boolean;
|
|
344
|
+
/** Main page: "Credits", bound to `credits_box` (.ui:198). */
|
|
345
|
+
creditsRow: boolean;
|
|
346
|
+
/** Main page: "Legal", bound to `legal_box` (.ui:215). */
|
|
347
|
+
legalRow: boolean;
|
|
348
|
+
/** Main page: "Acknowledgements", bound to `acknowledgements_box` (.ui:233). */
|
|
349
|
+
acknowledgementsRow: boolean;
|
|
350
|
+
/** Details page: the comments label (:1111). */
|
|
351
|
+
commentsLabel: boolean;
|
|
352
|
+
/** Details page: the links group (:1114). */
|
|
353
|
+
linksGroup: boolean;
|
|
354
|
+
/** Details page: "Website", the other half of the either/or (:1113). */
|
|
355
|
+
detailsWebsiteRow: boolean;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* `update_details` (:1102-1119) + `update_support` (:1121-1133) +
|
|
359
|
+
* `update_credits_legal_group` (:480-487), as one truth table.
|
|
360
|
+
*
|
|
361
|
+
* The three rules a port does not arrive at by guessing:
|
|
362
|
+
*
|
|
363
|
+
* 1. **Website is not a Details-page trigger.** `show_details` is
|
|
364
|
+
* `has_comments || has_custom_links` (:1108) — website is deliberately
|
|
365
|
+
* absent. A dialog with only a website and nothing else keeps the website
|
|
366
|
+
* on the MAIN page (:1112) and offers no Details row at all, because a
|
|
367
|
+
* subpage holding one link is worse than the link.
|
|
368
|
+
* 2. **The website row exists twice**, once per page, and exactly one of the
|
|
369
|
+
* two is visible (:1112-1113). They are separate widgets in the template
|
|
370
|
+
* (`website_row` .ui:133, `details_website_row` .ui:347).
|
|
371
|
+
* 3. **Support and issue links live on the MAIN page** (.ui:146-186, :1128-1129),
|
|
372
|
+
* not on Details. Only comments and links (website + `add_link`) are on the
|
|
373
|
+
* Details page. The browser renderer put all three link rows on Details,
|
|
374
|
+
* which buried the issue tracker one navigation step deeper than GTK.
|
|
375
|
+
*
|
|
376
|
+
* `hasCustomLinks` is a latch in the C — `add_link` sets it and nothing clears
|
|
377
|
+
* it (:2820) — so a renderer passes "has any extra link ever been added", not
|
|
378
|
+
* "does the links group currently have children".
|
|
379
|
+
*/
|
|
380
|
+
export declare function aboutDialogVisibility(props?: Partial<AdwAboutDialogProps>): AdwAboutDialogVisibility;
|
|
381
|
+
/**
|
|
382
|
+
* Whether the Legal page has anything on it — `append_legal_section`'s two
|
|
383
|
+
* early-outs collapsed for the DEFAULT section (:666-671, :682-687).
|
|
384
|
+
*
|
|
385
|
+
* The section is dropped when the copyright is empty AND the licence text is
|
|
386
|
+
* empty-or-absent; `force_title` is FALSE for the app's own section (:740), so
|
|
387
|
+
* there is no title-only case here. Note the licence half goes through
|
|
388
|
+
* {@link licenseText}, which means a `custom` type with an empty string
|
|
389
|
+
* contributes nothing while a `GPL-3.0` type always does.
|
|
390
|
+
*/
|
|
391
|
+
export declare function legalSectionVisible(copyright: string, licenseType: AdwLicenseType, license: string): boolean;
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
/** A title/subtitle label pair with the visibility the bindings give it. */
|
|
2
|
+
export interface AdwRowLabels {
|
|
3
|
+
/** The title label's text — `''` for an unset title, never `null`. */
|
|
4
|
+
title: string;
|
|
5
|
+
/** `string_is_not_empty(title)` — adw-action-row.ui:49-53. */
|
|
6
|
+
titleVisible: boolean;
|
|
7
|
+
/** The subtitle label's text — `''` for an unset subtitle. */
|
|
8
|
+
subtitle: string;
|
|
9
|
+
/** `string_is_not_empty(subtitle)` — adw-action-row.ui:71-75. */
|
|
10
|
+
subtitleVisible: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** What a row knows about its two labels. */
|
|
13
|
+
export interface AdwRowLabelInput {
|
|
14
|
+
/** `AdwPreferencesRow:title`. */
|
|
15
|
+
title?: string | null;
|
|
16
|
+
/** `AdwActionRow:subtitle`. */
|
|
17
|
+
subtitle?: string | null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The title/subtitle labels of any Adwaita row, with the `visible` each binding
|
|
21
|
+
* computes.
|
|
22
|
+
*
|
|
23
|
+
* Exported on its own — not just as part of {@link ActionRowState} — because the
|
|
24
|
+
* rows that already have a core state machine of their OWN (`Adw.ComboRow`,
|
|
25
|
+
* `Adw.ExpanderRow`, `Adw.SpinRow` via `rows.ts`) still render this pair, and
|
|
26
|
+
* every one of them had hand-rolled it.
|
|
27
|
+
*/
|
|
28
|
+
export declare function deriveRowLabels(input: AdwRowLabelInput): AdwRowLabels;
|
|
29
|
+
/** Everything a renderer needs to paint an `Adw.ActionRow`. */
|
|
30
|
+
export interface ActionRowRenderState extends AdwRowLabels {
|
|
31
|
+
/**
|
|
32
|
+
* `GtkListBoxRow:activatable` — whether a click activates the row at all.
|
|
33
|
+
* `False` in the template (adw-action-row.ui:5) and raised by an activatable
|
|
34
|
+
* widget rather than by the row itself.
|
|
35
|
+
*/
|
|
36
|
+
activatable: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* `Adw.ActionRow`: two labels plus the `activatable-widget` coupling.
|
|
40
|
+
*
|
|
41
|
+
* The coupling is the part no port had, and it is counter-intuitive twice over.
|
|
42
|
+
*
|
|
43
|
+
* (1) Setting an activatable widget does not set `activatable = TRUE`; it binds
|
|
44
|
+
* the WIDGET's `sensitive` onto the row's `activatable` with
|
|
45
|
+
* `G_BINDING_SYNC_CREATE` (adw-action-row.c:729-732). So handing the row an
|
|
46
|
+
* INSENSITIVE widget leaves the row unactivatable, and later flipping that
|
|
47
|
+
* widget's `sensitive` flips the row with it, for as long as the binding lives.
|
|
48
|
+
*
|
|
49
|
+
* (2) Clearing the widget only UNBINDS (`g_clear_pointer (&priv->
|
|
50
|
+
* activatable_binding, g_binding_unbind)`, C:709); it never writes `activatable`
|
|
51
|
+
* back. The row therefore STAYS activatable after its widget is taken away —
|
|
52
|
+
* which the class documentation states outright ("unsetting it won't change the
|
|
53
|
+
* row's activatability", C:28-30). A port that models this as
|
|
54
|
+
* `activatable = hasActivatableWidget` gets the sticky case exactly backwards.
|
|
55
|
+
*
|
|
56
|
+
* `TWidget` is whatever the renderer calls a widget — a DOM element, an NS
|
|
57
|
+
* `View`. Core only ever compares it by identity and hands it back.
|
|
58
|
+
*/
|
|
59
|
+
export declare class ActionRowState<TWidget = unknown> {
|
|
60
|
+
private _title;
|
|
61
|
+
private _subtitle;
|
|
62
|
+
private _activatableWidget;
|
|
63
|
+
private _activatable;
|
|
64
|
+
private _widgetSensitive;
|
|
65
|
+
/** The current render snapshot. */
|
|
66
|
+
get state(): ActionRowRenderState;
|
|
67
|
+
/** `AdwPreferencesRow:title`. */
|
|
68
|
+
get title(): string;
|
|
69
|
+
/** Set the title. Returns whether it changed (the `notify::title` gate). */
|
|
70
|
+
setTitle(title: string | null | undefined): boolean;
|
|
71
|
+
/** `AdwActionRow:subtitle`. */
|
|
72
|
+
get subtitle(): string;
|
|
73
|
+
/** Set the subtitle. Returns whether it changed (the `notify::subtitle` gate). */
|
|
74
|
+
setSubtitle(subtitle: string | null | undefined): boolean;
|
|
75
|
+
/** `AdwActionRow:activatable-widget` — `null` when unset. */
|
|
76
|
+
get activatableWidget(): TWidget | null;
|
|
77
|
+
/**
|
|
78
|
+
* `adw_action_row_set_activatable_widget` (C:696-741).
|
|
79
|
+
*
|
|
80
|
+
* `sensitive` is the widget's own `GtkWidget:sensitive` at the moment of the
|
|
81
|
+
* set, which `G_BINDING_SYNC_CREATE` copies straight into `activatable`
|
|
82
|
+
* (C:729-732); it defaults to `true` because a freshly built widget is
|
|
83
|
+
* sensitive. Passing `null` unbinds and LEAVES `activatable` alone (C:709).
|
|
84
|
+
*
|
|
85
|
+
* Returns whether the widget changed — the `notify::activatable-widget` gate
|
|
86
|
+
* (C:740, guarded by the identity early-return at C:706-707).
|
|
87
|
+
*/
|
|
88
|
+
setActivatableWidget(widget: TWidget | null, sensitive?: boolean): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* The live half of the binding: the activatable widget's `sensitive` is now
|
|
91
|
+
* `sensitive`. Safe to call unconditionally — a renderer that re-reads the
|
|
92
|
+
* widget rather than being told is the normal case on both ports.
|
|
93
|
+
*
|
|
94
|
+
* Two things make it a no-op, and both are the C's:
|
|
95
|
+
* - no widget is set, so `g_clear_pointer (…, g_binding_unbind)` (C:709)
|
|
96
|
+
* already took the binding away;
|
|
97
|
+
* - the value is unchanged, so `gtk_widget_set_sensitive` early-returned
|
|
98
|
+
* and `notify::sensitive` — the only thing a GBinding listens to — never
|
|
99
|
+
* fired. Without this half, a re-assertion of the value the widget
|
|
100
|
+
* already had would silently undo a direct write to `activatable`.
|
|
101
|
+
*
|
|
102
|
+
* Returns whether `activatable` changed.
|
|
103
|
+
*/
|
|
104
|
+
setActivatableWidgetSensitive(sensitive: boolean): boolean;
|
|
105
|
+
/** `GtkListBoxRow:activatable`. */
|
|
106
|
+
get activatable(): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Set `activatable` directly.
|
|
109
|
+
*
|
|
110
|
+
* Legal even while a binding is live: `g_object_bind_property` without
|
|
111
|
+
* `G_BINDING_BIDIRECTIONAL` is one-way, so GTK lets the write land and the
|
|
112
|
+
* next `sensitive` change overwrites it. Kept faithful rather than guarded —
|
|
113
|
+
* a port that refused the write would diverge from every application that
|
|
114
|
+
* sets `activatable` in a `.ui` file.
|
|
115
|
+
*
|
|
116
|
+
* Returns whether it changed.
|
|
117
|
+
*/
|
|
118
|
+
setActivatable(activatable: boolean): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* `adw_action_row_activate_real` (C:297-307): forward the activation to the
|
|
121
|
+
* activatable widget, then emit `activated`.
|
|
122
|
+
*
|
|
123
|
+
* Returns the widget to forward to, or `null`. The caller emits `activated`
|
|
124
|
+
* UNCONDITIONALLY afterwards — C:306 is outside the `if`, and
|
|
125
|
+
* `adw_action_row_activate` is public API (adw-action-row.h:90) with no
|
|
126
|
+
* `activatable` check of its own. The `activatable` gate lives one level up,
|
|
127
|
+
* in GtkListBox, which does not emit `row-activated` for an unactivatable
|
|
128
|
+
* row; a renderer's CLICK handler is where that check belongs.
|
|
129
|
+
*/
|
|
130
|
+
activate(): TWidget | null;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* `Adw.SwitchRow`: one boolean, and the notify rule the two ports disagreed on.
|
|
134
|
+
*
|
|
135
|
+
* `adw_switch_row_set_active` (C:216-228) early-returns when the value is
|
|
136
|
+
* unchanged and otherwise writes the slider, whose `notify::active` runs
|
|
137
|
+
* `slider_notify_active_cb` (C:66-77) — which updates the a11y `checked` state
|
|
138
|
+
* and emits `notify::active` on the ROW. That callback is the ONLY notify path,
|
|
139
|
+
* and it cannot see where the change came from, so a programmatic set notifies
|
|
140
|
+
* exactly like a drag on the handle.
|
|
141
|
+
*
|
|
142
|
+
* Both renderers had half of it: `@gjsify/adwaita-web` emitted only from the
|
|
143
|
+
* checkbox's `change` event, which the DOM does not fire for a programmatic
|
|
144
|
+
* `.checked =`, so `row.active = true` was silent; `@gjsify/adwaita-nativescript`
|
|
145
|
+
* re-emitted from `checkedChange`, which NS DOES fire on a programmatic write,
|
|
146
|
+
* so it notified. One widget, one C source, two opposite answers.
|
|
147
|
+
*
|
|
148
|
+
* There is deliberately NO `interactive` flag (the `SpinState`/`ComboState`
|
|
149
|
+
* shape): adding one would be an abstraction that actively contradicts C:66-77.
|
|
150
|
+
*/
|
|
151
|
+
export declare class SwitchRowState {
|
|
152
|
+
private _active;
|
|
153
|
+
/** `Adw.SwitchRow:active`. */
|
|
154
|
+
get active(): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* `adw_switch_row_set_active` (C:216-228). Returns whether it changed —
|
|
157
|
+
* i.e. whether the renderer must emit `notify::active`. The `!!is_active`
|
|
158
|
+
* normalisation is C:222.
|
|
159
|
+
*/
|
|
160
|
+
setActive(active: boolean): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* The row was activated (clicked, or <kbd>Enter</kbd>) — invert the state.
|
|
163
|
+
*
|
|
164
|
+
* `adw_switch_row_init` makes the row activatable and points the
|
|
165
|
+
* activatable-widget at the slider (C:160-162), so an activation is
|
|
166
|
+
* forwarded to the `GtkSwitch` and toggles it; the class docs state the
|
|
167
|
+
* outcome directly ("When activated, the row will invert its active state.
|
|
168
|
+
* The user can control the switch by activating the row or by dragging on
|
|
169
|
+
* the switch handle", C:23-27). Neither port did this — the row's text was
|
|
170
|
+
* dead and only the handle worked.
|
|
171
|
+
*
|
|
172
|
+
* Always returns `true`: inverting a boolean always changes it.
|
|
173
|
+
*/
|
|
174
|
+
activate(): boolean;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* `Adw.ButtonRow` is ALWAYS activatable — `<property name="activatable">True
|
|
178
|
+
* </property>` in the template (adw-button-row.ui:5), with no setter, no
|
|
179
|
+
* property and the class documentation saying so in one line
|
|
180
|
+
* ("`AdwButtonRow` is always activatable.", adw-button-row.c:31).
|
|
181
|
+
*
|
|
182
|
+
* Exported as data because the browser renderer had INVENTED an
|
|
183
|
+
* `activatable="false"` opt-out, and a passing test pinned it.
|
|
184
|
+
*/
|
|
185
|
+
export declare const BUTTON_ROW_ACTIVATABLE = true;
|
|
186
|
+
/** Everything a renderer needs to paint an `Adw.ButtonRow`. */
|
|
187
|
+
export interface ButtonRowRenderState {
|
|
188
|
+
/** `AdwPreferencesRow:title` — `''` when unset. */
|
|
189
|
+
title: string;
|
|
190
|
+
/** `string_is_not_empty(title)` — adw-button-row.ui:34-38. */
|
|
191
|
+
titleVisible: boolean;
|
|
192
|
+
/** `AdwButtonRow:start-icon-name` — `''` when unset (C:209-210). */
|
|
193
|
+
startIconName: string;
|
|
194
|
+
/** `string_is_not_empty(start_image.icon-name)` — adw-button-row.ui:20-24. */
|
|
195
|
+
startIconVisible: boolean;
|
|
196
|
+
/** `AdwButtonRow:end-icon-name` — `''` when unset (C:221-222). */
|
|
197
|
+
endIconName: string;
|
|
198
|
+
/** `string_is_not_empty(end_image.icon-name)` — adw-button-row.ui:55-59. */
|
|
199
|
+
endIconVisible: boolean;
|
|
200
|
+
/** Always {@link BUTTON_ROW_ACTIVATABLE}. */
|
|
201
|
+
activatable: true;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* `Adw.ButtonRow`: a centered title between two optional symbolic icons.
|
|
205
|
+
*
|
|
206
|
+
* The second icon is the lift: `AdwButtonRow:end-icon-name` (C:213-223, with
|
|
207
|
+
* `adw_button_row_set_end_icon_name` at C:342-352 and the image bound at
|
|
208
|
+
* adw-button-row.ui:52-65) has existed since libadwaita 1.6 and neither renderer
|
|
209
|
+
* had it — so the "Open in Files ›" shape that the property exists for could not
|
|
210
|
+
* be expressed at all.
|
|
211
|
+
*
|
|
212
|
+
* Both icon setters go through `g_set_str`, which returns FALSE for an unchanged
|
|
213
|
+
* value and thereby gates the notify (C:309-312, C:348-351). `g_set_str (&s,
|
|
214
|
+
* NULL)` stores NULL, but every read is `string_is_not_empty`-guarded and the
|
|
215
|
+
* pspec default is `""`, so `''` is the faithful TS spelling of both.
|
|
216
|
+
*/
|
|
217
|
+
export declare class ButtonRowState {
|
|
218
|
+
private _title;
|
|
219
|
+
private _startIconName;
|
|
220
|
+
private _endIconName;
|
|
221
|
+
/** The current render snapshot. */
|
|
222
|
+
get state(): ButtonRowRenderState;
|
|
223
|
+
/** `AdwPreferencesRow:title`. */
|
|
224
|
+
get title(): string;
|
|
225
|
+
/** Set the title. Returns whether it changed. */
|
|
226
|
+
setTitle(title: string | null | undefined): boolean;
|
|
227
|
+
/** `AdwButtonRow:start-icon-name`. */
|
|
228
|
+
get startIconName(): string;
|
|
229
|
+
/** `adw_button_row_set_start_icon_name` (C:303-313). Returns whether it changed. */
|
|
230
|
+
setStartIconName(iconName: string | null | undefined): boolean;
|
|
231
|
+
/** `AdwButtonRow:end-icon-name`. */
|
|
232
|
+
get endIconName(): string;
|
|
233
|
+
/** `adw_button_row_set_end_icon_name` (C:342-352). Returns whether it changed. */
|
|
234
|
+
setEndIconName(iconName: string | null | undefined): boolean;
|
|
235
|
+
}
|
|
236
|
+
/** Everything a renderer needs to paint an `Adw.WindowTitle`. */
|
|
237
|
+
export type WindowTitleRenderState = AdwRowLabels;
|
|
238
|
+
/**
|
|
239
|
+
* `Adw.WindowTitle`: the same two labels, one level out of the boxed list.
|
|
240
|
+
*
|
|
241
|
+
* Three rules, two lines each, and neither renderer had any of them: the TITLE
|
|
242
|
+
* label is hidden when the title is empty (C:207-208 — the `.ui` even starts it
|
|
243
|
+
* `visible=False`, adw-window-title.ui:15), a set to the CURRENT value returns
|
|
244
|
+
* early (C:203-204, C:244-245), and a real change notifies (C:210, C:251).
|
|
245
|
+
*
|
|
246
|
+
* DIVERGENCE, deliberate: setting `null` over an already-empty value does NOT
|
|
247
|
+
* notify here, where libadwaita does. Its guard is `g_strcmp0 (gtk_label_get_label
|
|
248
|
+
* (…), title)` and `gtk_label_get_label` never returns NULL, so `g_strcmp0 ("",
|
|
249
|
+
* NULL)` is 1 — the early return is skipped, the label is re-set to the same
|
|
250
|
+
* `""`, and `notify::title` fires for a no-op. That is an artefact of a
|
|
251
|
+
* NULL-vs-`""` pointer comparison, not a designed behaviour; both renderers
|
|
252
|
+
* carry `null` for "attribute absent" and `''` for `title=""`, and emitting a
|
|
253
|
+
* change notification for the difference between them would be noise. The
|
|
254
|
+
* normalisation happens BEFORE the comparison, and `WINDOW_TITLE_VECTORS` pins
|
|
255
|
+
* the divergence rather than hiding it.
|
|
256
|
+
*/
|
|
257
|
+
export declare class WindowTitleState {
|
|
258
|
+
private _title;
|
|
259
|
+
private _subtitle;
|
|
260
|
+
/** The current render snapshot. */
|
|
261
|
+
get state(): WindowTitleRenderState;
|
|
262
|
+
/** `Adw.WindowTitle:title`. */
|
|
263
|
+
get title(): string;
|
|
264
|
+
/** `adw_window_title_set_title` (C:197-211). Returns whether it changed. */
|
|
265
|
+
setTitle(title: string | null | undefined): boolean;
|
|
266
|
+
/** `Adw.WindowTitle:subtitle`. */
|
|
267
|
+
get subtitle(): string;
|
|
268
|
+
/** `adw_window_title_set_subtitle` (C:238-252). Returns whether it changed. */
|
|
269
|
+
setSubtitle(subtitle: string | null | undefined): boolean;
|
|
270
|
+
}
|