1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
// Resolution engine: three-stage pipeline.
//
// 1. resolve() -- pure data transform: fills None fields from defaults and
// related widgets via ~91 inheritance rules. No OS detection, no I/O.
// 2. resolve_platform_defaults() -- fills fields that require OS detection:
// button_order (from detected desktop environment).
// 3. validate() -- extracts Option<T> -> T, producing ResolvedTheme.
//
// Convenience: resolve_all() = 1+2, into_resolved() = 1+2+3.
//
// Split into submodules:
// - inheritance: Phase 1-5 resolution rules (fill None fields from defaults/other widgets)
// - validate: Field extraction, range checks, ResolvedTheme construction
pub
pub
pub
pub
pub use ResolutionContext;
/// Widget field metadata for TOML linting. Populated by `#[derive(ThemeWidget)]`.
pub
collect!;
/// Non-widget (plain struct) field metadata for TOML linting.
///
/// Populated by `#[derive(ThemeFields)]` on plain structs like `FontSpec`,
/// `IconSizes`, `ThemeDefaults`, etc. Consumed by `lint_toml` to detect
/// unknown keys in sub-tables. See `docs/archive/v0.5.7_gaps.md` §G5 for
/// rationale — this sister registry to `WidgetFieldInfo` eliminates the
/// hand-authored `FIELD_NAMES` constants that previously duplicated
/// struct field lists.
pub
collect!;
/// Border inheritance registry (Phase 94-01 G6).
///
/// Populated by `#[derive(ThemeWidget)]` for widgets that declare
/// `#[theme_inherit(border_kind = "full" | "full_lg" | "partial")]`. Each
/// declaration produces one row in this registry.
///
/// Consumed by the inverted drift test
/// `border_inheritance_toml_matches_macro_emit` in `inheritance.rs::tests`
/// which asserts `docs/inheritance-rules.toml [border_inheritance]` matches
/// the registry byte-for-byte (macro is the source of truth post-G6;
/// TOML is a generated-documentation output).
///
/// Sister registry to [`WidgetFieldInfo`] / [`FieldInfo`] — same
/// inventory-crate pattern (`inventory::submit!` from the derive output).
///
/// Fields carry `#[cfg_attr(not(test), allow(dead_code))]` because they are
/// consumed only by the drift tests in `inheritance.rs::tests`
/// (introspection via `inventory::iter`). A non-test build compiles the
/// registry rows but never reads them — matching Phase 93-09's conditional
/// `allow(dead_code)` pattern for self-unmasking (if a future non-test
/// consumer lands, the allow stops firing and real dead-code regressions
/// surface).
pub
collect!;
/// Font inheritance registry (Phase 94-01 G6).
///
/// Populated by `#[derive(ThemeWidget)]` for widgets that declare one or
/// more `#[theme_inherit(font = "<field>")]` attributes. Each attribute
/// produces one row in this registry; widgets like `list` (item_font +
/// header_font) and `dialog` (title_font + body_font) contribute two rows.
///
/// Consumed by the inverted drift test
/// `font_inheritance_toml_matches_macro_emit` in `inheritance.rs::tests`
/// which asserts `docs/inheritance-rules.toml [font_inheritance]` matches
/// the registry byte-for-byte.
///
/// Fields carry `#[cfg_attr(not(test), allow(dead_code))]` — see
/// [`BorderInheritanceInfo`] for rationale.
pub
collect!;
use crateThemeMode;
use crateResolvedTheme;