nx_nishios_events.nx
buildroot/runtime/nx_nishios_events.nx
about
nx_nishios_events.nx -- NishiOS GUI rung-3: an INPUT EVENT LOOP (interactivity).
A desktop you can't touch isn't an OS GUI. This adds the real loop: data-driven windows (a window
table), a click handler that RAISES the window under the cursor (focus -> z-order changes from the
event), and cursor tracking. It renders frame 0 (win "files" on top), processes a CLICK on the lower
"terminal" window, then renders frame 1 -- where that window is now raised to the front. The z-order
change between the two frames IS the proof the event loop works.
The event SOURCE is scripted here (the emu has no live PS/2 mouse; that driver is the wiring rung),
but the event-handling LOGIC -- hit-testing, focus-raise, cursor move, re-render -- is real.
KAT: frame0 overlap shows the top window; after the click, frame1 overlap shows the RAISED window;
the cursor moved to the click point; both frames exported as real BMPs.
HONEST SCOPE: scripted events + 2 windows. Live PS/2 input, drag, a full ASCII font, and wiring into
the boot kernel's framebuffer are the next rungs. No hw writes (Rule 26).
expect_exit: 0 license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_fb.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 15 | const K_MAGIC_192054: i64 = 192054 |
functions
| 17 | func ev_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } called by 1: main |
| 18 | func ev_num(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} 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(1,b,k); return 0 } called by 1: main |
| 22 | func draw_all(fb: *u8, W: i64, H: i64, font: *u8, idx: *u8, win: *i64, n: i64) -> i64 |
| 44 | func raise_win(win: *i64, n: i64, px: i64, py: i64) -> i64 called by 1: main |
| 60 | func render_frame(fb: *u8, W: i64, H: i64, font: *u8, idx: *u8, win: *i64, n: i64, cx: i64, cy: i64, path: *u8) -> i64 |
| 69 | func main() -> i64 |