Skip to main content

oa/ui/
type.gen.rs

1// @generated by tool/gen/fn/generate.py; DO NOT EDIT.
2// schema=ui_types.json schema_version=1 generator_version=64
3// schema_sha256=a762fb9dc8812d0af0199f50709b1f48e9eab4e14f4ea4bce850fe7e6f9f049e
4use super::{FontId, PixelRect, UiDirection};
5use crate::Color;
6#[derive(Clone, Debug, Default)]
7pub struct UiTabBarResult {
8	/// Full tab-bar rectangle.
9	pub bar: PixelRect,
10	/// Rectangle spanning visible tab buttons only.
11	pub tabs: PixelRect,
12	/// Index of the first visible tab after this call.
13	pub first_visible: i32,
14	/// One past the last visible tab.
15	pub one_past_last: i32,
16	/// Index of the tab that was clicked, or -1.
17	pub activated_index: i32,
18	/// Index of the tab whose close button was clicked, or -1.
19	pub close_requested_index: i32,
20	/// Whether `state.selected` changed.
21	pub selection_changed: bool,
22	/// Index of the tab held in an active drag this frame, or -1.
23	pub dragged_index: i32,
24	/// Insertion index computed for a released drag, or -1.
25	pub drop_index: i32,
26	/// True on the frame an active drag was released.
27	pub dropped: bool,
28}
29
30#[derive(Clone, Debug, Default)]
31pub struct UiTreeRowConfig {
32	/// Nesting depth (0 = root).
33	pub depth: i32,
34	/// Pixels per indent level.
35	pub indent: i32,
36	/// Width reserved for the disclosure arrow.
37	pub disclosure_width: i32,
38	/// True if this item has children.
39	pub has_children: bool,
40	/// True if this item is currently expanded.
41	pub open: bool,
42	/// True if this item is selected.
43	pub selected: bool,
44	/// False to render greyed out.
45	pub enabled: bool,
46}
47
48#[derive(Clone, Debug, Default)]
49pub struct UiTreeRowResult {
50	/// Full row rectangle.
51	pub row: PixelRect,
52	/// Disclosure-arrow rectangle.
53	pub disclosure: PixelRect,
54	/// Label rectangle.
55	pub label: PixelRect,
56	/// True if the row was activated (clicked).
57	pub activated: bool,
58	/// True if the open/close state toggled.
59	pub open_changed: bool,
60	/// Current open state after this call.
61	pub open: bool,
62}
63
64#[derive(Clone, Debug)]
65pub struct UiScrollConfig {
66	/// Pixels scrolled per mouse-wheel notch.
67	pub wheel_step: f32,
68	/// Width of the scrollbar track in pixels.
69	pub scrollbar_width: f32,
70	/// Gap between content and scrollbar track.
71	pub scrollbar_gap: f32,
72	/// Whether to show the scrollbar.
73	pub show_scrollbar: bool,
74}
75
76#[derive(Clone, Debug)]
77pub struct UiSplitConfig {
78	/// Flow direction: Column = top/bottom split, Row = left/right split.
79	pub direction: UiDirection,
80	/// Width of the drag handle in pixels.
81	pub handle_size: f32,
82	/// Minimum size of the first pane in pixels.
83	pub minimum_first: f32,
84	/// Minimum size of the second pane in pixels.
85	pub minimum_second: f32,
86	/// Pixels moved per arrow-key press.
87	pub keyboard_step: f32,
88}
89
90#[derive(Clone, Debug)]
91pub struct UiPropertyRowConfig {
92	/// Fraction of the row width reserved for the label (0–1).
93	pub label_fraction: f32,
94	/// Gap between label and value columns in pixels.
95	pub gap: f32,
96	/// Horizontal padding inside each column.
97	pub padding_x: f32,
98	/// Draw an alternating background on even rows.
99	pub alternate: bool,
100}
101
102#[derive(Clone, Debug)]
103pub struct UiPopupConfig {
104	/// Popup width in pixels.
105	pub width: f32,
106	/// Popup height in pixels (0 = hug content).
107	pub height: f32,
108	/// Gap between anchor and popup in pixels.
109	pub gap: f32,
110	/// Padding inside the popup panel.
111	pub padding: f32,
112}
113
114#[derive(Clone, Debug)]
115pub struct UiDropdownConfig {
116	/// Maximum number of visible items before scrolling.
117	pub max_visible_items: i32,
118	/// Popup width override (0 = match widget width).
119	pub popup_width: f32,
120	/// Gap between widget and popup.
121	pub popup_gap: f32,
122}
123
124#[derive(Clone, Debug)]
125pub struct UiTableConfig {
126	/// Body row height in pixels (0 = default item height).
127	pub row_height: i32,
128	/// Maximum body rows drawn inside the widget (0 = all).
129	pub max_visible_rows: i32,
130	/// Draw the column header band.
131	pub show_header: bool,
132	/// Alternate row backgrounds.
133	pub zebra: bool,
134}
135
136#[derive(Clone, Debug)]
137pub struct UiTooltipConfig {
138	/// Milliseconds to wait before showing the tooltip.
139	pub delay_ms: f32,
140	/// Maximum tooltip width in pixels.
141	pub max_width: f32,
142	/// Gap between cursor and tooltip box.
143	pub gap: f32,
144	/// Padding inside the tooltip panel.
145	pub padding: f32,
146}
147
148#[derive(Clone, Debug)]
149pub struct UiHeatmapConfig {
150	/// Number of data rows.
151	pub rows: i32,
152	/// Number of data columns.
153	pub cols: i32,
154	/// Minimum value mapped to the cold color.
155	pub v_min: f32,
156	/// Maximum value mapped to the hot color.
157	pub v_max: f32,
158	/// Colormap index (matches [`crate::plot::axes::HeatmapStyle`] colormap).
159	pub colormap: i32,
160	/// Auto-scale range from data when true.
161	pub auto_scale: bool,
162	/// Draw grid lines between cells.
163	pub show_grid: bool,
164}
165
166#[derive(Clone, Debug)]
167pub struct UiGridConfig {
168	pub origin: [f32; 2],
169	pub minor_spacing: [f32; 2],
170	pub major_every: u32,
171	/// Number of minor intervals per super-major interval.
172	pub super_major_every: u32,
173	pub minor_thickness: f32,
174	pub major_thickness: f32,
175	pub super_major_thickness: f32,
176	pub axis_thickness: f32,
177	pub opacity: f32,
178	pub guide_fade_center: [f32; 2],
179	pub guide_fade_inner_radius: f32,
180	pub guide_fade_outer_radius: f32,
181	pub background_top: Color,
182	pub background_bottom: Color,
183	pub minor_color: Color,
184	pub major_color: Color,
185	pub super_major_color: Color,
186	pub axis_color: Color,
187	pub fill_background: bool,
188	pub draw_grid: bool,
189	pub draw_axes: bool,
190	pub radial_guide_fade: bool,
191	pub dither_background: bool,
192}
193
194#[derive(Clone, Copy, Debug, PartialEq)]
195pub struct UiPlotConfig {
196	/// Series line color.
197	pub color: Color,
198	/// X-axis minimum (screen-space sample domain when not auto-scaled).
199	pub x_min: f32,
200	/// X-axis maximum.
201	pub x_max: f32,
202	/// Y-axis minimum, used when `auto_scale` is false.
203	pub y_min: f32,
204	/// Y-axis maximum, used when `auto_scale` is false.
205	pub y_max: f32,
206	/// Resolve Y bounds from finite samples.
207	pub auto_scale: bool,
208	/// Draw the chart grid behind the series.
209	pub show_grid: bool,
210	/// Fill under the series line.
211	pub fill: bool,
212	/// Compute-line rasterization samples; the implemented set is 1/4/8. Other values resolve to four samples rather than naming MSAA on a storage-image path.
213	pub antialias_samples: u32,
214	/// Rasterized line width in pixels.
215	pub line_width: f32,
216	/// Paint the themed plot surface before drawing.
217	pub draw_surface: bool,
218}
219
220#[derive(Clone, Copy, Debug)]
221pub struct CvBboxesConfig {
222	pub color: Color,
223	pub line_width: f32,
224	pub alpha: f32,
225	pub label_scale: i32,
226	pub show_labels: bool,
227	pub show_scores: bool,
228}
229
230#[derive(Clone, Debug)]
231pub struct DetectionOverlayConfig {
232	pub max_detections: u32,
233	pub max_glyphs: u32,
234	pub thickness_pixels: f32,
235	pub font_size: f32,
236	pub label_padding_x: f32,
237	pub label_padding_y: f32,
238	pub box_color: Color,
239	pub label_text_color: Color,
240	pub show_labels: bool,
241}
242
243#[derive(Clone, Copy, Debug, Default, PartialEq)]
244pub struct GlyphInfo {
245	pub codepoint: u32,
246	pub atlas_x: f32,
247	pub atlas_y: f32,
248	pub atlas_w: f32,
249	pub atlas_h: f32,
250	pub bearing_x: f32,
251	pub bearing_y: f32,
252	pub advance: f32,
253	pub ink_w: f32,
254	pub ink_h: f32,
255	pub raster_size: f32,
256}
257
258#[derive(Clone, Copy, Debug, PartialEq)]
259pub struct TextLayoutConfig {
260	pub font: FontId,
261	pub size: f32,
262	pub wrap_width: f32,
263	pub monospace: bool,
264}