67 lines
4.5 KiB
Markdown
67 lines
4.5 KiB
Markdown
# HTab
|
|||
|
|
|
||
|
|
**HTab** (short for *Hacker's Tables*) is a fast, lightweight standalone X11 spreadsheet built in C++20. It pairs an engine library (`libcalc`) with ANODE's `libgemui` toolkit (statically linked by default so `htab` runs cleanly outside ANODE on any X11 desktop), scaling from HiDPI screens down to `240x296` pocket displays.
|
||
|
|
|
||
|
|
## Features
|
||
|
|
|
||
|
|
- **Fast formula engine (`libcalc`)**: Incremental dependency graph recalculation, circular reference detection (`#CYCLE!`), dynamic array spilling (`#SPILL!`), and full Undo/Redo across edits and structural shifts.
|
||
|
|
- **100 built-in functions**: Math & Trig (27), Logical (6), Statistical (12), Lookup & Reference including `FILTER` spilling (8), Text (14), Date & Time (11), Financial (10), and Database `D*` functions (12).
|
||
|
|
- **CSV and multi-sheet save files**: Full RFC 4180 CSV import/export (evaluated values or raw formulas) alongside a clean `.htab` JSON format that keeps formulas, multiple sheets, column widths, row heights, and number formats.
|
||
|
|
- **Responsive X11 UI**: Automatically reads ANODE/X11 DPI scaling (`Xft.dpi`, `theme.scale`, `theme.touchMode`) on desktop displays and switches into Compact Mode at `<= 320x360` (tested down to `240x296`).
|
||
|
|
|
||
|
|
## Build & Install
|
||
|
|
|
||
|
|
HTab uses a strict POSIX `Makefile`.
|
||
|
|
|
||
|
|
### Prerequisites
|
||
|
|
|
||
|
|
- C++20 compiler (`g++` or `clang++`), C11 compiler (`cc`), and `ar`
|
||
|
|
- For the GUI (`htab`): `pkg-config`, standard X11/Cairo/Pango/HarfBuzz/Fontconfig/FreeType development libraries, and the bundled `libgemui/` Git submodule (`git clone --recursive` or `git submodule update --init`). `libgemui.a` is built and statically linked by default (`GEMUI_STATIC=1`) so `htab` needs no ANODE runtime files (pass `GEMUI_STATIC=0 GEMUI_DEPS=""` for system shared `libgemui.so`). The calculation engine and tests (`make calc`, `make test`) require only the C++20 standard library.
|
||
|
|
|
||
|
|
### Commands
|
||
|
|
|
||
|
|
```sh
|
||
|
|
git submodule update --init # Fetch the libgemui submodule if not cloned with --recursive
|
||
|
|
make -j # Build build/libcalc.a, build/libgemui/libgemui.a, and build/htab
|
||
|
|
make test # Build and run the headless engine unit tests (no X11 needed)
|
||
|
|
sudo make install # Install the htab binary to /usr/local/bin/htab
|
||
|
|
```
|
||
|
|
|
||
|
|
Run `make help` for additional options (`PREFIX`, `DESTDIR`, `CC`, `CXX`, `CFLAGS`, `CXXFLAGS`, `GEMUI_DIR`, `GEMUI_STATIC`, `GEMUI_DEPS`, `STRIP_BIN`, `make rebuild`, `make clean`, `make uninstall`). `build/htab` is stripped by default (pass `STRIP_BIN=0 CXXFLAGS="-O0 -g"` for debug symbols).
|
||
|
|
|
||
|
|
## Running HTab
|
||
|
|
|
||
|
|
```sh
|
||
|
|
./build/htab # Start with a blank workbook
|
||
|
|
./build/htab budget.htab # Open a saved workbook
|
||
|
|
./build/htab data.csv # Import a CSV file
|
||
|
|
./build/htab --geometry 240x296 # Launch constrained to 240x296 compact mode
|
||
|
|
```
|
||
|
|
|
||
|
|
## Quick Controls
|
||
|
|
|
||
|
|
| Task | How to do it |
|
||
|
|
|---|---|
|
||
|
|
| Move / select cells | `Arrow keys`, `Shift + Arrows`, or click and drag |
|
||
|
|
| Go to cell / range | Click the active cell box (e.g. `A1`) or press `Ctrl+G` |
|
||
|
|
| Edit a cell | Type directly, press `F2`, double-click a cell, or click the formula bar |
|
||
|
|
| Confirm / cancel edit | `Enter` / `Tab` to confirm (`Shift` reverses), `Esc` to cancel |
|
||
|
|
| Copy / Cut / Paste | `Ctrl+C`, `Ctrl+X`, `Ctrl+V` (supports formulas and external TSV text), or right-click a cell |
|
||
|
|
| Undo / Redo | `Ctrl+Z`, `Ctrl+Y`, or toolbar `Undo` / `Redo` (`<` / `>`) |
|
||
|
|
| Add / remove rows & cols | Toolbar `+Row`, `-Row`, `+Col`, `-Col`, right-click a header or cell, or `F10` Menu |
|
||
|
|
| Add / switch / rename sheets | Click `+` to add, click tab or `Ctrl+PgUp` / `Ctrl+PgDn` to switch, right-click tab to rename |
|
||
|
|
| Close a sheet | Click `x` on the tab, middle-click the tab, right-click tab -> `Close Sheet`, or `F10` -> `Delete Sheet` |
|
||
|
|
| Auto-fill series or formulas | Drag the small square handle at the bottom-right corner of the selection |
|
||
|
|
| Resize columns or rows | Drag the border line between column letters or row numbers |
|
||
|
|
| Open full menu | Press `F10` or click `Menu` (`New`, `Open`, `Save`, `Export CSV`, `Format`, `Quit`) |
|
||
|
|
| Keyboard hints | Press `F1` or `F10` -> `Keyboard Hints (F1)` |
|
||
|
|
| Quit HTab | `Ctrl+Q`, `F10` -> `Quit`, or window close (prompts to save if modified) |
|
||
|
|
|
||
|
|
## Documentation
|
||
|
|
|
||
|
|
- [USER_GUIDE.md](USER_GUIDE.md) — Complete walkthrough of formulas, dynamic spilling, shortcuts, file formats, DPI scaling, and all 100 functions.
|
||
|
|
- [design.md](design.md) — Technical architecture and specification.
|
||
|
|
|
||
|
|
## Credits
|
||
|
|
|
||
|
|
Created by Luxferre in 2026, released into the public domain with no warranties.
|