code wiki / (root) / nx_x11_window.nx

nx_x11_window.nx

buildroot/runtime/nx_x11_window.nx

8006 B225 linesdepth 4pulls 4 transitivereach 21 importersview sourcekind tooltopic x11
docsdependenciesstructsconstsfunctions

about

nx_x11_window.nx -- bits-up X11 CreateWindow + MapWindow. Session 2 of the bits-up browser arc (Task #83). Composes the X11 connection from nx_x11_connect with the wire-protocol opcodes that put a window on screen. WSLg translates the X11 stream into a real native Windows surface. CreateWindow (opcode 1) layout (X Protocol §10 / xproto.xml): byte 0: opcode = 1 byte 1: depth (0 = CopyFromParent) bytes 2-3: request_length (4-byte units) bytes 4-7: window_id (allocated via nx_x11_alloc_id) bytes 8-11: parent (e.g. root_window) bytes 12-13: x (signed) bytes 14-15: y bytes 16-17: width bytes 18-19: height bytes 20-21: border_width bytes 22-23: class (1 = InputOutput, 2 = InputOnly) bytes 24-27: visual (0 = CopyFromParent) bytes 28-31: value_mask (optional) value_list (4 bytes per set bit in value_mask) value-mask bits we use (X protocol §6.7): CWBackPixel = 0x00000002 CWEventMask = 0x00000800 MapWindow (opcode 8): byte 0: opcode = 8 byte 1: unused bytes 2-3: request_length = 2 bytes 4-7: window_id API: nx_x11_create_window(conn, x, y, w, h, bg_pixel, event_mask) -> window_id (or 0 - NX_X11_*) nx_x11_map_window(conn, window_id) -> 0 | negative nx_x11_flush_via_get_input_focus(conn) -- forces server to actually process pending requests by sending a synchronous round-trip (GetInputFocus). Without

dependencies 2 imports · 13 importers

nx_syscalls.nx nx_x11_connect.nx nx_x11_window.nx nx_browser.nx nx_browser_demo_test.nx nx_render_wiki_styled_window.nx nx_render_wiki_window.nx nx_x11_font_test.nx nx_x11_get_image.nx nx_x11_keyboard.nx nx_x11_paint.nx nx_x11_paint_text_5x7.nx nx_x11_pixmap.nx

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

imports: nx_syscalls.nxnx_x11_connect.nx

imported by: nx_browser.nxnx_browser_demo_test.nxnx_render_wiki_styled_window.nxnx_render_wiki_window.nxnx_x11_font_test.nxnx_x11_get_image.nxnx_x11_keyboard.nxnx_x11_paint.nxnx_x11_paint_text_5x7.nxnx_x11_pixmap.nxnx_x11_pixmap_kat_test.nxnx_x11_put_image.nxnx_x11_window_real_test.nx

structs

none

consts

50const NX_X11_CW_BACK_PIXEL: i64 = 0x00000002
51const NX_X11_CW_EVENT_MASK: i64 = 0x00000800

functions

54func _x11_wr_u16(buf: *u8, off: i64, v: i64) -> i64
60func _x11_wr_u32(buf: *u8, off: i64, v: i64) -> i64
69func _x11_send(conn: *X11Conn, buf: *u8, n: i64) -> i64
81func nx_x11_create_window(conn: *X11Conn,
133func nx_x11_set_wm_name(conn: *X11Conn, window: i64,
164func nx_x11_map_window(conn: *X11Conn, window_id: i64) -> i64
184func nx_x11_flush_via_get_input_focus(conn: *X11Conn) -> i64
213func _x11_dead_err_path() -> i64
calls 1: sys_mmap
223func main() -> i64