A window that emulates a character-mode terminal
PtWidget --> PtBasic --> PtContainer --> PtTerminal
For more information, see the diagram of the widget hierarchy.
<photon/PtTerm.h>
The PtTerminal class provides a text window emulating a character terminal.
A PtTerminal widget.
Characters can be sent to the terminal with the PtTerminalPutc(), PtTerminalPut() and PtTerminalPuts() functions, and keyboard input to the terminal is available with the Pt_CB_TERM_INPUT callback.
Other convenience functions and callbacks support the following kinds of user interaction:
PtTerminal uses some
Ctrl
-Alt
combinations for
cutting and pasting, changing font sizes, and so on, but
all Alt-key combinations that are defined for text mode
are passed to your text-mode application, provided that the
window manager lets PtTerminal see them.
The window manager intercepts certain Alt-key combinations unless you set Ph_WM_STATE_ISALTKEY in the Pt_ARG_WINDOW_STATE resource of the PtWindow that contains the PtTerminal. |
The main difference between PtTerminal and PtTty is that PtTerminal doesn't do any I/O for you. The only way to display characters in a PtTerminal is by giving them to one of the PtTerminalPut*() functions. Similarly, the only thing PtTerminal does with Photon input is translate function keys into text-mode compatible escape sequences and give the result to your Pt_CB_TERM_INPUT callback.
PtTty adds device I/O to that. The code that opens a pty, reads characters from it, and gives those characters to PtTerminalPut() is part of PtTty. Similarly, PtTty attaches a Pt_CB_TERM_INPUT callback that writes Photon keyboard input (translated by PtTerminal to text-mode compatible format) to the pty.
Another responsibility of PtTty is spawning a command for you and invoking the Pt_CB_TTY_TERMINATED callbacks when the command terminates.
Application programs set the Pt_ARG_TERM_FONT resource to set an explicit font name or the Pt_ARG_TERM_FONT_INDEX resource to choose a font from the list of supported fonts, Pt_ARG_TERM_FONT_LIST.
If the Pt_TERM_KBFONT bit is set in Pt_ARG_TERM_RESIZE_FL, the user can select a font using the keyboard:
The Pt_TERM_KBFORCE flag affects any resizing that occurs when the above keychords are used:
If the Pt_TERM_OPFONT flag is set, the font can be changed by escape sequences:
PtTerminal uses two 8-bit character sets:
In the ANSI mode, the internal character set can be used for display by setting one of the G0...G3 character sets to "the PC character set." The escape sequences that do it are:
ESC ( U ESC ) U ESC * U ESC + U
See the documentation for Dev.ansi in the QNX Utilities Reference.
By default, the internal character set is the PC character set ("IBM code page 437") and the ANSI character set is ISO 8859-1. PtTerminal lets you choose any 8-bit character sets - the only requirement is that they must be supersets of ASCII: PtTerminal translates only codes above 0x7F.
By default, PtTerminal assumes that the Photon font used for display is encoded using the internal character set (in particular, all the terminal fonts shipped with Photon use the PC character set rather than Unicode). The application can define an additional mapping; for example, it's possible to use a Unicode font to display any character sets in PtTerminal.
The Pt_ARG_TERM_CHARSETS resource stores the current character sets.
When the PtTerminalPut*() functions parse the output stream, certain escape sequences contained in the stream may cause resource changes that invoke callback functions. The callback functions shouldn't call any of the PtTerminalPut*() functions to output text to the same terminal widget that invoked the callback because the protocol engine function isn't reentrant. Recursion is allowed, but only when each of the nested calls outputs data to a different terminal widget. Otherwise, the PtTerminalPut*() functions return -1 to indicate an illegal call.
There are four groups of resources that affect a terminal widget's geometry:
A widget's dimensions can be calculated as long as terminal size, font size, and margins are known. Thus, whenever one of these resources is changed, another resource - or sometimes even two resources - must be adjusted too.
The return value of the function attached to the Pt_ARG_TERM_RESIZE_FUN resource (known as the resize function) determines how the widget is resized. The function is called with two output arguments: the first is a pointer to a string that describes which resource is changing and how, and the second is the value of widget's Pt_ARG_TERM_RESIZE_STR resource.
Each character in the string has a specific meaning. The first character is a resource identifier that describes which resource is changing:
The next series of characters provide the details, starting with the character x or y to specify direction (horizontal or vertical). The next character can be one of the following:
Character | Meaning |
---|---|
- | The value is decreasing. |
+ | The value is increasing. |
= | The value didn't change (used only when the size or margin is changing). |
Additional characters can be given to indicate resources that aren't sufficient alone to adjust the widget because these resources have limited values. An m means that the adjustment must involve a resource other than the margins, and an s means that the adjustment must involve a resource other than the terminal size.
The result of the "resize function" is a string specifying the order of the resources used in the adjustment process. The adjustment can be performed in both directions, but if the original resource change doesn't affect horizontal or vertical dimensions, only the affected direction is adjusted.
The resize function may either return a static string or use the buffer passed in the first argument. The buffer size is at least 10 bytes. A NULL pointer is equivalent to an empty string.
Each character in the adjustment string has a specific meaning:
For example, xsym would adjust the number of columns (xs) and the margin height (ym).
Before any adjustments specified by the string are done, Pt_ARG_TERM_MARGINS resource is reset to the Pt_ARG_MARGIN_HEIGHT and/or Pt_ARG_MARGIN_WIDTH values.
Adjusting the dimension is always successful, while adjusting size or margin isn't always sufficient - size is limited and must be a multiple of the font size, and margin must be nonnegative.
After the adjustments specified by the string are done, the dimension is adjusted to make sure that the new values are coherent. Thus, specifying a d is always superfluous and specifying anything after a d has no effect unless it specifies a different direction.
The default function uses only the resource identifier (i.e. D, M, S or F) given in the first argument. The function assumes that the Pt_ARG_TERM_RESIZE_STR resource string given in the second argument consists of segments delimited by colons.
Each of the segments consists of a list of letters that define resources, an equality symbol (=), and the string that's returned if the resource identifier matches one of the letters in the list.
The default value of the Pt_ARG_TERM_RESIZE_STR resource is D=sM:M=s, which means:
Other resources that may affect geometry are the size limits:
When a limit is being set to a value that makes the current size invalid, the current size is adjusted. If a minimum is set to a value larger than the corresponding maximum, then both the maximum and the current size are also set to this value.
The opposite is also true: if a maximum is changed, the corresponding minimum may be adjusted. This means that if you want to set the limits and size to arbitrary values regardless of their current values, the limits should be set before the size.
The minimum size (together with font and margins) determines also minimal values for the Pt_ARG_DIM resource. There is no upper limit for the dimensions because there is no upper limit for the Pt_ARG_TERM_MARGINS resource.
A PtSetResources() call for the Pt_ARG_TERM_CONSOLE resource works in a manner similar to the console_write() function.
First, the application should fill a PtTerminalConsoleWrite_t structure with data corresponding to arguments of the console_write() function. The pointer to the structure is the argument of the PtSetArg() macro. The PtSetResources() function transfers actual screen data from the buffer given by the application to the widget's screen buffer. Then a damage event is generated in order to display the new data. The function doesn't check whether offset and length given by the application don't exceed the size of the buffer.
A PtGetResources() call for the Pt_ARG_TERM_CONSOLE resource directly returns a pointer to the buffer. If the application wishes to get the contents of a specific fragment of the screen, it must calculate the offset to the desired position in the buffer and copy the data.
The Pt_ARG_TERM_COLOR_TABLE resource is an array used by the widget for mapping color numbers into Photon PgColor_t color values. Color numbers are indexes into this array. The default array has 16 elements corresponding to 16 standard CGA colors.
The Pt_ARG_FILL_COLOR (see PtBasic) defines the color of the margins.
The background color of the terminal defaults to black - or whatever the Pt_ARG_TERM_COLOR_TABLE resource defines as entry 0. If you want a different background color, you can either change the color table or set the background color by sending appropriate escape sequences to the terminal using PtTerminalPut() The latter is probably safer if the widget is a PtTty that will be running arbitrary programs in it; programs that use color might look odd if the colors in the color table differ from the default values too much.
The Pt_ARG_TERM_DRAW_MODES resource defines the widget's scrolling capability.
If characters are given to the PtTerminalPut() function in a large portion that consists of many lines that scroll through the terminal, the widget may attempt to optimize drawing speed.
Instead of blitting h-1 lines (where h is the height of the terminal in lines) and drawing the bottom line on each scroll, the widget blits h-n lines (if h-n is positive) and draws min(h,n) lines every n scrolls.
The limit for the actual value of n is determined by the Pt_ARG_BANDWIDTH_THRESHOLD (see PtBasic), Pt_ARG_TERM_SCROLL, and Pt_ARG_TERM_DRAW_MODES resources and by the current graphics bandwidth (see PhQuerySystemInfo() in the Photon Library Reference). If the connection is slow and the Pt_TERM_SCROLL_NOSPEEDCHK bit in Pt_ARG_TERM_CURSOR_FLAGS is clear, there's no limit for n. Otherwise, the maximal value of n is the value of the Pt_ARG_TERM_SCROLL resource.
Resource | C type | Pt type | Default |
---|---|---|---|
Pt_ARG_TERM_APP | PtTerminalAppState_t | Struct | See below |
Pt_ARG_TERM_CHARSETS | PtTerminalCsXlatData_t * | Pointer | See below |
Pt_ARG_TERM_COLOR_MODE | PtTerminalColorFunctions_t | Struct | Pt_TERM_COLOR_MODE |
Pt_ARG_TERM_COLOR_TABLE | PgColor_t[], short | Array | CGA colors, 16 |
Pt_ARG_TERM_COLS | short | Scalar | 80 |
Pt_ARG_TERM_CONSOLE | PtTerminalConsoleWrite_t | Complex | N/A |
Pt_ARG_TERM_CUR_COL | short | Scalar | 0 |
Pt_ARG_TERM_CUR_POS | PtTerminalRowCol_t | Struct | 0, 0 |
Pt_ARG_TERM_CUR_ROW | short | Scalar | 0 |
Pt_ARG_TERM_CURSOR_FLAGS | short | Flag | Pt_TERM_CURSOR_ON_FOCUS |
Pt_ARG_TERM_DRAW_MODES | unsigned char | Flag | Pt_TERM_SCROLL_RFSH |
Pt_ARG_TERM_FONT | char * | String | "pcterm14" |
Pt_ARG_TERM_FONT_INDEX | short | Scalar | -1 |
Pt_ARG_TERM_FONT_LIST | char **, short | Array | NULL, 0 |
Pt_ARG_TERM_FONT_SIZE | PhDim_t | Struct | Size of default font (read-only) |
Pt_ARG_TERM_MARGINS | PhRect_t | Struct | 0, 0, 0, 0 (read-only) |
Pt_ARG_TERM_MAXCOLS | short | Scalar | 1000 |
Pt_ARG_TERM_MAXROWS | short | Scalar | 1000 |
Pt_ARG_TERM_MAXSIZE | PtTerminalRowCol_t | Struct | 1000, 1000 |
Pt_ARG_TERM_MINCOLS | short | Scalar | 1 |
Pt_ARG_TERM_MINROWS | short | Scalar | 1 |
Pt_ARG_TERM_MINSIZE | PtTerminalRowCol_t | Struct | 1, 1 |
Pt_ARG_TERM_OPTIONS | unsigned long | Flag | 0x84380 |
Pt_ARG_TERM_OPTMASK | unsigned long | Flag | ~0uL |
Pt_ARG_TERM_PROTOCOL | int | Boolean | 1 |
Pt_ARG_TERM_RESIZE_FL | unsigned short | Flag | All defined flags |
Pt_ARG_TERM_RESIZE_FUN | See below | Pointer | Pointer to static function |
Pt_ARG_TERM_RESIZE_STR | char * | String | "DF=sM:M=s" |
Pt_ARG_TERM_ROWS | short | Scalar | 25 |
Pt_ARG_TERM_SCRLBK_COUNT | short | Scalar | 0 |
Pt_ARG_TERM_SCRLBK_LIMIT | short | Scalar | 0 |
Pt_ARG_TERM_SCRLBK_POS | short | Scalar | 0 |
Pt_ARG_TERM_SCROLL | short | Scalar | Pt_TERM_MAX_ROWS |
Pt_ARG_TERM_SELECTION | PtTerminalSelection_t | Struct | 0 |
Pt_ARG_TERM_SIZE | PtTerminalRowCol_t | Struct | 25, 80 |
Pt_ARG_TERM_VISUAL_BELL | short | Scalar | 20 |
Pt_CB_TERM_APP | PtCallback_t * | Link | NULL |
Pt_CB_TERM_FONT | PtCallback_t * | Link | NULL |
Pt_CB_TERM_INPUT | PtCallback_t * | Link | NULL |
Pt_CB_TERM_OPTIONS | PtCallback_t * | Link | NULL |
Pt_CB_TERM_RESIZE | PtCallback_t * | Link | NULL |
Pt_CB_TERM_RESIZED | PtCallback_t * | Link | NULL |
Pt_CB_TERM_SCRLBK | PtCallback_t * | Link | NULL |
C type | Pt type | Default |
---|---|---|
PtTerminalAppState_t | Struct | See below |
A structure containing the application window state, which is needed by the protocol engine (see the Pt_CB_TERM_APP callback). This structure also contains some other information that can be used by a terminal emulator, such as the window title, size, and position.
The PtTerminalAppState_t structure is defined as:
typedef struct Pt_terminal_app_state { struct PtTerminal_app_state_bins { /* Binary part - memcmp can be used for comparing */ unsigned version; PhArea_t area; PtTerminalRowCol_t size; unsigned iconic: 1, infront: 1; } b; /* Strings - guaranteed to never contain garbage after '\0' */ char title[ Pt_TERM_WSTRING_MAX + 1 ]; char l_msg[ Pt_TERM_WSTRING_MAX + 1 ]; char icon[ Pt_TERM_WSTRING_MAX + 1 ]; char reserved; } PtTerminalAppState_t;
Most of the members of this structure are present mainly for compatibility with QNX Windows. A text-mode program written for QNX Windows might use certain special escape sequences to set those values, and other special escape sequences to query those values. In pterm, the values are preserved (so your text-mode program sees the expected responses to escape sequences), but otherwise ignored because their original meaning is too specific to QNX Windows). The only exception is title - pterm uses it to set its window title.
If you have a text-mode program that needs more compatibility with the QNX Windows terminal emulator than pterm offers, you'll need to use the Pt_ARG_TERM_APP resource and the Pt_CB_TERM_APP callback.
The members are:
C type | Pt type | Default |
---|---|---|
PtTerminalCsXlatData_t * | Pointer | See below |
This resource handles the character set translation. It's a pointer to translation tables stored in a PtTerminalCsXlatData_t structure. The contents of the structure aren't defined in a public header - the only way to create a PtTerminalCsXlatData_t structure is by calling PtTerminalCreateCsXlat().
If you set Pt_ARG_TERM_CHARSETS to NULL, the widget calls PtTerminalCreateCsXlat() to create its own copy of the default translation tables. This copy is freed when you destroy the widget or set its Pt_ARG_TERM_CHARSETS resource to a non-NULL value.
PtTerminalCreateCsXlat() doesn't make a copy of the
PtTerminalCharsets_t structure passed to it,
and PtTerminal doesn't make a copy of
the PtTerminalCsXlatData_t structure when you set
Pt_ARG_TERM_CHARSETS.
Don't free these structures until they're no longer needed by any widget.
The PtTerminalCsXlatData_t structure created by PtTerminalCreateCsXlat() is placed in a single allocated block of memory. When it's no longer needed, you can simply free() it. |
C type | Pt type | Default |
---|---|---|
PtTerminalColorFunctions_t | Struct | Pt_TERM_COLOR_MODE |
A set of pointers to conversion functions, used internally by the widget.
C type | Pt type | Default |
---|---|---|
PgColor_t[], short | Array | CGA colors, 16 |
Color table used for display. Converts color numbers used internally to actual Photon color values. Color numbers are indexes into this array. The default array has 16 elements corresponding to 16 standard CGA colors:
Index | Color |
---|---|
0 | BLACK |
1 | BLUE |
2 | GREEN |
3 | CYAN |
4 | RED |
5 | MAGENTA |
6 | BROWN |
7 | WHITE (light grey) |
8 | BRIGHT BLACK (dark grey) |
9 | BRIGHT BLUE |
10 | BRIGHT GREEN |
11 | BRIGHT CYAN |
12 | BRIGHT RED |
13 | BRIGHT MAGENTA |
14 | BRIGHT BROWN (yellow) |
15 | BRIGHT WHITE |
C type | Pt type | Default |
---|---|---|
short | Scalar | 80 |
The number of character columns.
C type | Pt type | Default |
---|---|---|
PtTerminalConsoleWrite_t | Complex | N/A |
This resource can be used for accessing the "video memory" of the widget. For more information, see the "Console emulation" part of the "Description" section above.
C type | Pt type | Default |
---|---|---|
short | Scalar | 0 |
The column number of cursor position.
C type | Pt type | Default |
---|---|---|
PtTerminalRowCol_t | Struct | 0, 0 |
The cursor position. The PtTerminalRowCol_t structure contains the following members:
C type | Pt type | Default |
---|---|---|
short | Scalar | 0 |
The line number of cursor position.
C type | Pt type | Default |
---|---|---|
short | Flag | Pt_TERM_CURSOR_ON_FOCUS |
Flags affecting the cursor timer. Possible values are:
C type | Pt type | Default |
---|---|---|
unsigned char | Flag | Pt_TERM_SCROLL_RFSH |
The flags that determine scrolling optimization.
For more information, see the "Drawing and scrolling" part of the "Description" section above.
C type | Pt type | Default |
---|---|---|
char * | String | "pcterm14" |
The name of the font used for display. For more information, see the "Fonts" part of the "Description" section above.
PtTerminal works only with fixed-width fonts. It ignores any attempts to change to a proportional font. |
C type | Pt type | Default |
---|---|---|
short | Scalar | -1 |
Position of the current font on the font list, or -1 if the current font isn't on the list. Can be used to choose a font from the list, but cannot be explicitly set to -1.
C type | Pt type | Default |
---|---|---|
char **, short | Array | NULL, 0 |
List of fonts (an array of pointers to strings).
When this resource is being set, the meaning of the value argument of the PtSetArg() macro depends on whether the len argument is zero or nonzero:
C type | Pt type | Default |
---|---|---|
PhDim_t | Struct | Size of default font |
The dimensions of the font used for display.
C type | Pt type | Default |
---|---|---|
PhRect_t | Struct | 0, 0, 0, 0 |
The actual width and height of the widget's margins. These values are equal to or greater than values of Pt_ARG_MARGIN_WIDTH and Pt_ARG_MARGIN_HEIGHT resources. For more information, see the "Geometry" part of the "Description" section above.
C type | Pt type | Default |
---|---|---|
short | Scalar | 1000 |
The maximum number of character columns.
C type | Pt type | Default |
---|---|---|
short | Scalar | 1000 |
The maximum number of character rows.
C type | Pt type | Default |
---|---|---|
PtTerminalRowCol_t | Struct | 1000, 1000 |
Maximum screen size. The PtTerminalRowCol_t structure contains the following members:
C type | Pt type | Default |
---|---|---|
short | Scalar | 1 |
The minimum number of character columns.
C type | Pt type | Default |
---|---|---|
short | Scalar | 1 |
The minimum number of character rows.
C type | Pt type | Default |
---|---|---|
PtTerminalRowCol_t | Struct | 1, 1 |
Minimum screen size. The PtTerminalRowCol_t structure contains the following members:
C type | Pt type | Default |
---|---|---|
unsigned long | Flag | 0x84380 |
A set of flags that can be set or cleared by escape sequences. The flags are numbered from 1 to 32 (see <photon/PtTerm.h>). Some of them are handled by the widget, some others can be handled by the application.
C type | Pt type | Default |
---|---|---|
unsigned long | Flag | ~0uL |
A set of bits that correspond to those in Pt_ARG_TERM_OPTIONS. Clearing a bit in Pt_ARG_TERM_OPTMASK disables the escape sequence for the corresponding bit in Pt_ARG_TERM_OPTIONS
C type | Pt type | Default |
---|---|---|
short | Boolean | 1 |
The protocol:
C type | Pt type | Default |
---|---|---|
unsigned short | Flag | All defined flags |
Bit flags that affect terminal widget's resizing. Valid values are:
C type | Pt type | Default |
---|---|---|
See below | Pointer | Pointer to static function |
Pointer to a function used in geometry adjustments. The prototype is:
const char*(*)(char*, const char*)
For more information, see the "Geometry" part of the "Description" section above.
C type | Pt type | Default |
---|---|---|
char * | String | "DF=sM:M=s" |
A hint for the function used in geometry adjustments. For more information, see the "Geometry" part of the "Description" section above.
C type | Pt type | Default |
---|---|---|
short | Scalar | 25 |
The number of character rows.
C type | Pt type | Default |
---|---|---|
short | Scalar | 0 |
The current number of lines saved in the scrollback buffer.
C type | Pt type | Default |
---|---|---|
short | Scalar | 0 |
The maximum of number of lines saved in the scrollback buffer.
C type | Pt type | Default |
---|---|---|
short | Scalar | 0 |
The current position in the scrollback buffer (reset to zero on any output, including the Pt_ARG_TERM_CONSOLE resource).
C type | Pt type | Default |
---|---|---|
short | Scalar | Pt_TERM_MAX_ROWS |
The maximum number of scrolls that will be delayed. For more information, see the "Scrolling optimization" part of the "Description" section above.
C type | Pt type | Default |
---|---|---|
PtTerminalSelection_t | Struct | 0 |
The PtTerminalSelection_t structure contains at least the following members:
unsigned char type; unsigned char old_type; unsigned short flags; PtTerminalRowCol_t first, last;
where:
The following flags aren't stored in the widget but they tell the widget that the corresponding member of the structure shouldn't be modified:
C type | Pt type | Default |
---|---|---|
PtTerminalRowCol_t | Struct | 25, 80 |
Screen size, measured in characters. The PtTerminalRowCol_t structure contains the following members:
C type | Pt type | Default |
---|---|---|
short | Scalar | 20 |
Time, in milliseconds, of the screen flash when the ASCII BEL character ( Ctrl -G ) is received.
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of callbacks invoked whenever the Pt_ARG_TERM_APP resource changes, or a private escape sequence is received.
Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
There are four general sources of the Pt_CB_TERM_APP callback. They can be recognized by the values of the reason_subtype and cbdata fields:
The value of the reason_subtype field is the ASCII code of the character that indicates the escape sequence type, and the cbdata field points to the <string>.
These callbacks should return Pt_CONTINUE.
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of callbacks invoked after the font is changed. Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
These callbacks should return Pt_CONTINUE.
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of callbacks invoked when keyboard or mouse input is delivered to the widget. Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
The widget issues this callback on every keystroke unless both Ctrl and Alt modifiers are pressed.
When text is being pasted from the clipboard, the callback subtype is set to Pt_TERM_PASTE_INPUT if the buffer has been allocated with the malloc() function. A callback function can take over the responsibility for freeing the buffer by changing the subtype to Pt_TERM_PASTE_NF_INPUT.
These callbacks should return Pt_CONTINUE.
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of callbacks invoked whenever the Pt_ARG_TERM_OPTIONS resource changes. Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
These callbacks should return Pt_CONTINUE.
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of callbacks invoked when the terminal is about to change its size (number of rows and/or columns).
Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
The PtTerminalRowCol_t structure contains the following members:
This callback is issued whenever one of the Pt_ARG_TERM_SIZE, Pt_ARG_TERM_ROWS, or Pt_ARG_TERM_COLS resources is set, even if the new value is equal to the old value.
However, if a PtSetResources() call is issued with invalid size values (outside of limits defined by Pt_ARG_TERM_MINSIZE and Pt_ARG_TERM_MAXSIZE resources), the new size is validated before issuing the callback.
These callbacks should return Pt_CONTINUE.
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of callbacks invoked after the size is changed.
Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
The PtTerminalRowCol_t structure contains the following members:
This callback is issued whenever one of the Pt_ARG_TERM_SIZE, Pt_ARG_TERM_ROWS, or Pt_ARG_TERM_COLS resources is set, even if the new value is equal to the old value.
After an unsuccessful attempt to resize the terminal, the callback is issued with cbdata set to NULL.
This callback should return Pt_CONTINUE.
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of callbacks invoked whenever the Pt_ARG_TERM_SCRLBK_POS resource or the number of saved lines in the widget's buffer changes. Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
Functions invoked by this callback shouldn't set any of the widget's resources. |
These callbacks should return Pt_CONTINUE.
If the widget modifies an inherited resource, the "Default override" column indicates the new value. This modification affects any subclasses of the widget.
The threshold value for graphics bandwidth (as reported by PhQuerySystemInfo()) that defines a slow connection. For more information, see Pt_ARG_TERM_CURSOR_FLAGS and the "Scrolling optimization" part of the "Description" section.
The color of widget's margins. When set to Pt_INHERIT_COLOR, the widget draws margins using the "saved" fill color, which can be set to the current fill color using an escape sequence:
The PtTerminal widget defines several convenience functions and data structures that make it easier to use the terminal once it's been created. Here's a brief overview: