code wiki / _hdl_build / nx_render_wiki_styled_window.nx

nx_render_wiki_styled_window.nx

buildroot/runtime/_hdl_build/nx_render_wiki_styled_window.nx

12860 B261 linesdepth 7pulls 25 transitivereach 0 importersview sourcekind tooltopic render
docsdependenciesstructsconstsfunctions

about

nx_render_wiki_styled_window.nx -- the STYLED live browser window: real Wikipedia, scrollable, with the CSS cascade driving per-element TEXT SIZE + COLOR. Merges the proven styling pipeline (combined [HTML][CSS] buffer -> layout_from_dom -> box-indexed cascade -> computed) into the scrollable X11 window; each text box looks up its parent element box's computed font-size (-> glyph px_size) and color (-> gc foreground). Layout sizes boxes by font-size so bigger headings don't overlap. Sovereign.

dependencies 15 imports · 0 importers

nx_syscalls.nx nx_css_tokenize.nx nx_css_parse.nx nx_css_apply.nx nx_css_selector_match.nx nx_html_tokenizer.nx nx_dom_query.nx nx_layout_box.nx nx_layout_default_display.nx nx_layout_from_dom.nx nx_render_wiki_styled_window.n

diagram shows first 10 each side; +5 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_css_tokenize.nxnx_css_parse.nxnx_css_apply.nxnx_css_selector_match.nxnx_html_tokenizer.nxnx_dom_query.nxnx_layout_box.nxnx_layout_default_display.nxnx_layout_from_dom.nxnx_layout_block.nxnx_x11_connect.nxnx_x11_window.nxnx_x11_paint.nxnx_x11_paint_text_5x7.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 sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_write sw_slen nx_layout_tree_init nx_layout_from_dom_stack_i nx_layout_from_dom nx_layout_box_append _layout_box_at _lfd_push sys_mmap ↻ nx_html_cursor_init nx_html_next_token _scan_name _is_name _is_void_element _lc _lfd_is_chrome_start _lfd_chrome_tag _lfd_has_role_nav _lfd_name_eq _lfd_lc _lfd_has_chrome_class _lfd_src_has_sub _lfd_inline_hidden _lfd_src_has_sub ↻ nx_layout_default_display _disp_eq1 _disp_lc _disp_is_h_family _disp_lc ↻ _disp_eq2 _disp_lc ↻ _disp_eq3

structs

none

consts

21const K_MAGIC_16384: i64 = 16384
22const K_MAGIC_8192: i64 = 8192

functions

24func sw_slen(s: *u8) -> i64 { var k: i64=0; while s[k]!=(0 as u8){k=k+1} return k }
called by 2: sw_region_ismain
25func sw_region_is(src: *u8, off: i64, len: i64, lit: *u8) -> i64
called by 2: sw_comp_intsw_comp_color calls 1: sw_slen
32func sw_parse_int(src: *u8, off: i64, len: i64) -> i64
called by 1: sw_comp_int
38func sw_hex1(c: i64) -> i64
called by 1: sw_comp_color
45func sw_comp_int(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64, prop: *u8, dflt: i64) -> i64
57func sw_comp_color(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64) -> i64
called by 1: draw_styled calls 2: sw_region_issw_hex1
74func sw_extract(html: *u8, hlen: i64, elements: *CssElement, maxn: i64) -> i64
96func sw_is_elem(k: i64) -> i64 { if k==NX_LAYOUT_BOX_BLOCK {return 1} if k==NX_LAYOUT_BOX_INLINE {return 1} if k==NX_LAYOUT_BOX_INLINE_BLOCK {return 1} return 0 }
called by 1: main
100func draw_styled(c: *X11Conn, wid: i64, gc: i64, paper: i64, tree: *LayoutTree, html: *u8,
131func main() -> i64