code wiki / (root) / nx_browser_demo_styled.nx

nx_browser_demo_styled.nx

buildroot/runtime/nx_browser_demo_styled.nx

5776 B150 linesdepth 7pulls 17 transitivereach 0 importersview sourcekind sketch/demotopic browser
docsdependenciesstructsconstsfunctions

about

nx_browser_demo_styled.nx -- the closing demo of the day. Renders "NISHI" on a blue background by composing: - HTML "<body>NISHI</body>" via nx_html_tokenizer - LayoutBox tree via nx_layout_from_dom - Manually-populated cascade with body { background-color: #0000ff } so nx_paint_walk_layout fills the body rect blue - nx_paint_ctx_set_text(WHITE) so the text rasterizer paints "NISHI" in white over the blue background - nx_paint_fb_ascii_dump -> stdout Demonstrates that the substrate composes HTML + CSS cascade + layout + background paint + text paint + ASCII output bits-up end-to-end.

dependencies 12 imports · 0 importers

nx_syscalls.nx nx_css_tokenize.nx nx_css_apply.nx nx_css_color_decode.nx nx_html_tokenizer.nx nx_layout_box.nx nx_layout_default_display.nx nx_layout_from_dom.nx nx_paint_solid_rect.nx nx_paint_text.nx nx_browser_demo_styled.nx

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

imports: nx_syscalls.nxnx_css_tokenize.nxnx_css_apply.nxnx_css_color_decode.nxnx_html_tokenizer.nxnx_layout_box.nxnx_layout_default_display.nxnx_layout_from_dom.nxnx_paint_solid_rect.nxnx_paint_text.nxnx_paint_walk_layout.nxnx_paint_fb_ascii_dump.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 _put_byte 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 _disp_lc ↻ _disp_eq4 _disp_lc ↻ _disp_eq5 _disp_lc ↻ _disp_eq6 _disp_lc ↻

structs

none

consts

27const K_MAGIC_2048: i64 = 2048

functions

29func _put_byte(buf: *u8, i: i64, v: i64) -> i64
called by 1: main
34func main() -> i64