code wiki / _hdl_build / nishi_gui.nx
nishi_gui.nx
buildroot/runtime/_hdl_build/nishi_gui.nx
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
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
structs
| none |
consts
| 26 | const W_WriteFile: i64 = 4 |
| 27 | const W_GetModuleHandleA: i64 = 6 |
| 28 | const W_RegisterClassExA: i64 = 7 |
| 29 | const W_CreateWindowExA: i64 = 8 |
| 30 | const W_ShowWindow: i64 = 9 |
| 31 | const W_PeekMessageA: i64 = 10 |
| 32 | const W_TranslateMessage: i64 = 11 |
| 33 | const W_DispatchMessageA: i64 = 12 |
| 34 | const W_DefWindowProcA: i64 = 13 |
| 35 | const W_GetDC: i64 = 14 |
| 36 | const W_ReleaseDC: i64 = 15 |
| 37 | const W_IsWindow: i64 = 16 |
| 38 | const W_LoadCursorA: i64 = 17 |
| 39 | const W_SetDIBitsToDevice: i64 = 18 |
| 40 | const W_ReadFile: i64 = 19 |
| 41 | const W_CreateFileA: i64 = 20 |
| 42 | const W_CreateProcessA: i64 = 21 |
| 43 | const W_WaitForSingleObject:i64 = 22 |
| 44 | const W_CloseHandle: i64 = 23 |
| 45 | const W_GetClientRect: i64 = 24 // added to the win_gui import table for live resize re-flow |
| 47 | const LINKMAX: i64 = 1024 |
functions
| 13 | func win32(id: i64, args: *i64) -> i64 { return id } |
| 14 | func win32addr(id: i64) -> i64 { return id } called by 1: main |
| 49 | func w8(p: *u8, o: i64, v: i64) -> i64 { p[o] = (v & 0xff) as u8; return 0 } |
| 50 | func w16(p: *u8, o: i64, v: i64) -> i64 { p[o]=(v&0xff) as u8; p[o+1]=((v>>8)&0xff) as u8; return 0 } |
| 51 | func w32(p: *u8, o: i64, v: i64) -> i64 |
| 54 | func wp(p: *u8, o: i64, v: i64) -> i64 { w32(p,o,v); w32(p,o+4, v / 4294967296); return 0 } |
| 55 | func 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) } |
| 56 | func rp(p: *u8, o: i64) -> i64 { return rd32(p,o) | (rd32(p,o+4) * 4294967296) } |
| 57 | func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: draw_text |
| 58 | func print_int(v: i64) -> i64 |
| 68 | func 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 } |
| 70 | func fill_rect(fb: *u8, W: i64, x0: i64, y0: i64, rw: i64, rh: i64, b: i64, g: i64, r: i64) -> i64 |
| 83 | func draw_char(fb: *u8, W: i64, ft: *u8, c: i64, x0: i64, y0: i64, sc: i64, b: i64, g: i64, r: i64) -> i64 |
| 100 | func 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 |
| 110 | func draw_text(fb: *u8, W: i64, ft: *u8, x0: i64, y0: i64, str: *u8, sc: i64, b: i64, g: i64, r: i64) -> i64 |
| 117 | func fetch_url(url: *u8, ulen: i64, outbuf: *u8, cap: i64, a: *i64, cmd: *u8) -> i64 |
| 177 | func read_local(fname: *u8, outbuf: *u8, cap: i64, a: *i64) -> i64 |
| 197 | func split_page(pbuf: *u8, plen: i64, out: *i64) -> i64 |
| 213 | func resolve_url(raw: *u8, rawlen: i64, cur: *u8, curlen: i64, out: *u8) -> i64 |
| 252 | func fetch_image(url: *u8, ulen: i64, a: *i64, cmd: *u8) -> i64 |
| 290 | func load_images(page: *Page, baseurl: *u8, baselen: i64, a: *i64, cmd: *u8, tmpurl: *u8, imgbuf: *u8, imgcap: i64) -> i64 |
| 338 | func strip_markers(src: *u8, len: i64, out: *u8) -> i64 |
| 354 | func rec_link(linktab: *u8, lcount: *i64, x0: i64, y0: i64, x1: i64, y1: i64, uptr: i64, ulen: i64) -> i64 |
| 367 | func draw_body(fb: *u8, W: i64, ft: *u8, x0: i64, ytop: i64, colw: i64, lineh: i64, maxy: i64, |
| 432 | func downsample(fb: *u8, W: i64, H: i64, fb2: *u8, RW: i64) -> i64 |
| 452 | func draw_chrome(fb2: *u8, RW: i64, RH: i64, ft: *u8, tptr: *u8, tlen: i64, urlptr: *u8, urllen: i64) -> i64 |
| 479 | func render_content(fb2: *u8, RW: i64, RH: i64, ft: *u8, body: *u8, blen: i64, scroll_px: i64, linktab: *u8, lcount: *i64) -> i64 |
| 488 | func show_loading(a: *i64, hwnd: i64, bmi: *u8, fb: *u8, W: i64, H: i64, ft: *u8, url: *u8, ulen: i64) -> i64 |
| 505 | func draw_addrbar_edit(fb: *u8, W: i64, ft: *u8, ed: *u8, edlen: i64) -> i64 |
| 514 | func hist_push(histbuf: *u8, hoff: *i64, hlen: *i64, histn: i64, hcur: i64, url: *u8, ulen: i64) -> i64 called by 1: main |
| 524 | func rgba_to_bgra(dst: *u8, src: *u8, n: i64) -> i64 called by 1: paint_css |
| 538 | func paint_css(page: *Page, fbs: *Framebuffer, fb: *u8, fb2: *u8, W: i64, H: i64, url: *u8, ulen: i64, scroll_px: i64) -> i64 called by 1: main calls 5: br_set_fast_vecbr_draw_fb_atnx_paint_solid_rectbr_color_from_intrgba_to_bgra |
| 558 | func gappend(buf: *u8, n: i64, val: i64) -> i64 |
| 570 | func gwrite(a: *i64, buf: *u8, n: i64) -> i64 |
| 581 | func gmark(a: *i64, buf: *u8, val: i64) -> i64 |
| 586 | func main() -> i64 |