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
53 lines
1.0 KiB
Plaintext
53 lines
1.0 KiB
Plaintext
// Generated using `moon info`, DON'T EDIT IT
|
|
package "chandra/desktop/compositor/renderer"
|
|
|
|
import {
|
|
"chandra/desktop/compositor/scene",
|
|
}
|
|
|
|
// Values
|
|
pub fn add_image(Pixmap) -> UInt32
|
|
|
|
pub fn blit_shm_surface(Pixmap, @scene.ShmBufferSnapshot, @scene.Rect) -> Unit
|
|
|
|
pub fn decode_png(Bytes) -> Pixmap?
|
|
|
|
pub fn draw_ops(Pixmap, Array[@scene.DrawOp], Int32, Int32) -> Unit
|
|
|
|
pub fn encode_png(Pixmap) -> Bytes
|
|
|
|
pub fn encode_ppm(Pixmap) -> Bytes
|
|
|
|
pub fn render_scene(@scene.SceneGraph) -> Pixmap
|
|
|
|
pub fn scale_pixmap(Pixmap, Int32, Int32) -> Pixmap
|
|
|
|
pub fn set_glyph_source((Int32, Int32, Bool, Bool) -> Glyph) -> Unit
|
|
|
|
pub fn text_width(String, Int32, Bool, Bool) -> Int32
|
|
|
|
// Errors
|
|
|
|
// Types and methods
|
|
pub(all) struct Glyph {
|
|
w : Int32
|
|
h : Int32
|
|
xoff : Int32
|
|
yoff : Int32
|
|
advance : Int32
|
|
coverage : Bytes
|
|
embolden : Bool
|
|
}
|
|
|
|
pub(all) struct Pixmap {
|
|
width : Int32
|
|
height : Int32
|
|
data : FixedArray[Byte]
|
|
}
|
|
pub fn Pixmap::new(Int32, Int32) -> Self
|
|
pub fn Pixmap::pixel(Self, Int32, Int32) -> @scene.Rgba?
|
|
|
|
// Type aliases
|
|
|
|
// Traits
|