Expand description
VNode FFI - Functions for constructing VNodes from Windjammer code
This module provides a stable FFI interface that Windjammer components can use to construct VNodes. This enables cross-platform UI rendering:
- Web: VNode → HTML (via simple_renderer)
- Desktop: VNode → egui (via desktop_renderer)
The design uses opaque handles (u64) to reference VNodes stored in a thread-local registry. This avoids complex memory management across the FFI boundary.
Functions§
- vnode_
attr - Add a static attribute to a VNode
- vnode_
button - Create a button element
- vnode_
child - Add a child VNode to a parent VNode The child is consumed (moved from registry to parent’s children)
- vnode_
class - Add a class to a VNode (convenience for class attribute)
- vnode_
clear - Clear all VNodes from the registry (for cleanup between renders)
- vnode_
div - Create a div element with optional class and style
- vnode_
element - Create a new element VNode with a tag name Returns a handle to the VNode
- vnode_
get - Get a reference to a VNode (without removing it)
- vnode_
span - Create a span element with text content
- vnode_
style - Add inline style to a VNode
- vnode_
take - Get the VNode for a handle and remove it from the registry This is called when the VNode tree is complete and ready to render
- vnode_
text - Create a text VNode Returns a handle to the VNode