1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
|

# Library for creating terminal applications with text-based widgets
FINAL CUT is a C++ class library and widget toolkit with full [mouse](doc/mouse-control.md#title-bar-actions-on-mouse-clicks) support for creating a [text-based user interface](https://en.wikipedia.org/wiki/Text-based_user_interface). The library supports the programmer to develop an application for the text console. It allows the simultaneous handling of multiple text windows on the screen.
The structure of the Qt framework was originally the inspiration for the C++ class design of FINAL CUT. It provides common controls like dialog boxes, push buttons, check boxes, radio buttons, input lines, list boxes, status bars and so on.
## Building and code analysis
| | Badge |
|-------------------:|:------|
| *Latest release* | [](https://github.com/gansm/finalcut/releases) |
| *License* | [](COPYING) |
| *Class Reference* | [](https://codedocs.xyz/gansm/finalcut/hierarchy.html) |
| *ARM build* | [](https://github.com/gansm/finalcut/actions/workflows/arm.yml) |
| *FreeBSD build* | [](https://github.com/gansm/finalcut/actions/workflows/freebsd.yml) |
| *OpenBSD build* | [](https://github.com/gansm/finalcut/actions/workflows/openbsd.yml) |
| *macOS build* | [](https://github.com/gansm/finalcut/actions/workflows/macos.yml) |
| *Cygwin build* | [](https://github.com/gansm/finalcut/actions/workflows/cygwin.yml) |
| *Solaris build* | [](https://github.com/gansm/finalcut/actions/workflows/solaris.yml) |
| *CodeQL analysis* | [](https://github.com/gansm/finalcut/actions/workflows/codeql-analysis.yml) |
| *LGTM* | [](https://lgtm.com/projects/g/gansm/finalcut/context:cpp) |
| *Coverity Scan* | [](https://scan.coverity.com/projects/6508 ) |
| *SonarCloud* | [](https://sonarcloud.io/dashboard?id=gansm_finalcut) |
| *CodeFactor* | [](https://www.codefactor.io/repository/github/gansm/finalcut) |
## Installation
```bash
> git clone git://github.com/gansm/finalcut.git
> cd finalcut
> autoreconf --install --force
> ./configure --prefix=/usr
> make
> su -c "make install"
```
## Supported platforms
* Linux
* FreeBSD
* NetBSD
* OpenBSD
* macOS
* Cygwin
* GNU Hurd
* Solaris
## Documentation
See the [first steps documentation](doc/first-steps.md#first-steps-with-the-final-cut-widget-toolkit) for information on how to use the library.
## Frequently Asked Questions
For general questions about FINAL CUT, likely the answer is already included in the [FAQ](doc/faq.md#frequently-asked-questions).
## Screenshots
The FFileDialog widget with incremental file name search:

The FINAL CUT FProgressbar widget:

Scrollable text in the FTextView widget:

The Mandelbrot set example:

## FINAL CUT newfont
A [graphical text font](final/font/) for X11 and the Linux console.

Newfont drive symbols:

The calculator example in newfont mode:

## Benchmark
Here you can find a test for [measuring the character speed](doc/benchmark.md#benchmark) in the terminal.
## Virtual terminal
FINAL CUT uses a virtual terminal to print character via an update method on the screen. It provides (as an overlying layer) virtual windows for the realization of window movements. The update methods only transfer differences to the virtual terminal or physical screen.
<pre style="line-height: 1 !important;">
print(...)
printf(...)
│
│ ╔════════════════════════[ vterm ]════════════════════════╗
│ ║createVTerm() ║
│ ║ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ ║
│ ║ ║
│ ║ │ restoreVTerm(x,y,w,h) │ ║
│ ┌───────╨────[ vwin ]────────────┐ ║
│ │createArea(area) │ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ ║
│ │ │ ║
│ │ │ ║
└──┼────────► putArea(area) ────► ║
│ │ ║
│ putArea(x,y,area) ────► ║
│ │ ║
│ ◄──── getArea(x,y,area) ║
│ │ ║
│ │ ║
│ │ ║
│ resizeArea(area)│ ║
└───────╥────────────────────────┘ ║
║ ║
║ │ resizeVTerm()║
╚═══════▼═════════════════════════════════════════════════╝
│
│ putVTerm()
└──────────────────► updateTerminalLine(y)
updateTerminal() │
▼
┌───────────────┐
│ output_buffer │
└───────────────┘
│
│ flushOutputBuffer()
│ and putchar(char)
▼
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▌ ▐
▌ screen ▐
▌ ───────────── ▐
▌ real terminal ▐
▌ ▐
▀▀▀▀▀▀▀███▀▀▀▀▀▀▀
███
▀▀▀▀▀▀▀▀▀
</pre>
## Class digramm
<pre style="line-height: 1 !important;">
┌────────────┐1
│ FTermLinux ├------┐
└────────────┘ :
┌──────────────┐1 :
│ FTermFreeBSD ├------┐
└──────────────┘ :
┌──────────────┐1 :
│ FTermOpenBSD ├------┐
└──────────────┘ :
┌────────────────┐1 :
│ FTermDetection ├------┐
└────────────────┘ :
┌────────────────┐1 :
│ FTermcapQuirks ├------┐
└────────────────┘ : ┌───────────┐
┌────────────────┐1 : ┌────┤ FKeyEvent │
│ FTermXTerminal ├------┐ │ └───────────┘
└────────────────┘ : │ ┌─────────────┐
┌──────────┐1 : ├────┤ FMouseEvent │
│ FTermcap ├------┐ │ └─────────────┘
└──────────┘ : │ ┌─────────────┐
┌──────────┐1 : ├────┤ FWheelEvent │
│ FTermios ├------┐ │ └─────────────┘
└──────────┘ : │ ┌─────────────┐
┌───────────────┐1 : ├────┤ FFocusEvent │
│ FColorPalette ├------┐ │ └─────────────┘
└───────────────┘ : │ ┌─────────────┐
┌───────────┐1 : ├────┤ FAccelEvent │
│ FOptiMove ├------┐ │ └─────────────┘
└───────────┘ : │ ┌──────────────┐
┌───────────┐1 : ├────┤ FResizeEvent │
│ FOptiAttr ├------┐ │ └──────────────┘
└───────────┘ : │ ┌────────────┐
┌───────────┐1 : ├────┤ FShowEvent │
│ FKeyboard ├------┐ │ └────────────┘
└───────────┘ : │ ┌────────────┐
┌───────────────┐1 : ├────┤ FHideEvent │
│ FMouseControl ├------┐ │ └────────────┘
└───────────────┘ : │ ┌─────────────┐
┌─────────┐1 : ├────┤ FCloseEvent │
│ FSystem ├------┐ │ └─────────────┘
└─────────┘ : │ ┌─────────────┐
┌─────────┐* : ├────┤ FTimerEvent │
│ FString ├---┐ : │ └─────────────┘
└─────────┘ : : │ ┌────────────┐1 1┌───────┐
┌───────────────┐* : : ├────┤ FUserEvent ├------┤ FData │
│ FStringStream ├---┐ : │ └────────────┘ └───────┘
└───────────────┘ : : │ ┌──────┐ ┌─────────┐
┌────────┐* : : │ │ FLog │◄──┤ FLogger │
│ FPoint ├---┐ : │ └──┬───┘ └─────────┘
└────────┘ : : │ :1
┌───────┐* : : │ ┌──┴───────────┐
│ FRect ├---┐ : │ ┌────┤ FApplication │
└───────┘ : : │ │ └──────────────┘
┌───────┐* : : │ │ ┌────────┐
│ FSize ├---┐ : │ ├────┤ FLabel │
└───────┘ : : │ │ └────────┘
:1 :1 │ │ ┌───────────┐
┌───┴──┴┐ │ ├────┤ FLineEdit │
│ FTerm │ │ │ └───────────┘
└───┬───┘ │ │ ┌──────────┐
:1 │ ├────┤ FSpinBox │
┌─────────┐ ┌──────┴──────┐ │ │ └──────────┘
│ FOutput │◄──┤ FTermOutput │ │ │ ┌─────────┐
└────┬────┘ └─────────────┘ │ ├────┤ FButton │
: ┌────────┐ │ │ └─────────┘
:1 │ FEvent │◄──┘ │ ┌──────────────┐ ┌──────────────┐
┌───┴────┐ └────┬───┘ ├────┤ FButtonGroup │ ┌──┤ FRadioButton │
│ FVTerm │◄──┐ :1 │ └──────────────┘ │ └──────────────┘
└────────┘ │ ┌────┴────┐ │ ┌───────────────┐ │ ┌───────────┐
├────┤ FWidget │◄─────┼────┤ FToggleButton │◄─┼──┤ FCheckBox │
┌─────────┐ │ └────┬────┘ │ └───────────────┘ │ └───────────┘
│ FObject │◄──┘ :1 │ ┌──────────────┐ │ ┌─────────┐
└─────────┘ ┌──────┴────────┐ ├────┤ FProgressbar │ └──┤ FSwitch │
│ FWidgetColors │ │ └──────────────┘ └─────────┘
└───────────────┘ │ ┌────────────┐
├────┤ FScrollbar │
│ └────────────┘
│ ┌───────────┐
├────┤ FTextView │
│ └───────────┘
│ ┌───────────┐1 1┌──────────────────┐
├────┤ FComboBox ├------┤ FDropDownListBox │
│ └───────────┘ └──────────────────┘
┌──────────────┐1 │ ┌──────────┐1 *┌──────────────┐1
│ FVTermBuffer ├-------------------├────┤ FListBox ├-------┤ FListBoxItem ├--┐
└──────────────┘ │ └──────────┘ └──────────────┘ :
│ 1┌───────────┐1 *┌───────────────┐ :
├────┤ FListView ├------┤ FListViewItem │ :
│ └───────────┘ └────────┬──────┘ :
│ ┌─────────────┐ :1 :
├────┤ FScrollView │ ┌───┴───┐1 :
│ └─────────────┘ │ FData ├----┘
│ └───────┘
│ ┌────────────┐1 *┌────────────┐
│ ┌──┤ FStatusBar ├-----┤ FStatusKey │
│ │ └────────────┘ └────────────┘
│ │
│ ▼ ┌─────────────┐
┌───┴─┴───┐ ┌─────────┐ ┌──┤ FFileDialog │
│ FWindow │◄─┤ FDialog │◄──┤ └─────────────┘
└──┬──┬───┘ └─────────┘ │ ┌─────────────┐
▲ ▲ └──┤ FMessageBox │
│ │ └─────────────┘
│ │ ┌──────────┐ ┌────────────────┐
│ └──────┤ FToolTip │◄─┤ FBusyIndicator │
│ └──────────┘ └────────────────┘
└───────────────┐ ┌──────────┐
│ ┌───┤ FMenuBar │
┌───────────┐ └──────┤ └──────────┘
│ FMenuList │◄──────────┤ ┌───────┐
└────┬──────┘ └───┤ FMenu │◄──┐
:1 └───────┘ │
: ┌─────────────────┐ │
: │ FDialogListMenu ├───┘
: └─────────────────┘
└--------------------------------┐
:* ┌────────────────┐* :
┌────┴─────┐ ┌──┤ FCheckMenuItem ├---┘
│FMenuItem │◄─┤ └────────────────┘ :
└──────────┘ │ ┌────────────────┐* :
└──┤ FRadioMenuItem ├---┘
└────────────────┘
</pre>
## Please send bug reports to
https://github.com/gansm/finalcut/issues
## License
GNU Lesser General Public License Version 3 <a href="https://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img width="200" align="right" src="https://camo.githubusercontent.com/726b87cc2ebaf8c40716842ff509c5f874381c8e/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f332f33622f4c47504c76335f4c6f676f2e737667" alt="LGPLv3" data-canonical-src="https://upload.wikimedia.org/wikipedia/commons/3/3b/LGPLv3_Logo.svg"></a>
|