A fresh approach to TUI development that promotes efficiency and code reusability.
- Unlike traditional TUI programs that rely on a single binary with duplicated interface implementations, ccanvas allows multiple binaries to draw on the same terminal.
- In ccanvas, binaries become reusable building blocks, the same binary "component" can be employed across different "component bundles," eliminating duplicated implementations and promoting a modular approach to TUI development.
- Binary components connect to ccanvas via Unix sockets, enabling them to draw on the terminal and listen to events.
- Components can communicate with each other through messages, shared variables, and shared file storage.
Ok, so what does ccanvas in action looks like?
At its core, ccanvas is a program that provides a standardised interface for easy interaction.
ccanvas
- the main ccanvas program.libccanvas
- binding structs + component utility.
To create a component for ccanvas, visit
libccanvas/examples
.
Components are the building blocks of a ccanvas program. Here are some general purpose components.
ccanvas-layout
- component layout manager.ccanvas-quit
- configurable quitting handler.ccanvas-saver
- terminal size limiter/screen saver.ccanvas-scroll
- scrolling text display.ccanvas-solid
- debug component to fill screen with the same character.
A ccanvas reimplementation of youtube-tui
is currently being developed.
Meanwhile, you can check out the minimal apps in libccanvas/examples
to get a feel of its full power.
<3