Class UserTerm
#include <UserTerm.h >
Super class: UserDevice
Interface to a virtual terminal. Virtual terminals are managed by TermGW via TermAPI and displayed to the user's device.
If your application generates text and needs to manage the display of that text - it's location, character attributes, etc - then this interface abstracts all that; this interface works with any video terminal type.
const string& device |
a string representation of the user's device, e.g. UserDevice.toString() Default value: "" |
Construct a virtual terminal with an optional id.
const UserDevice& device |
the end-user's device; note that the region here is where the terminal will be displayed |
const string& screenName |
the application-specific keyword to use for this terminal; if multiple terminals are displayed to the user, this keyword differentiates them |
const string& terminalType |
if important to your application, specify here, otherwise it's xterm; see TermAPI for supported terminals Default value: "xterm" |
Setup a virtual terminal display on the user's device.
Return value: an instance of UserTerm to connect to the virtual terminal
const string& screenName |
the application-specific keyword to use for this terminal; if multiple terminals are displayed to the user, this keyword differentiates them |
Setup a virtual terminal display on the user's device.
Get the screen name for this virtual terminal
Return value: virtual terminal screen name
UserDevice& device |
end user's device |
Specify the user device for this virtual terminal.
This needs to be done before calling create(). If called after create(), communication with the virtual terminal may be broken - if it's pointing to the wrong user device region.
Query the end user's device
Return value: end user's device
int c |
the caracter to send |
Send a character to the terminal
Return value: the character upon success, 0 upon failure
const string& text |
the text to display to the terminal |
Send some text to the virtual terminal.
Return value: true if directive sent successfully, false if not
const string& termType |
this tells the virtual terminal emulator what capabilities the video terminal has; also, if you send any escape sequences, it knows how to interpret them Default value: "xterm" |
Set the terminal type.
Return value: true if directive sent successfully, false if not
Tell the virtual terminal to redraw its terminal image.
Return value: true if directive sent successfully, false if not
Sound the terminal bell.
Return value: true if directive sent successfully, false if not
Tab the cursor to the right to the next tab stop.
Return value: true if directive sent successfully, false if not
int y |
cursor row, from 1+ |
int x |
cursor column, from 1+ |
Set the cursor position to the coordinates given.
Return value: true if directive sent successfully, false if not
const string& mode |
on, off, or toggle Default value: "toggle" |
Turn on, off, or toggle bold mode.
Return value: true if directive sent successfully, false if not
Turn on bold mode.
Return value: true if directive sent successfully, false if not
Turn off bold mode.
Return value: true if directive sent successfully, false if not
const string& mode |
on, off, or toggle Default value: "toggle" |
Turn on, off, or toggle underline mode.
Return value: true if directive sent successfully, false if not
Turn on underline mode.
Return value: true if directive sent successfully, false if not
Turn off underline mode.
Return value: true if directive sent successfully, false if not
const string& mode |
on, off, or toggle Default value: "toggle" |
Turn on, off, or toggle reverse video mode.
Return value: true if directive sent successfully, false if not
Turn on reverse video mode.
Return value: true if directive sent successfully, false if not
Turn off reverse video mode.
Return value: true if directive sent successfully, false if not
const string& mode |
on, off, or toggle Default value: "toggle" |
Turn on, off, or toggle character blinking/flashing mode.
Return value: true if directive sent successfully, false if not
Turn on blinking mode.
Return value: true if directive sent successfully, false if not
Turn off blinking mode.
Return value: true if directive sent successfully, false if not
const string& defaultColor |
color name, e.g. black, red, green, yellow, blue, magenta, cyan, white (default) |
Set the character attribute to the specified color. Characters printed after this will be of that color.
Return value: true if directive sent successfully, false if not
Set character attribute color to black. Characters printed after this will be of that color.
Return value: true if directive sent successfully, false if not
Set character attribute color to red. Characters printed after this will be of that color.
Return value: true if directive sent successfully, false if not
Set character attribute color to green. Characters printed after this will be of that color.
Return value: true if directive sent successfully, false if not
Set character attribute color to yellow. Characters printed after this will be of that color.
Return value: true if directive sent successfully, false if not
Set character attribute color to blue. Characters printed after this will be of that color.
Return value: true if directive sent successfully, false if not
Set character attribute color to magenta. Characters printed after this will be of that color.
Return value: true if directive sent successfully, false if not
Set character attribute color to cyan. Characters printed after this will be of that color.
Return value: true if directive sent successfully, false if not
Set character attribute color to white. Characters printed after this will be of that color.
Return value: true if directive sent successfully, false if not
Reset all the character attributes back to default.
Return value: true if directive sent successfully, false if not
const string& area |
identify area by name, e.g. all, above, below, left, right, line, toptohere, heretoend, last Default value: "all" |
Clear a region of the screen with respect to the cursor
Return value: true if directive sent successfully, false if not
int y |
the row to delete, from 1+ |
Delete the screen row. Rows below it will scroll up to fill in the deleted line
Return value: true if directive sent successfully, false if not
int y |
the row to delete, from 1+ |
Insert a blank row at screen row. Rows below it will scroll down to make room
Return value: true if directive sent successfully, false if not
Delete the character at the cursor. Characters to the right will scroll left one character.
Return value: true if directive sent successfully, false if note
int x |
the column of character to delete, from 1+ |
Delete the character at the column specified. Characters to the right will scroll left one character.
Return value: true if directive sent successfully, false if note
int y |
the row of the character to delete, from 1+ |
int x |
the column of character to delete, from 1+ |
Delete the character at the row and column specified. Characters to the right will scroll left one character.
Return value: true if directive sent successfully, false if note
int c |
the character to insert Default value: ' ' |
Insert a character at the cursor. Characters to the right will scroll right one character
Return value: true if directive sent successfully, false if note
int x |
the column of character to insert, from 1+ |
int c |
the character to insert Default value: ' ' |
Insert a character at the column specified. Characters to the right will scroll right one character.
Return value: true if directive sent successfully, false if note
int y |
the row of the character to insert, from 1+ |
int x |
the column of character to insert, from 1+ |
int c |
the character to insert Default value: ' ' |
Insert a character at the row and column specified. Characters to the right will scroll right one character.
Return value: true if directive sent successfully, false if note
int y1 |
row of corner 1, from 1+ |
int x1 |
column of corner 1, from 1+ |
int y2 |
row of corner 2, from 1+ |
int x2 |
column of corner 2, from 1+ |
Clear an area of the screen specified by the two corners provided.
Return value: true if directive sent successfully, false if note
int y1 |
row of corner 1, from 1+ |
int x1 |
column of corner 1, from 1+ |
int y2 |
row of corner 2, from 1+ |
int x2 |
column of corner 2, from 1+ |
int c |
the character to fill Default value: ' ' |
Fill an area of the screen specified by the two corners provided with the character provided.
Return value: true if directive sent successfully, false if note
int y1 |
row of corner 1, from 1+ |
int x1 |
column of corner 1, from 1+ |
int y2 |
row of corner 2, from 1+ |
int x2 |
column of corner 2, from 1+ |
int yt |
row of target upper corner, from 1+ |
int xt |
column of target left corner, from 1+ |
int c |
the character to fill in the old area Default value: 0 |
Move text from an area of the screen specified by the two corners provided to a new target spot (upper left corner prividd).
Return value: true if directive sent successfully, false if note
const string& direction |
direction to move cursor, e.g. up, down, left, right, home |
int amount |
number of columns or rows to move Default value: 1 |
Move the cursor in the specified direction the specified amount
Return value: true if directive sent successfully, false if not (or if invalid direction)
Move the cursor to the home position, (1,1).
Return value: true if directive sent successfully, false if not
int amount |
number of rows to move Default value: 1 |
Move the cursor upward the specified amount.
Return value: true if directive sent successfully, false if not
int amount |
number of rows to move Default value: 1 |
Move the cursor downward the specified amount.
Return value: true if directive sent successfully, false if not
int amount |
number of columns to move Default value: 1 |
Move the cursor to the right the specified amount.
Return value: true if directive sent successfully, false if not
int amount |
number of columns to move Default value: 1 |
Move the cursor to the right the specified amount.
Return value: true if directive sent successfully, false if not
Future feature. Query the terminal's row.
This may not be the actual row; this is UserTerm's estimation of where the cursor row is.
Return value: terminal row of cursor
Future feature. Query the terminal's column
This may not be the actual column; this is UserTerm's estimation of where the cursor column is.
Return value: terminal column of cursor
string name |
virtual terminal screen name |
string termType |
terminal type of virtual terminal, e.g. xterm |
bool stable |
Flag: (unused) have any attributes been sent to video terminal |
int x |
Cursor location (column, row) |
int y |
Cursor location (column, row) |
int rows |
Size of video terminal |
int columns |
Size of video terminal |
string _bold |
Character attribute flags |
string _underline |
Character attribute flags |
string _reverse |
Character attribute flags |
string _blinking |
Character attribute flags |
string _color |
Character attribute flags |
bool yxonly |
true to only reset cursor position; false to reset character attribute state, too Default value: true |
Clear video terminal state. Cursor location and character attributes are typically tracked.