|
|
@@ -146,21 +146,34 @@
|
|
|
<h2>Window manager</h2>
|
|
|
<p>
|
|
|
The WM is a process that owns the desktop and a fixed array of eight
|
|
|
- windows. It draws a system bar with the banner, launcher buttons,
|
|
|
+ windows. It draws a system bar with the NebOS start button, the
|
|
|
clock, the temperature, and, on ThinkPads and Chromebooks, an
|
|
|
- AC/battery status icon at the far right (a plug on AC, a
|
|
|
- level-filled battery on battery, with a percentage tooltip below
|
|
|
- the bar on hover, painted above the windows), plus draggable
|
|
|
+ AC/battery status icon at the far right (the Adwaita
|
|
|
+ <code>ac-adapter</code> symbol on AC, and the <code>battery</code>
|
|
|
+ outline with our own level fill inside on battery), plus
|
|
|
+ draggable
|
|
|
terminal and canvas windows with a title bar and close button.
|
|
|
+ A normal window has no visible frame; an invisible resize band
|
|
|
+ (1 px inside, 3 px outside its outer edge) is the resize grab
|
|
|
+ area, and the active title bar uses the toolkit's highlight
|
|
|
+ colour.
|
|
|
Click-to-focus, drag-by-title-bar and close are routed through the
|
|
|
same pointer path. To the left of the rightmost AC/battery status
|
|
|
- icon, a network status icon shows a
|
|
|
- cable for wired Ethernet, signal bars for a connected WiFi link, a
|
|
|
- USB mark for RNDIS tethering, or a red X when no link is up.
|
|
|
- The whole right status area — temperature, date/time, network
|
|
|
- and AC/battery items plus the gaps between them — is one button:
|
|
|
- it opens the anchored <code>bin/netmenu</code> control panel (a
|
|
|
- second click closes it).
|
|
|
+ icon, a network status icon shows the Adwaita
|
|
|
+ <code>network-wired</code> symbol for wired Ethernet, a
|
|
|
+ <code>network-wireless-signal-*</code> symbol for a connected WiFi
|
|
|
+ link, the <code>phone</code> symbol for RNDIS tethering, and
|
|
|
+ <code>network-wired-disconnected</code> in red when no NIC is
|
|
|
+ active (<code>network-wireless-offline</code> when a WiFi card is
|
|
|
+ present but not associated).
|
|
|
+ The whole right status cluster — temperature, date/time,
|
|
|
+ network and AC/battery items plus the gaps between them — is
|
|
|
+ one button with a single rounded hover pill; the empty bar
|
|
|
+ between the start button and the cluster is not clickable. Both
|
|
|
+ bar buttons use the same height and rounded style, stopping just
|
|
|
+ above the rainbow separator, and turn selection-blue while their
|
|
|
+ panel is open. It opens the anchored <code>bin/netmenu</code>
|
|
|
+ control panel (a second click closes it).
|
|
|
It opens collapsed: the battery/clock summary and Quick settings
|
|
|
pills are visible, while the network, power-mode and date/time
|
|
|
settings stay hidden until their pill is clicked. Present NICs
|
|
|
@@ -168,6 +181,25 @@
|
|
|
joined, asking for the WPA2 passphrase first when the AP requires
|
|
|
one.
|
|
|
</p>
|
|
|
+ <p>
|
|
|
+ The NebOS banner in the top-left is the start button. Clicking it
|
|
|
+ opens a Windows-like start menu drawn by the WM as a flat overlay,
|
|
|
+ not a window, so it floats above every canvas without consuming a
|
|
|
+ window slot. The panel uses the control panel's theme: a flat
|
|
|
+ <code>theme.bg</code> surface with no rim, a dim
|
|
|
+ <code>Applications</code> caption as its first row, rounded hover
|
|
|
+ rows and a rounded Power tile. Every self-contained GUI
|
|
|
+ application in the pack gets a row with a coloured letter tile —
|
|
|
+ Terminal, Files, Web, Gallery, Chat, Clock, Text editor, Colors,
|
|
|
+ Mines, Cards, Disks, Tasks, Settings and Date & Time — the
|
|
|
+ pointer highlights the hovered row, and an outside press dismisses
|
|
|
+ the panel. Row height shrinks to keep the whole list inside the
|
|
|
+ work area on short panels. The last row, Power, opens a submenu
|
|
|
+ with Reboot and Power off; both run the privileged kernel command
|
|
|
+ through <code>SYS_SPAWN_KCMD</code>. The bar notice and the
|
|
|
+ right-aligned status never draw left of
|
|
|
+ <code>WM_BAR_LEFT_END</code>.
|
|
|
+ </p>
|
|
|
<p>
|
|
|
A popover is a chromeless canvas window created with
|
|
|
<code>u_win_create_popover()</code> (<code>WIN_F_POPOVER</code>).
|
|
|
@@ -179,7 +211,7 @@
|
|
|
panel. The kernel uses the window origin for content-relative
|
|
|
pointer and scroll coordinates. An outside press dismisses the
|
|
|
popover and the click then continues normally; a second click on
|
|
|
- any status target toggles it. The panel itself is drawn with the
|
|
|
+ the status cluster toggles it. The panel itself is drawn with the
|
|
|
ngui components: a battery/AC and clock summary, a brightness
|
|
|
slider when the panel PWM is present, and Quick settings tiles for
|
|
|
Network, the CPU power mode (<code>SYS_CPUFREQ</code>) and Date
|
|
|
@@ -277,7 +309,11 @@
|
|
|
counters, so the WM cannot lose one. <code>content_gen</code> comes
|
|
|
from a global counter and is unique per window creation, so a new
|
|
|
window that reuses a just-closed slot forces the WM to remap its
|
|
|
- front canvas instead of reusing a stale mapping.
|
|
|
+ front canvas instead of reusing a stale mapping. The ring-3 WM
|
|
|
+ revalidates the generation after <code>u_wm_begin()</code>:
|
|
|
+ the kernel refuses client self-resizes while a frame is active,
|
|
|
+ so a resize between the pre-frame map refresh and the draw can no
|
|
|
+ longer unmap the canvas under the WM.
|
|
|
</p>
|
|
|
<p>
|
|
|
<code>SYS_WIN_CREATE</code> creates a generic canvas window.
|
|
|
@@ -330,8 +366,11 @@
|
|
|
which makes side-by-side placement exact. Windows can be dragged past the left, right and
|
|
|
bottom edges; <code>WM_DRAG_VISIBLE</code> (48 px) of the title bar
|
|
|
always stays on-screen for recovery, and the top bar is never
|
|
|
- overlapped. The resize grip is clamped to the full work area and
|
|
|
- snaps to it when dragged into the screen corner.
|
|
|
+ overlapped. An invisible resize band (1 px inside, 3 px outside)
|
|
|
+ runs along every edge and corner: the grabbed edges follow the
|
|
|
+ pointer while the opposite edges stay put, clamped to the work
|
|
|
+ area. While a drag or resize is active the WM owns the pointer,
|
|
|
+ so the window content does not see the held button.
|
|
|
</p>
|
|
|
<div class="note">
|
|
|
<p><strong>Buttons fire on the release edge.</strong> The toolkit keeps
|
|
|
@@ -356,8 +395,8 @@
|
|
|
clipped RGB565 primitives, buttons, menu items, text fields, the
|
|
|
Adwaita symbolic icons (see <a href="#icons">UI icons</a>), a theme palette, layout cut helpers and scrolling
|
|
|
panes. It is linked into <code>files</code>, <code>mines</code>,
|
|
|
- <code>solitaire</code>, <code>chat</code>, the control panel and
|
|
|
- the real <code>gallery.elf</code>.
|
|
|
+ <code>solitaire</code>, <code>process</code>, <code>chat</code>,
|
|
|
+ the control panel and the real <code>gallery.elf</code>.
|
|
|
</p>
|
|
|
<ul>
|
|
|
<li><strong>Text fields</strong> support drag-selection, double-click select-all, Ctrl+Left/Right word jumps, Ctrl+Delete/Backspace word deletion and Ctrl+A. They use the proportional face with measured caret, selection and horizontal scrolling; a field marked <code>disabled</code> ignores pointer and keyboard input, drops the focus and paints its value dimmed in the same proportional face. A field marked <code>secret</code> is measured and painted from a <code>*</code> mask (caret, selection and click positions follow the mask, Ctrl+Left/Right jump to the ends), and Tab returns <code>NGUI_INPUT_NEXT</code> together with <code>NGUI_INPUT_CANCEL</code> so forms can move the focus. Fields hold up to 511 characters (<code>NGUI_INPUT_MAX</code> 512). The terminal and editor keep the 8×16 cell grid.</li>
|
|
|
@@ -376,7 +415,13 @@
|
|
|
use real pixel sizes from 8 to 48 px; the browser maps CSS
|
|
|
<code>font-size</code>, <code>font-weight</code>,
|
|
|
<code>font-style</code> and <code>font-family: monospace</code> to
|
|
|
- the faces. Missing fonts fall back to the 8×16 bitmap. The browser
|
|
|
+ the faces. Pages may bring their own faces with
|
|
|
+ <code>@font-face</code>: TrueType/OpenType (TrueType outlines) or
|
|
|
+ WOFF 1.0, which <span class="file">ufont_woff.c</span>
|
|
|
+ unwraps by inflating each table; per family the browser keeps one
|
|
|
+ face per weight/style and picks the nearest one at layout. Its
|
|
|
+ arena is 3 MB instead of the default 512 KB so web fonts
|
|
|
+ fit beside the built-in set. Missing fonts fall back to the 8×16 bitmap. The browser
|
|
|
detaches the font arena before <code>heap_reset()</code> and
|
|
|
reattaches after <code>heap_start()</code>; terminal content and
|
|
|
the editor keep the bitmap cells.
|
|
|
@@ -400,17 +445,21 @@
|
|
|
<h3>files</h3>
|
|
|
<p>File browser on the VFS: opens text in <code>edit</code>, images in <code>view</code> and HTML in <code>browser</code>. The first ngui user.</p>
|
|
|
</div>
|
|
|
+ <div class="card">
|
|
|
+ <h3>process</h3>
|
|
|
+ <p>Graphical task manager (the start menu's <em>Tasks</em> entry or <code>process</code>, the ngui counterpart of <code>top</code>): 60 s CPU, physical-memory and NIC-throughput graphs fed by one sample per second, and a sortable process table (PID, state, CPU%, memory, CPU time, name). A selected row shows its details and <em>End task</em> terminates it after a second confirming click; kernel threads and the monitor itself are protected. Headers sort, PgUp/PgDn and the wheel scroll, Esc closes.</p>
|
|
|
+ </div>
|
|
|
<div class="card">
|
|
|
<h3>gallery</h3>
|
|
|
<p>Live showcase of every ngui control and primitive. Ships in the pack as <code>bin/gallery.app</code>; a launcher prefers <code>/share/GALLERY</code> for development.</p>
|
|
|
</div>
|
|
|
<div class="card">
|
|
|
<h3>chat</h3>
|
|
|
- <p>Cloudron Chat client: native OIDC login, channel/DM sidebar with unread badges and presence dots, a wrapped timeline with avatars, day headers and reply snippets, a composer and browse/new-DM pickers. Media downloads use a warm <code>curl __serve</code> helper; message images are also decoded there (480×320 bounds), while avatars decode at 32×32 on the chat thread, so the window keeps drawing. Saved sessions resume from <code>/data</code>. The top-bar <em>Chat</em> button launches it.</p>
|
|
|
+ <p>Cloudron Chat client: native OIDC login, channel/DM sidebar with unread badges and presence dots, a wrapped timeline with avatars, day headers, reply snippets and link-preview cards (site, title, description and an optional thumbnail; clicking one opens the link in the browser), a composer and browse/new-DM pickers. Media downloads use a warm <code>curl __serve</code> helper; message images are also decoded there (480×320 bounds), while avatars decode at 32×32 on the chat thread, so the window keeps drawing. Saved sessions resume from <code>/data</code>. The start menu's <em>Chat</em> entry launches it.</p>
|
|
|
</div>
|
|
|
<div class="card">
|
|
|
<h3>disks</h3>
|
|
|
- <p>Storage manager: devices, MBR partitions and mounts, per-volume mount name, read-only and automount, and Format / Install NebOS dialogs that show the kernel command's output. The top-bar <em>Disks</em> button and the <em>Disks</em> button in <code>files</code> launch it.</p>
|
|
|
+ <p>Storage manager: devices, MBR partitions and mounts, per-volume mount name, read-only and automount, and Format / Install NebOS dialogs that show the kernel command's output. The start menu's <em>Disks</em> entry and the <em>Disks</em> button in <code>files</code> launch it.</p>
|
|
|
</div>
|
|
|
<div class="card">
|
|
|
<h3>solitaire</h3>
|
|
|
@@ -454,7 +503,8 @@
|
|
|
<p>
|
|
|
ngui's icons (<code>ngui_icon()</code>, <code>ngui_icon_button()</code>:
|
|
|
back/forward, reload and home in the browser toolbar, folder/file/drive
|
|
|
- in <code>files</code>) are GNOME Adwaita symbolic icons
|
|
|
+ in <code>files</code>) and the WM's top-bar network/battery
|
|
|
+ indicators are GNOME Adwaita symbolic icons
|
|
|
(adwaita-icon-theme 51, LGPL-3 or CC-BY-SA-3.0). The unchanged
|
|
|
<code>*-symbolic.svg</code> files live in
|
|
|
<span class="file">assets/icons/adwaita/</span>; the host tool
|
|
|
@@ -463,13 +513,13 @@
|
|
|
8-bit coverage mask and writes one <code>NBICO1</code> bundle,
|
|
|
<code>/ramfs/icons/adwaita16.icn</code> (layout in
|
|
|
<span class="file">include/icon_abi.h</span>): a 16-byte header and
|
|
|
- 13 masks, ~3.3 KB raw and ~0.8 KB gzip, so both the USB
|
|
|
+ 24 masks, ~6.2 KB raw and ~1.3 KB gzip, so both the USB
|
|
|
and the floppy pack carry it.
|
|
|
</p>
|
|
|
<ul>
|
|
|
- <li><strong>Icon list.</strong> <code>ICON_LIST</code> is an X-macro of enum suffix, short name and theme file. Its order is the icon id and the bundle order (append only); it generates <code>enum ngui_icon</code> and <code>ngui_icon_name()</code>, and the gallery shows every entry.</li>
|
|
|
- <li><strong>Tinting.</strong> Symbolic icons are one colour, so only coverage is stored. <code>ngui_icon()</code> blends the mask in the caller's colour (the theme text colour on buttons, <code>icon_folder</code>/<code>icon_disk</code>/<code>icon_file</code> in <code>files</code>), centred and clipped.</li>
|
|
|
- <li><strong>Loading.</strong> Each process reads the bundle once into a BSS buffer, so the browser's <code>heap_reset()</code> cannot free it. The read is capped at the ids the app was built with, so an older app still works with a newer bundle. Without the bundle the icon is left blank; there is no line-drawn fallback, because it cost ~2 KB of code in each app.</li>
|
|
|
+ <li><strong>Icon list.</strong> <code>ICON_LIST</code> is an X-macro of enum suffix, short name and theme file. Its order is the icon id and the bundle order (append only); it generates <code>enum ngui_icon</code> and <code>ngui_icon_name()</code>, and the gallery shows every entry. <code>uwm_lib.h</code> applies the same list to <code>enum uwm_icon</code>, so the ring-3 WM can use ids without linking ngui.</li>
|
|
|
+ <li><strong>Tinting.</strong> Symbolic icons are one colour, so only coverage is stored. <code>ngui_icon()</code> blends the mask in the caller's colour (the theme text colour on buttons, <code>icon_folder</code>/<code>icon_disk</code>/<code>icon_file</code> in <code>files</code>), centred and clipped. <code>usurf_icon()</code> does the same over the WM's 16/24/32 bpp shadow. The bar's battery clears the striped <code>battery</code> mask's interior to a quarter-brightness shade and draws its level fill over the lower part, so the gauge reads at 16 px.</li>
|
|
|
+ <li><strong>Loading.</strong> Each process (every ngui app and the WM) reads the bundle once into a BSS buffer, so the browser's <code>heap_reset()</code> cannot free it. The read is capped at the ids the process was built with, so an older app still works with a newer bundle. Without the bundle the icon is left blank; there is no line-drawn fallback, because it cost ~2 KB of code in each app.</li>
|
|
|
<li><strong>Strict converter.</strong> mkicons reads only what symbolic icons use (<code><svg viewBox></code>, <code><g></code>, <code><path></code>, <code><rect></code>, <code><circle></code>, <code><ellipse></code>, fill, fill-rule, opacity) and fails the build on transforms, strokes, <code>style</code> or unknown elements instead of drawing a wrong icon. <code>./mkicons assets/icons/adwaita 16 out.icn -v</code> prints an ASCII preview of every mask.</li>
|
|
|
</ul>
|
|
|
</section>
|
|
|
@@ -494,7 +544,7 @@
|
|
|
</p>
|
|
|
<ul>
|
|
|
<li><strong>Loading.</strong> <span class="file">cursor.c</span> copies the bundle out of the ramfs into its own pages after <code>ramfs_init()</code> and after every <code>ramfs_replace()</code> (the old pack is freed), then tells <span class="file">mouse.c</span> to re-fetch its image.</li>
|
|
|
- <li><strong>Selection.</strong> On every <code>SYS_WM_POLL</code> the window server resolves the shape: the WM's override (<code>SYS_WM_SET_CURSOR</code>: resize arrows on the grip and while resizing, the move cross during a title-bar drag, a hand over launchers and the status area), else the cursor of the window holding the pointer capture, else the content cursor (<code>SYS_WIN_SET_CURSOR</code>) of the window under the pointer, else the arrow.</li>
|
|
|
+ <li><strong>Selection.</strong> On every <code>SYS_WM_POLL</code> the window server resolves the shape: the WM's override (<code>SYS_WM_SET_CURSOR</code>: resize arrows on the resize band and while resizing, the move cross during a title-bar drag, a hand over the start button, the start menu and the status cluster), else the cursor of the window holding the pointer capture, else the content cursor (<code>SYS_WIN_SET_CURSOR</code>) of the window under the pointer, else the arrow.</li>
|
|
|
<li><strong>Clients.</strong> ngui resets the cursor to the arrow for each redrawn frame, a hovered text field asks for the I-beam, <code>ngui_cursor_rect()</code>/<code>ngui_set_cursor()</code> serve apps, and <code>ngui_end_ex()</code> sends it when it changed. The terminal uses the I-beam; the browser maps the inherited CSS <code>cursor</code> property and, for <code>auto</code>, a hand over links, an I-beam over text fields and the progress arrow while a page loads. The gallery's Cursors section shows every shape.</li>
|
|
|
<li><strong>Drawing.</strong> <code>cur_x</code>/<code>cur_y</code> stay the hotspot; the image's top-left is the hotspot minus the image's hotspot and may be off-screen. The software cursor saves up to 32×32 pixels under it and blends the premultiplied pixels over them. Intel Ironlake and Radeon copy the ARGB image into their 64×64 planes (Intel uses CURPOS sign bits for negative positions and follows the matching primary plane's gamma enable, because the display palette is after the plane blender and a cursor-only gamma pass brightens its antialiased edges on a VBE mode whose primary bypasses the palette; Radeon uses <code>HORZ_VERT_OFF</code> plus a shifted <code>CUR_OFFSET</code>); Cirrus reduces it to its two colours and clamps the position at 0. Animated frames advance from <code>mouse_poll_update()</code>.</li>
|
|
|
</ul>
|
|
|
@@ -546,8 +596,9 @@
|
|
|
<li><code>user/apps/browser/browser.c</code>, <code>user/apps/browser/browser_html.c</code> — HTML/CSS renderer and inline SVG</li>
|
|
|
<li><code>user/lib/ngui/ngui.c</code>, <code>user/lib/ngui/ngui.h</code> — toolkit</li>
|
|
|
<li><code>user/lib/ufont/ufont.c</code>, <code>user/lib/ufont/ufont_ttf.c</code>, <code>user/lib/ufont/ufont_draw.c</code> — fixed-point TrueType text</li>
|
|
|
+ <li><code>user/lib/ufont/ufont_woff.c</code> — WOFF 1.0 to sfnt (browser only)</li>
|
|
|
<li><code>fonts/*.ttf</code> — Arimo / Liberation Mono / Noto Emoji subsets in the pack</li>
|
|
|
- <li><code>user/apps/files/ucmd_files.c</code>, <code>user/apps/gallery/gallery.c</code>, <code>user/apps/solitaire/ucmd_solitaire.c</code>, <code>user/apps/chat/ucmd_chat.c</code></li>
|
|
|
+ <li><code>user/apps/files/ucmd_files.c</code>, <code>user/apps/process/ucmd_process.c</code>, <code>user/apps/gallery/gallery.c</code>, <code>user/apps/solitaire/ucmd_solitaire.c</code>, <code>user/apps/chat/ucmd_chat.c</code></li>
|
|
|
<li><code>user/lib/img/img*.c</code> — image codecs</li>
|
|
|
<li><code>kernel/ati.c</code>, <code>kernel/nvidia.c</code>, <code>kernel/intel.c</code>, <code>kernel/nv50.c</code></li>
|
|
|
<li><code>kernel/backlight.c</code>, <code>kernel/backlight.h</code> — Cherryview/VLV panel PWM</li>
|