How 45474f52/displaynodes works
DisplayNodes is a declarative C# UI layout and rendering engine, with a Playground IDE for authoring and previewing UI scripts. The main workflow is to edit and compile a script, construct a fluent node tree, measure and arrange it, then render through a selected adapter. The graph also preserves reactive updates, layout/container capabilities, and both documented backends. Several implementation details are unsampled; those subsystem links are documented in the README rather than inferred from folder names.
Main entry points: IPreviewHost.cs Preview hosts · UI.cs Fluent UI API · LibDisplayDrawingAdapter/RenderRoot.cs Drawing adapter · WinFormsAdapter/RenderRoot.cs WinForms adapter
Components 17
Playground IDE
- IDE shell
Playground/AppForm.cs - Script editor
Playground/Editor/CodeEditor.cs - Script compilation
Playground/Compilation/ScriptRunner.cs - Preview hosts
Playground/Infrastructure/IPreviewHost.cs
UI Definition
- Fluent UI API
Kernel/Fluent/UI.cs
Layout and Runtime
- Layout containers
Kernel/Core - Measure and arrange
Kernel/Core/LayoutNode.cs - Leaf widgets
Kernel/Widgets - Reactive values
Kernel/Core/Observable.cs - Label behavior
Kernel/Widgets/LabelNode.cs
Rendering Backends
- Render contracts
Kernel/Core/Rendering - GDI wrappers
Gdi/GdiConversions.cs - Drawing adapter
LibDisplayDrawingAdapter/RenderRoot.cs - WinForms adapter
WinFormsAdapter/RenderRoot.cs
Other components
- UI author
- Preview image
- Rendered UI
Connections 18
- UI author → Script editor: edits script
- IDE shell → Script editor: hosts editor
Playground/AppForm.cs - IDE shell → Script compilation: runs scripts
Playground/AppForm.cs - Script compilation → Fluent UI API: builds UI
- Fluent UI API → Layout containers: creates containers
Kernel/Fluent/UI.cs - Fluent UI API → Leaf widgets: creates widgets
Kernel/Fluent/UI.cs - Layout containers → Measure and arrange: measures and arranges
Kernel/Core/LayoutNode.cs - Leaf widgets → Measure and arrange: participate in layout
Kernel/Widgets/WidgetNode.cs - Reactive values → Label behavior: updates bindings
Kernel/Widgets/LabelNode.cs - Label behavior → Render contracts: uses component contracts
Kernel/Widgets/LabelNode.cs - Preview hosts → Measure and arrange: builds tree
Playground/Infrastructure/LibDisplayDrawingPreviewHost.cs - Preview hosts → Drawing adapter: selects backend
- Preview hosts → WinForms adapter: selects backend
- Drawing adapter → Rendered UI: renders controls
- WinForms adapter → Rendered UI: renders controls
- Drawing adapter → Preview image: produces bitmap
- WinForms adapter → Preview image: exports image
- GDI wrappers → Render contracts: implements abstractions
Gdi/GdiConversions.cs