Sign in Join
Wiki copytemporary

Free Vision: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-## Contents
2-
3- * 1 Overview
4- * 2 To do list
5- * 3 Unicode version
6- * 4 Turbo Vision
7- * 4.1 Turbo Vision code bases
8- * 4.1.1 C++
9- * 4.1.2 Pascal
10- * 5 Problems on macOS
11- * 6 Tutorial
12-
131## Overview
142
153**Free Vision** is an application framework that allows you to design user friendly text mode applications. It is designed to be API-compatible with Borland's Turbo Vision framework.
164
17-Free Vision implements a full windowing system, where each window can be updated, moved and operated independently from other windows. It is implemented on top of the [[video unit|video]], [keyboard](</index.php?title=keyboard_unit&action=edit&redlink=1> "keyboard unit \(page does not exist\)") and [mouse](</index.php?title=mouse_unit&action=edit&redlink=1> "mouse unit \(page does not exist\)") units and Free Vision applications can therefore run on most FPC platforms using the _write once, compile anywhere_ principle.
5+Free Vision implements a full windowing system, where each window can be updated, moved and operated independently from other windows. It is implemented on top of the [[video unit|video]], [[keyboard unit|keyboard]] and [[mouse unit|mouse]] units and Free Vision applications can therefore run on most FPC platforms using the _write once, compile anywhere_ principle.
186
197The [[Textmode IDE|Free Pascal IDE]] uses Free Vision for its user interface. [[Textmode IDE development]] lists a simple object chart of IDE + FV objects.
208
219Free Vision is not 100% complete:
2210
2311 * the colorsel unit is missing, and the support to use it (palette support) might not be complete and/or debugged since the TV->FV transition in +/- 2000.
2412
2513**Availability:**
2614
2715 * Debian Linux: => install the package: [fp-units-fv](<http://packages.debian.org/hu/stable/fp-units-fv>)
2816 * Other distributions/OSes: Free Vision is included with the FPC source package.
2917
3018## To do list
3119
3220These items were written on a separate page, last edited May 2008:
3321
3422 * getting it fully up to speed and compatible with TV
3523 * endianness and 64-bit clean work.
3624 * filepaths to ansistring ? TP compat less of a problem nowadays. (copy to separate version if necessary?)
3725
3826## Unicode version
3927
4028Original Turbo Vision stored screen characters in 1-byte cells allowing only single byte code pages to be used (like 437, 866, 1251 etc), also did Free Vision. This is a serious limiting factor for use of Free Vision on modern systems. An [issue about Unicode support](<https://gitlab.com/freepascal.org/fpc/source/-/issues/21373>) presents in FPC bug tracker for a long time.
4129
4230As of February, 2022, adoption of Free Vision to Unicode has been merged into the FPC main branch. This branch has already been tested on Linux and Windows and considered stable at least on these two platforms.
4331
4432It requires FPC 3.1.1 or later, because it uses [[management operators]]. It uses them to store Unicode character cells in the enhanced video unit buffer. Each "character" on the screen is actually a unicode string, because it can contain several unicode code points, e.g. combining characters, etc. Management operators was used to avoid extra overhead of the unicode string (an extra heap block + reference count, etc) when a character cell is only a single unicode code point, which improves performance a lot with commonly used characters, such as ASCII, Cyrillic, etc, while still supporting languages with combining characters.
4533
4634[Instruction](<https://github.com/elfmz/far2l/issues/1255#issuecomment-1042898940>) on how to build Free Vision Unicode test app from sources on recent Ubuntu.
4735
4836**Supported features:**
4937
50381\. non-BMP characters
5139
52402\. East Asian (wide) character support
5341
54423\. combining characters
5543
56444\. fallback to legacy non-Unicode KVM drivers for operating systems that don't support Unicode
5745
58465\. backward compatibility FV units that use legacy codepages. All the unicode-enabled FV units have a 'U' prefix, i.e. 'UDrivers', 'UDialogs', 'UApp', etc. A lot of code sharing between the two sets of units (unicode and legacy) is achieved by using include files and ifdefs.
5947
60486\. unlimited string length in the new Unicode FV units (they're based on the UnicodeString type, which is UTF-16 and unlimited length). Legacy units still have shortstring limitations in certain places.
6149
6250Things **not planned** to be implemented for now (maybe later, after merging the branch):
6351
64521\. bidirectional text & right-to-left language support
6553
66542\. Arabic shaping
6755
6856Reason: author is entirely unfamiliar with right-to-left languages and also support in consoles is still rare and not very well standardized. However, the gnome-terminal now supports them, and the authors have proposed a [spec](<https://terminal-wg.pages.freedesktop.org/bidi/implementations.html>) for it, which hopefully may be adopted by other terminals also, so it should be possible to implement support for terminals that follow this spec. Any help, from people who know a right-to-left language, or have experience in implementing bidi text support is welcome.
6957
7058**Remaining things to be done:**
7159
72601\. Support the new Windows 10 console that supports non-BMP characters
7361
74622\. Port and test any remaining FV units and controls (most of them are probably ported, but the author might have left some unit out - look for FV units that don't have any Unicode versions with the 'U' prefix)
7563
76643\. Port and test other platforms, besides Windows and Linux
7765
78664\. [Port](<https://gitlab.com/freepascal.org/fpc/source/-/issues/40674>) the IDE to the new Unicode FV
7967
80685\. (not very important) Implement better handling of emoji width (e.g. currently the infamous U+1F4A9 character (💩) is double width, but is currently treated as single width, which results in broken rendering, so these kind of things should be handled properly in the EastAsianWidth unit)
8169
8270## Turbo Vision
8371
8472The Turbo Vision framework originates from Borland, and was delivered with the later incarnations on the Turbo range of compilers. There were two versions, a C++ one, and a Pascal one. The C++ was open sourced (PD) at some point, the Pascal didn't follow, which prompted FPC to search for an alternative.
8573
8674This was found in the shape of Free Vision, which (afaik) was a backport of the PD C++ code back to Pascal by Leon de Boer for use in graphics mode. As far as I can remember, Pierre and Peter backported the code back to textmode (coordinate system change that affected a lot of code!), ported missing parts, improved compatibility, and hooked it into the Textmode IDE. Note that the sf.net TVISION page falsely states that FPC uses Pascal sources donated by Borland, however it seems that nobody reacts to mails there.
8775
8876### Turbo Vision code bases
8977
9078There are currently a handful of Turbo Vision based codebases, all open source ones derived from the C++ version released by Borland.
9179
9280#### C++
9381
9482 * The C++ version as released by Borland (Public Domain). Unfortunately after all the mergers of Borland, the FTP server it was on is dead.
9583 * Possibly non free versions as delivered with Turbo C++ (and Object Vision?).
9684 * The SF.net C++ version, but it is GPL (a GPL library, which severely hampers usage).
9785 * Another alternative is an older C++ Turbo Vision version (BSD license) at [this homepage](<http://www.sigala.it/sergio/tvision/>).
9886 * There is also a modern alternative with support for C++17, UTF-8, etc., at this [GitHub repository](<https://github.com/magiblot/tvision>). This one is MIT licensed.
9987
10088#### Pascal
10189
10290 * The commercial versions packaged with Turbo Pascal compilers. These are still not open source in any form.
10391 * The (AFAIK heavily modified) Borland Pascal 7 version that was used for Virtual Pascal (not open).
10492 * Free Vision (LGPL license with linking exception). See above for details. Based on the C++ version.
10593 * Free Vision [adopted for UTF-8](<https://github.com/unxed/fv_utf8>).
10694 * Free Vision [Unicode adoption branch](<https://gitlab.com/freepascal.org/fpc/source/-/issues/21373#note_833019965>).
10795
10896## Problems on macOS
10997
11098User wrote: Unable to close Free Vision program on macOS, when Alt+X keyboard shortcut is pressed.
11199
112100FPC developer Jonas Maebe replied:
113101
114102Under native macOS programs, by default Option+key ("Option" is the name of the "Alt" key on macOS) is a way to enter a special character; Option/Alt is not mapped to Meta like on most other Unix platforms. If you want to map Option to Meta in Terminal, go to "Preferences -> Profiles -> Keyboard" and tick the "Use Option as Meta key" checkbox at the bottom.
115103
116104## Tutorial
117105
118106German (Deutsches) tutorial to Free Vision: [GitHub repo](<https://github.com/sechshelme/Lazarus-FreeVision-Tutorial>).
119107
120108The documentation of the individual components is available directly in the sources.
121109
122110---
123111*From the Free Pascal wiki, page "FVISION", as the Internet Archive kept it on 2025-12-20, last changed on 2024-08-22. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history