code wiki / _hdl_build / nishi_gui.nx

nishi_gui.nx

buildroot/runtime/_hdl_build/nishi_gui.nx

41790 B838 linesdepth 10pulls 70 transitivereach 0 importersview sourcekind tooltopic nishi
docsdependenciesstructsconstsfunctions

about

nishi_gui.nx -- the NISHI browser, graphical + INTERACTIVE (Windows). "Nishi" = west (the family). GUI-R5: a real navigable browser. Self-contained: fetches its own pages in-process by spawning the proven nishi_fetch.exe (CreateProcessA, child stdout -> temp file -> read back). Clickable links (hit-test the mouse against a per-render link table -> fetch that URL -> re-render). Back stack. Still 2x supersampled anti-aliasing + reading-view layout + page title heading + blue links. Built by nx_pe_compile_win_gui.nx (sovereign Win32 FFI; no gcc/curl/zlib/toolkit).

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_font8x8.nx nx_browser_render.nx nx_img_bytes_to_rgb.nx nishi_gui.nx

imports: nx_syscalls.nxnx_font8x8.nxnx_browser_render.nxnx_img_bytes_to_rgb.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap win32 w32 win32addr sys_exit font8x8_table sys_mmap ↻ fg nx_framebuffer_init scopy show_loading fill_rect draw_text draw_span draw_char fill_rect ↻ slen draw_span ↻ win32 ↻ fetch_url scopy ↻ sys_mmap ↻ w32 ↻ wp w32 ↻ win32 ↻ rp rd32 rd32 ↻ hist_push rd32 ↻ br_hit_link resolve_url scopy ↻ br_layout br_slen sys_mmap ↻ rh_extract_styles sys_mmap ↻

structs

none

consts

26const W_WriteFile: i64 = 4
27const W_GetModuleHandleA: i64 = 6
28const W_RegisterClassExA: i64 = 7
29const W_CreateWindowExA: i64 = 8
30const W_ShowWindow: i64 = 9
31const W_PeekMessageA: i64 = 10
32const W_TranslateMessage: i64 = 11
33const W_DispatchMessageA: i64 = 12
34const W_DefWindowProcA: i64 = 13
35const W_GetDC: i64 = 14
36const W_ReleaseDC: i64 = 15
37const W_IsWindow: i64 = 16
38const W_LoadCursorA: i64 = 17
39const W_SetDIBitsToDevice: i64 = 18
40const W_ReadFile: i64 = 19
41const W_CreateFileA: i64 = 20
42const W_CreateProcessA: i64 = 21
43const W_WaitForSingleObject:i64 = 22
44const W_CloseHandle: i64 = 23
45const W_GetClientRect: i64 = 24 // added to the win_gui import table for live resize re-flow
47const LINKMAX: i64 = 1024

functions

13func win32(id: i64, args: *i64) -> i64 { return id }
14func win32addr(id: i64) -> i64 { return id }
called by 1: main
49func w8(p: *u8, o: i64, v: i64) -> i64 { p[o] = (v & 0xff) as u8; return 0 }
50func w16(p: *u8, o: i64, v: i64) -> i64 { p[o]=(v&0xff) as u8; p[o+1]=((v>>8)&0xff) as u8; return 0 }
51func w32(p: *u8, o: i64, v: i64) -> i64
54func wp(p: *u8, o: i64, v: i64) -> i64 { w32(p,o,v); w32(p,o+4, v / 4294967296); return 0 }
called by 2: fetch_urlfetch_image calls 1: w32
55func rd32(p: *u8, o: i64) -> i64 { return (p[o]&0xff) | ((p[o+1]&0xff)<<8) | ((p[o+2]&0xff)<<16) | ((p[o+3]&0xff)<<24) }
56func rp(p: *u8, o: i64) -> i64 { return rd32(p,o) | (rd32(p,o+4) * 4294967296) }
called by 2: fetch_urlfetch_image calls 1: rd32
57func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: draw_text
58func print_int(v: i64) -> i64
68func scopy(dst: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[o+i]=s[i]; i=i+1 } return o+i }
70func fill_rect(fb: *u8, W: i64, x0: i64, y0: i64, rw: i64, rh: i64, b: i64, g: i64, r: i64) -> i64
83func draw_char(fb: *u8, W: i64, ft: *u8, c: i64, x0: i64, y0: i64, sc: i64, b: i64, g: i64, r: i64) -> i64
called by 2: draw_spandraw_body calls 1: fill_rect
100func draw_span(fb: *u8, W: i64, ft: *u8, x0: i64, y0: i64, text: *u8, start: i64, len: i64, sc: i64, b: i64, g: i64, r: i64) -> i64
110func draw_text(fb: *u8, W: i64, ft: *u8, x0: i64, y0: i64, str: *u8, sc: i64, b: i64, g: i64, r: i64) -> i64
117func fetch_url(url: *u8, ulen: i64, outbuf: *u8, cap: i64, a: *i64, cmd: *u8) -> i64
called by 1: main calls 7: scopysys_mmapw32wpwin32rp+1
177func read_local(fname: *u8, outbuf: *u8, cap: i64, a: *i64) -> i64
called by 1: load_images calls 4: win32sys_mmapw32rd32
197func split_page(pbuf: *u8, plen: i64, out: *i64) -> i64
213func resolve_url(raw: *u8, rawlen: i64, cur: *u8, curlen: i64, out: *u8) -> i64
called by 2: load_imagesmain calls 1: scopy
252func fetch_image(url: *u8, ulen: i64, a: *i64, cmd: *u8) -> i64
290func load_images(page: *Page, baseurl: *u8, baselen: i64, a: *i64, cmd: *u8, tmpurl: *u8, imgbuf: *u8, imgcap: i64) -> i64
338func strip_markers(src: *u8, len: i64, out: *u8) -> i64
367func draw_body(fb: *u8, W: i64, ft: *u8, x0: i64, ytop: i64, colw: i64, lineh: i64, maxy: i64,
called by 1: render_content calls 2: rec_linkdraw_char
432func downsample(fb: *u8, W: i64, H: i64, fb2: *u8, RW: i64) -> i64
452func draw_chrome(fb2: *u8, RW: i64, RH: i64, ft: *u8, tptr: *u8, tlen: i64, urlptr: *u8, urllen: i64) -> i64
479func render_content(fb2: *u8, RW: i64, RH: i64, ft: *u8, body: *u8, blen: i64, scroll_px: i64, linktab: *u8, lcount: *i64) -> i64
488func show_loading(a: *i64, hwnd: i64, bmi: *u8, fb: *u8, W: i64, H: i64, ft: *u8, url: *u8, ulen: i64) -> i64
505func draw_addrbar_edit(fb: *u8, W: i64, ft: *u8, ed: *u8, edlen: i64) -> i64
called by 1: main calls 2: fill_rectdraw_span
514func hist_push(histbuf: *u8, hoff: *i64, hlen: *i64, histn: i64, hcur: i64, url: *u8, ulen: i64) -> i64
called by 1: main
524func rgba_to_bgra(dst: *u8, src: *u8, n: i64) -> i64
called by 1: paint_css
538func paint_css(page: *Page, fbs: *Framebuffer, fb: *u8, fb2: *u8, W: i64, H: i64, url: *u8, ulen: i64, scroll_px: i64) -> i64
558func gappend(buf: *u8, n: i64, val: i64) -> i64
called by 1: gmark calls 1: sys_mmap
570func gwrite(a: *i64, buf: *u8, n: i64) -> i64
called by 1: gmark calls 2: win32sys_mmap
581func gmark(a: *i64, buf: *u8, val: i64) -> i64
calls 2: gappendgwrite
586func main() -> i64