Translator's note: If you can read Chinese, please prioritize reading the Chinese version; this is the author's original manuscript, other language versions are primarily translated by AI models and are for reference only.
Crate Structure
Graphics backend and platform layer are at the same dependency level, not depending on each other, selected by core framework via feature.
Lower layer numbers mean more foundational; crates at the same layer don't depend on each other.
Framework Features
flor doesn't enable any features by default. Applications usually need at least one rendering backend, then enable layout, atomic class, platform capabilities etc. as needed.
Below are features exposed to users by flor crate. View libraries may forward some of these features, but framework-side names are as listed here. For detailed usage of platform capabilities, see Framework Capabilities.
Rendering Backends
Rendering backends submit Flor's drawing commands to specific graphics implementations. Applications need to enable at least one backend; if both GPU backend and tiny-skia are enabled, it will continue trying CPU backend after GPU initialization fails.
direct2d and opengl both enable gpu-render-backend marker; choose one GPU backend in the same build. tiny-skia enables cpu-render-backend marker, can be enabled together with a GPU backend.
Drawing Capabilities
These features are not backends themselves, but add drawing or resource capabilities on enabled backends.
Basic shapes, text, images and other conventional drawing capabilities are provided by rendering backends, no need to additionally enable svg or memory-font.
Layout and Class
For complete layout builder methods, see Layout Builder. For class usage, see Atomic Class. For layout class syntax list, see Layout Class Syntax.
Platform Capabilities
For feature-controlled parts in event builder and handlers, see Event Builder and Handler API.
Development and Internal Selection
Applications usually directly enable direct2d, opengl or tiny-skia. Don't manually enable only cpu-render-backend / gpu-render-backend internal markers.
Introduction to Each Part
What you need to know for simply using the framework
By default you'll use it with a view library, prioritize these contents:
- Initialization and message loop
- Window Creation and Control
- Cross-thread reactive signal system
- Use class or declarative builder to configure layout and style
- Enable framework features as needed
What you need to know for developing views
By default you already know how to use Flor to write applications, then continue with these contents:
View trait: Trait that new views need to implement. Framework manages lifecycle, events, drawing etc. flows.ViewId: View's unique ID, also provides runtime access entries for parent-child relationships, focus, scroll, visibility state, redraw etc.Resolverattribute macro and struct: Generates view-state property template code through enums.Render API: Framework provides a drawing API sufficient for most view drawing; when advanced capabilities are needed, get corresponding handle by backend for custom processing.

