Skip to main content

Crate plat

Crate plat 

Source

Re-exports§

pub use vfs::display_name;
pub use power::INHIBIT_IDLE;
pub use power::INHIBIT_SUSPEND;
pub use power::Inhibit;
pub use power::inhibit;
pub use power::inhibited;
pub use autostart::AUTOSTART_WAIT_MS;
pub use autostart::AutostartError;
pub use autostart::autostart_entry;
pub use autostart::autostart_get;
pub use autostart::autostart_set;
pub use recent::recent_add;
pub use recent::recent_clear;
pub use recent::recent_list;
pub use recent::recent_remove;
pub use screen::Monitor;
pub use screen::monitors;
pub use hotkey::Chord;
pub use hotkey::HotkeyError;
pub use hotkey::HotkeyEvent;
pub use hotkey::hotkey_register;
pub use hotkey::hotkey_take;
pub use hotkey::hotkey_unregister;

Modules§

a11y
aio
Files without blocking the caller: chunked reads, atomic writes and copies with progress and cancellation.
assoc
The app’s file types and URL schemes registered without a setup (developer builds).
audio
Sound output: streams, short sounds from memory or files, the system’s own sounds.
autostart
Starting the app when the user logs in (Run key, XDG autostart, Background portal, an MSIX package’s StartupTask).
boot
What build_rs.py builds into a program (name, assets, manifest), set up at start-up.
certs
The operating system’s trusted certificate authorities (TLS clients of public servers).
content
The documents of other apps as files: Android’s content:// names (the name logic on all platforms, tested with a host in memory).
control_ipc
fs
Metadata, directory listings, links, times, free space, owner-only files, the local zone.
hotkey
Global keyboard shortcuts: chords that reach the app while another program has the keyboard.
instance
One running instance per app and user; later starts hand over their arguments.
modabi
net
TCP and UDP sockets (IPv4 / IPv6) with timeouts, numeric names.
pkg
The package the program runs from (MSIX, Flatpak, AppImage, Snap) and what its package system offers for updates (App Installer, the Flatpak portal).
policy
The app’s permissions (apps/NAME/PERMISSIONS) and their checks.
power
Keeping the computer awake: no standby, no screen saver while a guard lives.
process
Owned native child processes with pipes and process-tree lifetime management.
recent
The system’s list of recently used files (jump lists, recently-used.xbel).
sandbox
OS sandbox derived from the manifest: Landlock + seccomp (Linux), mitigation policies (Windows).
screen
The monitors, a pixel’s colour anywhere on the screen, pictures of the screen.
secret
Passwords, tokens and keys in the system’s secret store (Credential Manager, Secret Service).
sensors
service
Running as a system service (Windows service control manager, systemd units).
spell
The system’s spell checker (Windows ISpellChecker); Hunspell files are the spell crate’s.
sync
Mutex, Condvar, RwLock and bounded channels for worker threads.
task
Async execution: executors in the event loop and for block_on, a pool for blocking work, timers, cancellation, progress, joins.
taskbar
The app’s taskbar / dock button: progress, a badge, the jump list’s tasks.
tray
The app’s symbol in the notification area and system notifications.
vfs
One file namespace: app://, config://, data://, cache://, mem:// and mounted providers.
watch
Changes below folders as they happen (continuous data protection).
x11s
the X11 state other plat modules read (plat-shared)
x11t
the X11 internals linuxtest –test x11synth / x11err drives (x11_event, x11_ks_value, x11_kb_, g_x11_xkb_on, g_x11_mods, x11_req, x11_sync, g_x11_err_last; the key table is plat::xkb_)

Macros§

log
log!(LOG_INFO, “target”, “format”, args…): a line, formatted only when its level is on

Structs§

AtomicFile
The streaming form of write_file: the bytes go into a sibling of the target, commit puts it in place in one step (readers see the old file or all of the new one); dropped without commit, the sibling is removed and the target is unchanged. Checked and routed like write_file when it is created. OS paths: an exclusive “NAME.tmp-PID-SEQ-TIME” beside the file, fsync and rename (Linux keeps the old file’s access bits; the browser: in memory until commit). Mounts: a “NAME.tmp-..” file of the mount, renamed by the provider (one without rename gets the whole file written); a provider whose rename cannot replace a file (atomic_rename() == false, content://) gets the bytes written in place at commit.
Cancelled
a loop or job ended through cancel()
Capabilities
Snapshot of services actually provided by the current host.
CrashInfo
what the crash handler knows (the CRASHINFO record of ASMLIB)
Date
a date and time (date(): Windows local time, Linux UTC)
DragData
the content of one drag (a drop that arrives, or what the app drags)
Event
one platform event (the EV_* record): type, button, modifiers, window index (0 = the main window), position (px; E_RESIZE: size), data
File
an open file (closed when dropped): an OS file, or a stream of a vfs mount
FileLock
Nonblocking exclusive sidecar lock; drop releases it. All cooperating writers must lock the same path before checking and replacing data. OS files: across processes (Windows: an exclusive handle, Linux: flock); a mount without OS files: inside this process.
Frame
the pixels to present: rows of 32-bit B, G, R, x
GpuBufDesc
a buffer of memory the GPU drew into
GpuCaps
what a display accepts as buffers
GpuPlane
a plane of a buffer: a dma-buf (owned: closed once sent), its offset and row pitch
GuardInfo
GUARDINFO: what a guarded call hit; tag is an input (guard_tag)
HcColors
the colours of a high-contrast scheme (0xRRGGBB)
Job
a background job: count items of f on the workers; wake() when it is finished
JobCtl
a job as its item functions see it: cancel the rest, look at the progress
JxlEncReq
a JPEG XL encode for the module (img_jxl::writer): the samples (owned: they move to the module) and the writer’s options
Lib
a loaded plugin library (LIBH)
LibSeg
one segment of a loaded image: [start, end), LIBA_*
NativeWindow
the Linux form of the handles lib/gpu gets for a window (Windows: HWND, HINSTANCE)
PPage
the page (PPAGE, pt = 1/72 inch)
PdfOpt
PDFOPT of pdf_write_image
Place
where the image goes (PLACE, pt from the page’s top-left)
Preedit
PrintJob
one print job (PRINTJOB)
PrintSrc
the pixels of a print job: rows of 32-bit B, G, R, A (the fields of gfx::Surface)
Sem
a counting semaphore
SysSettings
what the system says (see the module comment)
Thread
a thread started by thread_spawn; join it to wait for its end (and free its stack)
Titlebar
the buttons and click actions of a title bar the library draws (SysSettings::titlebar)

Enums§

FingerPhase
what happens to a finger (finger)

Constants§

BK_NONE
BK_WAYLAND
BK_X11
BTN_LEFT
BTN_MIDDLE
BTN_RIGHT
BTN_X1
BTN_X2
CAP_CLIPBOARD_IMAGE
Exchange clipboard images.
CAP_CLIPBOARD_RICH
Exchange native/RTF/HTML rich clipboard representations. Browser hosts provide an instance-local clipboard, without OS rich-format access.
CAP_CLIPBOARD_TEXT
Exchange plain UTF-8 clipboard text.
CAP_FILE_READ
Read files through the platform’s file namespace.
CAP_FILE_WRITE
Write files through the platform’s file namespace.
CAP_LOCAL_IPC
Connect through a user-local IPC transport after explicit activation.
CAP_NATIVE_PLUGINS
Load native shared libraries with the platform plugin ABI.
CAP_PERSISTENT_STORAGE
Confirm durable storage, rather than a temporary in-memory write.
CAP_PRINT
Submit a print job through the host.
CAP_SHELL_INTEGRATION
Install operating-system shortcuts or integrations.
CAP_SYSTEM_FONTS
Discover fonts installed in the operating system.
CAP_THREADS
Run parallel operating-system threads.
CAP_WINDOWING
Display windows, including library windows inside a browser canvas.
CK_ACCESS
CK_BUS
CK_DIVIDE
CK_ILLEGAL
CK_OTHER
CK_PANIC
CK_STACK
CLIP_DOCX
Private document fragment bytes, MIME application/x-jfgui-docx-fragment.
CLIP_HTML
UTF-8 HTML fragment (Windows CF_HTML framing is handled by the platform).
CLIP_IMAGE
CLIP_PNG
CLIP_RICH_MAX
Maximum combined payload of an opt-in multi-format clipboard write (64 MiB).
CLIP_RTF
Rich Text Format document bytes.
CLIP_TEXT
CPU_AVX2
CPU_BMI2
CPU_FMA
CPU_POPCNT
CPU_SSE41
CUR_ARROW
CUR_COUNT
CUR_CROSS
CUR_CUSTOM
CUR_HAND
CUR_IBEAM
CUR_MAX_PX
CUR_MOVE
CUR_NONE
CUR_SIZE_NESW
CUR_SIZE_NS
CUR_SIZE_NWSE
CUR_SIZE_WE
CUR_TABLE
CUR_USER0
CUR_USER_MAX
CUR_WAIT
DE_ALL
DE_COPY
DE_LINK
DE_MOVE
DIR_COUNT
the number of DIR_* kinds
DIR_DESKTOP
user_dir: the desktop
DIR_DOCUMENTS
user_dir: the documents
DIR_DOWNLOADS
user_dir: the downloads of the browser
DIR_MUSIC
user_dir: music
DIR_PICTURES
user_dir: pictures and photos
DIR_VIDEOS
user_dir: videos
DT_FILES
DT_HTML
DT_IMAGE
DT_STD
DT_TEXT
DT_URL
DT_USER0
EDGE_BOTTOM
EDGE_LEFT
EDGE_RIGHT
EDGE_TOP
ERR_CANCEL
ERR_DIMS
ERR_FAULT
ERR_IO
ERR_LIMIT
ERR_NOMEM
ERR_UNSUPPORTED
EVQ_CAP
E_CLOSE
E_DOWN
E_DPI
E_DRAG
E_DRAG_END
E_DROP
E_FOCUS_IN
E_FOCUS_OUT
E_IME_COMMIT
E_KEY_DOWN
E_KEY_UP
E_LEAVE
E_MOVE
E_NONE
E_PAINT
E_POWER
E_PREEDIT
E_RESIZE
E_SESSION_END
E_SETTINGS
E_TEXT
E_UP
E_WAKE
E_WHEEL
E_WINPOS
FD_EXT_SHIFT
FD_FOLDER
FD_OPEN
FD_PENDING
file_dialog’s answer when the system answers later (Android’s picker): file_dialog_poll
FD_SAVE
FONT_HINT_FULL
FONT_HINT_MEDIUM
FONT_HINT_NONE
SysSettings::font_hinting
FONT_HINT_SLIGHT
FONT_RGBA_BGR
FONT_RGBA_NONE
SysSettings::font_rgba: the order of a pixel’s subpixels (none: greyscale smoothing)
FONT_RGBA_RGB
FONT_RGBA_VBGR
FONT_RGBA_VRGB
FO_READ
FO_RW
FO_WRITE
GK_ACCESS
GK_ARITH
GK_BREAK
GK_BUS
GK_ILLEGAL
GK_NONE
GK_STACK
GPU_BUF_BUSY
GPU_BUF_FAILED
GPU_BUF_FREE
GPU_BUF_PENDING
a buffer’s state (gpu_buf_state)
GPU_STATE_NEVER
this system cannot: the CPU path for good
GPU_STATE_OK
a window showed through the GPU
GPU_STATE_TRYING
the first start is about to run a driver
GPU_STATE_UNKNOWN
nothing known, nothing to remember
GT_MAX
HB_BLOCK
HB_CLOSE
HB_CURSOR_SHIFT
HB_DISABLED
HB_DRAG
HB_FOCUS
HB_MAX
HB_MIN
HB_MOVES
HB_TEXT
IBUS_RELEASE
ProcessKeyEvent state bit of a key release
ICC_MON_PRIMARY
monitor_icc / monitor_key: the primary monitor instead of a window’s
JXLENC_FILE
the module’s file name next to the exe
KV_CP
KV_DEAD
KV_KP
KV_MODSHIFT
LH_SEGMAX
LIBA_R
LIBA_W
LIBA_X
LIBE_DEPS
LIBE_FORMAT
LIBE_INIT
LIBE_IO
LIBE_MAP
LIBE_NOMEM
LIBE_RELOC
LIB_FILE_MAX
LOG_DEBUG
LOG_ERROR
LOG_INFO
LOG_OFF
LOG_TRACE
LOG_WARN
MOD_ALT
MOD_ALTGR
MOD_CAPS
MOD_CTRL
MOD_NUM
MOD_SHIFT
MOD_SUPER
PAPER_A3
PAPER_A4
PAPER_A5
PAPER_LEGAL
PAPER_LETTER
PAPER_N
PATH_CAP
file_dialog: the path capacity (FD_PATH of ui_filedlg.s)
PA_ABOVE
PA_BELOW
PA_FREE
PA_POINT
PA_SIDE
PD_AGE_MASK
PD_AGE_SHIFT
PD_CANCEL
PD_PRESSURE
PD_TILTX_SHIFT
PD_TILTY_SHIFT
PD_TYPE_SHIFT
PJF_CENTER
PJF_LANDSCAPE
PJF_SMASK
PJS_DPI
PJS_FIT
PJS_PERCENT
PPW_MAX
PRESSURE_ONE
PRINT_ARGB
PRINT_PARGB
PRINT_XRGB
PRW_BGR
PRW_COPY
PRW_OPAQUE
PRW_PREMUL
PTR_ERASER
PTR_MOUSE
PTR_PEN
PTR_TOUCH
PWF_DIALOG
PWF_MASK
PWF_MODAL
PWF_NOACTIVATE
PWF_NOCLOSE
PWF_RESIZABLE
PWF_SYSFRAME
PWF_TOOL
PWS_HIDE
PWS_SHOW
PWS_SHOWNA
PW_DEFAULT
PW_KEEP
PW_MAX
PW_NOOWNER
SET_CONTRAST
SET_FONTS
SET_LOCALE
SET_MONITORS
SET_OTHER
SET_THEME
TB_ACT_LOWER
below the other windows (X11; Wayland has no request for it: nothing)
TB_ACT_MAXIMIZE
maximize, or restore a maximized window
TB_ACT_MENU
the window manager’s window menu (move, resize, always on top, …)
TB_ACT_MINIMIZE
TB_ACT_NONE
Titlebar::double / middle / right: what a click on the empty part of the bar does
TB_BTN_CLOSE
Titlebar::buttons: the caption buttons of a title bar the library draws
TB_BTN_MAX
TB_BTN_MIN
THR_MAX
VALUE_OPTS
the library’s options that take a value (--size 800x600): a program whose plain arguments are files skips the value after these
VERSION
the library’s version, “MAJOR.MINOR.PATCH” (the root Cargo.toml; docs/VERSIONING.md says what a change of each part promises). Not the app’s version: that is rt::app_version!().
VERSION_MAJOR
the first number of VERSION (incompatible API changes; while 0, the MINOR number counts them)
VERSION_MINOR
the second number of VERSION
VERSION_PATCH
the third number of VERSION
WCMD_CLOSE
WCMD_FULLSCREEN
WCMD_LOWER
WCMD_MAXIMIZE
WCMD_MINIMIZE
WCMD_RESTORE
WCMD_WINDOWED
WST_ACTIVE
WST_CHILD
the window is drawn inside its owner (a Wayland subsurface): win_get_rect / win_set_rect / E_WINPOS use positions relative to the owner’s surface origin (px), the owner carries it
WST_CSD
WST_FULLSCREEN
WST_HIDDEN
(Windows) the window is not shown, whoever hid it: the system hides a tool window while its owner is minimised
WST_MAXIMIZED
WST_MINIMIZED
WST_TILED
WST_TILED_BOTTOM
WST_TILED_LEFT
WST_TILED_RIGHT
WST_TILED_SHIFT
with WST_TILED: which edges touch the tiling (EDGE_* << WST_TILED_SHIFT; Wayland’s xdg_toplevel tiled_* states, X11 the edges of a one-direction maximize); the UI keeps its resize band off them, as from a maximized window
WST_TILED_TOP
WT_DPI
WT_FROM_POINT
WT_MOVE
WT_NOANIM
WT_PIXEL
WT_POPUP_RECT
WT_REDRAW
WT_SHOW

Traits§

Display
a display backend (window-indexed; see the free functions below for the semantics)

Functions§

app_finish
Android: the runtime ended (ui.quit): the activity goes and its process with it, a new start needs a new runtime. Elsewhere nothing: there the main loop ends the program
arg_value
the argument after name on the command line (argument 0, the program, is skipped) arg_value
args
at_exit
run f at the normal end of the process (plat::exit, or the program’s main returns), not after a crash; before the handlers registered earlier
avx2_probe
run two 256-bit AVX2 instructions (they fault without OS support); only call it when cpu_features() reports CPU_AVX2 [plattest t_cpu]
back_trap
Android: while on, the back key reaches the app as Esc (a page of the app goes back, a popup closes; UIC_ESCAPE when nothing took it) instead of ending the activity. Elsewhere nothing: there Esc is a key of its own
begin_move
let the system move the current window (on a button press)
begin_resize
let the system resize the current window from an edge (EDGE_* bits)
cache_dir
$XDG_CACHE_HOME (absolute), else $HOME/.cache; no trailing slash
capabilities
Current native service set, less what the app’s permissions leave out (policy.rs). Browser permissions are supplied by its host adapter.
clip_bmp_fix
a BMP file of another program with the same alpha rule
clip_dib_to_bmp
a clipboard DIB as a BMP file (None: invalid header)
clip_get
clip_has
clip_html_decode
Extract a UTF-8 fragment from CF_HTML. Reject invalid/overflowing offsets and UTF-8.
clip_html_encode
Wrap a UTF-8 HTML fragment in Windows CF_HTML, with byte offsets and final NUL.
clip_many_valid
Validate a multi-format text clipboard before replacing the previous contents. Formats must be distinct TEXT/HTML/RTF/DOCX; text and HTML are NUL-free UTF-8.
clip_set
clip_set_many
Publish distinct TEXT/HTML/RTF/DOCX representations of one selection.
clipimg_pack
the CLIPIMG bytes of a PNG file and a BMP file (either may be empty)
clipimg_split
(PNG, BMP) of CLIPIMG bytes (an absent part is empty; None: malformed)
config_dir
$XDG_CONFIG_HOME (absolute), else $HOME/.config; no trailing slash
cpu_brand
the processor name from CPUID 0x80000002..4, blanks trimmed cpu_brand
cpu_count
CPUs this process may run on (sched_getaffinity), >= 1 [plat_cpu_count]
cpu_features
CPU_* bits (cached; rt::cpu) cpu_features
crash_hook
f(&CrashInfo) runs in the crash handler, after the stderr line, before exit code 3; also for panics (CK_PANIC) [plat_crash_hook]
crash_test
a deliberate crash for tests: mov eax, 16 (5 bytes), then a 4-byte write to address 0x10 – the faulting instruction is at crash_test + 5
crash_test_caller
(plat-win) crash_test called from a known place (call rel32): the return address crash_test_caller + 5 must be among CrashInfo::frames (plattest’s call chain check)
current_exe
Absolute path of the running native executable, independent of argv[0].
cursor_create
cursor_destroy
cursor_dpi
the dpi to draw a cursor for a window of this dpi (no display yet: the dpi itself)
cwd
the current directory (“” on failure) [plat_cwd]
data_dir
$XDG_DATA_HOME (absolute), else $HOME/.local/share; no trailing slash
date
the date and time in UTC (no time zone database); the flag is true (UTC) [plat_date]
delete
a file or an empty directory [plat_delete]
dev_ino
(st_dev, st_ino) of a path (links followed), None when it cannot be read: the identity fontdb uses to visit a directory once [fd_visit_once]
dir_list
f(name, is_dir, size_lo) for every entry except “.” and “..” [plat_dir_list]
disp_backend
0 none, 1 Wayland, 2 X11
disp_wl_quiet
(disp.s g_wl_quiet) the Wayland backend is being tried without jfgui_BACKEND=wayland: it should fail without messages (X11 may follow)
dl_close
close a library from dl_open
dl_error
why the calling thread’s last dl_open / dl_sym failed (“”: it did not, or it was already asked)
dl_open
open a library through the system’s dynamic linker (a name, searched as ld.so does, or a path) and run its initialisers -> its handle
dl_sym
the address of a symbol of a library from dl_open (0: none); name ends in NUL
dpi
dpi of the main window (96 = 100 %)
drag_effect_pick
the effect of a drop: the modifier keys choose (Ctrl copy, Shift move, Ctrl+Shift link), else the first of copy / move / link that allowed has (0: none)
drag_hook
install (Some) or remove (None) the drop target hook (the UI does it for its windows)
drag_query
(OS layers) what platform window pw takes at (x, y) px of a drag offering types with the effects allowed (0 = copy | move) -> (accepted types, the effect); (0, 0) = refused
drag_running
an outgoing drag runs (until its E_DRAG_END is queued)
drag_start
drag data out of the app (call while the left button is held) -> started; E_DRAG_END (data = the effect, 0 = cancelled or refused) follows. Only the standard kinds leave the app.
drives
the root “/” [plat_drives]
drop_add
one path (copied) -> false when it is empty, too long, has a NUL or the list is full
drop_add_url
(OS layers) one URL of the pending drop (“scheme:…”, no blanks or control characters, bounded, no duplicates) -> added
drop_data_take
the pending drop (E_DROP): its paths (drop_take) and the rest; both start empty again
drop_reset
forget the pending list (and the rest of the pending drop: dnd.rs)
drop_set_effect
(OS layers) the effect the drop was made with (DE_*)
drop_set_html
(OS layers) the pending drop’s HTML fragment (UTF-8 bytes) -> false when too large
drop_set_image
(OS layers) the pending drop’s image file (PNG or BMP bytes) -> false when too large
drop_set_text
(OS layers) the pending drop’s text (UTF-8 bytes; cut at a NUL) -> false when too large
drop_take
hand the pending list over (it starts empty again)
drop_text_from
(OS layers) text in other programs’ encodings -> UTF-8 bytes: UTF-16 LE (utf16, up to a NUL unit) or bytes as they are (up to a NUL)
drop_uri_list
text/uri-list -> paths added
drop_url_list
(OS layers) the lines of a URL list (text/uri-list, text/x-moz-url, UniformResourceLocator): ‘#’ lines skipped, every other line one URL; local files are left to drop_uri_list -> URLs added (also used for the URL a browser drags)
env
the value of an environment variable [plat_env / plat_getenv]
evq_clear
evq_count
events queued (the ring and the overflow queue)
evq_dropped
events dropped since the start because more than EVQ_MORE_MAX waited (tests)
evq_pen_data
Event::data of a pen pointer event (0 for a mouse or while pen input is off)
evq_pop
the oldest queued event
evq_push
append an event (behind a full ring: the overflow queue) -> false when it was dropped (more than EVQ_MORE_MAX events wait)
exit
end the process: std::process::exit, which writes out what std’s stdout still holds; from any thread, not from a crash handler
file_dialog
the portal’s FileChooser (see the file header) [plat_file_dialog]
file_dialog_poll
The answer of a system file dialog that answers later (file_dialog -> FD_PENDING: only Android’s picker and the browser’s; web.rs): None while it is open, then once (1 chosen / 0 not, index, path).
file_exists
0 missing, 1 file, 2 directory [plat_file_exists]
file_exists_checked
Some(0) only for a missing path, Some(1/2) for file/directory, None for other errors.
fill_random
fill a buffer with cryptographically secure random bytes (stops the process on failure)
finger
A host’s raw finger, in px of its window (Event::win as for every pointer event): this is all a platform does for touch; pan, fling, tap, long press and what takes the finger are decided in ui/touch.rs. Every finger goes through here, in the order they happen; a finger that goes away without an Up gets a Cancel. The browser and Android, whose windows live in one surface, come through jfgui_finger instead. -> false when the event was dropped
finger_event
the Event of a raw finger: E_DOWN / E_MOVE / E_UP with PTR_TOUCH in its data. id: the host’s number of this finger while it is down (a second one has another); age_ms: how old the sample is now (the velocity needs it; 0 when the host does not know)
font_hint_parse
a FONT_HINT_* name (“none”, “slight”, “medium”, “full”; also “hintnone” … of fontconfig)
font_rgba_parse
a FONT_RGBA_* name (“none”, “rgb”, “bgr”, “vrgb”, “vbgr”; “grayscale” is none)
getenv
the same as env (ASMLIB’s plat_getenv)
glibc_thread_ids
the calling thread’s FS base, pthread_self() and the address of errno: its thread control block and thread-local storage (a raw clone would have 0 and the creator’s)
glibc_version
the version of the running glibc (“2.43”)
gpu_buf_free
gpu_buf_new
gpu_buf_state
gpu_can_show
gpu_next_look
gpu_out_state
how the output came up (GPU_STATE_*): Android keeps it across runs
gpu_show
gpu_test_presented
(bench: jfgui_WL_FEEDBACK=1 on Wayland) the commits since the last call and when each reached the screen (wp_presentation): (time of the commit, time on the screen; 0: discarded), time_us
gpu_thread_spawn
a thread for the output’s jobs
gpu_wait
guard_call
f(a1, a2, a3, a4) under the crash guard (see the file header) [plat_guard_call]
guard_init
install the fault handler (idempotent, thread safe) [plat_guard_init]
guard_read
copy len bytes at any address under the crash guard -> None when addr is 0, the copy faulted or the memory for the copy is missing (pn-sys)
guard_run
run the Rust closure f under the crash guard -> Ok(result), Err(ERR_FAULT) when it faulted (info filled), Err(ERR_LIMIT) when the thread table is full (f did not run). A fault abandons f’s frames without running destructors (what they own leaks): meant for host code that may touch plugin memory (the loader fuzz runs lib_open / lib_sym under it).
guard_tag
info.tag of the innermost active guard of this thread (0 = none) [plat_guard_tag]
guard_test_code
(test aid) the address of guard test function k (see above), 0 for an unknown k
guard_test_state
(test aid) this thread’s MXCSR, x87 control word and direction flag
guard_write
write data at any address under the crash guard -> false when addr is 0 or it faulted (pn-sys)
home
$HOME (or “/”) [plat_home]
ibus_available
whether an input method may be asked (a session bus, not turned off)
ibus_focus
a text field got or lost the keyboard focus
ibus_key
let the input method see a key -> it took it
ibus_ready
whether the input context exists (before that keys are not sent)
ime_commit_set
One composition commit is one event, avoiding truncation by the character ring.
ime_commit_take
ime_commit_text
Committed text of any length: commits of at most 4096 bytes, split between characters -> the bytes queued (fewer: the commit queue or the event ring is full, the rest can follow once the app took these).
ime_pos
Forward caret position to backends with text-input support.
ime_preedit
ime_preedit_set
Publish valid UTF-8 and a byte caret; invalid/oversized updates clear composition.
jfgui_std_start
what rt::main!’s and ui::main!’s fn main calls: std_start
jxlenc_encode
the module’s writer on req: Some(file / ERR_*), None without a module
jxlenc_file
the file the module is (or would be) loaded from; None = “off” / no exe folder
jxlenc_ready
the module is loaded (the first call loads it)
jxlenc_set_path
the module file to load (None = the default next to the exe, “off” = none); resets an earlier failed attempt, never a loaded module
layout
the image rectangle and the printable area on the page [print_layout]
lib_close
unload a library (dropping the Lib does the same) [plat_lib_close]
lib_open
open a plugin ELF object (see the file header) [plat_lib_open]
lib_read
copy len bytes at addr of the image of h – only when they lie in one readable segment (lib_seg), else None (pointers a plugin hands over)
lib_seg
the end of the segment of h holding addr (0 = none) and its LIBA_* flags [plat_lib_seg]
lib_sym
the address of the defined dynamic symbol name, or 0 [plat_lib_sym]
life_poll
(wait) a SIGTERM since the last call -> E_SESSION_END queued
life_start
the SIGTERM handler and the watcher thread (once)
locale_tag
a POSIX locale name or a BCP 47 tag as a BCP 47 tag: language lower case, a script title case, a region upper case (“zh_hant_tw” -> “zh-Hant-TW”); None for “C” / “POSIX” / empty
log_debug
a LOG_DEBUG line
log_dir
the base folder of logs: $XDG_STATE_HOME (absolute), else $HOME/.local/state (vfs::app_dir(APP_LOG) = /)
log_enabled
any sink wants lines of this level
log_error
a LOG_ERROR line
log_file
write the lines to path (rotated at max_bytes, keep older files path.1 .. path.keep); None stops -> false when the file cannot be opened
log_info
a LOG_INFO line
log_levels
set the levels of stderr and the file (jfgui_LOG wins over both)
log_line
one line to every sink that wants its level
log_quiet
one line to the ring and the file only (its text went to stderr already)
log_recent
the newest whole lines of the ring, at most max_bytes
log_warn
a LOG_WARN line
mem_total
physical memory in bytes (sysinfo), 0 unknown [plat_mem_total]
mkdir
create a directory and its missing parents; an existing directory is fine [plat_mkdir]
module_at
the loaded module holding addr: (its file name, its image base) – for crash reports (no lock, no allocation)
monitor_icc
the ICC profile of the monitor showing window w (validated), None = assume sRGB [plat_monitor_icc]
monitor_key
a cheap key of the monitor showing window w (poll it every frame; 0 = unknown) [plat_monitor_key]
open_folder
show a folder / a file in the file manager (OpenURI.OpenDirectory) -> 0 / -1 [plat_open_folder]
open_url
a web page in the default application (OpenURI.OpenURI) -> 0 / -1 [plat_open_url]
page_init
the paper in pt, PJF_LANDSCAPE swaps; no unprintable edge [print_page_init]
parallel_for
f(index, job) for every index in 0..count, on the workers and this thread [thr_parallel_for]
pdf_write_image
one image on one PDF 1.4 page: objects 1 Catalog, 2 Pages, 3 Page, 4 Contents, 5 Image (/DeviceRGB 8 bit /FlateDecode, composited over white – with PJF_SMASK and a straight source: straight colours), 6 Info, [7 /SMask alpha]; classic xref pdf_write_image
pen_devices
pens / pen tablets of the display backend (-1 = unknown or no display) [plat_pen_devices]
pen_enable
pen input on (default) / off (pens become plain mouse events)
pen_enabled
persistent_name
The name under which a file the user chose stays reachable after a restart, for a list of recent files or a session (ui.recent_add keeps this one). A document of Flatpak’s documents portal ($XDG_RUNTIME_DIR/doc/ID/NAME) is asked for its lasting form (Documents.Add, persistent; linux_docs.rs): <mount>/<ID>/<NAME> of the portal’s answer. Where the portal reaches the real file that is a lasting document of it; for a document of its own mount the portal answers that document’s own ID, so inside the sandbox the name stays as the dialog gave it (the portal’s file dialog makes lasting documents, “Open with” session ones). Every other name comes back unchanged: Android keeps the grant of a content:// document and the browser the handle of a /handles/ file when the user chooses it, and OS paths need nothing. The name must be readable under the app’s permissions.
popup
show / move / present popup slot slot over window owner (rect None hides it) [lx_popup.s]
popup_anchor
(§6) how the next popup() of slot slot hangs at its anchor: anchor x, y, w, h and the popup’s natural place x, y (owner px), PA_* kind. Wayland builds the xdg_positioner from it (the compositor flips / slides the popup to keep it on screen); X11 places it as asked.
popup_placed
(§6) where the platform put popup slot slot (owner px) when that is not its natural place (Wayland: the compositor’s configure); None: where the UI asked, or not known yet
present
show dirty rectangles (None = everything) of the main window’s framebuffer; its pixels outside them must be what the last present showed (the backends keep whole frames up to date from it)
present_account
add the time since t0 (time_us) to present_time; frame: a win_present call, or a frame the UI showed through the GPU instead
present_time
(frames handed to win_present, microseconds spent in the platform’s present paths) since the start, all windows together: win_present itself plus the work it defers (X11: a segment that frees up, Wayland: the frame callback, the browser and Android: the composition and the hand-over to the host). For measurements (linuxtest –test pbench).
print
print one image on one page (see the file header) [plat_print]
print_dpi
pixels per inch from a document resolution: unit 0 none -> 96, 1 inch, 2 cm (* 2.54); dpu <= 0 -> 96 print_dpi
print_pdf
the job laid out on page as a one-page PDF (job.page_w / page_h set) print_pdf
random_bytes
N random bytes
random_u64
a random 64-bit number
reach_clamp
where a window the user moves may be (x, y; w its width; screen the area’s size; dpi for the margin): the title bar stays on the screen, at least 48 DIP of the window at each side
read_file
the contents of a file [plat_file_read]
read_stdin
Read bytes from the process standard input, retrying interrupted system calls and waiting on a descriptor inherited non-blocking.
rename
rename, replacing an existing target (both names on the OS or in the same mount) [plat_rename]
restart_self
like spawn_self, but the program file now at this process’s path: after an update put a new file there, /proc/self/exe still names the old one (“PATH (deleted)”) -> 0 / -1
row_white
n pixels of src (B, G, R, A) -> n * 3 bytes of dst (R, G, B; PRW_BGR: B, G, R). Straight: c * a / 255 + 255 - a (rounded); PRW_PREMUL: c + 255 - a; PRW_COPY / PRW_OPAQUE: c [print_row_white]
set_cursor
CUR_* pointer shape of the current window
set_min_size
minimum client size of the main window (DIP)
set_print_deflate
the compressor of the PDF streams (None: zlib stored blocks, no compression)
set_refresh
set_title
setenv
set (Some) or remove (None) an environment variable of this process [plat_setenv]
sleep_ms
spawn_self
fork; the child execs /proc/self/exe with argv[0], the arguments (at most 31) and the current environment (exit 127 when that fails) -> 0 / -1 [plat_spawn_self]
stack_aligned
the stack pointer is 16-byte aligned where a call could happen (the compiler relies on it: a thread started with a misaligned stack shows here) [plattest th_raw]
std_start
(feature std) the start of a program with std, from its fn main (rt::main!, ui::main! or the program’s own): std’s arguments and environment as a block like the initial stack, then what glibc_main does, with rt’s panic hook first; the end through std::process::exit
sys_settings
the system’s settings and the jfgui_* overrides
sys_settings_env
the defaults and the jfgui_* overrides only (headless runs stay the same everywhere)
system_languages
the UI languages in order of preference (empty when the system names none)
system_locale
the regional format (numbers, dates, currency) of the user
temp_dir
$TMPDIR (absolute), else /tmp
theme
0 light, 1 dark, -1 unknown: jfgui_THEME=light|dark wins, then GTK_THEME “Name:dark” or “Name-dark”, then the settings portal’s answer at the last sys_settings (color-scheme; GNOME’s “Default” is light; unknown before the first, e.g. in headless runs) [plat_theme]
thr_count
the number of worker threads (starts the pool on first use) thr_count
thr_init
start the pool (once): the number of worker threads thr_init
thr_self
the calling thread’s slot: k on worker k, the worker count on any other thread thr_self
thr_shutdown
stop the workers once the queue is empty, join them; a later call starts a new pool
thread_spawn
run f on a new thread with stack bytes of stack (0 = 1 MB) [plat_thread_create]
thread_yield
give the rest of the time slice away [plat_thread_yield]
time_us
titlebar_action_parse
a title bar action as GNOME names it (GDesktopTitlebarAction): toggle-maximize (also -horizontally / -vertically, which xdg-shell can not do: GTK treats them alike), minimize, lower, menu, none; toggle-shade is none (no compositor shades client-side windows)
titlebar_layout_parse
a button layout in GNOME’s button-layout syntax (GTK’s gtk-decoration-layout): the left side, ‘:’, the right side, names separated by ‘,’. close, minimize and maximize are kept, other names (appmenu, icon, menu, spacer) and repeats skipped; without ‘:’ everything is the left side (as GTK reads it)
touch_keyboard
(ui touch.rs) a text field got the focus through a finger (show) or lost it: the on-screen keyboard of window w. Windows: InputPane; Wayland: text-input follows the focus by itself (the compositor’s keyboard); elsewhere the host’s job (Android, the browser) or nothing there is to ask (X11)
touch_long_press
(ui touch.rs) a finger rested long enough: the host’s feedback (Android: performLongClick)
touch_primary
(ui touch.rs) the host’s main pointer is a finger at the start (Android; a phone’s browser: pointer: coarse; a Windows tablet in slate posture): no scroll bars from the first frame on; the next pointer event decides again
touch_reached
(ui touch.rs) a finger’s gesture reached a widget (a tap, a drag), or it did not (a scroll): Android asks after the finger lifted whether the keyboard has to follow
trash
move a file or folder into the trash (Windows: the recycle bin; Linux: the freedesktop trash) -> false: it stays where it was, never deleted for good (trash.rs). Counts as writing the path; a vfs name needs a folder mount.
unix_time_ns
wall-clock time: nanoseconds since 1970-01-01 00:00 UTC (CLOCK_REALTIME)
user_dir
the user’s folder of kind DIR_* (None: unknown kind, or none on this system)
user_dir_scheme
the vfs scheme of a user folder: “desktop”, “documents”, “downloads”, “pictures”, “music”, “videos” (None for another kind)
wait
pump the display until an event is queued or the deadline passes (0 = poll, u64::MAX = forever); without a display (headless) sleep until the deadline or a wake() [lx_wait_nodisp]
wait_events
headless wait (no display): until a wake-up (E_WAKE to on_event, returns 1) or the deadline in time_us() (0 = only poll, u64::MAX = forever; returns 0) [lx_wait_nodisp]
wait_refresh
wait(deadline) with a redraw closure for a modal move / size loop (Windows); the Linux backends have no modal loop: there it is wait() [main agent]
wake
any thread: make the UI thread’s wait return with E_WAKE (coalesced) [plat_wake]
win_activate
win_begin_move
win_begin_resize
win_cmd
win_create
see win_api.rs (Windows) for the semantics of every function
win_current
the window set by win_use (0 by default)
win_destroy
win_display_adapter
the GPU that drives the window’s monitor: not known here, the display’s device decides (GpuCaps)
win_dpi
win_enable
win_get_rect
win_gpu_child
win_gpu_child_alone
the window still shows on its child alone: here always
win_gpu_child_later
no child now, but it may come (the host or the next frame wakes the loop): only Android
win_gpu_child_show
win_hit_hook
stored: the compositor needs no hit tests, the Wayland backend asks it for the click activation of child windows (disp_hit)
win_in_sizemove
win_move_hook
stored: the window manager or compositor moves toplevels and does not ask; the Wayland backend snaps the child windows it moves itself (disp_moving)
win_present
show the frame’s dirty rectangles (x, y, w, h; None = all) in window w; pixels outside them must be what the last present of w showed (linux_x11_present.rs, linux_wl_present.rs)
win_release_kept
win_remote_session
win_set_cursor
win_set_min_size
win_set_rect
win_set_title
win_show
win_show_menu
the compositor’s window menu (move, resize, always on top, …) of window w at x, y (px of the window); call on the press of the right button over a library-drawn title bar
win_size
win_state
win_test
(tests) WT_PIXEL the colour the window system holds at client pixel a[0], a[1] of window w: X11 GetImage, Wayland the last shared memory buffer; -1: no way to know (Wayland on GPU buffers: a client cannot read a window back) WT_MOVE a[0], a[1], a[2], a[3]: the window’s rectangle; win_set_rect reports nothing back here, the event a size change has on Windows comes from this aid WT_DPI a[0]: the dpi as if the compositor preferred that scale (Wayland with a viewport, else -1: X11 has one dpi for the display and no second size) WT_SHOW a[0] = 7 minimised, 4 back: X11 through the window manager; Wayland can minimise, but no client can undo that: 4 does what the compositor’s next activation does here WT_POPUP_RECT popup slot w is shown: 1, else -1 WT_NOANIM, WT_FROM_POINT nothing to turn off; nobody tells a client what lies on top of its window: it counts as ours
win_test_image
(tests) what the window system holds for window w: (w, h, rows of w * 4 bytes): X11 reads it back (GetImage; also a buffer on the window), Wayland has no way to: None
win_test_screen
(tests) a part of the screen: no client on Linux can read it without asking the user
win_test_send
(tests) nothing to send to: Windows’ messages
win_test_usage
(tests) (CPU time of this process so far in us, its resident bytes, its anonymous resident bytes)
win_use
the window the single-window per-window calls refer to (-1 = none)
win_work_area
window_cmd
window_create
the main window (AF_CUSTOM_TITLEBAR: no system caption; AF_RESIZABLE), shown at once
window_create_at
window_create with the client area’s top left at x, y (screen px; PW_DEFAULT: where the system puts it) and maximized (its normal size w_dip x h_dip)
window_menu
(Linux, a library-drawn title bar) the window manager’s menu of the current window at x, y (px of the window), on a right-button press: move, resize, always on top, …
window_size
client pixels of the main window
window_state
WST_* bits of the current window
wl_connect
connect to the compositor -> the backend, None when there is no Wayland display (quiet unless jfgui_BACKEND=wayland forces it) wl_connect
wl_cursor_image
the built-in cursor image of a CUR_* shape: (width, height, hot x, hot y, rows of ‘X’ black / ‘o’ white / ‘.’ transparent) wl_cursor_image
wl_cursor_render
expand a cursor image into ARGB pixels (S x S blocks, rows of width * S pixels) wl_cursor_render
wl_input_service
key repeat at now (time_us) -> the next repeat deadline, u64::MAX = none wl_input_service
wl_mods
the MOD_* bits the events carry (g_wl_mods)
wl_mods_set
set the MOD_* bits of the events (a modifier key’s own event, wl_input)
wl_test_event
call the handler of event event (“enter”, “key”, …) of interface iface (“wl_pointer”, “wl_keyboard”, …) with decoded arguments (object id 1, udata 0), as linuxtest –test synth does -> false when there is no such event [hcall]
wl_test_event_u
(main agent) wl_test_event with the handler’s udata (a tablet tool’s slot …), as plattest –test pen does [tcall in apps/plattest/src/pen.s]
wl_test_presented
the pixels of window w’s last committed buffer – what the compositor shows – as (w, h, rows of w * 4 bytes B, G, R, x); None while damage waits (linuxtest –test pcheck)
wl_test_protoerr
attach a buffer id that does not exist to the main window’s surface: the compositor answers with wl_display.error, which ends the process (linuxtest –test protoerr)
wl_test_roundtrip
a wl_display.sync round trip: the events that arrive before its answer are dispatched first (linuxtest –test burst: a burst of keys while it waits) -> 0 ok / -1 timeout
wl_test_scale
(main agent) the pointer scale while there is no window (g_wl_s120, 120ths) alone
wl_test_setup
the pointer scale while there is no window (g_wl_s120, 120ths) and the seat version the handlers assume (g_wl_seat_ver)
write_file
Write an exclusively created sibling, flush it, then replace path (a mount: its own way of replacing a file; missing folders are created). [plat_file_write]
write_stderr
write_stdout
x11_connect
connect to $DISPLAY -> the backend, None when there is no X server [x11_plat_win_create]
xkb_begin
(X11 backend) empty key table and modifier roles, before xkb_set_key xkb_begin
xkb_dead_keysym
the X keysym of a dead key from its spacing character (0 = none)
xkb_dead_reset
forget a pending dead key (the keyboard focus changed)
xkb_dump
print every defined key: evdev, VK, flags, modifier id, 4 levels xkb_dump
xkb_is_dead
the key gives a dead key now (with the current modifiers)
xkb_is_modifier
the key’s level-1 symbol is a modifier xkb_is_modifier
xkb_key
evdev code -> (VK code, text codepoint (0 = none)) xkb_key
xkb_key_typed
a key press with the dead keys composed -> (VK, up to two codepoints, 0 = none)
xkb_mod_bit
MOD_* bit of a held modifier key (0 for other keys and locks) xkb_mod_bit
xkb_parse
parse an xkbcommon text keymap -> 0 ok / -1 (fewer than 20 keys found) xkb_parse
xkb_set_key
(X11 backend) define one key: 4 symbol values (as the keymap parser makes them), nlev = number of levels listed xkb_set_key
xkb_set_mods
the real modifier state -> MOD_* bits (also the events’ modifiers) xkb_set_mods
xkb_set_roles
(X11 backend) real-modifier masks of the modifier roles (0 = the Wayland default) xkb_set_roles
xkb_use_fallback
evdev -> US English symbols (used when no keymap parses) xkb_use_fallback
xkb_vk_keys
the evdev codes of the keys that give vk without modifiers (keypad keys: with Num Lock on) – the keys a global shortcut grabs (linux_x11_screen.rs)

Type Aliases§

CrashHook
DeflateFn
a zlib compressor: (data, level) -> zlib stream (img_core::deflate::zlib_deflate)
DragHook
what the UI takes at a point: f(platform window, x, y px, offered DT_) -> (accepted DT_, accepted DE_*)