mirror of
https://github.com/nicbarker/clay.git
synced 2026-02-06 12:48:49 +00:00
Major refactor of the Ncurses renderer and example application to improve code readability, maintainability, and documentation coverage.
**Ncurses Renderer (`renderers/ncurses/clay_renderer_ncurses.c`):**
* **Atomic Rendering Functions**: Decomposed the monolithic `Clay_Ncurses_Render` function into specialized handlers:
* `Clay_Ncurses_RenderRectangle`
* `Clay_Ncurses_RenderText`
* `Clay_Ncurses_RenderBorder`
* **Scissor Management**: Encapsulated scissor stack operations into `Clay_Ncurses_PushScissor` and `Clay_Ncurses_PopScissor`.
* **Visibility Logic**: Extracted visibility/clipping checks into `Clay_Ncurses_GetVisibleRect` for cleaner reuse.
* **Documentation**: Added comprehensive Doxygen documentation for file headers, internal state, constants, and all functions.
**Ncurses Example (`examples/ncurses-example/main.c`):**
* **Architecture Refactor**: Implementation split into clear "App State", "Input Processing", and "UI Components" sections.
* **UI Componentization**: Renamed and organized UI functions with a consistent `UI_` prefix (e.g., `UI_Sidebar`, `UI_FeedPost`, `UI_HelpModal`).
* **State Management**: Introduced `AppState` struct to centralize application state (sidebar visibility, scroll delta, etc.).
* **Input Handling**: Centralized input logic in `App_ProcessInput` loop.
* **Documentation**: Added full Doxygen documentation for the example source.
This refactor maintains identical runtime behavior while significantly improving the codebase's "spoken english" readability and modularity. loop.
* **Documentation**: Added full Doxygen documentation for the example source.
This refactor maintains identical runtime behavior while significantly improving the codebase's readability and modularity.
|
||
|---|---|---|
| .. | ||
| cairo-pdf-rendering | ||
| clay-official-website | ||
| cpp-project-example | ||
| introducing-clay-video-demo | ||
| ncurses-example | ||
| playdate-project-example | ||
| raylib-multi-context | ||
| raylib-sidebar-scrolling-container | ||
| SDL2-video-demo | ||
| SDL3-simple-demo | ||
| shared-layouts | ||
| sokol-corner-radius | ||
| sokol-video-demo | ||
| termbox2-demo | ||
| termbox2-image-demo | ||
| terminal-example | ||
| win32_gdi | ||