1use egui_pop_core::strings::StrKey;
7
8pub const VIEWPORT: StrKey = StrKey::new("egui-pop-viewport-label", "Image viewport");
10pub const HISTOGRAM: StrKey = StrKey::new("egui-pop-viewport-histogram-label", "Histogram");
12pub const HISTOGRAM_VALUE: StrKey = StrKey::new(
14 "egui-pop-viewport-histogram-value",
15 "{ $channels } ({ $bins } bins)",
16);
17pub const HISTOGRAM_VALUE_LOG: StrKey = StrKey::new(
19 "egui-pop-viewport-histogram-value-log",
20 "{ $channels } ({ $bins } bins, logarithmic)",
21);
22
23pub const HISTOGRAM_CLIPPED_SHADOWS: StrKey = StrKey::new(
25 "egui-pop-viewport-histogram-clipped-shadows",
26 "shadows clipped: { $percent } %",
27);
28pub const HISTOGRAM_CLIPPED_HIGHLIGHTS: StrKey = StrKey::new(
30 "egui-pop-viewport-histogram-clipped-highlights",
31 "highlights clipped: { $percent } %",
32);
33pub const CURVE_VALUE: StrKey = StrKey::new("egui-pop-viewport-curve-value", "{ $points } points");
35pub const CURVE_VALUE_SELECTED: StrKey = StrKey::new(
37 "egui-pop-viewport-curve-value-selected",
38 "point { $point } of { $points }: input { $input } %, output { $output } %",
39);
40pub const CURVE_EDITOR: StrKey = StrKey::new("egui-pop-viewport-curve-editor", "Curve editor");
43pub const CURVE_SECONDARY_CLICK: StrKey = StrKey::new(
45 "egui-pop-viewport-curve-secondary-click",
46 "Deletes the point under the pointer",
47);
48pub const WHEEL_VALUE: StrKey = StrKey::new(
50 "egui-pop-viewport-wheel-value",
51 "hue { $hue }°, chroma { $chroma } %, luminance { $luminance }",
52);
53pub const WHEEL_LUMINANCE: StrKey =
55 StrKey::new("egui-pop-viewport-wheel-luminance", "{ $wheel } luminance");
56pub const NAVIGATOR: StrKey = StrKey::new("egui-pop-viewport-navigator-label", "Navigator");
58pub const NAVIGATOR_VALUE: StrKey = StrKey::new(
60 "egui-pop-viewport-navigator-value",
61 "zoom { $zoom } %, centre { $x }, { $y }",
62);
63pub const LOUPE_DISPLAY: StrKey = StrKey::new("egui-pop-viewport-loupe-display", "display");
65pub const LOUPE_SCENE: StrKey = StrKey::new("egui-pop-viewport-loupe-scene", "scene");
67pub const LOUPE_NONE: StrKey = StrKey::new("egui-pop-viewport-loupe-none", "no value");
69pub const ZOOM_OUT: StrKey = StrKey::new("egui-pop-viewport-zoom-out", "Zoom out");
71pub const ZOOM_IN: StrKey = StrKey::new("egui-pop-viewport-zoom-in", "Zoom in");
73pub const ZOOM_FIT: StrKey = StrKey::new("egui-pop-viewport-zoom-fit", "Fit");
75pub const ZOOM_ACTUAL: StrKey = StrKey::new("egui-pop-viewport-zoom-actual", "100 %");
77pub const ZOOM_FRAME_SELECTION: StrKey = StrKey::new(
79 "egui-pop-viewport-zoom-frame-selection",
80 "Frame the selection",
81);
82pub const ZOOM_LEVEL: StrKey = StrKey::new("egui-pop-viewport-zoom-level", "Zoom level");
84
85pub const GRAPH: StrKey = StrKey::new("egui-pop-viewport-graph-label", "Node graph");
87pub const GRAPH_VALUE: StrKey = StrKey::new(
89 "egui-pop-viewport-graph-value",
90 "{ $nodes } nodes, { $wires } wires, { $level }",
91);
92pub const GRAPH_LEVEL_OVERVIEW: StrKey =
94 StrKey::new("egui-pop-viewport-graph-level-overview", "overview");
95pub const GRAPH_LEVEL_PORTS: StrKey = StrKey::new("egui-pop-viewport-graph-level-ports", "ports");
97pub const GRAPH_LEVEL_DETAIL: StrKey =
99 StrKey::new("egui-pop-viewport-graph-level-detail", "detail");
100pub const GRAPH_ROLE_NODE: StrKey = StrKey::new("egui-pop-viewport-graph-role-node", "node");
102pub const GRAPH_ROLE_STACK: StrKey = StrKey::new("egui-pop-viewport-graph-role-stack", "stack");
104pub const GRAPH_ROLE_INPUT: StrKey =
106 StrKey::new("egui-pop-viewport-graph-role-input", "input port");
107pub const GRAPH_ROLE_OUTPUT: StrKey =
109 StrKey::new("egui-pop-viewport-graph-role-output", "output port");
110pub const GRAPH_NODE_VALUE: StrKey = StrKey::new(
112 "egui-pop-viewport-graph-node-value",
113 "{ $inputs } inputs, { $outputs } outputs, { $wires } wires",
114);
115pub const GRAPH_PORT_INPUT: StrKey = StrKey::new(
117 "egui-pop-viewport-graph-port-input",
118 "{ $node }, input { $port }",
119);
120pub const GRAPH_PORT_OUTPUT: StrKey = StrKey::new(
122 "egui-pop-viewport-graph-port-output",
123 "{ $node }, output { $port }",
124);
125pub const GRAPH_PORT_VALUE: StrKey = StrKey::new(
127 "egui-pop-viewport-graph-port-value",
128 "{ $type }, { $wires } wires",
129);
130pub const GRAPH_COLLAPSE: StrKey =
132 StrKey::new("egui-pop-viewport-graph-collapse", "Collapse { $node }");
133pub const GRAPH_EXPAND: StrKey = StrKey::new("egui-pop-viewport-graph-expand", "Expand { $node }");
135pub const GRAPH_FOLD: StrKey = StrKey::new("egui-pop-viewport-graph-fold", "Fold { $group }");
137pub const GRAPH_UNFOLD: StrKey = StrKey::new(
139 "egui-pop-viewport-graph-unfold",
140 "Unfold { $group } ({ $count } nodes)",
141);
142pub const GRAPH_WIRE_STARTED: StrKey = StrKey::new(
144 "egui-pop-viewport-graph-wire-started",
145 "Wire from { $port }: choose a port",
146);
147pub const GRAPH_CONNECTED: StrKey = StrKey::new(
149 "egui-pop-viewport-graph-connected",
150 "{ $from } connected to { $to }",
151);
152pub const GRAPH_REFUSED: StrKey = StrKey::new(
154 "egui-pop-viewport-graph-refused",
155 "{ $to } refuses { $from }: { $reason }",
156);
157pub const GRAPH_TYPES_DIFFER: StrKey = StrKey::new(
159 "egui-pop-viewport-graph-types-differ",
160 "the types differ ({ $from }, { $to })",
161);
162pub const GRAPH_SAME_NODE: StrKey = StrKey::new(
164 "egui-pop-viewport-graph-same-node",
165 "a node cannot feed itself",
166);
167pub const GRAPH_SAME_SIDE: StrKey = StrKey::new(
169 "egui-pop-viewport-graph-same-side",
170 "two inputs or two outputs",
171);
172pub const GRAPH_EXISTS: StrKey = StrKey::new(
174 "egui-pop-viewport-graph-exists",
175 "the wire is already there",
176);
177pub const GRAPH_ADD_NODE: StrKey = StrKey::new("egui-pop-viewport-graph-add-node", "Add a node");
179pub const GRAPH_DUPLICATE: StrKey = StrKey::new("egui-pop-viewport-graph-duplicate", "Duplicate");
181pub const GRAPH_DELETE: StrKey = StrKey::new("egui-pop-viewport-graph-delete", "Delete");
183pub const GRAPH_DISCONNECT: StrKey =
185 StrKey::new("egui-pop-viewport-graph-disconnect", "Disconnect");
186pub const GRAPH_ROLE_WIRE: StrKey = StrKey::new("egui-pop-viewport-graph-role-wire", "wire");
188pub const GRAPH_WIRE_NAME: StrKey =
190 StrKey::new("egui-pop-viewport-graph-wire-name", "{ $from } to { $to }");
191pub const GRAPH_WIRE_TIP: StrKey = StrKey::new(
193 "egui-pop-viewport-graph-wire-tip",
194 "{ $from_node } · { $from_port } to { $to_node } · { $to_port }",
195);
196pub const GRAPH_WIRE_KEYS: StrKey = StrKey::new(
198 "egui-pop-viewport-graph-wire-keys",
199 "Delete to disconnect, Enter to move its input end, Shift+Enter to move its output end",
200);
201pub const GRAPH_WIRE_HINT: StrKey = StrKey::new(
203 "egui-pop-viewport-graph-wire-hint",
204 "Click: select the wire · Ctrl+click: add it · Drag: move its nearer end · Right-click: its menu",
205);
206pub const NAV_HINT: StrKey = StrKey::new(
208 "egui-pop-viewport-nav-hint",
209 "Middle-drag, Space+drag or H to pan · Ctrl+wheel to zoom · F to frame",
210);
211pub const NAV_HAND_BUTTON: StrKey = StrKey::new("egui-pop-viewport-nav-hand-button", "Hand");
213pub const NAV_HAND: StrKey = StrKey::new(
215 "egui-pop-viewport-nav-hand",
216 "Hand: drag to pan (H to leave)",
217);
218pub const GRAPH_DISCONNECTED: StrKey = StrKey::new(
220 "egui-pop-viewport-graph-disconnected",
221 "{ $from } disconnected from { $to }",
222);
223pub const GRAPH_WIRES_SELECTED: StrKey = StrKey::new(
225 "egui-pop-viewport-graph-wires-selected",
226 "{ $count } wires selected",
227);
228pub const GRAPH_WIRE_INPUT_PICKED: StrKey = StrKey::new(
230 "egui-pop-viewport-graph-wire-input-picked",
231 "Wire from { $from } taken off { $to }: choose an input",
232);
233pub const GRAPH_WIRE_OUTPUT_PICKED: StrKey = StrKey::new(
235 "egui-pop-viewport-graph-wire-output-picked",
236 "Wire to { $to } taken off { $from }: choose an output",
237);
238pub const GRAPH_SELECT_SOURCE: StrKey =
240 StrKey::new("egui-pop-viewport-graph-select-source", "Select the source");
241pub const GRAPH_SELECT_DESTINATION: StrKey = StrKey::new(
243 "egui-pop-viewport-graph-select-destination",
244 "Select the destination",
245);
246pub const GRAPH_MINIMAP: StrKey =
248 StrKey::new("egui-pop-viewport-graph-minimap-label", "Graph overview");
249pub const GRAPH_MINIMAP_VALUE: StrKey =
251 StrKey::new("egui-pop-viewport-graph-minimap-value", "zoom { $zoom } %");
252
253pub const HINT_ZOOM: StrKey = StrKey::new("egui-pop-viewport-hint-zoom", "zoom");
255pub const HINT_ZOOM_FREE: StrKey =
256 StrKey::new("egui-pop-viewport-hint-zoom-free", "zoom without stops");
257pub const HINT_PAN: StrKey = StrKey::new("egui-pop-viewport-hint-pan", "pan");
258pub const HINT_PAN_X: StrKey = StrKey::new("egui-pop-viewport-hint-pan-x", "pan sideways");
259pub const HINT_PAN_Y: StrKey = StrKey::new("egui-pop-viewport-hint-pan-y", "pan up and down");
260pub const HINT_ZOOM_CYCLE: StrKey =
261 StrKey::new("egui-pop-viewport-hint-zoom-cycle", "100 %, 200 %, fit");
262pub const HINT_FIT: StrKey = StrKey::new("egui-pop-viewport-hint-fit", "fit");
263pub const HINT_ZOOM_TOGGLE: StrKey =
264 StrKey::new("egui-pop-viewport-hint-zoom-toggle", "fit or 100 %");
265pub const HINT_LEAVE: StrKey = StrKey::new("egui-pop-viewport-hint-leave", "leave");
266
267pub const ALL: &[StrKey] = &[
269 HINT_ZOOM,
270 HINT_ZOOM_FREE,
271 HINT_PAN,
272 HINT_PAN_X,
273 HINT_PAN_Y,
274 HINT_ZOOM_CYCLE,
275 HINT_FIT,
276 HINT_ZOOM_TOGGLE,
277 HINT_LEAVE,
278 VIEWPORT,
279 HISTOGRAM,
280 HISTOGRAM_VALUE,
281 HISTOGRAM_VALUE_LOG,
282 HISTOGRAM_CLIPPED_SHADOWS,
283 HISTOGRAM_CLIPPED_HIGHLIGHTS,
284 CURVE_VALUE,
285 CURVE_VALUE_SELECTED,
286 CURVE_EDITOR,
287 CURVE_SECONDARY_CLICK,
288 WHEEL_VALUE,
289 WHEEL_LUMINANCE,
290 NAVIGATOR,
291 NAVIGATOR_VALUE,
292 LOUPE_DISPLAY,
293 LOUPE_SCENE,
294 LOUPE_NONE,
295 ZOOM_OUT,
296 ZOOM_IN,
297 ZOOM_FIT,
298 ZOOM_ACTUAL,
299 ZOOM_FRAME_SELECTION,
300 ZOOM_LEVEL,
301 GRAPH,
302 GRAPH_VALUE,
303 GRAPH_LEVEL_OVERVIEW,
304 GRAPH_LEVEL_PORTS,
305 GRAPH_LEVEL_DETAIL,
306 GRAPH_ROLE_NODE,
307 GRAPH_ROLE_STACK,
308 GRAPH_ROLE_INPUT,
309 GRAPH_ROLE_OUTPUT,
310 GRAPH_NODE_VALUE,
311 GRAPH_PORT_INPUT,
312 GRAPH_PORT_OUTPUT,
313 GRAPH_PORT_VALUE,
314 GRAPH_COLLAPSE,
315 GRAPH_EXPAND,
316 GRAPH_FOLD,
317 GRAPH_UNFOLD,
318 GRAPH_WIRE_STARTED,
319 GRAPH_CONNECTED,
320 GRAPH_REFUSED,
321 GRAPH_TYPES_DIFFER,
322 GRAPH_SAME_NODE,
323 GRAPH_SAME_SIDE,
324 GRAPH_EXISTS,
325 GRAPH_ADD_NODE,
326 GRAPH_DUPLICATE,
327 GRAPH_DELETE,
328 GRAPH_DISCONNECT,
329 GRAPH_ROLE_WIRE,
330 GRAPH_WIRE_NAME,
331 GRAPH_WIRE_TIP,
332 GRAPH_WIRE_KEYS,
333 GRAPH_WIRE_HINT,
334 GRAPH_DISCONNECTED,
335 GRAPH_WIRES_SELECTED,
336 GRAPH_WIRE_INPUT_PICKED,
337 GRAPH_WIRE_OUTPUT_PICKED,
338 GRAPH_SELECT_SOURCE,
339 GRAPH_SELECT_DESTINATION,
340 GRAPH_MINIMAP,
341 GRAPH_MINIMAP_VALUE,
342 NAV_HINT,
343 NAV_HAND,
344 NAV_HAND_BUTTON,
345];
346
347#[cfg(test)]
348mod tests {
349 use super::*;
350
351 #[test]
352 fn keys_are_unique_fluent_ids() {
353 let mut seen = std::collections::BTreeSet::new();
354 for k in ALL {
355 assert!(seen.insert(k.key), "`{}` twice", k.key);
356 assert!(k.key.starts_with("egui-pop-"), "{}", k.key);
357 assert!(
358 k.key
359 .chars()
360 .all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || c == '-'),
361 "{}",
362 k.key
363 );
364 }
365 }
366}