FINAL CUT is a C++ class library and a widget toolkit with full mouse support for creating a text-based user interface. It's based on the Termcap library and has its own cursor optimization and window management.
Most Unix TUIs are difficult to use or limited in their functionality. I developed FINAL CUT to fix these problems. The main goals in FINAL CUT design were to create a library that is easy to use, powerful, visually appealing and easily expandable.
From 1991 to 1996 I developed with Borland Pascal under DOS a text-based file manager called “The Final Cut”, with the intention to be more visually appealing than all other products. The calculator example is, among other things, an extract from this program.
As I got to learn object-oriented programming (OOP) with C++ at the end of the 90s, I noticed significant design weaknesses in my program code. I decided to re-implement the code cleanly in C++. This time I wanted to avoid old mistakes and do everything right and open source. In the meanwhile, I switched from DOS to Linux, so I started the implementing of the first widgets (FDialog, FButton, FLineEdit, FScrollbar) and the string class FString for the Linux console. Unfortunately, the project lost my attention in 2000.
In 2012, I needed an attractive terminal presentation for a textual data structure. So I have started to develop FINAL CUT to a widget library.
You require an operating system environment that implements a POSIX system call API. This can be realized in Windows with the Cygwin project.
The supported platforms are Linux, FreeBSD, NetBSD, OpenBSD, macOS, Cygwin on Microsoft Windows, GNU Hurd, and Oracle Solaris
You require a C++ compiler like GCC (g++) or Clang (clang++).
You need three things:
-
C++ compiler like GCC (g++) or Clang (clang++).
-
The GNU building tools
For example, in a Debian-based distribution it would be the following packages:
- autotools-dev
- automake
- autoconf
- autoconf-archive
- libtool
- pkg-config
-
Development packages for the following libraries:
- C standard library
- C++ standard library
- Termcap library (mostly part of the curses library)
- General Purpose Mouse library (optional, only if you need mouse support on the Linux console)
For example, in a Debian-based distribution it would be the following packages:
- libglib2.0-dev
- libstdc++-6-dev
- libtinfo-dev
- libncurses5-dev
- libgpm-dev
./configure --without-gpm
- Normal xterm mouse tracking (limited to 223 rows/columns)
- Xterm SGR mouse tracking
- URXVT mouse tracking
- General Purpose Mouse (gpm) on a linux console
You require the unit testing framework CppUnit.
-
Make sure that the environment variable TERM has the right terminal name.
-
Use the command "
msgcat --color=test
" to test whether the terminal displays colors correctly in the terminal. -
If characters are not displayed in the right place on the screen, it may help to disable cursor optimization for your program with the parameter --no-optimized-cursor.
-
If terminal detection did not work, it is useful to turn off the terminal detection with the parameter --no-terminal-detection.
-
If the color palette redefinition causes difficulties, you can switch off the color mapping with the parameter --no-color-change.
With Ctrl-L you can clear and redraw all information on the terminal screen. This may be necessary if a background program overwrites the displayed widgets with other characters.
How to disable mouse tracking and the non-scrollable alternate screen buffer in the GNU Debugger (GDB)
If you are using an xterm-compatible terminal, you can disable mouse tracking and re-enable the terminal scroll buffer by resetting the terminal settings. You can use the following command in the GNU Debugger to do this:
(gdb) printf "%s\n", "\033c\033]104\007"