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
//! Central widget variant manifest.
//!
//! [`for_all_widget_variants!`] is the **single source of truth** for the set
//! of widget variants that appear in `ElementKind`, `NodeKind`, `Tag`, and the
//! various dispatch match arms across the crate. Adding a new widget to the
//! manifest automatically wires up:
//!
//! - `Tag` enum + `tag_of_element()` + `tag_of_node()` (in `layout/tag.rs`)
//! - `ElementKind::dimensions()` standard arms (in `core/element.rs`)
//! - `LayoutHash for ElementKind` delegation arms (in `layout/hash.rs`)
//! - `node_kind_delegate_match!` variant arms (in `core/node/kind.rs` via
//! `scripts/generate-node-kind-delegate-arms.py`)
//!
//! **Not** currently generated (stable Rust cannot nest `macro_rules!`):
//! - `renderers/mod.rs` module declarations (module names don't map 1:1)
//!
//! # Macro callback pattern
//!
//! `for_all_widget_variants!` invokes a caller-supplied `$callback` macro with
//! the full categorised variant list. Each consumer site defines a small
//! callback macro that destructures only the categories it cares about.
//!
//! # Categories
//!
//! | Category | `dimensions()` | `layout_hash` | In `NodeKind` | Feature |
//! |---|---|---|---|---|
//! | `direct` | `w.width, w.height` | delegate | yes | - |
//! | `direct_gated` | `w.width, w.height` | delegate | yes | ✓ |
//! | `direct_no_hash` | `w.width, w.height` | `None` | yes | - |
//! | `direct_no_hash_gated` | `w.width, w.height` | `None` | yes | ✓ |
//! | `props_dims` | `w.props.{w,h}` | delegate | yes | - |
//! | `const_auto_hash` | `(Auto, Auto)` | delegate | yes | - |
//! | `const_auto_hash_gated` | `(Auto, Auto)` | delegate | yes | ✓ |
//! | `const_flex` | `(Flex(1), Flex(1))` | delegate | yes | - |
//! | `const_flex_no_hash` | `(Flex(1), Flex(1))` | `None` | yes | - |
//! | `no_dims` | `None` | delegate | yes | - |
//! | `element_only_const_auto` | `(Auto, Auto)` | `None` | **no** | - |
/// Invoke `$callback!` with the full categorised widget variant list.
///
/// The callback receives blocks of variants grouped by category.
/// Feature-gated variants carry `=> "feature-name"` annotations.