Add the file faq.md

This commit is contained in:
Markus Gans 2018-11-01 00:49:13 +01:00
parent 77ad698c45
commit 4afa988232
7 changed files with 161 additions and 55 deletions

View File

@ -11,7 +11,7 @@
*Class Reference:*<br /> *Class Reference:*<br />
&#160;&#160;&#160;&#160;&#160;[![documented](https://codedocs.xyz/gansm/finalcut.svg)](https://codedocs.xyz/gansm/finalcut/hierarchy.html) &#160;&#160;&#160;&#160;&#160;[![documented](https://codedocs.xyz/gansm/finalcut.svg)](https://codedocs.xyz/gansm/finalcut/hierarchy.html)
The Final Cut is a C++ class library and widget toolkit with full mouse 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 FINAL CUT is a C++ class library and widget toolkit with full mouse 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 C++ class design was inspired by the Qt framework. It provides common controls like dialog boxes, push buttons, check boxes, radio buttons, input lines, list boxes, status bars and so on. The C++ class design was inspired by the Qt framework. It provides common controls like dialog boxes, push buttons, check boxes, radio buttons, input lines, list boxes, status bars and so on.
### Installation ### Installation
@ -141,6 +141,7 @@ printf(...)
Class digramm Class digramm
------------- -------------
<pre style="line-height: 1 !important;"> <pre style="line-height: 1 !important;">
1┌──────────────┐ 1┌──────────────┐
┌-----------┤ FTermFreeBSD │ ┌-----------┤ FTermFreeBSD │

1
debian/control vendored
View File

@ -23,6 +23,7 @@ Depends:
, ${misc:Depends} , ${misc:Depends}
Suggests: Suggests:
coreutils coreutils
, ncurses-term
, grep , grep
, sed , sed
, vim-common , vim-common

101
doc/faq.md Normal file
View File

@ -0,0 +1,101 @@
Frequently Asked Questions
==========================
What is FINAL CUT?
------------------
The 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.
Are Windows and DOS supported by FINAL CUT?
-------------------------------------------
You need an operating system environment that implements a POSIX system
call API. This can be realized in Windows with the Cygwin project.
Is my platform supported?
-------------------------
The supported platforms are Linux, FreeBSD, NetBSD, OpenBSD, macOS,
Cygwin on Microsoft Windows and Oracle Solaris
What do I need to write my own programs with FINAL CUT?
-------------------------------------------------------
You need a C++ compiler like GCC (g++) or Clang (clang++).
What do I need to build this library?
-------------------------------------
You need three things:
1. C++ compiler like GCC (g++) or Clang (clang++).
2. The GNU building tools
*For example, in a Debian-based distribution it would be
the following packages:*
* autotools-dev
* automake
* autoconf
* autoconf-archive
* libtool
3. Development packages for 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
How to compile FINAL CUT without gpm support?
---------------------------------------------
```bash
./configure --without-gpm
```
What do I need to compile the unit tests?
-----------------------------------------
You need the unit testing framework CppUnit.
How can I fix display problems?
-------------------------------
* Make sure that the environment variable TERM has the right
terminal name.
* With the command "`msgcat --color=test`" you can test whether
the colors are displayed 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 problems, you can switch off
the color mapping with the parameter *--no-color-change*.

View File

@ -9,7 +9,7 @@ How to use the library
At the beginning of this introduction to the Final Cut At the beginning of this introduction to the Final Cut
we will start with a small example. we will start with a small example.
It creates an empty 30×10 character dialog. The following example creates an empty 30×10 character dialog.
**File:** *dialog.cpp* **File:** *dialog.cpp*
```cpp ```cpp
@ -49,12 +49,11 @@ All final cut programs must include the *final.h* header.
```cpp ```cpp
finalcut::FApplication app(argc, argv); finalcut::FApplication app(argc, argv);
``` ```
In this line creates the `finalcut::FApplication` object `app` with This line creates the `finalcut::FApplication` object `app` with
the command line arguments `argc` and `argv`. This object manages the command line arguments `argc` and `argv`. This object manages
the application main event loop. It receives keyboard and mouse events the application main event loop. It receives keyboard and mouse events
and sends them to the target widgets. Before widgets can be created, and sends them to the target widgets. You must create an application
an application object must be created! Only one `finalcut::FApplication` object before you can create a widgets object.
object should be created.
The next line The next line
```cpp ```cpp
@ -72,16 +71,16 @@ The title bar of the dialog box gets the text "A dialog".
```cpp ```cpp
dialog.setGeometry (25, 5, 30, 10); dialog.setGeometry (25, 5, 30, 10);
``` ```
The dialog window geometry is set to a width of 30 characters and The dialog window gets a width of 30 and a height of 10 characters.
a height of 10 characters. The window in the terminal is positioned The window in the terminal is located at the positions x=25 and
at the positions x=25 and y=5 (note: x=1 and y=1 represents the upper y=5 (note: x=1 and y=1 represents the upper left corner).
left corner).
```cpp ```cpp
app.setMainWidget(&dialog); app.setMainWidget(&dialog);
``` ```
The `dialog` object is selected as the main widget for the application. The `dialog` object was now selected as the main widget for the application.
When the user closes a main widget, the application will be closed. When you close the main widget, the entire application quits.
```cpp ```cpp
dialog.show(); dialog.show();

View File

@ -560,47 +560,6 @@ char* FOptiMove::moveCursor (int xold, int yold, int xnew, int ynew)
return 0; return 0;
} }
//----------------------------------------------------------------------
void FOptiMove::printDurations()
{
std::cout << " speed: "
<< baudrate << " baud\r\n";
std::cout << " char_duration: "
<< char_duration << " ms\r\n";
std::cout << " cursor_home: "
<< F_cursor_home.duration << " ms\r\n";
std::cout << " cursor_to_ll: "
<< F_cursor_to_ll.duration << " ms\r\n";
std::cout << " carriage_return: "
<< F_carriage_return.duration << " ms\r\n";
std::cout << " tab: "
<< F_tab.duration << " ms\r\n";
std::cout << " back_tab: "
<< F_back_tab.duration << " ms\r\n";
std::cout << " cursor_up: "
<< F_cursor_up.duration << " ms\r\n";
std::cout << " cursor_down: "
<< F_cursor_down.duration << " ms\r\n";
std::cout << " cursor_left: "
<< F_cursor_left.duration << " ms\r\n";
std::cout << " cursor_right: "
<< F_cursor_right.duration << " ms\r\n";
std::cout << " cursor_address: "
<< F_cursor_address.duration << " ms\r\n";
std::cout << " column_address: "
<< F_column_address.duration << " ms\r\n";
std::cout << " row_address: "
<< F_row_address.duration << " ms\r\n";
std::cout << " parm_up_cursor: "
<< F_parm_up_cursor.duration << " ms\r\n";
std::cout << " parm_down_cursor: "
<< F_parm_down_cursor.duration << " ms\r\n";
std::cout << " parm_left_cursor: "
<< F_parm_left_cursor.duration << " ms\r\n";
std::cout << "parm_right_cursor: "
<< F_parm_right_cursor.duration << " ms\r\n";
}
// private methods of FApplication // private methods of FApplication
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -403,7 +403,7 @@ char* FTerm::cursorsVisibility (bool on)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTerm::printMoveDurations() void FTerm::printMoveDurations()
{ {
opti_move->printDurations(); finalcut::printDurations(*opti_move);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -166,7 +166,6 @@ class FOptiMove
// Methods // Methods
void check_boundaries (int&, int&, int&, int&); void check_boundaries (int&, int&, int&, int&);
char* moveCursor (int, int, int, int); char* moveCursor (int, int, int, int);
void printDurations();
private: private:
// Constant // Constant
@ -208,6 +207,9 @@ class FOptiMove
bool isMethod5Faster (int&, int, int, int); bool isMethod5Faster (int&, int, int, int);
void moveByMethod (int, int, int, int, int); void moveByMethod (int, int, int, int, int);
// Friend function
friend void printDurations (const FOptiMove&);
// Data Members // Data Members
capability F_cursor_home; capability F_cursor_home;
capability F_carriage_return; capability F_carriage_return;
@ -336,6 +338,49 @@ inline void FOptiMove::set_auto_left_margin (const bool& bcap)
inline void FOptiMove::set_eat_newline_glitch (const bool& bcap) inline void FOptiMove::set_eat_newline_glitch (const bool& bcap)
{ eat_nl_glitch = bcap; } { eat_nl_glitch = bcap; }
// FOptiMove non-member function
//----------------------------------------------------------------------
inline void printDurations (const FOptiMove& om)
{
std::cout << " speed: "
<< om.baudrate << " baud\r\n";
std::cout << " char_duration: "
<< om.char_duration << " ms\r\n";
std::cout << " cursor_home: "
<< om.F_cursor_home.duration << " ms\r\n";
std::cout << " cursor_to_ll: "
<< om.F_cursor_to_ll.duration << " ms\r\n";
std::cout << " carriage_return: "
<< om.F_carriage_return.duration << " ms\r\n";
std::cout << " tab: "
<< om.F_tab.duration << " ms\r\n";
std::cout << " back_tab: "
<< om.F_back_tab.duration << " ms\r\n";
std::cout << " cursor_up: "
<< om.F_cursor_up.duration << " ms\r\n";
std::cout << " cursor_down: "
<< om.F_cursor_down.duration << " ms\r\n";
std::cout << " cursor_left: "
<< om.F_cursor_left.duration << " ms\r\n";
std::cout << " cursor_right: "
<< om.F_cursor_right.duration << " ms\r\n";
std::cout << " cursor_address: "
<< om.F_cursor_address.duration << " ms\r\n";
std::cout << " column_address: "
<< om.F_column_address.duration << " ms\r\n";
std::cout << " row_address: "
<< om.F_row_address.duration << " ms\r\n";
std::cout << " parm_up_cursor: "
<< om.F_parm_up_cursor.duration << " ms\r\n";
std::cout << " parm_down_cursor: "
<< om.F_parm_down_cursor.duration << " ms\r\n";
std::cout << " parm_left_cursor: "
<< om.F_parm_left_cursor.duration << " ms\r\n";
std::cout << "parm_right_cursor: "
<< om.F_parm_right_cursor.duration << " ms\r\n";
}
} // namespace finalcut } // namespace finalcut
#endif // FOPTIMOVE_H #endif // FOPTIMOVE_H