nx_layout_block.nx
buildroot/runtime/nx_layout_block.nx
about
dependencies 11 imports · 26 importers
diagram shows first 10 each side; +1 more imports, +16 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_render.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 |
| 891 | 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 |
| 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 |
| 734 | func _il_text_w(b: *LayoutBox, avail_w: i64) -> i64 |
| 749 | func _layout_lineheight_decl_px(ctx: *LayoutCtx, element_idx: i64, fs: i64) -> i64 |
| 851 | func _layout_lineheight_px(ctx: *LayoutCtx, box_idx: i64, fs: i64) -> i64 |
| 871 | func nx_layout_set_vec_measure(v: i64) -> i64 { l_vec_measure = v; return 0 } |
| 875 | func nx_layout_set_ytrap(v: i64) -> i64 { l_ytrap = v; return 0 } |
| 876 | 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 } |
| 877 | 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 |
| 895 | func _layout_vec_text_w(t: *u8, start: i64, end: i64, fs: i64) -> i64 |
| 903 | func _il_prop_is(src: *u8, off: i64, name: *u8, n: i64) -> i64 called by 1: _layout_border_w |
| 912 | func _layout_border_w(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 934 | func _layout_intrinsic_w(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 968 | func _layout_inline_flow(ctx: *LayoutCtx, pen: *InlinePen, box_idx: i64) -> i64 |
| 1199 | func _layout_display_flex(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1229 | func _lb_margin_auto(ctx: *LayoutCtx, box_idx: i64, side: i64) -> i64 |
| 1290 | func _layout_has_grid_areas(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1312 | func _layout_flex_dir_col(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1332 | func _layout_display_grid(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1359 | func _layout_display_table(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1384 | func _lb_box(ctx: *LayoutCtx, i: i64) -> *LayoutBox |
| 1387 | func _layout_nearest_table(ctx: *LayoutCtx, idx: i64) -> i64 |
| 1405 | func _layout_table_cols(ctx: *LayoutCtx, tbl_idx: i64, avail_w: i64, colw: *i64) -> i64 |
| 1485 | func _grid_int_val(src: *u8, voff: i64, vlen: i64) -> i64 |
| 1500 | func _grid_prop_px(ctx: *LayoutCtx, box_idx: i64, name: *u8, nlen: i64) -> i64 |
| 1518 | func _grid_gap(ctx: *LayoutCtx, box_idx: i64, want_row: i64) -> i64 |
| 1531 | func _layout_grid_template(ctx: *LayoutCtx, box_idx: i64, ooff: *i64, olen: *i64) -> i64 |
| 1572 | func _grid_parse_size(src: *u8, ts: i64, te: i64, fr_out: *i64) -> i64 |
| 1622 | func _grid_resolve_tracks(src: *u8, voff: i64, vlen: i64, avail: i64, col_gap: i64, widths: *i64, maxcols: i64) -> i64 |
| 1733 | func _layout_float(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1765 | func _layout_position(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1798 | func _layout_justify(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1828 | func _layout_align(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1856 | func _layout_flex_grow(ctx: *LayoutCtx, box_idx: i64) -> i64 |
| 1904 | func _layout_shift_subtree(ctx: *LayoutCtx, box_idx: i64, dy: i64) -> i64 |
| 1929 | func _layout_block_recurse(ctx: *LayoutCtx, table: *LayoutPropTable, |
| 2481 | func nx_layout_block_layout(ctx: *LayoutCtx, table: *LayoutPropTable, |
| 2490 | func nx_layout_ctx_init(ctx: *LayoutCtx, tree: *LayoutTree, |