code wiki / _hdl_build / nx_nishios_browser_input.nx

nx_nishios_browser_input.nx

buildroot/runtime/_hdl_build/nx_nishios_browser_input.nx

23114 B397 linesdepth 9pulls 30 transitivereach 0 importersview sourcekind tooltopic nishios
docsdependenciesstructsconstsfunctions

about

nx_nishios_browser_input.nx -- BROWSER-ON-ALL-OS arc, rung N2: the Nishi browser is USED on NishiOS. N1 (nx_nishios_browser) proved the browser RENDERS on NishiOS. This rung proves INPUT + NAVIGATION: the OS delivers a click at the desktop point over a link in the rendered page; the browser maps it to page coordinates, hit-tests it with the SAME br_hit_link the Linux/Windows browsers use, resolves the href, loads the target page from the OS content store (disk), re-lays-out and re-renders -- a real browse interaction (click a link -> the page changes), frame0/frame1 exported as BMPs. KAT: T1 booted off the persisted image; T2 LONG mode; T3 start page laid out; T4 the OS click HITS the link box (br_hit_link==1); T5 the resolved href is exactly '/wiki/'; T6 the target page laid out; T7 the target page rendered (h1 bar pixels in frame1); T8 frame0 and frame1 DIFFER across the window region (navigation visibly changed the page); T9 both BMPs exported at the exact expected size. NEG/liar-kill: T10 a click at a NON-link point hits nothing (no navigation -- input evidence is box-sensitive, not a constant); T11 a 0-sector-load sibling image never reaches long mode -> no frame is ever drawn. HONEST SEAM (same class as nx_nishios_events/kbd): the click SOURCE is scripted (a live PS/2 controller on the emu = the hardware rung); the click HANDLING (desktop->page mapping, br_hit_link, href resolve, load, re-render) is the real browser input path. Navigation loads from DISK (the OS content store); NishiOS-native network fetch = rung N3 (nx_nishios_net), named not claimed. NEVER-BRICK (Rule 26): writes FILE artifacts only; models INT 13h *reads*; no /dev. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_browser_render.nx nx_fb.nx nx_nishios_browser_input.nx

imports: nx_browser_render.nxnx_fb.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nb_puts nb_build_image nb_movrax nb_write_file sys_openat_wr sys_read_file sys_openat_rd sys_lseek sys_mmap sys_read sys_close nb_boot_image nb_emu_boot_disk nb_mode nb_num nb_draw_desktop fb_nishi_font fb_gly fb_rect fb_setpx fb_text fb_char fb_rect ↻ fb_window fb_rect ↻ fb_text ↻ nb_str font8x8_table sys_mmap ↻ fg fb_setpx ↻ nx_framebuffer_init br_draw_fb br_draw_fb_at sys_mmap ↻ br_comp_bg br_prop_eq sys_mmap ↻ nx_css_color_decode

structs

none

consts

25const NB_MAGIC_200000: i64 = 200000
26const NB_MAGIC_32767: i64 = 32767
27const NB_MAGIC_65536: i64 = 65536
104const NB_IMG_SZ: i64 = 1024
185const NB_W: i64 = 640
186const NB_H: i64 = 480
187const NB_BW: i64 = 620
188const NB_BH: i64 = 426
189const NB_OX: i64 = 10
190const NB_OY: i64 = 38

functions

29func nb_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main
30func nb_num(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 }
called by 1: main
31func nb_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
32func nb_contains(hay: *u8, hn: i64, ndl: *u8, nn: i64) -> i64
38func nb_mode(cr0: i64, efer: i64) -> i64 { let pe: i64=cr0&1; let pg: i64=(cr0>>31)&1; let lme: i64=(efer>>8)&1; if pe==0 { return 0 } if pg==1 { if lme==1 { return 2 } } return 1 }
called by 1: nb_emu_boot_disk
41func nb_emu_boot_disk(mem: *u8, disk: *u8, entry: i64, console: *u8, clen: *i64, st: *i64) -> i64
called by 1: nb_boot_image calls 1: nb_mode
106func nb_movrax(img: *u8, base: i64, o: i64, b0: i64, b1: i64, b2: i64, b3: i64) -> i64
called by 1: nb_build_image
111func nb_build_image(img: *u8) -> i64
called by 1: main calls 1: nb_movrax
150func nb_boot_image(img: *u8, console: *u8, clen: *i64, st: *i64, loaded: *i64) -> i64
called by 1: main calls 1: nb_emu_boot_disk
163func nb_str(fb: *u8, W: i64, H: i64, x: i64, y: i64, s: *u8, r: i64, g: i64, b: i64) -> i64
177func nb_write_file(path: *u8, data: *u8, n: i64) -> i64
called by 1: main calls 1: sys_openat_wr
193func nb_draw_desktop(desk: *u8, page: *Page, url: *u8, ulen: i64, cx: i64, cy: i64) -> i64
248func main() -> i64