CI / test (push) Failing after 16s
Each pill now shows the icon the app's .desktop file names (Icon=), looked up in the freedesktop icon themes, instead of the letter tile. The tile stays as the fallback for windows with no app id, no desktop file or no icon the host can read. - WIT: a new `icons` capability (`app-icon(app-id) -> u32`, a handle, never a path or pixels) and an `image(image-op)` draw op (appended, so existing modules keep their ABI). taskbar-widget and plasmoid-host import `icons`. Host raster gains `load-image(path)` and a `draw-image` op; the plasmoids host gets an icons table (6: app id, handle). - Compositor (shell/icons.mbt): window app id -> desktop file (resolve_app_id, so StartupWMClass and last-dotted-part matches work) -> Icon= -> theme lookup (XDG data dirs, ~/.icons, flatpak exports; hicolor, Adwaita, breeze; 48/64/32 px PNG first, then scalable SVG when the host can draw it, then other sizes, then /usr/share/pixmaps). Absolute Icon= paths are used as they are. Results are cached per app id; the table is published only when a module imports `icons`. - wasm host (host-wasm): PNG via the png crate, SVG via resvg (rendered sharp at each size), PNGs area-averaged to the drawn size; loads cached by path. - Native build: a small PNG decoder (compositor/renderer/png.mbt: inflate + filters, 1-16 bit, palettes with tRNS) and the Image op in the software renderer. SVG-only icons fall back to the tile there. The wasmer stub serves `icons.app-icon` from the same table. - Tests: PNG decoder fixtures (all filters, fixed/dynamic/stored blocks, palette), image scaling and drawing, icon lookup order, Icon= parsing, task module icon-or-tile (native and wasmtime), host raster PNG+SVG loading and drawing. Checked end to end with the wasm host: foot's hicolor icon shows on its pill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hhmtDt52EjaW8jevGU
79 lines
2.4 KiB
Plaintext
79 lines
2.4 KiB
Plaintext
package chandra:desktop@0.1.0;
|
|
|
|
/// Shared value types. Everything here is plain data (no resources) so that
|
|
/// it can cross any component boundary and any host implementation.
|
|
interface types {
|
|
record size { w: u32, h: u32 }
|
|
record point { x: s32, y: s32 }
|
|
record rect { x: s32, y: s32, w: u32, h: u32 }
|
|
/// Non-premultiplied sRGB, 8 bits per channel.
|
|
record color { r: u8, g: u8, b: u8, a: u8 }
|
|
|
|
enum text-align { left, center, right }
|
|
|
|
record text-style {
|
|
/// Pixel height of the em box.
|
|
size: u32,
|
|
color: color,
|
|
align: text-align,
|
|
bold: bool,
|
|
}
|
|
|
|
record fill-rect-op { rect: rect, color: color, radius: u32 }
|
|
record stroke-rect-op { rect: rect, color: color, width: u32, radius: u32 }
|
|
record line-op { start: point, end: point, color: color, width: u32 }
|
|
record circle-op { center: point, radius: u32, color: color, filled: bool }
|
|
/// `origin` is the left edge (align=left), centre (center) or right edge
|
|
/// (right) of the text, at the vertical *middle* of the line box.
|
|
record text-op { origin: point, text: string, style: text-style }
|
|
/// An image the host holds, scaled to fill `rect`. `image` is a handle a capability handed
|
|
/// out (`icons.app-icon`); 0 or an unknown handle draws nothing.
|
|
record image-op { rect: rect, image: u32 }
|
|
|
|
/// The render-list vocabulary. Components never touch pixels: they return
|
|
/// a list of these in their own local coordinate space (origin top-left),
|
|
/// and the host/compositor translates, clips and rasterises them.
|
|
variant draw-op {
|
|
fill-rect(fill-rect-op),
|
|
stroke-rect(stroke-rect-op),
|
|
line(line-op),
|
|
circle(circle-op),
|
|
text(text-op),
|
|
push-clip(rect),
|
|
pop-clip,
|
|
image(image-op),
|
|
}
|
|
|
|
variant input-event {
|
|
pointer-move(point),
|
|
pointer-down(point),
|
|
pointer-up(point),
|
|
pointer-leave,
|
|
/// Sent to a popup owner when the user clicks outside its popup.
|
|
focus-lost,
|
|
/// A printable character ("a") or a named key ("Backspace", "Enter", "Escape").
|
|
key-down(string),
|
|
}
|
|
|
|
record datetime {
|
|
year: u32,
|
|
month: u8,
|
|
day: u8,
|
|
hour: u8,
|
|
minute: u8,
|
|
second: u8,
|
|
/// 0 = Sunday .. 6 = Saturday
|
|
weekday: u8,
|
|
}
|
|
|
|
record app-entry {
|
|
id: string,
|
|
name: string,
|
|
comment: string,
|
|
category: string,
|
|
/// A short glyph (1-2 chars) standing in for an icon until the icon
|
|
/// theme interface lands.
|
|
glyph: string,
|
|
}
|
|
}
|