2026-09-07 20:19:13 -06:00
2026-09-07 20:19:13 -06:00
2026-04-20 19:26:24 -06:00
2026-09-07 14:36:45 -06:00
2026-09-07 15:24:52 -06:00
2026-04-09 16:05:36 +00:00
2026-09-07 20:19:13 -06:00
2026-09-07 20:19:13 -06:00
2026-09-07 14:36:45 -06:00
2026-09-07 17:13:40 -06:00

desktoplib

License: MIT

A lightweight, cross-platform C++20 library for building desktop applications that need uniform access to terminal UIs, OS processes, and serial (USB) interfaces.

Designed as a standalone static library with an intentionally limited scope. No heavy dependencies — just standard C++20 and platform-specific OS calls.

Features

  • Terminal UI — ANSI escape-sequenced output with RGB/HSL colors, cursor positioning, alternative buffers, and input handling
  • UI Widgets — Built-in Box, InnerScroll, MenuMap, and Content for composing terminal layouts
  • Process Management — Planned uniform process spawn/stream abstraction (stub in place)
  • Serial Communication — Planned cross-platform USB/serial port interface
  • OS Abstraction Layer — Shared terminal/input/OS calls behind common.hpp, with POSIX and Windows implementations

Requirements

  • C++20 compatible compiler (g++ recommended)
  • Make (GNU Make)
  • POSIX or Windows environment

Building

# Build the static library
make -f makelib.mak

# Build and run the test executable
make
./out/out.exe

Produces out/libdesktoplib.a for linking into your own projects.

Quick Start

#include <desktoplib/terminal/Terminal.hpp>

int main() {
    using namespace ckitty::terminal;

    Terminal term;
    term.altbuff(true)
        .cursor(false)
        .cls()
        .fill(color::B_BLACK);

    term << pos{ 1, 1 } << backg::BLUE << color::WHITE << style::BOLD;
    term.center(40, " Hello, desktoplib ");
    term << style::RESET;

    term.flush();
    term.wait(); // Block until a key is pressed

    term.altbuff(false).cursor(true).cls();
    return 0;
}

Architecture

src/desktoplib/
├── os/                  # Platform abstraction (POSIX / Windows)
├── terminal/            # Terminal engine, ANSI codes, input
│   └── ui/              # Widgets: Box, InnerScroll, MenuMap, Content
└── proc/                # Process management (stub)

All modules live in the ckitty namespace. The terminal layer uses ANSI escape sequences wrapped in typed structs (color, backg, style, pos, move) and supports method chaining on Terminal.

Roadmap

Module Status Target
Terminal UI Stable —
OS Abstraction Stable (POSIX + Windows) —
Process Stub Spawn, stdin/stdout/stderr streams, exit code
Serial / USB Not started Cross-platform port enumeration + read/write

License

MIT — see LICENSE.

S
Description
A library that helps when building desktop apps by adding support for Terminals, Serial interfaces, and other general desktop-only things.
Readme MIT 108 KiB
Languages
C++ 92.9%
Makefile 5.5%
Shell 1.6%