GUI & Desktop
Contents[hide] |
The desktop is overlapping widgets drawn to the framebuffer — no toolkit, no compositor. Each window is x/y/w/h integers plus a draw function, hit-tested in main(). Recent work: smooth rendering (fast fills, bulk present, 1:1 dragging), ghost-free cursor (front-buffer only), edge-clamped 2× mouse.
Desktop layout
+-------------------------------------------------------------+ | [PAINT] [TERMINAL] [FILES] [RECYCLE BIN] (icons left) | | | | +---------------------------+ | | | nexOS v0.1 [X]| main window 500x350 | | +---------------------------+ | +-------------------------------------------------------------+ +----------+----------+--------------------------------+------+ | START | PAINT | nexOS | taskbar 40px +----------+----------+--------------------------------+------+
Alpine palette
The old brown/orange theme was replaced with Alpine Linux dark (commit “Alpine Linux theme”). All colors are 0x00RRGGBB:
| Constant | Value | Use |
|---|---|---|
| COL_BG / COL_TERMBG | 0x001E1E2E | Desktop + terminal background |
| COL_TASKBAR | 0x00181825 | Taskbar (2px accent strip on top) |
| COL_TITLE / COL_WINBG | 0x00313244 | Title bars + window bodies |
| COL_BTN | 0x0045475A | Buttons |
| COL_ACCENT | 0x0089B4FA | START, icons, progress, paint default |
| COL_MUTED | 0x006C7086 | Secondary text |
| COL_WHITE / TEXT / BLACK | 0x00CDD6F4 | All mapped to light lavender (even BLACK) |
| COL_RED | 0x00F38BA8 | Close X, SHUTDOWN |
| COL_SCRN | 0x00000000 | Splash clear |
Bitmap font
Hand-defined 8×8 glyphs, font_map[256], draw_char per-bit + draw_str x+=10. Lowercase remaps to uppercase; digits map to ‘O’ (“numerals? we don’t do numerals here”); unknown = solid box.
Windows & widgets
| Widget | Geometry | Flag | Notes |
|---|---|---|---|
| Main window | win_x,win_y 500×350 | win_open | “nexOS v0.1”, draggable, 1:1 (old ease dx/2 removed) |
| Taskbar | tb_h=40 | — | START + PAINT, “nexOS” label |
| START menu | 152×152 | menu_open | TERMINAL / NOTEPAD / ABOUT / BROWSER / red SHUTDOWN |
| Terminal | 520×300 | terminal_open | term_buf[160], 6-line scrollback, “>” prompt |
| File manager | 430×280 | file_open | Real FAT32 listing (was fake README/NOTES placeholders) |
| Paint | 430×300 | paint_open | paint_canvas[80*50], 6 Alpine colors, 5×5 cells |
| Browser | 400×300 | browser_open | URL bar, HTML-lite view (see below) |
Terminal commands
| Command | Effect |
|---|---|
| HELP | List commands |
| ABOUT / ECHO | “nexOS offline terminal” |
| CLEAR | Clear (message 0) |
| CREDITS / YAZEED / OMARI / SUDO / NEXOS / HELLO / SECRET / GOD | Canned replies (same as before) |
| LS | FAT32 root listing via fat32_list_dir |
| CAT FILE | fat32_read_file + paged view |
| PING | ARP to gateway |
| FETCH | HTTP GET → browser buffer + auto-open |
| BROWSER | Toggle browser window |
Browser window
draw_browser_window(): title “nexOS Browser”, red X, accent rule, black content area. Empty → welcome text. With data → strip <...> tags, wrap at 44 cols, 8 rows, browser_buf[2048].
Main loop
while (1) {
if (pit_ticks - last_poll >= 10) poll NIC;
text_updated -> redraw; mouse queue -> hit-test (START/PAINT/icons/drag/X/canvas/palette/SHUTDOWN);
dragging -> 1:1 follow; redraw -> render_desktop();
}