nx_ui_lib.nx
buildroot/runtime/nx_ui_lib.nx
about
nx_ui_lib.nx -- sovereign INTERACTIVE-FRONTEND render lib (fd-based, no main).
The REUSABLE core: writes interactive HTML/SVG to ANY fd (stdout, an HTTP
connection, a buffer) so the SAME render serves live, prints, or buffers.
Composed by nx_ui (demo), nx_ui_serve (live server), and any future frontend.
COMPOSABLE: the page is split into open / svg / controls / close so a server
can inject extra content (e.g. a pain tally) between the map and </body>
WITHOUT forking the renderer. ui_emit_region_map() composes them for the
simple case. Clickable regions + highlight + zoom + query parse. Zero JS.
license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_ui.nxnx_ui_serve.nx
structs
| none |
consts
| 26 | const UI_NREG: i64 = 5 |
functions
| 15 | func ui_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != 0 as u8 { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 16 | func ui_wn(fd: i64, n: i64) -> i64 |
| 28 | func ui_rx(i: i64) -> i64 { if i == 0 { return 80 } if i == 1 { return 70 } if i == 2 { return 40 } if i == 3 { return 135 } return 75 } called by 1: ui_region |
| 29 | func ui_ry(i: i64) -> i64 { if i == 0 { return 10 } if i == 1 { return 55 } if i == 2 { return 55 } if i == 3 { return 55 } return 160 } called by 1: ui_region |
| 30 | func ui_rw(i: i64) -> i64 { if i == 0 { return 40 } if i == 1 { return 60 } if i == 2 { return 25 } if i == 3 { return 25 } return 50 } called by 1: ui_region |
| 31 | func ui_rh(i: i64) -> i64 { if i == 0 { return 40 } if i == 1 { return 100 } if i == 2 { return 90 } if i == 3 { return 90 } return 120 } called by 1: ui_region |
| 32 | func ui_label(i: i64) -> *u8 called by 1: ui_emit_region_map_open |
| 40 | func ui_region(fd: i64, i: i64, selected: i64, zoom: i64) -> i64 |
| 51 | func ui_emit_region_map_open(fd: i64, selected: i64, zoom: i64) -> i64 |
| 67 | func ui_emit_page_close(fd: i64) -> i64 { ui_w(fd, "</body></html>\n"); return 0 } |
| 70 | func ui_emit_region_map(fd: i64, selected: i64, zoom: i64) -> i64 |
| 77 | func ui_qval(qs: *u8, key: *u8, deflt: i64) -> i64 called by 1: ui_handle_query |
| 103 | func ui_qhas(qs: *u8, key: *u8) -> i64 |
| 118 | func ui_handle_query(fd: i64, qs: *u8) -> i64 |