PlatformView API
PlatformView is declared by <huxerui/view.h>; registry and bridge values are in <huxerui/platform_registry.h>.
Construction and updates
Section titled “Construction and updates”PlatformView(std::string name) uses a registration without properties. PlatformView(name, properties) stores the actual C++ properties type, which must be move-constructible and equality-comparable. Keep it a small declarative value; compatible recomposition updates the existing platform instance instead of recreating it.
Register through RootContext::RegisterPlatformView<Properties>(name, factory), or its <Properties, Controller> overload. Include the host-specific platform_registry.h for its PlatformViewFactory. Registration names and types must match exactly.
Events and controller
Section titled “Events and controller”.On<Key>(handler) binds a named platform event directly. The key derives from Event<...> and defines Name. Direct C++ events use their typed values; only cross-language payload values need encoding/decoding. A result-bearing event can return a synchronous decision to the platform implementation.
.Controller(controller) supplies an equality-comparable, move-constructible typed controller to a registration that declares that controller type. Connection and disconnection follow the mounted instance; this is not a singleton service or a second source of controlled properties.
Factory lifetime
Section titled “Factory lifetime”A typed factory owns create, view extraction, update, and disposal callbacks, with optional controller connect/disconnect operations. Callbacks run on the platform UI thread. The factory’s retained instance keeps the platform view and its state alive until unmount; do not keep raw HuxerUI nodes in that instance.
Unknown names, incompatible properties/controllers, and malformed bridge values are integration errors. Validate these paths alongside compatible updates and unmount/remount.
HuxerUI owns layout and declarative lifetime, but platform controls retain backend-specific compositing and input limits. See the guide before relying on transforms, clipping, opacity, or overlap.

