nx_layout_block.nx
buildroot/runtime/nx_layout_block.nx
about
dependencies 11 imports · 28 importers
diagram shows first 10 each side; +1 more imports, +18 more importers in the complete lists below.
imports: nx_syscalls.nxnx_text_wrap.nxnx_font8x8.nxnx_font.nxnx_css_tokenize.nxnx_css_parse.nxnx_css_selector_match.nxnx_css_apply.nxnx_css_number_parse.nxnx_css_dimension_to_px.nxnx_layout_box.nx
imported by: nx_align_gate.nxnx_border_gate.nxnx_browser.nxnx_browser_importprobe.nxnx_browser_render.nxnx_browser_render_gif_t139.nxnx_flexgrow_gate.nxnx_flexgrow_probe.nxnx_float_gate.nxnx_float_test.nxnx_grid_gate.nxnx_grid_test.nxnx_grid_track_gate.nxnx_justify_gate.nxnx_layout_block_horizontal_test.nxnx_layout_block_test.nxnx_layout_debug.nxnx_layout_example_com_real_test.nxnx_negmargin_gate.nxnx_real_page_gate.nxnx_render_ascii.nxnx_render_html.nxnx_render_page_gate.nxnx_render_wiki_bmp.nxnx_render_wiki_styled_window.nxnx_render_wiki_window.nxnx_table_cell_gate.nxnx_wiki_boxdump.nx
structs
| 72 | struct LayoutCtx |
| 88 | struct LayoutPropTable |
| 517 | struct InlinePen |
consts
| 62 | const NX_MAGIC_100000: i64 = 100000 |
| 63 | const NX_MAGIC_37795: i64 = 37795 |
| 64 | const NX_MAGIC_10000: i64 = 10000 |
| 65 | const NX_MAGIC_65536: i64 = 65536 |
| 66 | const NX_MAGIC_1000000000: i64 = 1000000000 |
| 67 | const NX_MAGIC_4096: i64 = 4096 |
| 83 | const NX_LAYOUT_CTX_BYTES: i64 = 64 |
| 112 | const NX_LAYOUT_PROP_TABLE_BYTES: i64 = 168 |
| 360 | const NX_MARGIN_UNSET: i64 = 1073741824 |
| 526 | const NX_INLINE_PEN_BYTES: i64 = 56 |
| 527 | const NX_INLINE_GLYPH_W: i64 = 9 // matches the live browser's 9x15 X font advance (was 6 = paint_text cell; 6 made 9px text overflow its boxes ~1.5x) |
| 528 | const NX_INLINE_LINE_H: i64 = 17 // matches the 9x15 font height (15px) + 2px leading; was 10 |
| 744 | const LF_UNDECIDED: i64 = 0 - 1 |
| 1087 | const NX_TBL_MAXCOLS: i64 = 64 |
functions
| 116 | func _layout_put_byte(buf: *u8, i: i64, v: i64) -> i64 called by 1: nx_layout_prop_table_init |
| 123 | func nx_layout_prop_table_init(t: *LayoutPropTable, buf: *u8) -> i64 called by 22: run_layoutbr_layoutbr_layoutbr_layoutrun_layoutrun_layout+16 calls 1: _layout_put_byte |
| 277 | func _layout_lookup_px(ctx: *LayoutCtx, table_src: *u8, |
| 319 | func _layout_lookup_height_px(ctx: *LayoutCtx, table_src: *u8, |
| 365 | func _layout_margin_px(ctx: *LayoutCtx, table_src: *u8, box_idx: i64, prop_off: i64, prop_len: i64) -> i64 calls 1: nx_css_dimension_to_px |
| 399 | func _layout_boxside_px(ctx: *LayoutCtx, table_src: *u8, box_idx: i64, lh_off: i64, lh_len: i64, pname: *u8, pnlen: i64, side: i64, miss: i64) -> i64 |
| 548 | func _lb_lc(b: i64) -> i64 { if b >= 65 { if b <= 90 { return b + 32 } } return b } called by 1: nx_fontsize_value_px |
| 549 | func nx_fontsize_value_px(src: *u8, voff: i64, vlen: i64, uoff: i64, ulen: i64, pct_out: *i64) -> i64 |
| 617 | func _layout_fontsize_decl_px(ctx: *LayoutCtx, element_idx: i64, pct_out: *i64) -> i64 |
| 671 | func _layout_fontsize_inherited(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 699 | func _layout_scale_for_px(px: i64) -> i64 |
| 708 | func _layout_display_none(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 745 | func _lf_memo_for(tree: *LayoutTree) -> *i64 |
| 755 | func _lf_prop_is(src: *u8, cd: *CssComputedDecl, lit: *u8, len: i64) -> i64 called by 1: _lf_own |
| 762 | func _lf_val_has(src: *u8, cd: *CssComputedDecl, lit: *u8, len: i64) -> i64 |
| 779 | func _lf_weight_of(src: *u8, cd: *CssComputedDecl) -> i64 |
| 797 | func _lf_style_of(src: *u8, cd: *CssComputedDecl) -> i64 |
| 804 | func _lf_family_of(src: *u8, cd: *CssComputedDecl) -> i64 |
| 823 | func _lf_own(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64, out: *i64) -> i64 |
| 844 | func nx_layout_face_for_box(src: *u8, computed: *CssComputedDecl, ncomp: i64, tree: *LayoutTree, box_idx: i64) -> i64 |
| 874 | func _layout_face_inherited(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 877 | func _il_text_w(b: *LayoutBox, avail_w: i64) -> i64 |
| 892 | func _layout_lineheight_decl_px(ctx: *LayoutCtx, element_idx: i64, fs: i64) -> i64 |
| 994 | func _layout_lineheight_px(ctx: *LayoutCtx, box_idx: i64, fs: i64) -> i64 |
| 1021 | func nx_layout_set_vec_measure(v: i64) -> i64 { l_vec_measure = v; l_vec_measure_pinned = 1; return 0 } |
| 1023 | func nx_layout_default_vec_measure(v: i64) -> i64 { if l_vec_measure_pinned == 0 { l_vec_measure = v } return 0 } |
| 1025 | func nx_layout_clear_vec_measure_pin() -> i64 { l_vec_measure_pinned = 0; return 0 } called by 1: main |
| 1042 | func nx_layout_set_img_dims(wp: *i64, hp: *i64, n: i64) -> i64 |
| 1048 | func nx_layout_clear_img_dims() -> i64 { l_img_w_p = 0; l_img_h_p = 0; l_img_n = 0; return 0 } |
| 1050 | func _layout_img_h(idx: i64) -> i64 |
| 1059 | func _layout_img_w(idx: i64) -> i64 called by 1: _layout_inline_flow |
| 1071 | func nx_layout_set_ytrap(v: i64) -> i64 { l_ytrap = v; return 0 } |
| 1072 | func _yt_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(2,s,n); return 0 } |
| 1073 | func _yt_n(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{_yt_w("-" as *u8);m=0-m} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(2,b,k); return 0 } called by 3: _layout_inline_flow_layout_shift_subtree_layout_block_recurse calls 3: sys_mmap_yt_wsys_write |
| 1095 | func _layout_vec_text_w(t: *u8, start: i64, end: i64, fs: i64) -> i64 |
| 1100 | func _il_prop_is(src: *u8, off: i64, name: *u8, n: i64) -> i64 called by 1: _layout_border_w |
| 1109 | func _layout_border_w(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1131 | func _layout_intrinsic_w(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1166 | func _layout_inline_flow(ctx: *LayoutCtx, pen: *InlinePen, box_idx: i64) -> i64 |
| 1423 | func _layout_display_flex(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1453 | func _lb_margin_auto(ctx: *LayoutCtx, box_idx: i64, side: i64) -> i64 |
| 1514 | func _layout_has_grid_areas(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1536 | func _layout_flex_dir_col(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1556 | func _layout_display_grid(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1583 | func _layout_display_table(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1608 | func _lb_box(ctx: *LayoutCtx, i: i64) -> *LayoutBox |
| 1611 | func _layout_nearest_table(ctx: *LayoutCtx, idx: i64) -> i64 |
| 1629 | func _layout_table_cols(ctx: *LayoutCtx, tbl_idx: i64, avail_w: i64, colw: *i64) -> i64 |
| 1709 | func _grid_int_val(src: *u8, voff: i64, vlen: i64) -> i64 |
| 1724 | func _grid_prop_px(ctx: *LayoutCtx, box_idx: i64, name: *u8, nlen: i64) -> i64 |
| 1742 | func _grid_gap(ctx: *LayoutCtx, box_idx: i64, want_row: i64) -> i64 |
| 1755 | func _layout_grid_template(ctx: *LayoutCtx, box_idx: i64, ooff: *i64, olen: *i64) -> i64 |
| 1796 | func _grid_parse_size(src: *u8, ts: i64, te: i64, fr_out: *i64) -> i64 |
| 1846 | func _grid_resolve_tracks(src: *u8, voff: i64, vlen: i64, avail: i64, col_gap: i64, widths: *i64, maxcols: i64) -> i64 |
| 1957 | func _layout_float(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1989 | func _layout_position(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 2022 | func _layout_justify(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 2052 | func _layout_align(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 2080 | func _layout_flex_grow(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 2128 | func _layout_shift_subtree(ctx: *LayoutCtx, box_idx: i64, dy: i64) -> i64 |
| 2153 | func _layout_block_recurse(ctx: *LayoutCtx, table: *LayoutPropTable, |
| 2712 | func nx_layout_block_layout(ctx: *LayoutCtx, table: *LayoutPropTable, |
| 2721 | func nx_layout_ctx_init(ctx: *LayoutCtx, tree: *LayoutTree, |