Skip to content

Add Rust-drawn pixel surfaces and Rust-built tray icons (stage 34) - #17

Merged
Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
masterfrom
claude/stage34-pixel-surfaces-tray
Oct 30, 2026
Merged

Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
masterfrom
claude/stage34-pixel-surfaces-tray

Conversation

@mamoreau-devolutions

Copy link
Copy Markdown
Contributor

Two things the code-first API could not do, which an image editor or a capture tool needs: put pixels Rust produced on screen while getting the raw pointer stream, and show a tray icon without a view-model schema compiled into the host. Jiffshot (a screen capture tool and editor) is built entirely on these, with no AXAML or C#.

What's in it

  • IAvnApplication7 (stage 34), a separately versioned capability. Published vtables are unchanged; older hosts answer E_NOINTERFACE.
  • Pixel surfaces (IAvnPixelSurface, Rust-implemented IAvnPixelSurfaceHandler):
    • A host control drawing up to 8 bitmap layers that Rust fills (premultiplied RGBA or BGRA). Each layer is placed at a rectangle in DIPs or over the whole control, with an interpolation mode and opacity, over an optional background.
    • Input goes to a Rust closure: press/move (coalesced intermediate points included)/release/wheel/enter/exit/capture lost with buttons, modifiers and click count; keys; text input; size and scaling changes. A press captures the pointer until its release.
    • Rust: rustolonia::pixel_surface (PixelSurface, SurfaceInput, AppContext::create_pixel_surface), and examples/pixel_surface.rs, a small paint program.
  • Tray icons built from Rust (IAvnShellTray, IAvnShellTrayHandler):
    • Stage 33's tray needs a schema compiled into the host, which a code-first app on the prebuilt host doesn't have.
    • Rust: rustolonia::ShellTray with TrayMenuItem (commands, check boxes, separators, submenus) and AppContext::create_tray. Icons are released when Run ends, like stage 33's.
  • Docs: rust/COMPATIBILITY.md, rust/rustolonia/README.md.
  • rust/prepare-release.ps1: skips in-repository lock files that do not use rustolonia (an app with more than one workspace).

Testing

  • rustolonia-sys unit tests: 49 passed, including vtable slot counts and both Rust-implemented handlers.
  • rustolonia unit tests: 63 passed; cargo check --examples clean; the module's doc example compiles.
  • rustolonia-sys nativeaot_fixture: 12 passed, including the new capability against a locally published host. Bitmaps need the platform Run initializes, so before Run the fixture checks argument validation and the calls that don't render.
  • In use: Jiffshot's editor canvas, selection overlay (one window per monitor), Screen Draw, recording toolbar and tray icon run on these. Its scripted UI test and a live tray-mode run (menu, switches, capture hotkey) passed on a host built from this code.

Notes for review

  • A new host capability: per rust/COMPATIBILITY.md it belongs in a release that bumps all three crates. No version is bumped here. Jiffshot needs that release to build outside this repository on the prebuilt host.
  • Known gaps hit while building Jiffshot, not addressed here (follow-ups): menu headers can't carry access keys (header_text wraps a TextBlock; AccessText isn't projected); file-drop events carry no position; Rust can't start a drag; no "frame rendered" notification; a window's decoration theme can't be set.

🤖 Generated with Claude Code

IAvnApplication7 is a new, separately versioned capability; published
vtables are unchanged and older hosts answer E_NOINTERFACE.

- Pixel surfaces (IAvnPixelSurface, IAvnPixelSurfaceHandler): a control
  that draws up to 8 bitmap layers Rust fills (premultiplied RGBA or BGRA,
  placed at a rectangle or over the whole control) and reports the raw
  pointer stream, keys, text and resizes to a Rust closure. Safe API in
  rustolonia::pixel_surface; examples/pixel_surface.rs paints with it.
- Tray icons whose menu Rust builds (IAvnShellTray, IAvnShellTrayHandler):
  rustolonia::ShellTray, for code-first applications on the prebuilt host,
  which have no schema compiled into it.
- Docs: COMPATIBILITY.md, the crate READMEs (including copying the host
  next to an application's executable from its build script).
- prepare-release.ps1 skips in-repository lock files that do not use
  rustolonia.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) merged commit 90884b7 into master Oct 30, 2026
10 checks passed
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) deleted the claude/stage34-pixel-surfaces-tray branch October 30, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant