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.
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.
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!().
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
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
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
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
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.
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)
(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 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.
(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)
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
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)
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).
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
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
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.
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)
(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).
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
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]
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)
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)
(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)
(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
(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
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.
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]