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;
pub use web::*;

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.
content
The documents of other apps as files: Android’s content:// names (the name logic on all platforms, tested with a host in memory).
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.
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.
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
spell
The system’s spell checker (Windows ISpellChecker); Hunspell files are the spell crate’s.
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.
web
Host-driven boundary shared by browser workers and the native Android adapter.

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
The caller cancelled a loop or background job.
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
GuardInfo
Compatibility fault record for APIs returning an unsupported-operation error.
HcColors
the colours of a high-contrast scheme (0xRRGGBB)
Job
A background job whose items run between browser frames.
JobCtl
Cooperative progress and cancellation state exposed to one work item.
JxlEncReq
Shared JPEG XL request structure retained for the static fallback selection.
Lib
Opaque native plugin handle; browser loading always returns an error.
LibSeg
Native segment description; no such segments are loaded in the browser.
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)
SysSettings
what the system says (see the module comment)
Titlebar
the buttons and click actions of a title bar the library draws (SysSettings::titlebar)

Enums§

FingerPhase
what happens to a finger (finger)

Constants§

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
Native AVX2 capability bit; never advertised by the scalar browser backend.
CPU_BMI2
Native BMI2 capability bit; never advertised by the scalar browser backend.
CPU_FMA
Native FMA capability bit; never advertised by the scalar browser backend.
CPU_POPCNT
Native POPCNT capability bit; never advertised by the scalar browser backend.
CPU_SSE41
Native SSE4.1 capability bit; never advertised by the scalar browser backend.
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
Native guarded-call fault code.
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
Access violation category.
GK_ARITH
Arithmetic fault category.
GK_BREAK
Breakpoint category.
GK_BUS
Bus fault category.
GK_ILLEGAL
Illegal instruction category.
GK_NONE
No recorded fault.
GK_STACK
Stack exhaustion category.
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
Native guard slot count.
HB_BLOCK
HB_CLOSE
HB_CURSOR_SHIFT
HB_DISABLED
HB_DRAG
HB_FOCUS
HB_MAX
HB_MIN
HB_MOVES
HB_TEXT
ICC_MON_PRIMARY
Primary-monitor compatibility selector.
JXLENC_FILE
Empty because the browser does not load a native JPEG XL encoder module.
LH_SEGMAX
Native segment count limit.
LIBA_R
Readable native segment flag.
LIBA_W
Writable native segment flag.
LIBA_X
Executable native segment flag.
LIBE_DEPS
Unsupported native dependencies.
LIBE_FORMAT
Unsupported native binary format, including all browser DLL/SO attempts.
LIBE_INIT
Unsupported initializer.
LIBE_IO
Native library input failure.
LIBE_MAP
Unsupported native mapping.
LIBE_NOMEM
Allocation failure.
LIBE_RELOC
Unsupported relocation.
LIB_FILE_MAX
Native plugin size limit, retained in the common API.
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
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
Maximum native worker count; the browser has zero auxiliary compute threads.
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

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
avx2_probe
The browser does not advertise or execute native AVX2 instructions.
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)
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_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.
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)
cpu_brand
the processor name from CPUID 0x80000002..4, blanks trimmed cpu_brand
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
Deliberate termination on Android, where no hardware exception translator is installed.
crash_test_caller
Compatibility caller for the Android diagnostic termination.
delete
a file or an empty directory [plat_delete]
dir_list
f(name, is_dir, size_lo) for every entry except “.” and “..” [plat_dir_list]
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.
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)
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_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.
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)
guard_call
Reject arbitrary function-pointer execution through the native plugin boundary.
guard_init
Browser traps cannot be installed as recoverable native exception handlers.
guard_read
Arbitrary address reads are unavailable; use bounded host buffers instead.
guard_run
Reject a request for native fault recovery; the supplied closure is not invoked.
guard_tag
No native guard stack is installed.
guard_test_code
Native instruction fault tests are unavailable.
guard_test_state
No native guard test state exists.
guard_write
Arbitrary address writes are unavailable.
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_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
No native module result; the caller must select its compiled-in codec.
jxlenc_file
No native JPEG XL module path is available.
jxlenc_ready
The native module encoder is unavailable; codecs may use their static fallback.
jxlenc_set_path
Native module paths do not activate code in the browser.
layout
the image rectangle and the printable area on the page [print_layout]
lib_close
Consume an opaque handle.
lib_open
Reject native DLL/SO input on WebAssembly.
lib_read
Native library memory is unavailable.
lib_seg
No native segment can contain a requested address.
lib_sym
Native symbols cannot be resolved.
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: the virtual /data (vfs::app_dir(APP_LOG) = /data//Logs)
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
mkdir
create a directory and its missing parents; an existing directory is fine [plat_mkdir]
module_at
No native module owns a browser address.
monitor_icc
The browser host cannot query the physical display’s ICC profile.
monitor_key
No physical-monitor identity is exposed.
page_init
the paper in pt, PJF_LANDSCAPE swaps; no unprintable edge [print_page_init]
parallel_for
Run the existing parallel-loop contract sequentially, checking cancellation per item.
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_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.
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_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
pump_jobs
Process at most items background work items before yielding to the host again.
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]
rename
rename, replacing an existing target (both names on the OS or in the same mount) [plat_rename]
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_title
stack_aligned
WebAssembly’s compiler-managed value/call stacks satisfy their platform ABI.
std_start
In the browser and on Android the host starts the app (web.rs), never a fn main.
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
thr_count
Number of auxiliary workers.
thr_init
Browser compute remains on its app worker; no auxiliary OS threads are started.
thr_self
The app worker always uses scratch slot zero.
thr_shutdown
Cancel and complete all queued cooperative jobs.
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.
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_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]
win_current
the window set by win_use (0 by default)
win_use
the window the single-window per-window calls refer to (-1 = none)
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_size
client pixels of the main window
window_state
WST_* bits of the current window
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 errors to Android logcat.
write_stdout
Write diagnostics to Android logcat.

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_*)