Class TermAPI
#include <TermAPI.h >
This class is used by other apps to send messages to the term channel.
Use this interface instead of sending messages directly to ensure message keywords are spelled correctly, all parameters are specified, and error checked.
The receiving app defined this interface to ensure it receives the messages correctly.
UserDevice& device |
the user's terminal device |
const string& name |
the screen name |
int rows |
the number of lines on screen (default: 25) Default value: 25 |
int width |
the character width of screen (default: 80) Default value: 80 |
const string& termtype |
the terminal type to emulate (default: xterm), e.g. h19, vt100, ansi, c64 Default value: "xterm" |
Create a screen on the user's device for screen output.
Return value: true if sent
UserDevice& device |
the user's terminal device |
Redraw the teriminal window.
Return value: true if sent
UserDevice& device |
the user's terminal device |
int c |
the character to print |
Send a single character to the terminal.
Return value: true if sent
UserDevice& device |
the user's terminal device |
const string& text |
a string of characters |
Send a string of characters to the terminal.
Return value: true if sent
UserDevice& device |
the user's terminal device |
int y |
the screen row, e.g. 1, 2, ... 25 |
int x |
the screen column, e.g. 1, 2, ... 80 |
Move the cursor to the screen location specified by (x, y). The next printable character will appear there.
Return value: true if sent
UserDevice& device |
the user's terminal device (with the region set to the terminal name) |
int c |
the character to print |
const string& module |
the channel where the app is running |
Send a single character back to the app running in the terminal.
Return value: true if sent
UserDevice& device |
the user's terminal device (with the region set to the terminal name) |
const string& text |
a string of characters |
const string& module |
the channel where the app is running |
Send a string of characters back to the app running in the terminal.
Return value: true if sent
UserDevice& device |
the user's terminal device (with the region set to the terminal name) |
const string& termtype |
the new terminal type, e.g. xterm, h19, vt100, ansi, c64 |
const string& module |
the channel where the app is running |
Sometimes, a terminal can switch to a different terminal type mode. When that happens, termgw reports back to the controlling app with the new terminal type.
Return value: true if sent
UserDevice& device |
the user's terminal device |
const string& termType |
the terminal type, e.g. xterm, h19, vt100, ansi, c64 Default value: "xterm" |
Set the terminal type for emulation. Different terminal types use different character sequences to mean bold, color, etc. Set this value to the environment TERM variable or align it with the terminal output of the running app. Note the currently supported terminal types: xterm.
For xterm codes, see https://www.xfree86.org/current/ctlseqs.html.
Return value: true if sent
UserDevice& device |
the user's terminal device |
const string& mode |
the new bold mode - on, off, or toggle Default value: "toggle" |
Change text mode to display in bold.
Return value: true if sent
UserDevice& device |
the user's terminal device |
const string& mode |
the new underline mode - on, off, or toggle Default value: "toggle" |
Change text mode to display in underline.
Return value: true if sent
UserDevice& device |
the user's terminal device |
const string& mode |
the new reverse mode - on, off, or toggle Default value: "toggle" |
Change text mode to display in reverse.
Return value: true if sent
UserDevice& device |
the user's terminal device |
const string& mode |
the new blinking mode - on, off, or toggle Default value: "toggle" |
Change text mode to display in blinking.
Return value: true if sent
UserDevice& device |
the user's terminal device |
const string& newcolor |
valid colors are black, red, green, yellow, blue, magenta, cyan, white (default) Default value: "default" |
Change color of text being displayed.
Return value: true if sent
UserDevice& device |
the user's terminal device |
const string& area |
all, above, below, left, right |
Clear an area of the terminal screen based upon the value of parameter area.
Return value: true if sent
UserDevice& device |
the user's terminal device |
int y |
the screen row to delete, e.g. 1, 2, ... 25 |
int amount |
Default value: 1 |
Delete a screen line. Screen scrolls up to fill deleted line.
Return value: true if sent
UserDevice& device |
the user's terminal device |
int y |
the screen row to delete, e.g. 1, 2, ... 25 |
int amount |
Default value: 1 |
Insert a line into the screen. Screen scrolls down to fill deleted line.
Return value: true if sent
UserDevice& device |
the user's terminal device |
int y |
the screen row of character to delete, e.g. 1, 2, ... 25 |
int x |
the screen column of character to delete, e.g. 1, 2, ... 80 |
int amount |
Default value: 1 |
Delete a character from the screen. Screen scrolls left to fill deleted character.
Return value: true if sent
UserDevice& device |
the user's terminal device |
int y |
the screen row of character to delete, e.g. 1, 2, ... 25 |
int x |
the screen column of character to delete, e.g. 1, 2, ... 80 |
int c |
the character to instert Default value: ' ' |
int amount |
Default value: 1 |
Insert a character into the screen. Screen scrolls right to make room for inserted character.
Return value: true if sent
UserDevice& device |
the user's terminal device |
int y1 |
the upper left screen row of box to be filled |
int x1 |
the upper left screen column of box to be filled |
int y2 |
the lower right screen row of box to be filled |
int x2 |
the lower right screen column of box to be filled |
int c |
the fill character Default value: ' ' |
Fill a region of the screen with the character provided.
Return value: true if sent
UserDevice& device |
the user's terminal device |
int y1 |
the upper left screen row of box to be filled |
int x1 |
the upper left screen column of box to be filled |
int y2 |
the lower right screen row of box to be filled |
int x2 |
the lower right screen column of box to be filled |
int yt |
the new upper left corner of the box |
int xt |
the new upper left corner of the box |
int c |
the fill character of the old box; 0 means no fill |
Move the characters from a box on the screen to a a new location, filling in the old box with the fill charactger provided.
Return value: true if sent
UserDevice& device |
the user's terminal device |
const string& direction |
can be: up, down, left, right, home |
int amount |
number of lines/columns to move in that direction (ignored for home) Default value: 1 |
Move the cursor a certain amount in the specified direction.
Return value: true if sent
const string& request |
the request keyword |
const XMLData& params |
the data (parameter payload) Default value: XMLData("") |
const string& channel |
override where message is sent (default: term) Default value: "term" |
Send an API message to channel term.