pub struct Ui {
pub desc: AppDesc,
pub style: &'static dyn Style,
pub text: Text,
pub dc: Dc,
/* private fields */
}Expand description
the UI context: everything ASMLIB keeps in g_* variables
Fields§
§desc: AppDesc§style: &'static dyn Style§text: Textfonts, glyph cache, text runs (shared: the asm’s font module)
dc: Dcthe gfx draw context (the asm’s g_dc; render time only)
Implementations§
Source§impl Ui
impl Ui
Sourcepub fn a11y_tree(&self) -> Snapshot
pub fn a11y_tree(&self) -> Snapshot
The accessibility tree of the last pass as assistive technology gets it (screen readers through AT-SPI2 / UI Automation): every shown window with its nodes (roles, names, states, values, rectangles), built from the semantic records (see sem()).
Sourcepub fn a11y_value(&mut self, id: u32) -> Option<i32>
pub fn a11y_value(&mut self, id: u32) -> Option<i32>
A value a screen reader set for slider-like widget id (its record’s value scale),
taken once: the built-in sliders apply it themselves; a widget of its own applies it
like keyboard input (clamped) in the pass it is built.
Source§impl Ui
impl Ui
Sourcepub fn agent_enabled(&self) -> bool
pub fn agent_enabled(&self) -> bool
Whether external control was explicitly activated. No endpoint opens by reading this.
Sourcepub fn agent_connected(&self) -> bool
pub fn agent_connected(&self) -> bool
Whether the active control session has received a client request.
Sourcepub fn set_agent_enabled(&mut self, enabled: bool)
pub fn set_agent_enabled(&mut self, enabled: bool)
Enable or revoke external control. Revocation also discards screenshot resources.
Source§impl Ui
impl Ui
Sourcepub fn focus_ring_draw(&mut self, ev: u32)
pub fn focus_ring_draw(&mut self, ev: u32)
ui_focus_ring_draw(ev): the style’s focus visual around last_rect when it is shown (ev: the widget’s events; custom widgets built on hit_rect / behave call it last)
Sourcepub fn text(&mut self, style: u32, s: &str)
pub fn text(&mut self, style: u32, s: &str)
ui_text(style, s): a text in a text style (TS_* | TX_*)
Sourcepub fn heading(&mut self, level: u32, style: u32, s: &str)
pub fn heading(&mut self, level: u32, style: u32, s: &str)
A section title: text(style, s) that screen readers know as a heading of level
(1 the top level ..= 9; record K_HEADING, value: the level) – their heading navigation
finds it.
ui_button(id, label) -> EV_* (EV_ACT on click)
A focusable text action with explicit TS_/TX_ typography and horizontal inset in DIP. Uses the style’s button surface and ordinary button semantics. Long labels are ellipsized visually; accessibility and agent inspection retain the full label.
Sourcepub fn link(&mut self, id: u32, label: &str, typography: u32) -> u32
pub fn link(&mut self, id: u32, label: &str, typography: u32) -> u32
A hyperlink-style text action: accent-coloured text (T_ACCENT_TEXT), underlined while the pointer is over it, hand cursor, focus ring, no button surface. TS_/TX_ typography as in text(); a narrower slot than the text ellipsizes it.
ui_accent_button(id, label) -> EV_*: the accent (primary) button
ui_icon_button(id, icon, label) -> EV_*: subtle toolbar button
ui_toggle_button(id, label, &mut v) -> EV_*: checked look while v != 0; toggles v
ui_tool_button(id, icon, label, &mut sel, mine) -> EV_*: subtle icon button, checked when sel == mine; the tool buttons of one variable are one Tab stop (arrows inside)
Sourcepub fn checkbox(&mut self, id: u32, label: &str, v: &mut i32) -> u32
pub fn checkbox(&mut self, id: u32, label: &str, v: &mut i32) -> u32
ui_checkbox(id, label, &mut v) -> EV_*: v 0, 1, 2 = indeterminate (Space toggles, Enter is the dialog’s)
Sourcepub fn checkbox_wrap(&mut self, id: u32, label: &str, v: &mut i32) -> u32
pub fn checkbox_wrap(&mut self, id: u32, label: &str, v: &mut i32) -> u32
ui_checkbox_wrap(id, label, &mut v) -> EV_*: a check box for a text that may be long: the mark, beside it the label wrapped at the width the layout gives (next_size(-1, 0)); a click on the text toggles too; the record is the check box’s, named by the text
Sourcepub fn radio_wrap(
&mut self,
id: u32,
label: &str,
v: &mut i32,
mine: i32,
) -> u32
pub fn radio_wrap( &mut self, id: u32, label: &str, v: &mut i32, mine: i32, ) -> u32
ui_radio_wrap(id, label, &mut v, mine) -> EV_*: a radio for a text that may be long, as checkbox_wrap
Sourcepub fn radio(&mut self, id: u32, label: &str, v: &mut i32, mine: i32) -> u32
pub fn radio(&mut self, id: u32, label: &str, v: &mut i32, mine: i32) -> u32
ui_radio(id, label, &mut v, mine) -> EV_*: v = mine when clicked; the radios of one variable are one Tab stop, the arrows select inside (kbnav.rs)
Sourcepub fn switch(&mut self, id: u32, label: &str, v: &mut i32) -> u32
pub fn switch(&mut self, id: u32, label: &str, v: &mut i32) -> u32
ui_switch(id, label, &mut v) -> EV_*: toggle switch
Sourcepub fn slider(&mut self, id: u32, v: &mut i32, rg: &Range) -> u32
pub fn slider(&mut self, id: u32, v: &mut i32, rg: &Range) -> u32
ui_slider(id, &mut v, &range) -> EV_*: EV_ACT while the value changes, EV_COMMIT on release
Source§impl Ui
impl Ui
Sourcepub fn sparkline(&mut self, id: u32, values: &[f32], color: u32)
pub fn sparkline(&mut self, id: u32, values: &[f32], color: u32)
ui_sparkline(id, values, color): area + line over the values (min .. max scaled)
Sourcepub fn bar_chart(
&mut self,
id: u32,
labels: &[&str],
series: &[BarSeries<'_>],
stacked: bool,
) -> i32
pub fn bar_chart( &mut self, id: u32, labels: &[&str], series: &[BarSeries<'_>], stacked: bool, ) -> i32
ui_bar_chart(id, labels, series, stacked) -> the hovered column (-1 = none)
Sourcepub fn donut(
&mut self,
id: u32,
slices: &[DonutSlice<'_>],
center: &str,
sub: &str,
)
pub fn donut( &mut self, id: u32, slices: &[DonutSlice<'_>], center: &str, sub: &str, )
ui_donut(id, slices, center, sub): ring of slices (fractions of their sum) with a centre text (TS_SUBTITLE; TS_BODY_STRONG where that is wider than the hole) and a caption below it (left out where the hole is too low for both)
Source§impl Ui
impl Ui
Sourcepub fn dialog_begin(&mut self, id: u32, title: &str, open: &Shared<i32>) -> bool
pub fn dialog_begin(&mut self, id: u32, title: &str, open: &Shared<i32>) -> bool
ui_dialog_begin(id, title, open) -> true if the dialog is open
ui_dialog_buttons(primary, secondary, close) -> DLG_* (any result clears the open flag). Inside a content dialog: its footer. Otherwise, inside a WF_DIALOG window: a footer pinned to the window’s bottom; a result clears the window’s open flag.
Sourcepub fn dialog_end(&mut self)
pub fn dialog_end(&mut self)
ui_dialog_end
Sourcepub fn infobar(&mut self, id: u32, severity: u32, title: &str, msg: &str) -> u32
pub fn infobar(&mut self, id: u32, severity: u32, title: &str, msg: &str) -> u32
ui_infobar(id, severity, title, msg) -> EV (EV_ACT when the close button was clicked)
Sourcepub fn statusbar_begin(&mut self)
pub fn statusbar_begin(&mut self)
ui_statusbar_begin: a 32 DIP bar; call it last in a vertical layout (after a fill)
Sourcepub fn statusbar_end(&mut self)
pub fn statusbar_end(&mut self)
ui_statusbar_end
Sourcepub fn titlebar_begin(&mut self, title: &str, icon: u32)
pub fn titlebar_begin(&mut self, title: &str, icon: u32)
ui_titlebar_begin(title, icon): a title bar row (icon 0 = none)
Sourcepub fn titlebar_begin_opt(&mut self, title: Option<&str>, icon: u32)
pub fn titlebar_begin_opt(&mut self, title: Option<&str>, icon: u32)
ui_titlebar_begin with title 0: no title text (the record has no label) // pn-core
Sourcepub fn titlebar_begin_overlay(&mut self, title: Option<&str>, icon: u32)
pub fn titlebar_begin_overlay(&mut self, title: Option<&str>, icon: u32)
Overlay native window controls and a drag region without painting a titlebar surface.
Use next_rect_px to place it over the empty top edge of a file/start screen.
The agent indicator remains visible beside the caption buttons when control is enabled.
Sourcepub fn titlebar_end(&mut self)
pub fn titlebar_end(&mut self)
ui_titlebar_end: caption buttons at the right end (unless the style puts them at the left: SM_CAP_LEFT)
Sourcepub fn titlebar_open(&self) -> Option<([i32; 4], bool)>
pub fn titlebar_open(&self) -> Option<([i32; 4], bool)>
The title bar being built, between titlebar_begin and titlebar_end (None elsewhere
and on an overlay, which paints no bar): its rectangle (px) and whether the window is
active. For a style whose bar has the same colours in every theme (classic): a widget
drawn right on it cannot use the theme’s T_TEXT.
Source§impl Ui
impl Ui
Sourcepub fn clip_set_image(&mut self, sf: &Surface) -> i32
pub fn clip_set_image(&mut self, sf: &Surface) -> i32
ui_clip_set_image(sf) -> 0 / -1: sf as CLIP_IMAGE (PNG level 1 + BMP)
Sourcepub fn clip_get_image(&mut self) -> Result<Surface, i32>
pub fn clip_get_image(&mut self) -> Result<Surface, i32>
ui_clip_get_image -> the clipboard image in a new FMT_ARGB surface, or ERR_* (-1 = no image)
Source§impl Ui
impl Ui
Sourcepub fn draw_color(&mut self, argb: u32)
pub fn draw_color(&mut self, argb: u32)
ui_draw_color(argb): colour for the following draw_* calls
Sourcepub fn draw_color_get(&self) -> u32
pub fn draw_color_get(&self) -> u32
the colour of the following draw_* calls (g_dcol)
Sourcepub fn draw_rrect(&mut self, x: i32, y: i32, w: i32, h: i32, r: i32)
pub fn draw_rrect(&mut self, x: i32, y: i32, w: i32, h: i32, r: i32)
ui_draw_rrect(x, y, w, h, r): filled rounded rectangle in the draw colour
Sourcepub fn draw_frame(&mut self, x: i32, y: i32, w: i32, h: i32, r: i32, t: i32)
pub fn draw_frame(&mut self, x: i32, y: i32, w: i32, h: i32, r: i32, t: i32)
ui_draw_frame(x, y, w, h, r, t): border only, in the draw colour
Sourcepub fn cmd_rrect(
&mut self,
x: i32,
y: i32,
w: i32,
h: i32,
r: i32,
t: i32,
fill: u32,
stroke: u32,
stroke2: u32,
)
pub fn cmd_rrect( &mut self, x: i32, y: i32, w: i32, h: i32, r: i32, t: i32, fill: u32, stroke: u32, stroke2: u32, )
cmd_rrect(x, y, w, h, r, t, fill, stroke, stroke2): rounded rectangle with an optional fill and border (stroke2: the bottom edge)
Sourcepub fn cmd_panel_fx(
&mut self,
x: i32,
y: i32,
w: i32,
h: i32,
r: i32,
t: i32,
fill: u32,
stroke: u32,
)
pub fn cmd_panel_fx( &mut self, x: i32, y: i32, w: i32, h: i32, r: i32, t: i32, fill: u32, stroke: u32, )
Rounded fill/border with 24.8 pixel geometry and a single coverage composite. Fractional bounds participate in dirty-region hashing and clipping.
Sourcepub fn draw_text(&mut self, x: i32, y: i32, s: &str, font_size: u32)
pub fn draw_text(&mut self, x: i32, y: i32, s: &str, font_size: u32)
ui_draw_text(x, y, s, font_size): font_size = FONT_* | size_fx << 8
Sourcepub fn cmd_text(
&mut self,
x: i32,
y: i32,
s: &[u8],
font: u32,
size: i32,
c: u32,
maxw: i32,
)
pub fn cmd_text( &mut self, x: i32, y: i32, s: &[u8], font: u32, size: i32, c: u32, maxw: i32, )
cmd_text(x, y, s, font, size_fx, colour, maxw): at most 4000 bytes, never cut inside a UTF-8 sequence
Sourcepub fn emit_text(&mut self, x: i32, y: i32, s: &str, c: u32)
pub fn emit_text(&mut self, x: i32, y: i32, s: &str, c: u32)
emit_text(x, baseline, s, colour): text in the current text font (styles)
Sourcepub fn draw_icon(&mut self, cp: u32, x: i32, y: i32, size: i32)
pub fn draw_icon(&mut self, cp: u32, x: i32, y: i32, size: i32)
ui_draw_icon(cp, x, y, size_fx)
Sourcepub fn draw_circle(&mut self, x: i32, y: i32, r: i32, t: i32)
pub fn draw_circle(&mut self, x: i32, y: i32, r: i32, t: i32)
ui_draw_circle(cx, cy, r, t): 24.8 fixed, t = 0 fills
Sourcepub fn draw_line(&mut self, x0: i32, y0: i32, x1: i32, y1: i32, w: i32)
pub fn draw_line(&mut self, x0: i32, y0: i32, x1: i32, y1: i32, w: i32)
ui_draw_line(x0, y0, x1, y1, width): 24.8 fixed
Sourcepub fn draw_image(
&mut self,
sf: &Rc<Surface>,
ver: u32,
x: i32,
y: i32,
w: i32,
h: i32,
)
pub fn draw_image( &mut self, sf: &Rc<Surface>, ver: u32, x: i32, y: i32, w: i32, h: i32, )
ui_draw_image(sf, x, y, w, h): w / h 0 = natural size; ver stands for the
surface’s SF_AUX version (bump it when the pixels change)
Sourcepub fn draw_unclip(&mut self)
pub fn draw_unclip(&mut self)
ui_draw_unclip
Sourcepub fn icon_hook(&mut self, f: Option<IconHook>)
pub fn icon_hook(&mut self, f: Option<IconHook>)
ui_icon_hook(f): an app draws chosen icons itself (None removes the hook)
Source§impl Ui
impl Ui
Sourcepub fn swatch(&mut self, id: u32, argb: u32, selected: bool) -> u32
pub fn swatch(&mut self, id: u32, argb: u32, selected: bool) -> u32
ui_swatch(id, argb, selected) -> EV_*: the swatches of one box are one Tab stop (the selected one; arrows move inside, Space / Enter act, the menu key is a right click); next_flags(ST_NOFOCUS): a picture only, no Tab stop
Sourcepub fn color_picker(&mut self, id: u32, argb: &mut u32) -> u32
pub fn color_picker(&mut self, id: u32, argb: &mut u32) -> u32
ui_color_picker(id, &mut argb) -> EV_*
Source§impl Ui
impl Ui
Sourcepub fn pen(&self) -> (u32, u32)
pub fn pen(&self) -> (u32, u32)
ui_pen: (pressure 0 = none / 1..UI_PRESSURE_ONE, PTR_*) of the last pointer event
Sourcepub fn focus(&mut self, id: u32)
pub fn focus(&mut self, id: u32)
ui_focus(id): give the keyboard focus to a widget (focus ring shown). The id is looked up in whichever window emits it in the next pass (that window is activated).
Sourcepub fn focus_quiet(&mut self, id: u32)
pub fn focus_quiet(&mut self, id: u32)
the keyboard focus to a widget of this window without the focus ring: the keyboard goes back to it after a pointer gesture (a ring only follows keyboard navigation)
Sourcepub fn key(&mut self, vk: u32) -> bool
pub fn key(&mut self, vk: u32) -> bool
ui_key(vk): pressed this frame and not yet consumed (consumes it)
Sourcepub fn capture_shortcut(&mut self, vk: u32, mods: u32) -> bool
pub fn capture_shortcut(&mut self, vk: u32, mods: u32) -> bool
Capture an exact application shortcut before text widgets handle it. Unlike key(), this bypasses the focused textbox’s key reservation. Use only for an editing surface whose history/commands the application owns, and not while a modal draft dialog owns input. Other shortcuts and the normal key() behavior are unchanged.
Sourcepub fn key_peek(&mut self, vk: u32) -> bool
pub fn key_peek(&mut self, vk: u32) -> bool
ui_key_peek(vk): pressed this frame and unconsumed (not consumed)
Sourcepub fn key_down(&self, vk: u32) -> bool
pub fn key_down(&self, vk: u32) -> bool
ui_key_down(vk): held (mods: VK_SHIFT / VK_CONTROL / VK_MENU)
Sourcepub fn key_first(&self) -> u32
pub fn key_first(&self) -> u32
ui_key_first: the first unconsumed key this frame (VK | mods << 16) or 0
Sourcepub fn text_take(&mut self, cap: usize) -> Vec<u32>
pub fn text_take(&mut self, cap: usize) -> Vec<u32>
ui_text_take(cap): the typed codepoints (at most cap), consumed; when cap leaves some, they come in the next pass (nothing typed is lost)
Sourcepub fn hit_flags_at(&mut self, x: i32, y: i32) -> u32
pub fn hit_flags_at(&mut self, x: i32, y: i32) -> u32
ui_hit_flags_at(x, y): HB_* flags of the topmost hit box at a point of the main window (previous pass) – non-client hit testing of the platform
Sourcepub fn hit(&mut self, id: u32, hbflags: u32)
pub fn hit(&mut self, id: u32, hbflags: u32)
ui_hit(id, hbflags): register last_rect (clipped) as a hit box of the current layer
Sourcepub fn behave(&mut self, id: u32, hbflags: u32) -> u32
pub fn behave(&mut self, id: u32, hbflags: u32) -> u32
ui_behave(id, hbflags) -> EV_*: the standard pointer / keyboard behaviour of a widget occupying last_rect
Sourcepub fn hit_rect(
&mut self,
id: u32,
x: i32,
y: i32,
w: i32,
h: i32,
hbflags: u32,
) -> u32
pub fn hit_rect( &mut self, id: u32, x: i32, y: i32, w: i32, h: i32, hbflags: u32, ) -> u32
ui_hit_rect(id, x, y, w, h, hbflags) -> EV_*: behave on an explicit rectangle (px)
Sourcepub fn focus_ring(&self, ev: u32) -> bool
pub fn focus_ring(&self, ev: u32) -> bool
ui_focus_ring(ev): the focus visual should be drawn for the widget that just called behave (its events)
Sourcepub fn slot(&mut self, id: u32) -> &mut Slot
pub fn slot(&mut self, id: u32) -> &mut Slot
ui_slot(id): persistent per-id state (created on first use)
Sourcepub fn anim(&mut self, id: u32, target: u32, ms: u32) -> u32
pub fn anim(&mut self, id: u32, target: u32, ms: u32) -> u32
ui_anim(id, target, ms) -> current value (0..65535, usually 0..256) moving towards target (ease-out)
Sourcepub fn anim_ex(&mut self, id: u32, target: u32, ms: u32, curve: u32) -> u32
pub fn anim_ex(&mut self, id: u32, target: u32, ms: u32, curve: u32) -> u32
anim_ex(id, target, ms, curve) -> current value moving towards target along an EASE_* curve (EASE_OUT_BACK may overshoot; the value stays >= 0)
Sourcepub fn anim_color(&mut self, id: u32, argb: u32, ms: u32, curve: u32) -> u32
pub fn anim_color(&mut self, id: u32, argb: u32, ms: u32, curve: u32) -> u32
anim_color(id, argb, ms, curve) -> the colour on its way to argb (a transition: hover fills, state colours); the first call starts at argb
Sourcepub fn cmd_run(&mut self, id: u32, arg: u32)
pub fn cmd_run(&mut self, id: u32, arg: u32)
ui_cmd_run(id, arg): queue a command for App::command after this frame (in order)
Sourcepub fn timer(&mut self, id: u32, ms: u32)
pub fn timer(&mut self, id: u32, ms: u32)
ui_timer(id, ms): App::command(UIC_TIMER, id) after ms (replaces a timer with the same id)
Sourcepub fn last_reset(&mut self)
pub fn last_reset(&mut self)
g_last_rect = 0, g_last_state = 0: the apps’ hidden probe records (PaintCraft’s *_sem helpers zero both before ui_sem; later records of the pass see the zeroes too) // pn-core
Sourcepub fn last_set(&mut self, rect: [i32; 4], state: u32)
pub fn last_set(&mut self, rect: [i32; 4], state: u32)
g_last_rect = rect, g_last_state = state (apps that build a widget from drawing calls set the record’s rectangle and state before ui_sem) // pn-core
Sourcepub fn last_state(&self) -> u32
pub fn last_state(&self) -> u32
g_last_state: the SS_* state of the last behave // pn-core
Sourcepub fn mbtn(&self) -> u32
pub fn mbtn(&self) -> u32
g_mbtn / g_pressed / g_released: mouse buttons held / pressed / released this frame (bit 1 << BTN_*) // pn-core
pub fn pressed(&self) -> u32
pub fn released(&self) -> u32
Sourcepub fn sem(
&mut self,
kind: u16,
id: u32,
label: Option<&str>,
value: i32,
) -> &mut Sem
pub fn sem( &mut self, kind: u16, id: u32, label: Option<&str>, value: i32, ) -> &mut Sem
ui_sem(kind, id, label, value) -> the record (rect = last_rect, state from the last behave); the label is copied
Sourcepub fn clip_push(&mut self, x: i32, y: i32, w: i32, h: i32)
pub fn clip_push(&mut self, x: i32, y: i32, w: i32, h: i32)
ui_clip_push(x, y, w, h): px; intersects drawing and hit clipping
Sourcepub fn layer_set(&mut self, layer: u32) -> u32
pub fn layer_set(&mut self, layer: u32) -> u32
ui_layer_set(layer) -> previous: switch the command layer and hit layer together
Sourcepub fn begin_pass(&mut self, w: i32, h: i32)
pub fn begin_pass(&mut self, w: i32, h: i32)
ui_begin_pass(w, h): start recording a frame for a w x h px window (one window)
Sourcepub fn modal(&mut self, layer: u32)
pub fn modal(&mut self, layer: u32)
ui_modal(layer): a modal element (dialog) is open on layer this pass
Sourcepub fn modal_active(&self) -> u32
pub fn modal_active(&self) -> u32
ui_modal_active -> layer of the modal element of the last pass (0 = none)
Sourcepub fn disabled_push(&mut self)
pub fn disabled_push(&mut self)
ui_disabled_push / ui_disabled_pop: widgets in between are disabled
pub fn disabled_pop(&mut self)
Source§impl Ui
impl Ui
Sourcepub fn cursor_new(&mut self, f: CursorDraw, w: u32, h: u32, hot: u32) -> u32
pub fn cursor_new(&mut self, f: CursorDraw, w: u32, h: u32, hot: u32) -> u32
ui_cursor_new(f, w, h, hot) -> handle (0 = none)
Sourcepub fn cursor_custom(&mut self, h: u32)
pub fn cursor_custom(&mut self, h: u32)
ui_cursor_custom(handle): the cursor of CUR_CUSTOM hit boxes
Sourcepub fn cursor_current(&self) -> u32
pub fn cursor_current(&self) -> u32
ui_cursor_current -> handle
Source§impl Ui
impl Ui
Sourcepub fn grid_begin(
&mut self,
id: u32,
st: &mut GridState,
cols: &[GridCol<'_>],
keys: &[u64],
) -> (i32, i32)
pub fn grid_begin( &mut self, id: u32, st: &mut GridState, cols: &[GridCol<'_>], keys: &[u64], ) -> (i32, i32)
ui_grid_begin(id, &mut st, cols, keys) -> (first, end): the rows to emit
Sourcepub fn grid_row(&mut self, st: &mut GridState, i: i32) -> u32
pub fn grid_row(&mut self, st: &mut GridState, i: i32) -> u32
ui_grid_row(&mut st, i) -> EV_* of row i (EV_ACT clicked)
Sourcepub fn grid_cell(&mut self, st: &GridState, c: usize)
pub fn grid_cell(&mut self, st: &GridState, c: usize)
ui_grid_cell(&st, c): the next widget is placed into column c of the current row (inset by the cell padding, full row height)
Sourcepub fn grid_text(&mut self, st: &GridState, c: usize, s: &str)
pub fn grid_text(&mut self, st: &GridState, c: usize, s: &str)
ui_grid_text(&st, c, s): body text in column c (cut with “…”, the column’s alignment)
Sourcepub fn grid_text_ts(&mut self, st: &GridState, c: usize, ts: u32, s: &str)
pub fn grid_text_ts(&mut self, st: &GridState, c: usize, ts: u32, s: &str)
ui_grid_text_ts(&st, c, ts, s): text in column c with a text style (TS_* | TX_*)
Sourcepub fn tree(
&mut self,
id: u32,
st: &mut TreeState,
rows: &[TreeRow<'_>],
row_h: i32,
) -> TreeEv
pub fn tree( &mut self, id: u32, st: &mut TreeState, rows: &[TreeRow<'_>], row_h: i32, ) -> TreeEv
ui_tree(id, &mut st, rows, row_h) -> TreeEv: the visible rows of a tree (row_h DIP, 0 = the grid row height)
Sourcepub fn badge(&mut self, kind: u32, label: &str)
pub fn badge(&mut self, kind: u32, label: &str)
ui_badge(kind, label): a status pill (BADGE_*; next_icon puts an icon before the text); placed narrower than the pill (a grid cell), the label is cut with “…”
Sourcepub fn status_dot(&mut self, kind: u32)
pub fn status_dot(&mut self, kind: u32)
ui_status_dot(kind): a 10 DIP status dot (BADGE_*)
Source§impl Ui
impl Ui
Sourcepub fn time_box(&mut self, id: u32, hour: &mut i32, minute: &mut i32) -> u32
pub fn time_box(&mut self, id: u32, hour: &mut i32, minute: &mut i32) -> u32
ui_time_box(id, &mut hour, &mut minute) -> EV_* (EV_ACT changed)
Sourcepub fn weekday_toggles(&mut self, id: u32, mask: &mut u32) -> u32
pub fn weekday_toggles(&mut self, id: u32, mask: &mut u32) -> u32
ui_weekday_toggles(id, &mut mask) -> EV_* (EV_ACT changed); bit 0 = Monday. The buttons wrap where the row has less room than the seven of them (a narrow card)
Source§impl Ui
impl Ui
Sourcepub fn diagram(
&mut self,
id: u32,
st: &mut DiagramState,
m: &DModel<'_>,
tool: u32,
paint: Option<Rc<dyn DgPaint>>,
ver: u32,
) -> Vec<DEv>
pub fn diagram( &mut self, id: u32, st: &mut DiagramState, m: &DModel<'_>, tool: u32, paint: Option<Rc<dyn DgPaint>>, ver: u32, ) -> Vec<DEv>
ui_diagram(id, st, m, tool, paint, ver) -> what the user did: the node / edge canvas in the next layout slot (see the file header)
Sourcepub fn diagram_minimap(
&mut self,
id: u32,
st: &mut DiagramState,
m: &DModel<'_>,
) -> bool
pub fn diagram_minimap( &mut self, id: u32, st: &mut DiagramState, m: &DModel<'_>, ) -> bool
ui_diagram_minimap(id, st, m) -> the view moved: an overview of the nodes and the shown part in the bottom right corner of the last diagram (nothing when the canvas is small); pressing or dragging there centres the view on that point
Sourcepub fn diagram_sems(
&mut self,
id: u32,
st: &mut DiagramState,
m: &DModel<'_>,
label: &dyn Fn(u64) -> String,
)
pub fn diagram_sems( &mut self, id: u32, st: &mut DiagramState, m: &DModel<'_>, label: &dyn Fn(u64) -> String, )
ui_diagram_sems(id, st, m, label): one K_LISTITEM record per node the last diagram call showed (label(key), value = the node’s index, selected / focused / hover states), cut to the canvas; a screen reader’s click on one selects it
Sourcepub fn diagram_edge_sems(
&mut self,
id: u32,
st: &mut DiagramState,
m: &DModel<'_>,
label: &dyn Fn(u64) -> String,
)
pub fn diagram_edge_sems( &mut self, id: u32, st: &mut DiagramState, m: &DModel<'_>, label: &dyn Fn(u64) -> String, )
ui_diagram_edge_sems(id, st, m, label): one K_LISTITEM record per edge the last diagram call showed (label(key); value = the edge’s index; selected / focused / hover states), a small box around the middle of its route cut to the canvas, after the nodes’ records; a screen reader’s click on one selects the edge (and focuses it with tab_edges)
Source§impl Ui
impl Ui
Sourcepub fn dirty_force_full(&mut self)
pub fn dirty_force_full(&mut self)
dirty_force_full: the next frame redraws and presents everything
Source§impl Ui
impl Ui
Sourcepub fn drag_source(&mut self, id: u32, ev: u32) -> u32
pub fn drag_source(&mut self, id: u32, ev: u32) -> u32
drag_source(id, ev) -> DS_START / DS_ACTIVE / DS_END / 0 for the widget id whose
behave returned ev: DS_START when a drag of it begins (call drag_set in this pass),
DS_ACTIVE while its content is dragged, DS_END once afterwards (drag_effect())
Sourcepub fn drag_set(&mut self, data: DragData)
pub fn drag_set(&mut self, data: DragData)
drag_set(data): the content of the drag that starts (after DS_START, same pass)
Sourcepub fn drag_out(&mut self, data: DragData) -> bool
pub fn drag_out(&mut self, data: DragData) -> bool
drag_out(data) -> started: (the left button held) the platform drags data out of the app right away (DoDragDrop, Xdnd, wl_data_device.start_drag); UIC_DRAG_END at the end
Sourcepub fn drag_effect(&self) -> u32
pub fn drag_effect(&self) -> u32
the effect of the app’s last drag: DE_COPY / DE_MOVE / DE_LINK, 0 = cancelled / refused
Sourcepub fn dragging(&self) -> bool
pub fn dragging(&self) -> bool
one of the app’s drags runs (inside the app or carried by the platform)
Sourcepub fn drop_target(&mut self, id: u32, types: u32) -> u32
pub fn drop_target(&mut self, id: u32, types: u32) -> u32
drop_target(id, types) -> DS_HOVER / DS_DROP / 0: the widget at last_rect takes drags of these DT_* kinds (DT_USER0 << k: the app’s own). DS_HOVER while such a drag is over it (the style draws the highlight), DS_DROP in the pass of the drop (drop_data())
Sourcepub fn drop_accept(&mut self, types: u32)
pub fn drop_accept(&mut self, types: u32)
drop_accept(types): the DT_* kinds a window takes outside every drop target (default DT_FILES); those drops arrive as UIC_DROP
Sourcepub fn drag_over(&self) -> (u32, i32, i32)
pub fn drag_over(&self) -> (u32, i32, i32)
drag_over() -> (DT_* kinds, x, y DIP): the drag over the live window, (0, 0, 0) = none
Sourcepub fn drop_effect(&self) -> u32
pub fn drop_effect(&self) -> u32
the effect of the last drop (DE_*)
Source§impl Ui
impl Ui
Sourcepub fn richtext(&mut self, id: u32, doc: &mut RichDoc, flags: u32) -> u32
pub fn richtext(&mut self, id: u32, doc: &mut RichDoc, flags: u32) -> u32
ui_richtext(id, doc, RT_) -> EV_ (see the module header)
Sourcepub fn richtext_link(&mut self, id: u32) -> Option<String>
pub fn richtext_link(&mut self, id: u32) -> Option<String>
a link the user activated in richtext id (Ctrl+click, a click when read-only,
Ctrl+Enter), taken once
Sourcepub fn richtext_link_dialog(&mut self, id: u32, doc: &RichDoc)
pub fn richtext_link_dialog(&mut self, id: u32, doc: &RichDoc)
open the link flyout of richtext id (as Ctrl+K does): the url of the link at the
caret or “https://”; OK sets it on the selection (without one: inserts it as linked
text), “Entfernen” removes the link
Source§impl Ui
impl Ui
Sourcepub fn markdown_view(
&mut self,
id: u32,
st: &mut MdViewState,
text: &str,
flags: u32,
) -> MdEv
pub fn markdown_view( &mut self, id: u32, st: &mut MdViewState, text: &str, flags: u32, ) -> MdEv
ui_markdown_view(id, &mut st, text, MV_*) -> MdEv (see the module header of md_view.rs)
Sourcepub fn markdown_fit(
&mut self,
st: &mut MdViewState,
text: &str,
w_px: i32,
flags: u32,
) -> i32
pub fn markdown_fit( &mut self, st: &mut MdViewState, text: &str, w_px: i32, flags: u32, ) -> i32
ui_markdown_fit(&mut st, text, w_px, MV_*) -> the height in DIP a view w_px wide needs for the whole text (see the module header)
Source§impl Ui
impl Ui
Sourcepub fn vlist_begin(
&mut self,
id: u32,
st: &mut VListState,
count: usize,
) -> (usize, usize)
pub fn vlist_begin( &mut self, id: u32, st: &mut VListState, count: usize, ) -> (usize, usize)
ui_vlist_begin(id, &mut st, count) -> (first, end): the rows to emit (see the module header)
Sourcepub fn vlist_item_begin(&mut self, i: usize) -> u32
pub fn vlist_item_begin(&mut self, i: usize) -> u32
ui_vlist_item_begin(i) -> EV_*: row i (see the module header)
Sourcepub fn vlist_item_end(&mut self)
pub fn vlist_item_end(&mut self)
ui_vlist_item_end: the row’s height is measured
Sourcepub fn vlist_sel(&self) -> i32
pub fn vlist_sel(&self) -> i32
the selection of the innermost vlist while its rows are emitted (-1 outside one)
Sourcepub fn vlist_end(&mut self, st: &mut VListState) -> u32
pub fn vlist_end(&mut self, st: &mut VListState) -> u32
ui_vlist_end(&mut st) -> EV_* (see the module header)
Source§impl Ui
impl Ui
Sourcepub fn code_theme(&self) -> CodeTheme
pub fn code_theme(&self) -> CodeTheme
the code editors’ colours for the UI’s theme: dark / light syntax colours on the UI’s text box colours (accent selection, diagnostics in its critical / warning / info colours), or the high-contrast scheme’s colours
Source§impl Ui
impl Ui
Sourcepub fn code_theme_set(&mut self, theme: Option<CodeTheme>)
pub fn code_theme_set(&mut self, theme: Option<CodeTheme>)
the colours of every code editor (None: code_theme(), following the UI’s theme)
Sourcepub fn code_font_size(&mut self, pt: f32)
pub fn code_font_size(&mut self, pt: f32)
the size of the code editors’ font in points (0: 10 pt)
Sourcepub fn code_find(&mut self, id: u32, query: &str, replace: bool)
pub fn code_find(&mut self, id: u32, query: &str, replace: bool)
open the find bar of code editor id with a query (replace: with the replace row); the editor selects the first match from its caret on
Sourcepub fn code_status(&self, id: u32) -> CodeStatus
pub fn code_status(&self, id: u32) -> CodeStatus
the caret, the find matches, the lines tokenized and the diagnostics in code editor id’s last frame
Sourcepub fn code_diag(&self, id: u32) -> Option<Diag>
pub fn code_diag(&self, id: u32) -> Option<Diag>
the most severe diagnostic at the caret of code editor id in its last frame (its message for a status bar)
Sourcepub fn code_events(&self, id: u32) -> Vec<CodeEv>
pub fn code_events(&self, id: u32) -> Vec<CodeEv>
what the user asked of code editor id in its last pass (go to definition, rename, format, a breakpoint’s click)
Sourcepub fn code_popup_item(&self, id: u32) -> Option<CompItem>
pub fn code_popup_item(&self, id: u32) -> Option<CompItem>
the item the completion list of code editor id has chosen (None: closed)
Sourcepub fn code_editor(
&mut self,
id: u32,
doc: &mut CodeDoc,
h: &Highlighter,
flags: u32,
) -> u32
pub fn code_editor( &mut self, id: u32, doc: &mut CodeDoc, h: &Highlighter, flags: u32, ) -> u32
ui_code_editor(id, doc, hl, CE_) -> EV_ (see the module header)
Sourcepub fn code_editor_with(
&mut self,
id: u32,
doc: &mut CodeDoc,
h: &Highlighter,
assist: Option<&mut dyn CodeAssist>,
flags: u32,
) -> u32
pub fn code_editor_with( &mut self, id: u32, doc: &mut CodeDoc, h: &Highlighter, assist: Option<&mut dyn CodeAssist>, flags: u32, ) -> u32
code_editor with a language’s services (completion, hover, signature help; see the module header and code_assist.rs)
Source§impl Ui
impl Ui
Sourcepub fn dock_begin(
&mut self,
id: u32,
st: &mut DockState,
panels: &[DockPanel<'_>],
)
pub fn dock_begin( &mut self, id: u32, st: &mut DockState, panels: &[DockPanel<'_>], )
dock_begin(id, &mut st, panels): open the dock area (always pair with dock_end; fill it with dock_next). It takes the next place of the box (the whole rest when no size was set); panels: every panel the app has, each frame (titles and icons may change).
Source§impl Ui
impl Ui
Sourcepub fn drop_count(&self) -> u32
pub fn drop_count(&self) -> u32
ui_drop_count: files of the last drop
Sourcepub fn drop_path(&self, i: u32) -> Option<&str>
pub fn drop_path(&self, i: u32) -> Option<&str>
ui_drop_path(i): path i of the last drop (None when out of range)
Sourcepub fn open_take(&mut self) -> Vec<Request>
pub fn open_take(&mut self) -> Vec<Request>
AF_SINGLE_INSTANCE: the command lines of later starts that arrived (UIC_OPEN), oldest first; each call takes them
Sourcepub fn drop_pos(&self) -> (i32, i32)
pub fn drop_pos(&self) -> (i32, i32)
ui_drop_pos: drop position in DIP of the window it happened in
Sourcepub fn drop_window(&self) -> u32
pub fn drop_window(&self) -> u32
ui_drop_window: the app id of the window of the last drop (0 = main window)
Sourcepub fn drop_data(&self) -> &DragData
pub fn drop_data(&self) -> &DragData
everything the last drop carried (paths, text, URLs, HTML, image, the app’s own kind and bytes; effects = the effect it was dropped with)
Sourcepub fn drop_types(&self) -> u32
pub fn drop_types(&self) -> u32
the DT_* kinds of the last drop
Source§impl Ui
impl Ui
Sourcepub fn textbox_surface(
&mut self,
id: u32,
text: &mut String,
cap_flags: u32,
lines: &[TextSurfaceLine],
) -> u32
pub fn textbox_surface( &mut self, id: u32, text: &mut String, cap_flags: u32, lines: &[TextSurfaceLine], ) -> u32
Edit one UTF-8 buffer over caller-rendered rich text, without repainting its content. Layout may span differently sized/aligned lines and pages; each UTF-8 scalar boundary needs a caret stop. Text changes report EV_ACT and request a fresh layout on the next pass. Invalid ranges reject the call without consuming input. The caller owns scroll positioning and document history. Ordinary textboxes are unaffected.
Source§impl Ui
impl Ui
Sourcepub fn spell_enable(&mut self, on: bool)
pub fn spell_enable(&mut self, on: bool)
the spell checking switch for every TB_SPELL box (default on)
Sourcepub fn spell_language(&mut self, tag: &str)
pub fn spell_language(&mut self, tag: &str)
the language of the checker: a BCP 47 tag (“de-DE”), “” = the user’s languages
Sourcepub fn spell_sources(&mut self, sources: u32)
pub fn spell_sources(&mut self, sources: u32)
where checkers come from (spell::SRC_*; 0 = the default, see the module header)
Sourcepub fn spell_suggest_async(&mut self, on: bool)
pub fn spell_suggest_async(&mut self, on: bool)
suggestions on a worker: on / off (default: on in window mode, off in headless runs)
Sourcepub fn spell_state(&self) -> u32
pub fn spell_state(&self) -> u32
SPELL_OFF / SPELL_LOADING / SPELL_READY / SPELL_NONE
Source§impl Ui
impl Ui
Sourcepub fn textbox_selection(&self, id: u32) -> Option<(usize, usize)>
pub fn textbox_selection(&self, id: u32) -> Option<(usize, usize)>
Read the focused textbox’s UTF-8 byte selection (anchor, caret), after drawing it. Opt-in API for document editors; ordinary textbox behavior is unchanged.
Sourcepub fn textbox_select(
&mut self,
id: u32,
text: &str,
anchor: usize,
caret: usize,
) -> bool
pub fn textbox_select( &mut self, id: u32, text: &str, anchor: usize, caret: usize, ) -> bool
Select valid UTF-8 byte boundaries in an already focused/drawn textbox. Pass the same current text used by textbox(); returns false without changes for invalid ranges.
Sourcepub fn textbox(
&mut self,
id: u32,
placeholder: Option<&str>,
buf: &mut String,
cap_flags: u32,
) -> u32
pub fn textbox( &mut self, id: u32, placeholder: Option<&str>, buf: &mut String, cap_flags: u32, ) -> u32
ui_textbox(id, placeholder, buf, cap_flags) -> EV_* (see the module header)
Sourcepub fn textbox_icon(
&mut self,
id: u32,
icon: u32,
placeholder: Option<&str>,
buf: &mut String,
cap_flags: u32,
) -> u32
pub fn textbox_icon( &mut self, id: u32, icon: u32, placeholder: Option<&str>, buf: &mut String, cap_flags: u32, ) -> u32
Single-line text input with a leading semantic icon. The icon reserves its own inset, so pointer selection, caret scrolling and IME share the visible text origin. Multiline inputs ignore the icon and retain their ordinary presentation.
Sourcepub fn textbox_presented(
&mut self,
id: u32,
placeholder: Option<&str>,
buf: &mut String,
cap_flags: u32,
presentation: TextboxPresentation,
) -> u32
pub fn textbox_presented( &mut self, id: u32, placeholder: Option<&str>, buf: &mut String, cap_flags: u32, presentation: TextboxPresentation, ) -> u32
Edit multiline text on a caller-provided surface without the style’s textbox frame.
Uses zero text insets and the supplied font, line metrics and colors. The supplied
presentation applies only to this call; ordinary textboxes keep their default style.
TB_MULTI is implicit; other capacity and textbox flags retain their usual meaning.
pub fn ime_pos(&mut self, x: i32, y: i32, h: i32)
Sourcepub fn clip_set_many(&mut self, entries: &[(u32, &[u8])]) -> i32
pub fn clip_set_many(&mut self, entries: &[(u32, &[u8])]) -> i32
Publish distinct TEXT/HTML/RTF/DOCX representations of one selection (64 MiB total). Validation precedes replacement; 0 means every representation was published.
Sourcepub fn clip_set(&mut self, fmt: u32, data: &[u8]) -> i32
pub fn clip_set(&mut self, fmt: u32, data: &[u8]) -> i32
Replace the clipboard with one text, image or rich representation.
Sourcepub fn clip_get(&mut self, fmt: u32) -> Option<Vec<u8>>
pub fn clip_get(&mut self, fmt: u32) -> Option<Vec<u8>>
ui_clip_get(fmt) -> the clipboard data (text: UTF-8) or None
Sourcepub fn open_folder(&mut self, path: &str) -> i32
pub fn open_folder(&mut self, path: &str) -> i32
ui_open_folder(path) -> 0 / -1: (U2) show a folder (or a file selected in its folder) in the system file manager; headless runs start nothing: they print “ui_open_folder: PATH” and return 0
Sourcepub fn open_url(&mut self, url: &str) -> i32
pub fn open_url(&mut self, url: &str) -> i32
ui_open_url(url) -> 0 / -1: a web page / mailto link in the default application; headless runs print “ui_open_url: URL” and return 0
Sourcepub fn number_box(&mut self, id: u32, v: &mut i32, rg: &Range) -> u32
pub fn number_box(&mut self, id: u32, v: &mut i32, rg: &Range) -> u32
ui_number_box(id, &mut v, &range) -> EV_* (see the module header)
Sourcepub fn number_box_f(&mut self, id: u32, v: &mut f64, rf: &RangeF) -> u32
pub fn number_box_f(&mut self, id: u32, v: &mut f64, rf: &RangeF) -> u32
ui_number_box_f(id, &mut v, &range_f) -> EV_* (U1; see the module header)
Source§impl Ui
impl Ui
Sourcepub fn font_conf(&mut self) -> &FontConf
pub fn font_conf(&mut self) -> &FontConf
the rules for generic families, substitutes and languages
Sourcepub fn font_load(&mut self, sel: &FontSel) -> Option<u32>
pub fn font_load(&mut self, sel: &FontSel) -> Option<u32>
the font of a choice loaded into ui.text -> its id (None: no installed font fits)
Sourcepub fn font_resolved(&mut self, sel: &FontSel) -> String
pub fn font_resolved(&mut self, sel: &FontSel) -> String
the installed family font_load takes for a choice (“” none)
Sourcepub fn font_register(
&mut self,
family: &str,
weight: u32,
italic: bool,
font: u32,
)
pub fn font_register( &mut self, family: &str, weight: u32, italic: bool, font: u32, )
a font of the app’s own (an id of ui.text.load_mem) under a family name: font_load takes it for that family, weight and slant without asking the installed fonts; the rich-text toolbar lists the registered families (rich_edit.rs)
Sourcepub fn font_registered(&self) -> Vec<String>
pub fn font_registered(&self) -> Vec<String>
the families of font_register, in the order of their first registration
Sourcepub fn text_in_font(&mut self, font: u32, size_pt: f64, s: &str)
pub fn text_in_font(&mut self, font: u32, size_pt: f64, s: &str)
one line of text in font id font at size_pt points (the body text colour)
Sourcepub fn font_picker(&mut self, id: u32, sel: &mut FontSel) -> u32
pub fn font_picker(&mut self, id: u32, sel: &mut FontSel) -> u32
the font picker (see the module header) -> EV_ACT when sel changed
Source§impl Ui
impl Ui
Sourcepub fn gridbox_begin(&mut self, id: u32, cols: &[i32], flags: u32, gap: i32)
pub fn gridbox_begin(&mut self, id: u32, cols: &[i32], flags: u32, gap: i32)
gridbox_begin(id, cols, flags, gap): open a grid (see the module comment)
Sourcepub fn gridbox_rows(&mut self, rows: &[i32])
pub fn gridbox_rows(&mut self, rows: &[i32])
gridbox_rows(rows): row sizes of the open grid (DIP; > 0 fixed, 0 natural, < 0 fill)
Sourcepub fn next_span(&mut self, cols: u32, rows: u32)
pub fn next_span(&mut self, cols: u32, rows: u32)
next_span(cols, rows): the next grid child covers that many cells
Sourcepub fn next_cell(&mut self, col: u32, row: u32)
pub fn next_cell(&mut self, col: u32, row: u32)
next_cell(col, row): the next grid child starts in that cell
Sourcepub fn next_align(&mut self, h: u32, v: u32)
pub fn next_align(&mut self, h: u32, v: u32)
next_align(h, v): the next grid child’s alignment (AL_*; AL_DEFAULT: the grid’s)
Sourcepub fn gridbox_end(&mut self)
pub fn gridbox_end(&mut self)
gridbox_end: store the measured sizes (another pass when they changed), close the box
Source§impl Ui
impl Ui
Source§impl Ui
impl Ui
Sourcepub fn image_view(
&mut self,
id: u32,
st: &mut ImageViewState,
img: ViewImage<'_>,
flags: u32,
) -> u32
pub fn image_view( &mut self, id: u32, st: &mut ImageViewState, img: ViewImage<'_>, flags: u32, ) -> u32
ui_image_view(id, st, img, flags) -> EV: the image viewer (see the module header of imgview.rs)
Source§impl Ui
impl Ui
Sourcepub fn hyph_language(&mut self, tag: &str)
pub fn hyph_language(&mut self, tag: &str)
the hyphenation language: a BCP 47 tag (“de-DE”); “” = the UI language’s
Sourcepub fn next_hyph_language(&mut self, tag: &str)
pub fn next_hyph_language(&mut self, tag: &str)
the language of the next wrapped text or multi-line box only (it counts when that one hyphenates: TX_HYPHENATE, TB_HYPHENATE)
Sourcepub fn hyph_sources(&mut self, sources: u32)
pub fn hyph_sources(&mut self, sources: u32)
where hyphenation dictionaries come from (spell::SRC_*; 0 = the default)
Sourcepub fn hyph_set(&mut self, tag: &str, h: Hyphenator)
pub fn hyph_set(&mut self, tag: &str, h: Hyphenator)
the app’s own hyphenation patterns for a language tag (“de”, “en-US”)
Sourcepub fn hyphenator(&mut self, tag: &str) -> Option<Arc<Hyphenator>>
pub fn hyphenator(&mut self, tag: &str) -> Option<Arc<Hyphenator>>
the hyphenation patterns for a tag (“”: the current language), None when there are none
Source§impl Ui
impl Ui
Source§impl Ui
impl Ui
Sourcepub fn gpu_output(&self, win: u32) -> GpuOutput
pub fn gpu_output(&self, win: u32) -> GpuOutput
what window win (a UI window index, 0 = main) shows through
Sourcepub fn gpu_test_lose(&mut self)
pub fn gpu_test_lose(&mut self)
(test aid) the device behaves as lost from now on: the next frame goes back to the CPU path, a new device follows
Sourcepub fn gpu_test_image_budget(&mut self, bytes: u64)
pub fn gpu_test_image_budget(&mut self, bytes: u64)
(test aid) the bytes image textures may take
Sourcepub fn gpu_test_canvas_budget(&mut self, bytes: u64)
pub fn gpu_test_canvas_budget(&mut self, bytes: u64)
(test aid) the bytes canvas tiles may take
Sourcepub fn gpu_test_canvas_unused(&mut self, ms: u64)
pub fn gpu_test_canvas_unused(&mut self, ms: u64)
(test aid) the tiles go this long (ms) after the last move
Sourcepub fn gpu_canvas_settle(&mut self)
pub fn gpu_canvas_settle(&mut self)
every canvas whose view comes from tiles goes back to the CPU’s picture with the next frame
Sourcepub fn gpu_settle(&mut self)
pub fn gpu_settle(&mut self)
the pixels of the images the GPU draws into the framebuffers (Ui::fb reads them then)
Source§impl Ui
impl Ui
Sourcepub fn canvas_gpu_wanted(&self) -> bool
pub fn canvas_gpu_wanted(&self) -> bool
is the GPU output there to use a CanvasDesc? A widget without one saves building it
Sourcepub fn canvas_gpu(&mut self, d: CanvasDesc)
pub fn canvas_gpu(&mut self, d: CanvasDesc)
the custom command recorded last shows this content through this view (module header)
Sourcepub fn canvas_gpu_damage(&mut self, id: u32, r: [f64; 4])
pub fn canvas_gpu_damage(&mut self, id: u32, r: [f64; 4])
the content rectangle x0, y0, x1, y1 (content units) of canvas id changed: its tiles go
Source§impl Ui
impl Ui
Sourcepub fn inspect_enable(&mut self, on: bool)
pub fn inspect_enable(&mut self, on: bool)
arm the inspector (--inspect, jfgui_INSPECT=1): its hot keys (Ctrl+Shift+I and F12,
inspect_keys) open and close it; false closes it, the keys reach the app again
Sourcepub fn inspect_show(&mut self, on: bool)
pub fn inspect_show(&mut self, on: bool)
open / close the inspector: its overlay in the app’s windows and its tool window “Inspektor” (opening arms it); closed it costs nothing
Sourcepub fn inspect_open(&self) -> bool
pub fn inspect_open(&self) -> bool
the inspector is open
Sourcepub fn inspect_keys(&mut self, keys: &[u32])
pub fn inspect_keys(&mut self, keys: &[u32])
the inspector’s hot keys: VK | MOD_* << 16 each (MOD_SHIFT / MOD_CTRL / MOD_ALT);
default Ctrl+Shift+I and F12, none: only the API and --inspect open it
Source§impl Ui
impl Ui
Sourcepub fn focus_group_begin(&mut self, id: u32)
pub fn focus_group_begin(&mut self, id: u32)
focus_group_begin(id): the focusable widgets up to focus_group_end are one Tab stop, the arrows move inside (id 0: the current box’s id)
Sourcepub fn focus_group_end(&mut self)
pub fn focus_group_end(&mut self)
focus_group_end
Sourcepub fn focus_pane_begin(&mut self, id: u32)
pub fn focus_pane_begin(&mut self, id: u32)
focus_pane_begin(id): the widgets up to focus_pane_end are a pane (F6 / Shift+F6)
Sourcepub fn focus_pane_end(&mut self)
pub fn focus_pane_end(&mut self)
focus_pane_end
Sourcepub fn group_arrived(&mut self, id: u32) -> bool
pub fn group_arrived(&mut self, id: u32) -> bool
group_arrived(id): the arrow keys of its focus group just moved the focus to widget id (true once; a widget whose selection follows the focus – tabs, radios – selects itself then)
Sourcepub fn splitter_keys(&mut self, ev: u32, along_x: bool) -> i32
pub fn splitter_keys(&mut self, ev: u32, along_x: bool) -> i32
splitter_keys(ev, along_x) -> how far (DIP, + right / down) the keys of this pass move a focused splitter of the app (a box with HB_SPLITTER, its events ev; along_x: it moves left / right); Home / End: i32::MIN / 2, i32::MAX / 2 (clamp it); Enter / Esc give the focus back to the widget focused before F8
Source§impl Ui
impl Ui
Sourcepub fn next_size(&mut self, w: i32, h: i32)
pub fn next_size(&mut self, w: i32, h: i32)
ui_next_size(w, h): DIP; > 0 fixed, 0 natural, < 0 fill weight
Sourcepub fn next_rect(&mut self, x: i32, y: i32, w: i32, h: i32)
pub fn next_rect(&mut self, x: i32, y: i32, w: i32, h: i32)
ui_next_rect(x, y, w, h): DIP relative to the current box’s content origin
Sourcepub fn next_rect_px(&mut self, x: i32, y: i32, w: i32, h: i32)
pub fn next_rect_px(&mut self, x: i32, y: i32, w: i32, h: i32)
ui_next_rect_px(x, y, w, h): absolute placement of the next widget / box in window px (w or h 0 = natural size); nothing is accounted in the parent box
Sourcepub fn box_offset(&mut self, dx: i32, dy: i32)
pub fn box_offset(&mut self, dx: i32, dy: i32)
ui_box_offset(dx, dy): shift the content of the current box by (-dx, -dy) px
Sourcepub fn next_flags(&mut self, f: u32)
pub fn next_flags(&mut self, f: u32)
ui_next_flags(ST_*): style flags for the next widget (OR-ed)
Sourcepub fn take_flags(&mut self) -> u32
pub fn take_flags(&mut self) -> u32
ui_take_flags: the pending next_flags value (cleared; for widgets)
Sourcepub fn next_icon(&mut self, cp: u32)
pub fn next_icon(&mut self, cp: u32)
ui_next_icon(cp): icon code point (IC_*) for the next widget
Sourcepub fn box_id(&self) -> u32
pub fn box_id(&self) -> u32
ui_box_id: id of the current box (the root box’s id at the top level; 0 outside a pass)
Sourcepub fn box_rect(&self) -> [i32; 4]
pub fn box_rect(&self) -> [i32; 4]
ui_box_rect: [x, y, w, h] content rectangle of the current box (px)
Sourcepub fn place(&mut self, iw: i32, ih: i32) -> [i32; 4]
pub fn place(&mut self, iw: i32, ih: i32) -> [i32; 4]
ui_place(iw, ih) -> last_rect: place the next widget (natural size in px)
Sourcepub fn avail_width(&self, iw: i32) -> (i32, i32)
pub fn avail_width(&self, iw: i32) -> (i32, i32)
ui_avail_width(iw) -> (width px a wrapping widget of natural (unwrapped) width iw gets from the next place, 1 when that width does not depend on iw) – no side effects. 0 = unknown (no wrapping).
Sourcepub fn box_begin(&mut self, id: u32, flags: u32, gap: i32)
pub fn box_begin(&mut self, id: u32, flags: u32, gap: i32)
ui_box_begin(id, flags, gap): open a container (id 0 = automatic)
Sourcepub fn box_end(&mut self)
pub fn box_end(&mut self)
ui_box_end: store the measured natural size, correct the parent’s totals
Sourcepub fn spacer(&mut self, dip: i32)
pub fn spacer(&mut self, dip: i32)
ui_spacer(dip): empty space along the main axis (< 0 = fill weight)
Sourcepub fn dp(&self, dip: i32) -> i32
pub fn dp(&self, dip: i32) -> i32
ui_dp(dip): DIP -> physical pixels, round(dip * dpi / 96) (signed)
Source§impl Ui
impl Ui
Sourcepub fn scroll_begin(&mut self, id: u32, flags: u32)
pub fn scroll_begin(&mut self, id: u32, flags: u32)
ui_scroll_begin(id, flags)
Sourcepub fn scroll_end(&mut self)
pub fn scroll_end(&mut self)
ui_scroll_end
Sourcepub fn scroll_to(&mut self, id: u32, x: i32, y: i32)
pub fn scroll_to(&mut self, id: u32, x: i32, y: i32)
ui_scroll_to(id, x, y): DIP, -1 keeps that axis; jumps without animation
Sourcepub fn scroll_pos(&mut self, id: u32) -> (i32, i32)
pub fn scroll_pos(&mut self, id: u32) -> (i32, i32)
ui_scroll_pos(id) -> (x, y) DIP
Sourcepub fn scroll_extent(&mut self, id: u32) -> (i32, i32)
pub fn scroll_extent(&mut self, id: u32) -> (i32, i32)
ui_scroll_extent(id) -> (w, h): measured content size of scroll view id (DIP; 0
before its first pass). With the view size (last_rect after scroll_end) the app can
tell whether the content overflows. (U3)
Sourcepub fn scrollbar(
&mut self,
id: u32,
pos: &mut i32,
content: i32,
view: i32,
vertical: bool,
) -> u32
pub fn scrollbar( &mut self, id: u32, pos: &mut i32, content: i32, view: i32, vertical: bool, ) -> u32
ui_scrollbar(id, &mut pos, content, view, vertical) -> EV_*
Sourcepub fn list_begin(
&mut self,
id: u32,
sel: &mut i32,
count: i32,
item_h: u32,
) -> (i32, i32)
pub fn list_begin( &mut self, id: u32, sel: &mut i32, count: i32, item_h: u32, ) -> (i32, i32)
ui_list_begin(id, &mut sel, count, item_h | LF_*) -> (first, end): the rows to emit
Sourcepub fn list_item_begin(&mut self, i: i32) -> u32
pub fn list_item_begin(&mut self, i: i32) -> u32
ui_list_item_begin(i) -> EV_*: row i with a BOX_H (gap 8 DIP) for custom content
Sourcepub fn list_sel(&self) -> i32
pub fn list_sel(&self) -> i32
the innermost list’s selection while its rows are emitted (the asm’s rows see the app’s variable change at once; here the list holds it until list_end), -1 outside a list
Sourcepub fn list_item_end(&mut self)
pub fn list_item_end(&mut self)
ui_list_item_end
Sourcepub fn list_end(&mut self, sel: &mut i32) -> (u32, i32)
pub fn list_end(&mut self, sel: &mut i32) -> (u32, i32)
ui_list_end(&mut sel) -> (EV_* (EV_ACT if sel changed, EV_DOUBLE), sel); EV_DRAG: a row was dropped, the second value is from | to << 16
Sourcepub fn tabs_scrolling(&mut self, id: u32, sel: &mut i32, names: &[&str]) -> u32
pub fn tabs_scrolling(&mut self, id: u32, sel: &mut i32, names: &[&str]) -> u32
Tab strip with horizontal overflow arrows. Mouse scrolling and Left/Right,
Home/End on the strip retain ordinary tab semantics; changed selections
and resized viewports reveal the selected tab. Internal IDs follow the
usual (id * 8 + part) | 0x80000000 convention (parts 1, 2, 3 and 7).
Sourcepub fn tabs(&mut self, id: u32, sel: &mut i32, names: &[&str]) -> u32
pub fn tabs(&mut self, id: u32, sel: &mut i32, names: &[&str]) -> u32
ui_tabs(id, &mut sel, names) -> EV_* (EV_ACT when sel changed)
Sourcepub fn expander_begin(&mut self, id: u32, header: &str, open: &mut i32) -> i32
pub fn expander_begin(&mut self, id: u32, header: &str, open: &mut i32) -> i32
ui_expander_begin(id, header, &mut open) -> open: a card-like header (48 DIP) with a chevron; when open the content follows in a padded card below it (BOX_V, PAD_16, gap 8 DIP). Always call expander_end.
Sourcepub fn expander_end(&mut self)
pub fn expander_end(&mut self)
ui_expander_end
Source§impl Ui
impl Ui
Sourcepub fn toast(&mut self, kind: u32, title: &str, msg: &str, ms: u32) -> u32
pub fn toast(&mut self, kind: u32, title: &str, msg: &str, ms: u32) -> u32
ui_toast(kind, title, msg, ms) -> toast id
Sourcepub fn toast_dismiss(&mut self, id: u32)
pub fn toast_dismiss(&mut self, id: u32)
ui_toast_dismiss(id)
Sourcepub fn toast_clear(&mut self)
pub fn toast_clear(&mut self)
ui_toast_clear
Sourcepub fn toasts(&self) -> Vec<(u32, u32, String, String)>
pub fn toasts(&self) -> Vec<(u32, u32, String, String)>
the queued toasts: (id, kind, title, message)
Sourcepub fn toast_host(&mut self)
pub fn toast_host(&mut self)
ui_toast_host: draw the toasts (once per frame, after the content)
Sourcepub fn progress_indeterminate(&mut self, id: u32)
pub fn progress_indeterminate(&mut self, id: u32)
ui_progress_indeterminate(id): a bar with a running segment
Source§impl Ui
impl Ui
Sourcepub fn preview_card(
&mut self,
id: u32,
label: &str,
draw: Option<DrawRef>,
user: usize,
version: u32,
) -> u32
pub fn preview_card( &mut self, id: u32, label: &str, draw: Option<DrawRef>, user: usize, version: u32, ) -> u32
Focusable document/template preview card, naturally 150×194 DIP. The supplied drawing is inset into a white page; its document colors never follow the UI theme. Hover and selection use the style accent. The full label is exposed to agents.
Sourcepub fn ribbon_theme_tile(
&mut self,
id: u32,
label: &str,
theme_color: u32,
variant: u32,
) -> u32
pub fn ribbon_theme_tile( &mut self, id: u32, label: &str, theme_color: u32, variant: u32, ) -> u32
A 56×66-DIP theme chooser containing a 52×50-DIP miniature page.
theme_color is a document color, independent of the interface theme.
variant selects one of seven sample arrangements (0..=6); larger values wrap.
next_flags(ST_DISABLED | ST_CHECKED) controls behavior and selection, while
the document sample remains fully readable. The caller applies its own theme on EV_ACT.
Source§impl Ui
impl Ui
Sourcepub fn permissions_page(&mut self, id: u32) -> bool
pub fn permissions_page(&mut self, id: u32) -> bool
the permissions section of a settings page: the answers to the app’s permission questions, each with a reset (module header) -> an answer was revoked
Source§impl Ui
impl Ui
Sourcepub fn popup_is_open(&self, id: u32) -> bool
pub fn popup_is_open(&self, id: u32) -> bool
ui_popup_is_open(id): popup id is open
Sourcepub fn popup_count(&self) -> u32
pub fn popup_count(&self) -> u32
ui_popup_count -> open popups of the live window (U3)
Sourcepub fn popup_open(&mut self, id: u32)
pub fn popup_open(&mut self, id: u32)
ui_popup_open(id): open popup id (inside a flyout: as a child of that flyout,
otherwise it replaces every open popup); an open popup only loses its children
Sourcepub fn popup_close(&mut self)
pub fn popup_close(&mut self)
ui_popup_close: close every popup (the focus returns to where it was)
Sourcepub fn flyout_begin(&mut self, id: u32, flags: u32) -> bool
pub fn flyout_begin(&mut self, id: u32, flags: u32) -> bool
ui_flyout_begin(id, FL_*) -> popup id is open: then its content follows (a vertical
box with 4 DIP padding) until flyout_end, which is called in any case. The flyout is
anchored to the last placed widget (FL_POINT: to the pointer position where it
opened) and kept inside the window.
Sourcepub fn popup_ext(&self, i: u32) -> Option<[i32; 4]>
pub fn popup_ext(&self, i: u32) -> Option<[i32; 4]>
ui_popup_ext(i) -> rect x, y, w, h (px, window coordinates) of item i of the live window when it was drawn in the last pass partly outside its framebuffer. Items 0 .. 5 are the open popups, 6 the tooltip. (U3, OS popup windows)
Sourcepub fn popup_rect(&self, i: u32) -> Option<[i32; 4]>
pub fn popup_rect(&self, i: u32) -> Option<[i32; 4]>
ui_popup_rect(i) -> rect (px) of item i of the live window when it was drawn in the last pass (anywhere). The main window gives its popups own OS windows with it while tool windows are shown, so menus stay above them.
Sourcepub fn flyout_end(&mut self)
pub fn flyout_end(&mut self)
ui_flyout_end: close the content of flyout_begin (also when it returned false)
Sourcepub fn cmd_find(&self, id: u32) -> Option<&'static Command>
pub fn cmd_find(&self, id: u32) -> Option<&'static Command>
ui_cmd_find(id) -> the command record of the app’s command table
Sourcepub fn cmd_state(&mut self, id: u32, flags: u32)
pub fn cmd_state(&mut self, id: u32, flags: u32)
ui_cmd_state(id, flags): set the CF_* state of a command; it stays until changed (calling it every frame with the same flags is fine) and overrides the table flags. Up to 1536 commands have a state; more print one UIWARN and are ignored.
Sourcepub fn cmd_flags(&self, id: u32) -> u32
pub fn cmd_flags(&self, id: u32) -> u32
ui_cmd_flags(id) -> CF_* state (cmd_state, else the table flags)
Sourcepub fn cmd_label(&self, id: u32) -> String
pub fn cmd_label(&self, id: u32) -> String
ui_cmd_label(id) -> label of a command without ‘&’ (“” if unknown)
Sourcepub fn accel_text(&self, id: u32) -> String
pub fn accel_text(&self, id: u32) -> String
ui_accel_text(id) -> accelerator of a command as text, e.g. “Strg+Umschalt+S”
Sourcepub fn accel_order_set(&mut self, order: u32)
pub fn accel_order_set(&mut self, order: u32)
ui_accel_order: 0 = “Strg+Umschalt+Alt+X” (default), 1 = “Strg+Alt+Umschalt+X” (U1)
ui_cmd_button(id, ST_) -> EV_: button for a command: icon and label from the table (ST_ICON_ONLY: icon only), tooltip “Label (Strg+S)”, ST_DISABLED / ST_CHECKED from the command state; a click queues the command. Hidden commands draw nothing.
ui_menu_item(id, label) -> EV_*: menu row inside a flyout (next_icon; next_flags ST_DISABLED / ST_CHECKED); activation closes every popup
menu_item with keys (key_text) at the end of the row: a row whose keys the app
handles itself (no command of the table)
Sourcepub fn key_text(&self, vk: u32, mods: u32) -> String
pub fn key_text(&self, vk: u32, mods: u32) -> String
a key with modifiers (MOD_*) as the accelerator texts write it: “Strg+Umschalt+S”, “F5” (the UI language’s names; accel_order_set holds)
ui_menu_cmd(cmd) -> EV_*: menu row for a command (widget id = command id)
ui_menu_sep -> 0: separator line across the flyout
the disabled row an empty Mi::List with this base id shows instead of its placeholder (“”: the placeholder again), for a list that can be empty for different reasons
the rows of the Mi::List menus with this base id (row k: id base + k; the asm app’s STRLIST buffer); the list ends at the first empty string
ui_menubar(menubar) -> EV_OPEN while one of its menus is open (None = the one of AppDesc::menubar). WinUI MenuBar: subtle 32 DIP items, a flyout per menu. Keyboard: Alt (tap) or F10 enter / leave menu bar mode, Alt+mnemonic opens a menu, Left / Right move between the menus, Down / Enter open one, Esc steps back.
ui_menu_popup(menu): open a menu at the pointer (the runtime draws it); for the menu key / Shift+F10 (an EV_RCLICK kbnav.rs gave the focused widget in this pass) at the widget’s lower left corner with its first row focused
ui_context_menu(menu) -> EV_OPEN while menu is open for the last widget. Opens on a
right click (released over the widget), or with the menu key / Shift+F10 while the
widget has the focus – a list row: while the list has it and the row is selected –
(then at its lower left corner, first row focused).
Sourcepub fn context_target(&self) -> u32
pub fn context_target(&self) -> u32
ui_context_target -> id of the widget whose context menu is (or was last) open
ui_dropdown_button(id, label) -> EV_* | EV_OPEN while popup id is open (a click,
Enter / Space, Alt+Down or F4 opens it; the app draws the flyout with
flyout_begin(id, ..) right after). next_flags ST_SUBTLE: flat tool bar look,
ST_ICON_ONLY: icon + chevron, the label as tooltip (U1)
ui_split_button(id, label) -> EV_* of the main part | EV_OPEN while popup id is
open. The chevron part (widget id | 0x80000000; Alt+Down / F4 on the main part)
opens it.
Sourcepub fn combobox(&mut self, id: u32, sel: &mut i32, list: &[&str]) -> u32
pub fn combobox(&mut self, id: u32, sel: &mut i32, list: &[&str]) -> u32
ui_combobox(id, &mut sel, list) -> EV_*: EV_ACT when sel changed, EV_OPEN while the
list is open. WinUI ComboBox: 32 DIP, control fill, chevron; the list opens over the
box with the selected row (accent pill) on it. Keyboard: Up / Down change the
selection, Enter / Space / Alt+Down / F4 open the list. list is a STRLIST (it ends
at the first empty string).
Sourcepub fn tooltip(&mut self, s: &str)
pub fn tooltip(&mut self, s: &str)
ui_tooltip(s): post-modifier: show s as the tooltip of the last widget after 500 ms of hover (at once when another tooltip hid less than 300 ms ago); hidden on press, key or leave. Icon-only buttons call it with their label.
Sourcepub fn tooltip_part(&mut self, s: &str, part: u64)
pub fn tooltip_part(&mut self, s: &str, part: u64)
ui_tooltip_part(s, part): post-modifier like tooltip(s) for one part of the last widget
(an item on a canvas: a cable, a port). The delay starts again when part changes (at
once when a tooltip hid less than 300 ms ago, as between toolbar buttons); a press hides
it until the pointer is over another part; part 0 shows nothing.
Source§impl Ui
impl Ui
Sourcepub fn recent_add(&mut self, path: &str)
pub fn recent_add(&mut self, path: &str)
a file the user opened or saved: first in the app’s recent files and in the system’s
Sourcepub fn recent_open(&mut self, path: &str) -> RecentOpen
pub fn recent_open(&mut self, path: &str) -> RecentOpen
a file of the recent list about to be opened (from the user’s click or key): Ready, Asking (the browser asks for the permission; UIC_RECENT follows) or Missing
Sourcepub fn recent_reopened(&mut self) -> Option<String>
pub fn recent_reopened(&mut self) -> Option<String>
the file UIC_RECENT answered for, once
Sourcepub fn recent_files(&self) -> Vec<String>
pub fn recent_files(&self) -> Vec<String>
the app’s recent files, newest first
Sourcepub fn recent_remove(&mut self, path: &str)
pub fn recent_remove(&mut self, path: &str)
a file out of the app’s and the system’s recent files
Sourcepub fn recent_clear(&mut self)
pub fn recent_clear(&mut self)
the app’s recent files and its entries in the system’s list forgotten
Source§impl Ui
impl Ui
Sourcepub fn ribbon_begin(
&mut self,
id: u32,
groups: &[RibbonGroup<'_>],
) -> RibbonLayout
pub fn ribbon_begin( &mut self, id: u32, groups: &[RibbonGroup<'_>], ) -> RibbonLayout
Start a style-sized ribbon (110 DIP by default). Pair with ribbon_end.
All groups remain keyboard reachable; a scroll strip is the final fallback.
Sourcepub fn ribbon_group_begin(
&mut self,
layout: &RibbonLayout,
index: usize,
group: &RibbonGroup<'_>,
) -> Option<RibbonGroupMode>
pub fn ribbon_group_begin( &mut self, layout: &RibbonLayout, index: usize, group: &RibbonGroup<'_>, ) -> Option<RibbonGroupMode>
Begin a group’s controls when visible, or render its overflow button.
Only call ribbon_group_end when this returns Some.
Sourcepub fn ribbon_group_end(&mut self, mode: RibbonGroupMode, label: &str)
pub fn ribbon_group_end(&mut self, mode: RibbonGroupMode, label: &str)
Finish controls and draw the inline group caption; closes overflow when appropriate. Flyouts already have their named opener, so no trailing caption is painted over a nested action menu emitted while building their controls.
Sourcepub fn ribbon_group_end_launcher(
&mut self,
mode: RibbonGroupMode,
label: &str,
id: u32,
action_label: &str,
flags: u32,
) -> u32
pub fn ribbon_group_end_launcher( &mut self, mode: RibbonGroupMode, label: &str, id: u32, action_label: &str, flags: u32, ) -> u32
Finish a group with a separately focusable dialog-launch button in its caption.
id is an additional unique widget ID; action_label is its full semantic name.
Activation is returned to the app, which opens its existing dialog. Disabled
launchers retain their label and cannot be invoked through keyboard or agents.
Sourcepub fn ribbon_end(&mut self)
pub fn ribbon_end(&mut self)
Finish the ribbon begun with ribbon_begin.
Natural action width in DIP, including the style’s icon, label and menu spacing. Measuring neither consumes next_* hints nor creates a widget. Use it when composing translated ribbon columns before ribbon_begin.
Compact ribbon action with clipped drawing, native focus and a full tooltip.
ST_ICON_ONLY, ST_LARGE, ST_CHECKED and ST_DISABLED are supported.
Large ribbon action: the style draws its icon above a visible caption.
It is one normal focusable, inspectable button. Use next_size to override
its natural style size; checked/disabled flags keep their ordinary meaning.
Ribbon-styled menu opener. id is also the popup identifier. Its natural
dimensions, icon, menu indicator and enabled state come from the style.
Large split action with an icon hit area above its menu caption. Both
parts remain independently focusable and discoverable through semantics.
Pair the menu_id with a normal flyout. Alt+Down/F4 opens the caption menu.
A large primary action beside an independently focusable dropdown.
id identifies the primary action; menu_id identifies both the dropdown
button and its popup. Both IDs must be unique. menu_label is a full semantic
name, not an unlabeled chevron. Pair with flyout_begin(menu_id, ..) and
flyout_end immediately afterwards to provide actual secondary actions.
Returns primary EV_* flags plus EV_OPEN while the dropdown popup is open.
Tab reaches both parts; Enter/Space activate the focused part. Alt+Down or
unbound F4 on the main part forwards to the existing dropdown keyboard path.
Sourcepub fn ribbon_gallery_begin(&mut self, id: u32)
pub fn ribbon_gallery_begin(&mut self, id: u32)
Begin an inset horizontal gallery on an input-colored surface. The caller
supplies its size and tiles; finish with box_end. The whole frame is painted
before applying the three-DIP tile inset, including in dark themes.
Sourcepub fn ribbon_tile(
&mut self,
id: u32,
label: &str,
preview: &str,
typography: u32,
selected: bool,
) -> u32
pub fn ribbon_tile( &mut self, id: u32, label: &str, preview: &str, typography: u32, selected: bool, ) -> u32
Typography preview tile for a style gallery; selection is exposed semantically.
typography is a TS_* style; use next_size to set a compact gallery width.
Sourcepub fn ribbon_font_tile(
&mut self,
id: u32,
label: &str,
preview: &str,
typography: u32,
selected: bool,
face: Option<(u32, i32, u32)>,
) -> u32
pub fn ribbon_font_tile( &mut self, id: u32, label: &str, preview: &str, typography: u32, selected: bool, face: Option<(u32, i32, u32)>, ) -> u32
A gallery tile with an optional document font, 24.8-DIP size and ARGB ink. The surrounding control follows the application theme; the sample stays document-colored.
Sourcepub fn ribbon_sample_tile(
&mut self,
id: u32,
label: &str,
preview: &str,
typography: u32,
selected: bool,
sample: Option<RibbonSample>,
) -> u32
pub fn ribbon_sample_tile( &mut self, id: u32, label: &str, preview: &str, typography: u32, selected: bool, sample: Option<RibbonSample>, ) -> u32
Style-gallery tile with explicit highlight, baseline and text decorations.
Source§impl Ui
impl Ui
Sourcepub fn settings_page(&mut self, id: u32, s: &mut Settings) -> bool
pub fn settings_page(&mut self, id: u32, s: &mut Settings) -> bool
the settings page of the schema of s (see the module header) -> a value changed
Source§impl Ui
impl Ui
ui_nav_begin(id, &mut nav): open the pane (always call nav_end)
ui_nav_toggle(id, label): the menu button of the pane (toggles compact)
ui_nav_section(label): a group caption (a divider when the pane is compact)
ui_nav_item(id, icon, label, selected, badge) -> EV_* (EV_ACT clicked)
ui_nav_footer: end the scrolling item list; the items after it stay at the bottom
ui_nav_end
Sourcepub fn command_bar(&mut self, id: u32, items: &[CmdItem<'_>]) -> Option<u32>
pub fn command_bar(&mut self, id: u32, items: &[CmdItem<'_>]) -> Option<u32>
ui_command_bar(id, items) -> the id of the item clicked in this pass
Sourcepub fn split_begin(&mut self, id: u32, pos: i32, vertical: bool)
pub fn split_begin(&mut self, id: u32, pos: i32, vertical: bool)
ui_split_begin(id, pos, vertical): two panes, the first pos DIP wide (vertical:
high); emit the first pane, split_next, the second pane, split_end
Sourcepub fn split_next(&mut self)
pub fn split_next(&mut self)
ui_split_next: the grip, then the second pane
Sourcepub fn split_end(&mut self, pos: &mut i32) -> bool
pub fn split_end(&mut self, pos: &mut i32) -> bool
ui_split_end(&mut pos) -> the grip moved (pos updated, DIP; the mouse or the keyboard: F8 focuses the grip, arrows move it)
ui_breadcrumb(id, parts) -> the index of a clicked part (the last one is the current page and not a link)
Sourcepub fn segmented(&mut self, id: u32, sel: &mut i32, items: &[&str]) -> u32
pub fn segmented(&mut self, id: u32, sel: &mut i32, items: &[&str]) -> u32
ui_segmented(id, &mut sel, items) -> EV_* (EV_ACT when sel changed)
Sourcepub fn wizard_steps(
&mut self,
id: u32,
steps: &[&str],
current: usize,
states: &[i32],
) -> Option<usize>
pub fn wizard_steps( &mut self, id: u32, steps: &[&str], current: usize, states: &[i32], ) -> Option<usize>
ui_wizard_steps(id, steps, current, states) -> a step to go back to (clicked); states: WS_* per step (missing: done before the current, todo after it)
Sourcepub fn page_header(&mut self, title: &str, subtitle: &str)
pub fn page_header(&mut self, title: &str, subtitle: &str)
ui_page_header(title, subtitle): a page title (TS_TITLE) with an optional secondary line under it
Sourcepub fn key_value(&mut self, key: &str, value: &str, key_width: i32)
pub fn key_value(&mut self, key: &str, value: &str, key_width: i32)
ui_key_value(key, value, key_width): a “label: value” row (TS_BODY, the key in the secondary colour, key_width DIP)
Sourcepub fn empty_state(&mut self, icon: u32, title: &str, text: &str)
pub fn empty_state(&mut self, icon: u32, title: &str, text: &str)
ui_empty_state(icon, title, text): a centred hint for an empty view (icon 0 = none); the text wraps at 360 DIP, or at the enclosing box’s width when that is narrower
Source§impl Ui
impl Ui
Sourcepub fn beep(&mut self, kind: u32) -> bool
pub fn beep(&mut self, kind: u32) -> bool
the system’s sound for kind (plat::audio::SOUND_*) -> false: off, unknown, not
permitted (audio.output) or not played
Sourcepub fn dialog_sound(&mut self, kind: u32) -> bool
pub fn dialog_sound(&mut self, kind: u32) -> bool
inside an open content dialog: its sound, once when it has just opened, where message dialogs play one on this platform and the app may play sound -> whether a sound was asked for
Sourcepub fn set_sounds(&mut self, on: bool)
pub fn set_sounds(&mut self, on: bool)
the app’s switch for its sounds (beep, dialog_sound); on by default
Source§impl Ui
impl Ui
Sourcepub fn set_rtl(&mut self, on: Option<bool>)
pub fn set_rtl(&mut self, on: Option<bool>)
mirror the windows (Some(true)), never (Some(false)) or as the UI language reads (None)
Sourcepub fn ltr_begin(&mut self, x: i32, w: i32)
pub fn ltr_begin(&mut self, x: i32, w: i32)
ltr_begin(x, w): the following commands of this layer keep their LTR order inside the columns x .. x + w (px); pairs with ltr_end
Source§impl Ui
impl Ui
Sourcepub fn fb(&self) -> &Surface
pub fn fb(&self) -> &Surface
ui_fb: the live window’s framebuffer. While its frames go through the GPU a big image may be drawn only there, the view of a canvas while it moves (canvas.rs) too: Ui::gpu_settle() first when the pixels matter
Sourcepub fn client_size(&self) -> (i32, i32)
pub fn client_size(&self) -> (i32, i32)
ui_client_size: client area in DIP
pub fn set_anim_off(&mut self, off: bool)
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
ui_invalidate: request a new frame (state changed outside the callbacks)
Source§impl Ui
impl Ui
Sourcepub fn hotkeys_available(&mut self) -> bool
pub fn hotkeys_available(&mut self) -> bool
whether global shortcuts work here
Sourcepub fn hotkey_register(
&mut self,
id: u32,
chord: &str,
description: &str,
) -> Result<(), HotkeyError>
pub fn hotkey_register( &mut self, id: u32, chord: &str, description: &str, ) -> Result<(), HotkeyError>
register chord (“Ctrl+Alt+K”) as the global shortcut id; description tells the user what it does (the desktop’s dialog shows it)
Sourcepub fn hotkey_unregister(&mut self, id: u32) -> bool
pub fn hotkey_unregister(&mut self, id: u32) -> bool
remove the global shortcut id -> false when it was not registered
Sourcepub fn hotkey_error(&self, id: u32) -> Option<HotkeyError>
pub fn hotkey_error(&self, id: u32) -> Option<HotkeyError>
why the desktop dropped the shortcut id (after UIC_HOTKEY_LOST)
Sourcepub fn pick_available(&self) -> bool
pub fn pick_available(&self) -> bool
whether the user can pick a colour anywhere on the screen here (headless: yes, the script answers)
Sourcepub fn pick_color(&mut self) -> bool
pub fn pick_color(&mut self) -> bool
the user picks a pixel anywhere on the screen; UIC_PICK reports the end -> false when that is not possible here (or a pick runs)
Sourcepub fn picked_color(&mut self) -> Option<u32>
pub fn picked_color(&mut self) -> Option<u32>
the colour of the last pick (0xRRGGBB), once
Sourcepub fn screenshot(&mut self, rect: Option<[i32; 4]>) -> bool
pub fn screenshot(&mut self, rect: Option<[i32; 4]>) -> bool
a picture of the whole desktop (None) or of a rectangle (desktop units); UIC_SCREENSHOT reports it -> false when that is not possible here
Sourcepub fn screenshot_take(&mut self) -> Option<Surface>
pub fn screenshot_take(&mut self) -> Option<Surface>
the picture of the last screenshot, once
Sourcepub fn screen_error(&self) -> Option<ScreenError>
pub fn screen_error(&self) -> Option<ScreenError>
why the last pick or picture failed (None: it worked or was not asked for)
Source§impl Ui
impl Ui
Sourcepub fn scroll_copy_begin(&mut self, id: u32, ox: i64, oy: i64)
pub fn scroll_copy_begin(&mut self, id: u32, ox: i64, oy: i64)
ui_scroll_copy_begin(id, ox, oy): the commands recorded until scroll_copy_end are the
content of scroll view id; (ox, oy) = the window px of the content’s origin (its
position minus the scroll offset). Call right after the view’s clip. When only the
origin moved between two frames, pixels still shown may be moved in the framebuffer
instead of drawn again (content that does not move with the origin is simply drawn).
Sourcepub fn scroll_copy_end(&mut self)
pub fn scroll_copy_end(&mut self)
ui_scroll_copy_end: the end of the content of scroll_copy_begin
Source§impl Ui
impl Ui
Sourcepub fn taskbar_progress(&mut self, p: TaskbarProgress) -> bool
pub fn taskbar_progress(&mut self, p: TaskbarProgress) -> bool
show progress on the app’s taskbar button -> false: not shown here
Sourcepub fn taskbar_badge(&mut self, n: u32) -> bool
pub fn taskbar_badge(&mut self, n: u32) -> bool
a badge with n on the app’s taskbar button (0: none) -> false: not shown here
Sourcepub fn taskbar_tasks(&mut self, tasks: &[JumpTask]) -> bool
pub fn taskbar_tasks(&mut self, tasks: &[JumpTask]) -> bool
the tasks of the button’s jump list (empty: none) -> false: no jump list here
Source§impl Ui
impl Ui
Source§impl Ui
impl Ui
Sourcepub fn mono_font_set(&mut self, font: u32)
pub fn mono_font_set(&mut self, font: u32)
the monospace font of every console (a font id, e.g. from ui.text.load_mem)
Source§impl Ui
impl Ui
Sourcepub fn touch_mode(&self) -> bool
pub fn touch_mode(&self) -> bool
ui_touch_mode: the pointer is a finger (the last pointer event came from one; on Android and in a phone’s browser from the start): the library shows no scroll bars. A mouse ends it
Sourcepub fn touch_drag(&mut self)
pub fn touch_drag(&mut self)
ui_touch_drag: a finger that starts on the last widget’s rectangle drags in every direction instead of rolling what is around it: for a part of a widget that has no hit box of its own (the handle of a list’s row). Sliders, colour wheels, splitters and the like take the finger by themselves. Call it after the widget, every frame
Sourcepub fn touch_take(&mut self, flags: u32)
pub fn touch_take(&mut self, flags: u32)
ui_touch_take(flags): what the last widget (all hit boxes in its rectangle) wants of a finger, TF_*, instead of what its hit boxes say by themselves. Call it after the widget, every frame
Sourcepub fn touch_fingers(&self) -> Vec<Finger>
pub fn touch_fingers(&self) -> Vec<Finger>
ui_touch_fingers: the fingers down on the live window, the first one first (a widget with TF_TWO gets a pass whenever one moves)
Sourcepub fn touch_two(&mut self) -> Option<TwoFingers>
pub fn touch_two(&mut self) -> Option<TwoFingers>
ui_touch_two: two fingers on the last widget (it said TF_TWO; call it after the widget, every frame): where they are and how far apart. None while the first finger drags the widget: a stroke older than 200 ms goes on, the second finger waits
Sourcepub fn touch_hold_part(&self, id: u32) -> Option<u32>
pub fn touch_hold_part(&self, id: u32) -> Option<u32>
ui_touch_hold_part(id) -> how far a finger’s press and hold on widget id of this window is, in 1/1000 (TF_HOLD_LONG): None without one, 1000 once the drag runs. Show it: it is long without a sign
Source§impl Ui
impl Ui
Sourcepub fn theme_set(&mut self, mode: u32)
pub fn theme_set(&mut self, mode: u32)
ui_theme_set(mode): 0 light, 1 dark, 2 the system setting (unknown: dark)
Sourcepub fn theme_dark(&self) -> bool
pub fn theme_dark(&self) -> bool
ui_theme_dark: the dark theme is active
Sourcepub fn accent_set(&mut self, rgb: u32)
pub fn accent_set(&mut self, rgb: u32)
ui_accent_set(0xRRGGBB), 0 = the style’s default; the system’s accent no longer applies
Sourcepub fn high_contrast(&self) -> bool
pub fn high_contrast(&self) -> bool
the high-contrast theme is active
Sourcepub fn set_contrast(&mut self, on: Option<bool>)
pub fn set_contrast(&mut self, on: Option<bool>)
high contrast on (Some(true)), off (Some(false)) or as the system says (None)
Sourcepub fn set_reduced_motion(&mut self, on: Option<bool>)
pub fn set_reduced_motion(&mut self, on: Option<bool>)
reduced motion on (Some(true): no tweens, no fades), off (Some(false)) or as the system says (None); like –anim, a forced value outlasts the system’s changes
Sourcepub fn text_scale(&self) -> u32
pub fn text_scale(&self) -> u32
the text scale in percent (100 = the style’s sizes)
Sourcepub fn font_prefs(&self) -> (Option<bool>, Option<u8>, Option<u8>)
pub fn font_prefs(&self) -> (Option<bool>, Option<u8>, Option<u8>)
the system’s font rendering: (smoothing, plat::FONT_HINT_, plat::FONT_RGBA_), None where the system says nothing; smoothing off (ui.text.antialias()) and the subpixel order (ui.text.subpixel(): subpixel smoothing on the window’s framebuffer) are applied, hinting is not
Sourcepub fn set_text_scale(&mut self, percent: u32)
pub fn set_text_scale(&mut self, percent: u32)
scale text sizes and line heights (50..300 %); the system’s scale no longer applies
Sourcepub fn color(&self, tok: u32) -> u32
pub fn color(&self, tok: u32) -> u32
ui_color(tok): 0xAARRGGBB of a token (byte offset; any value reads inside the table)
Sourcepub fn ts_font(&mut self, ts: u32)
pub fn ts_font(&mut self, ts: u32)
ui_ts_font(ts): select the font and pixel size (size * dpi / 96, 24.8) of a style
Sourcepub fn set_theme(&mut self, th: &Theme) -> Result<(), ThemeError>
pub fn set_theme(&mut self, th: &Theme) -> Result<(), ThemeError>
the app’s theme over the style (theme_app.rs) from the next frame on: colours of light, dark and high contrast, the accent, corners, spacing, control heights, text styles and a font family. A font that cannot be loaded is an error; the previous theme stays.
Sourcepub fn clear_theme(&mut self)
pub fn clear_theme(&mut self)
no app theme: the style’s own look again
Sourcepub fn load_theme(&mut self, path: &str) -> Result<(), ThemeError>
pub fn load_theme(&mut self, path: &str) -> Result<(), ThemeError>
read a theme file (app://, config://, a path) and make it the app’s theme; on an error the previous theme stays
Sourcepub fn styles_add(&mut self, styles: &[&'static dyn Style])
pub fn styles_add(&mut self, styles: &[&'static dyn Style])
the styles set_style can switch to: the app names the style crates it links besides its
own (build_rs.py links every style_NAME its sources name):
ui.styles_add(&[&style_classic::STYLE, &style_kde::STYLE])
Sourcepub fn style_names(&self) -> Vec<&'static str>
pub fn style_names(&self) -> Vec<&'static str>
the names of the styles set_style knows (the app’s own first, then as added)
Sourcepub fn style_name(&self) -> &'static str
pub fn style_name(&self) -> &'static str
the name of the style in use (Style::name)
Sourcepub fn set_style(&mut self, name: &str) -> bool
pub fn set_style(&mut self, name: &str) -> bool
switch to another linked style (styles_add) from the next frame on: its tokens, fonts, metrics and painters; the app theme stays on top -> false: no such style
Source§impl Ui
impl Ui
Sourcepub fn tray_set(
&mut self,
icon: Option<&Surface>,
tooltip: &str,
menu: &[Mi],
) -> bool
pub fn tray_set( &mut self, icon: Option<&Surface>, tooltip: &str, menu: &[Mi], ) -> bool
show or update the symbol in the notification area -> false: there is none here
Sourcepub fn tray_remove(&mut self)
pub fn tray_remove(&mut self)
take the symbol away
Sourcepub fn notify(&mut self, title: &str, body: &str, icon: Option<&Surface>) -> u32
pub fn notify(&mut self, title: &str, body: &str, icon: Option<&Surface>) -> u32
a system notification -> its id (0: not shown); UIC_NOTE / UIC_NOTE_GONE report it
Sourcepub fn notify_close(&mut self, id: u32)
pub fn notify_close(&mut self, id: u32)
take a notification away
Sourcepub fn tray_supported(&self) -> bool
pub fn tray_supported(&self) -> bool
whether this system shows the symbol (a notification area; GNOME: only with the AppIndicator extension); notifications work without one
Sourcepub fn bring_to_front(&mut self)
pub fn bring_to_front(&mut self)
restore the main window when it is minimised and activate it
Source§impl Ui
impl Ui
Sourcepub fn cmd_track(&mut self, x: i32, y: i32, w: i32, h: i32, tk: &Track)
pub fn cmd_track(&mut self, x: i32, y: i32, w: i32, h: i32, tk: &Track)
cmd_custom of a value slider’s gradient track over (x, y, w, h): the track’s own drawing (TK_CUSTOM) or the gradient (track_cb, version = track_hash) [styles’ value.s]
Sourcepub fn decimal_sep(&self) -> u32
pub fn decimal_sep(&self) -> u32
ui_decimal_sep: the separator fmt_f64 shows (and parse_f64 accepts besides ‘,’ / ‘.’)
Sourcepub fn set_decimal_sep(&mut self, c: u32)
pub fn set_decimal_sep(&mut self, c: u32)
set ui_decimal_sep (a code point)
Sourcepub fn fmt_f64(&self, v: f64, decimals: u32) -> String
pub fn fmt_f64(&self, v: f64, decimals: u32) -> String
ui_fmt_f64(&v, decimals) -> fixed decimals with the decimal separator; -0 is shown as 0
Sourcepub fn parse_f64(&self, s: &str) -> Option<f64>
pub fn parse_f64(&self, s: &str) -> Option<f64>
ui_parse_f64(s) -> the value, or None when s has no digits. Blanks, a sign, digits, one ‘,’ or ‘.’ (or the decimal separator when ASCII), digits.
Sourcepub fn slider_f(&mut self, id: u32, v: &mut f64, rf: &RangeF) -> u32
pub fn slider_f(&mut self, id: u32, v: &mut f64, rf: &RangeF) -> u32
ui_slider_f(id, &mut v, &rf) -> EV_*
Sourcepub fn track_slider(
&mut self,
id: u32,
v: &mut i32,
rg: &Range,
track: Option<&Track>,
) -> u32
pub fn track_slider( &mut self, id: u32, v: &mut i32, rg: &Range, track: Option<&Track>, ) -> u32
ui_track_slider(id, &mut v, &rg, track) -> EV_*: i32 slider with a gradient track (None = the standard look)
Sourcepub fn prop_slider(
&mut self,
id: u32,
label: &str,
v: &mut i32,
rg: &Range,
default: i32,
) -> u32
pub fn prop_slider( &mut self, id: u32, label: &str, v: &mut i32, rg: &Range, default: i32, ) -> u32
ui_prop_slider(id, label, &mut v, &rg, default) -> EV_* (default NO_DEFAULT: no reset button)
Sourcepub fn prop_slider_f(
&mut self,
id: u32,
label: &str,
v: &mut f64,
rf: &RangeF,
default: Option<f64>,
) -> u32
pub fn prop_slider_f( &mut self, id: u32, label: &str, v: &mut f64, rf: &RangeF, default: Option<f64>, ) -> u32
ui_prop_slider_f(id, label, &mut v, &rf, default) -> EV_* (default None: no reset button)
Source§impl Ui
impl Ui
Sourcepub fn window_title_height(&self, flags: u32) -> i32
pub fn window_title_height(&self, flags: u32) -> i32
uiw_drawable(i): the window exists and is shown (the main window: always) the title bar of a window with these WF_* flags that draws its own (DIP): the style’s, higher with a finger, and the window grows with it (lay out what lies below it with this height)
Sourcepub fn window_begin(
&mut self,
id: u32,
title: &str,
open: Option<&Shared<i32>>,
flags: u32,
rect: Option<&Shared<WinRect>>,
) -> bool
pub fn window_begin( &mut self, id: u32, title: &str, open: Option<&Shared<i32>>, flags: u32, rect: Option<&Shared<WinRect>>, ) -> bool
ui_window_begin(id, title, open, flags, rect) -> true: the window is shown, emit its content now (window_end always follows). open None = always open; rect None: the library keeps the placement. The owner is the window being built.
Sourcepub fn window_end(&mut self)
pub fn window_end(&mut self)
ui_window_end: close window_begin (also when it returned false)
Sourcepub fn sync_hook_set(&mut self, f: Option<fn() -> bool>)
pub fn sync_hook_set(&mut self, f: Option<fn() -> bool>)
ui_sync_hook_set(f): f() -> true while background jobs are pending (the script
command sync waits for false)
Sourcepub fn window_place(&mut self, id: u32, rect: &WinRect)
pub fn window_place(&mut self, id: u32, rect: &WinRect)
ui_window_place(id, &rect): set the window’s placement (copied into its WINRECT; applied when it is built next). id 0: the main window (headless: its size)
Sourcepub fn window_snap(&mut self, id: u32, area: [i32; 4], dist: i32)
pub fn window_snap(&mut self, id: u32, area: [i32; 4], dist: i32)
ui_window_snap(id, area, dist): while the user moves window id, its outer edges snap
to the edges of area (x, y, w, h in DIP of the owner’s client area, like its
WINRECT) once they are at most dist DIP away – both axes at a corner; dist 0 turns
it off. Live where the platform lets the UI see the move (Windows: WM_MOVING) and for
scripts (movewin); a window manager that moves the windows itself (X11, Wayland) and
the browser do not snap. Call it in every frame the area may change (after the
window’s first window_begin).
Sourcepub fn window_rect(&self, id: u32) -> Option<WinRect>
pub fn window_rect(&self, id: u32) -> Option<WinRect>
ui_window_rect(id) -> the window’s placement (None = unknown window)
Sourcepub fn window_state(&mut self, id: u32) -> u32
pub fn window_state(&mut self, id: u32) -> u32
ui_window_state(id) -> UWS_OPEN | UWS_VISIBLE | UWS_ACTIVE | UWS_MINIMIZED | UWS_FULLSCREEN (0 unknown)
Sourcepub fn window_fullscreen(&mut self, id: u32, on: bool)
pub fn window_fullscreen(&mut self, id: u32, on: bool)
(L7) window_fullscreen(id, on): show the window (0 = the main window, else the app’s
window id) over its whole monitor without a frame, or back to its place and frame as
before. window_state reports UWS_FULLSCREEN at once; the platform follows after the
frame: Windows a borderless window over the window’s monitor (the old placement and
style come back), X11 _NET_WM_STATE_FULLSCREEN, Wayland xdg_toplevel set_fullscreen /
unset_fullscreen, the browser its Fullscreen API (only from the user’s gesture: a key or
a click that just happened). A tool window drops its library title bar and border
meanwhile. When the platform or the user leaves (or enters) full screen by itself (Esc
in the browser, the window manager), the state follows and UIC_FULLSCREEN arrives (arg
= the window’s id). Headless runs only record it (scripts: expect window ID fullscreen, system fullscreen off). Nothing happens on Android and for Wayland tool
windows drawn inside their owner (WST_CHILD). F11 is the app’s key for it (GUIDE).
Sourcepub fn window_activate(&mut self, id: u32)
pub fn window_activate(&mut self, id: u32)
ui_window_activate(id): give the window the keyboard and put it on top
Sourcepub fn window_destroy(&mut self, id: u32)
pub fn window_destroy(&mut self, id: u32)
ui_window_destroy(id): hide the window and free its state and buffers (not while it is being built)
Sourcepub fn window_current(&self) -> u32
pub fn window_current(&self) -> u32
ui_window_current -> id of the window being built (0 = main window)
Sourcepub fn window_modal(&self) -> u32
pub fn window_modal(&self) -> u32
ui_window_modal -> id of the topmost modal window, 0 = none
Source§impl Ui
impl Ui
Sourcepub fn state_save(&mut self, ini: &mut Ini)
pub fn state_save(&mut self, ini: &mut Ini)
write the placement of the main window and of the tool windows into ini (see the module header)
Sourcepub fn state_load(&mut self, ini: &Ini)
pub fn state_load(&mut self, ini: &Ini)
read the placements of state_save back (the main window now, the tool windows when window_begin meets them)
Source§impl Ui
impl Ui
Sourcepub fn desk_begin(&mut self, id: u32, st: &mut DeskState, wins: &[DeskWin<'_>])
pub fn desk_begin(&mut self, id: u32, st: &mut DeskState, wins: &[DeskWin<'_>])
desk_begin(id, &mut st, wins): open the window area (always pair with desk_end; fill it with desk_next). It takes the next place of the box (the whole rest when no size was set); wins: every open window, each frame (titles and icons may change), in the order the taskbar shows them.
Sourcepub fn desk_next(&mut self, st: &mut DeskState) -> Option<u32>
pub fn desk_next(&mut self, st: &mut DeskState) -> Option<u32>
desk_next(&mut st) -> the next window to fill (None: done), from the back to the front; its content goes into a vertical box (it clips) until the next call
Sourcepub fn desk_end(&mut self, st: &mut DeskState) -> Vec<DeskEv>
pub fn desk_end(&mut self, st: &mut DeskState) -> Vec<DeskEv>
desk_end(&mut st) -> what the user did in this pass (and the taskbar since the last desk_end): close requests, activation, moves, resizes, state changes
Sourcepub fn desk_taskbar_begin(&mut self, id: u32)
pub fn desk_taskbar_begin(&mut self, id: u32)
desk_taskbar_begin(id): open a taskbar for desk id (always pair with
desk_taskbar_end): a row with the style’s taskbar surface; the app’s items and
desk_taskbar go inside. Inside desk_begin .. desk_end without next_size / next_rect it
takes the area’s reserved strip (DeskState::set_reserve: the bottom one, else the top
one), else the next place, TASK_H DIP high unless next_size says otherwise.
Sourcepub fn desk_taskbar_end(&mut self)
pub fn desk_taskbar_end(&mut self)
desk_taskbar_end
Sourcepub fn desk_taskbar(&mut self, id: u32, st: &mut DeskState, flags: u32)
pub fn desk_taskbar(&mut self, id: u32, st: &mut DeskState, flags: u32)
desk_taskbar(id, &mut st, flags): the buttons of desk id’s windows (DTB_*), in the
order of desk_begin’s list; without a size they take the room the row leaves. Their
changes apply at once; desk_end reports them.