code wiki / _hdl_build / nx_browser_render_gif_t139.nx

nx_browser_render_gif_t139.nx

buildroot/runtime/_hdl_build/nx_browser_render_gif_t139.nx

103053 B1771 linesdepth 8pulls 34 transitivereach 2 importersview sourcekind librarytopic browser
docsdependenciesstructsconstsfunctions

about

nx_browser_render.nx -- REUSABLE sovereign CSS render core. Holds nx_browser's OS-AGNOSTIC pipeline: br_layout (HTML body -> CSS cascade -> box/flex/float layout -> LayoutTree + computed styles) and br_draw_fb / br_shot_png (paint the laid-out page into an RGBA framebuffer / PNG). NO X11, NO network -- pure compute over sys_mmap, so it compiles into the native-Windows GUI PE exactly as into the WSL/X11 browser. The window/blit/input + fetch live in the consumers. CSS-on-native-Windows arc R2. NOTE (R3 dedup pending): these fns are still ALSO defined in runtime/_hdl_build/nx_browser.nx; once this organ is proven, nx_browser.nx imports this and drops its copies. license_tier: ORIGINAL

dependencies 18 imports · 2 importers

nx_syscalls.nx nx_font8x8.nx nx_html_tokenizer.nx nx_dom_query.nx nx_srcset_lib.nx nx_html_entities.nx nx_render_html.nx nx_css_color_decode.nx nx_layout_box.nx nx_layout_default_display.nx nx_browser_render_gif_t139.nx nishi_gui_gif_t139.nx nx_gif_consumer_gate_t139.nx

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

imports: nx_syscalls.nxnx_font8x8.nxnx_html_tokenizer.nxnx_dom_query.nxnx_srcset_lib.nxnx_html_entities.nxnx_render_html.nxnx_css_color_decode.nxnx_layout_box.nxnx_layout_default_display.nxnx_layout_from_dom.nxnx_layout_block.nxnx_paint_solid_rect.nxnx_paint_text.nxnx_png_write.nxnx_font.nxnx_aa_raster.nxnx_ttf_fontlib.nx

imported by: nishi_gui_gif_t139.nxnx_gif_consumer_gate_t139.nx

structs

27struct Page

consts

65const NX_PAGE_FIELDS: i64 = 24
66const NX_PAGE_FIELD_BYTES: i64 = 8
67const NX_PAGE_BYTES: i64 = NX_PAGE_FIELDS * NX_PAGE_FIELD_BYTES
68const NX_CHROME_H: i64 = 44 // browser chrome (toolbar + address bar) height; page viewport is below it
827const BR_FACE_BYTES: i64 = 256
1249const BR_LO: i64 = 40
1250const BR_HI: i64 = 165

functions

70func br_slen(s: *u8) -> i64 { var k: i64=0; while s[k]!=(0 as u8){k=k+1} return k }
called by 2: br_layoutmain
88func br_cidx_build(tree: *LayoutTree, computed: *CssComputedDecl, ncomp: i64) -> i64
called by 1: br_layout calls 1: sys_mmap
138func br_comp_int(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64, prop: *u8, plen: i64, dflt: i64) -> i64
172func br_comp_color(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64, prop: *u8, plen: i64) -> i64
213func br_comp_fontsize_own(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64, pct_out: *i64) -> i64
259func br_comp_lineheight_own(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64, fs: i64) -> i64
354func br_comp_lineheight_px(src: *u8, computed: *CssComputedDecl, ncomp: i64, tree: *LayoutTree, box_idx: i64, fs: i64) -> i64
368func br_comp_fontsize_inh(src: *u8, computed: *CssComputedDecl, ncomp: i64, tree: *LayoutTree, box_idx: i64, dflt: i64) -> i64
390func br_comp_color_inh(src: *u8, computed: *CssComputedDecl, ncomp: i64, tree: *LayoutTree, box_idx: i64) -> i64
called by 1: br_draw_fb_at calls 1: br_comp_color
407func br_prop_eq(src: *u8, off: i64, lit: *u8, len: i64) -> i64
416func br_comp_bg(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64) -> i64
451func br_comp_border(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64, wout: *i64) -> i64
497func br_extract(html: *u8, hlen: i64, elements: *CssElement, ehref_off: *i64, ehref_len: *i64, esrc_off: *i64, esrc_len: *i64, elazy: *i64, vw: i64, dpr_permil: i64, maxn: i64) -> i64
571func br_layout(page: *Page, vw: i64) -> i64
775func br_find_canvas(page: *Page, from: i64) -> i64
814func br_set_fast_vec(v: i64) -> i64 { bpv_fast_on = v; return 0 }
called by 1: paint_css
830func br_face_register(idx: i64, fh: *i64) -> i64
867func br_face_select(idx: i64) -> i64
876func br_set_face(fh: *i64) -> i64
885func br_face_resolve(src: *u8, computed: *CssComputedDecl, ncomp: i64, tree: *LayoutTree, box_idx: i64) -> i64
889func br_face_load_idx(idx: i64, path: *u8) -> i64
895func br_face_load(path: *u8) -> i64
900func br_face_on() -> i64 { if br_face != 0 { return 1 } return 0 }
904func br_face_line_h(px: i64) -> i64 { if br_face == 0 { return (px * 12) / 10 + 2 } return tf_content_px(br_face as *i64, px) }
913func br_fold_text(src: *u8, off: i64, len: i64, out: *u8, out_cap: i64) -> i64
938func br_text_cp(text: *u8, i: i64, len: i64, cp: *i64) -> i64 { return font_next_cp(text, i, len, cp) }
called by 1: br_paint_vec_atlas calls 1: font_next_cp
939func bpv_atlas_init() -> i64
called by 1: br_paint_vec_atlas calls 1: sys_mmap
957func bpv_cell(ch: i64, empx: i64, cs: *i64, sn: *i64, out: *i64) -> i64
1009func bpv_blit_rgba(fb: *Framebuffer, ox: i64, oy: i64, cov: *u8, gw: i64, gh: i64, cr: i64, cg: i64, cb: i64) -> i64
called by 1: br_paint_vec_atlas
1036func br_paint_vec_atlas(fb: *Framebuffer, x0: i64, y0: i64, text: *u8, text_len: i64, empx: i64, color: *CssColor, avail_w: i64) -> i64
1082func br_paint_vec(fb: *Framebuffer, x0: i64, y0: i64, text: *u8, text_len: i64, empx: i64, color: *CssColor, avail_w: i64) -> i64
1169func font_vec_adv_px2(ch: i64, empx: i64) -> i64 { return (font_adv_em(ch) * empx) / 1000 }
1172func font_vec_text_w_px(text: *u8, start: i64, end: i64, empx: i64) -> i64 { return font_vec_text_w_fs(text, start, end, empx) }
called by 1: br_paint_vec calls 1: font_vec_text_w_fs
1173func font_vec_next_break_px(text: *u8, len: i64, avail_px: i64, start: i64, empx: i64) -> i64 { return font_vec_next_break_fs(text, len, avail_px, start, empx) }
1180func br_ci(a: i64) -> i64 { if a >= 65 { if a <= 90 { return a + 32 } } return a }
called by 1: br_box_has_term
1181func br_box_has_term(buf: *u8, off: i64, len: i64, term: *u8, tlen: i64) -> i64
called by 2: br_findbr_draw_fb_at calls 1: br_ci
1193func br_find(page: *Page, term: *u8, tlen: i64, yb: *i64) -> i64
calls 1: br_box_has_term
1215func br_color_from_int(c: i64) -> *CssColor
called by 2: paint_cssbr_draw_fb_at calls 1: sys_mmap
1224func br_bit(ft8: *u8, go: i64, col: i64, row: i64) -> i64
1233func br_glyph_cov(ft8: *u8, go: i64, fx256: i64, fy256: i64) -> i64
called by 1: br_cov_hybrid calls 1: br_bit
1251func br_sharpen(c: i64) -> i64
called by 1: br_cov_hybrid
1259func br_cov_hybrid(ft8: *u8, go: i64, fx256: i64, fy256: i64) -> i64
1275func br_paint_text2x(fb: *Framebuffer, x: i64, y: i64, text: *u8, text_len: i64, color: *CssColor, scale: i64) -> i64
1331func br_blit_pixels(fb: *Framebuffer, dx: i64, dy: i64, boxW: i64, boxH: i64, src: *u8, sw: i64, sh: i64,channels: i64) -> i64
1372func br_blit_rgb(fb: *Framebuffer,dx: i64,dy: i64,boxW: i64,boxH: i64,src: *u8,sw: i64,sh: i64) -> i64 {return br_blit_pixels(fb,dx,dy,boxW,boxH,src,sw,sh,3)}
calls 1: br_blit_pixels
1373func br_blit_rgba(fb: *Framebuffer,dx: i64,dy: i64,boxW: i64,boxH: i64,src: *u8,sw: i64,sh: i64) -> i64 {return br_blit_pixels(fb,dx,dy,boxW,boxH,src,sw,sh,4)}
called by 1: main calls 1: br_blit_pixels
1379func br_draw_fb_at(fb: *Framebuffer, page: *Page, win_w: i64, cur_url: *u8, ulen: i64, scale: i64, scroll_y: i64) -> i64
1641func br_draw_fb(fb: *Framebuffer, page: *Page, win_w: i64, cur_url: *u8, ulen: i64, scale: i64) -> i64
called by 1: br_shot_png calls 1: br_draw_fb_at
1652func br_shot_png(page: *Page, cur_url: *u8, ulen: i64, path: *u8) -> i64
1744func br_image_meta_bytes(count: i64) -> i64 {let n: i64=(count+1)*8;if n<=NXA_SMALL_MAX{return NXA_SMALL_MAX+1}return n}
1745func br_release_owned_images(page: *Page) -> i64
1753func br_release_image_metadata(page: *Page) -> i64
1763func br_image_take_result(page: *Page,i: i64,result: *i64) -> i64
called by 2: load_imagesmain calls 1: sys_munmap