Not logged inTalkContributionsCreate accountLog in

GUI & Desktop

From nexOS Wiki
Framebuffer drawing, Alpine theme, windows, terminal, browser

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:

ConstantValueUse
COL_BG / COL_TERMBG0x001E1E2EDesktop + terminal background
COL_TASKBAR0x00181825Taskbar (2px accent strip on top)
COL_TITLE / COL_WINBG0x00313244Title bars + window bodies
COL_BTN0x0045475AButtons
COL_ACCENT0x0089B4FASTART, icons, progress, paint default
COL_MUTED0x006C7086Secondary text
COL_WHITE / TEXT / BLACK0x00CDD6F4All mapped to light lavender (even BLACK)
COL_RED0x00F38BA8Close X, SHUTDOWN
COL_SCRN0x00000000Splash 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

WidgetGeometryFlagNotes
Main windowwin_x,win_y 500×350win_open“nexOS v0.1”, draggable, 1:1 (old ease dx/2 removed)
Taskbartb_h=40START + PAINT, “nexOS” label
START menu152×152menu_openTERMINAL / NOTEPAD / ABOUT / BROWSER / red SHUTDOWN
Terminal520×300terminal_openterm_buf[160], 6-line scrollback, “>” prompt
File manager430×280file_openReal FAT32 listing (was fake README/NOTES placeholders)
Paint430×300paint_openpaint_canvas[80*50], 6 Alpine colors, 5×5 cells
Browser400×300browser_openURL bar, HTML-lite view (see below)

Terminal commands

CommandEffect
HELPList commands
ABOUT / ECHO“nexOS offline terminal”
CLEARClear (message 0)
CREDITS / YAZEED / OMARI / SUDO / NEXOS / HELLO / SECRET / GODCanned replies (same as before)
LSFAT32 root listing via fat32_list_dir
CAT FILEfat32_read_file + paged view
PINGARP to gateway
FETCHHTTP GET → browser buffer + auto-open
BROWSERToggle 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();
}