|
CX Framework
Cross-platform C utility framework
|
Typedefs | |
| typedef enum ConEraseMode | ConEraseMode |
| Which portion of a line or screen to erase, relative to the current cursor position. | |
Enumerations | |
| enum | ConEraseMode { CON_EraseToEnd , CON_EraseToStart , CON_EraseAll } |
| Which portion of a line or screen to erase, relative to the current cursor position. More... | |
Functions | |
| bool | conSetCursor (ConStream *con, uint16 row, uint16 col) |
| bool | conMoveCursor (ConStream *con, int16 drow, int16 dcol) |
| bool | conGetCursor (ConStream *con, uint16 *row, uint16 *col) |
| bool | conShowCursor (ConStream *con, bool show) |
| bool | conSaveCursor (ConStream *con) |
| bool | conRestoreCursor (ConStream *con) |
| bool | conEraseLine (ConStream *con, ConEraseMode mode) |
| bool | conEraseScreen (ConStream *con, ConEraseMode mode) |
| bool | conScroll (ConStream *con, int16 lines) |
| bool | conAltScreen (ConStream *con, bool enable) |
| enum ConEraseMode |
Which portion of a line or screen to erase, relative to the current cursor position.
| Enumerator | |
|---|---|
| CON_EraseToEnd | From the cursor to the end of the line/screen. |
| CON_EraseToStart | From the start of the line/screen to the cursor. |
| CON_EraseAll | The entire line/screen. |
Definition at line 15 of file concursor.h.
| bool conAltScreen | ( | ConStream * | con, |
| bool | enable | ||
| ) |
Switches to (or back from) the terminal's alternate screen buffer, if available (see ConCaps::altscreen). Only ever available under VT – the legacy Windows console has no equivalent, so this always fails there.
| con | Destination stream |
| enable | true to switch to the alternate screen, false to switch back |
| bool conEraseLine | ( | ConStream * | con, |
| ConEraseMode | mode | ||
| ) |
Erases part or all of the current line. The cursor position does not change.
| con | Destination stream |
| mode | Which portion of the line to erase |
| bool conEraseScreen | ( | ConStream * | con, |
| ConEraseMode | mode | ||
| ) |
Erases part or all of the screen. The cursor position does not change.
| con | Destination stream |
| mode | Which portion of the screen to erase |
| bool conGetCursor | ( | ConStream * | con, |
| uint16 * | row, | ||
| uint16 * | col | ||
| ) |
Reports the cursor's current absolute position.
Only available when ConCaps::cursorquery is true – querying position under VT would require sending a DSR request and reading the reply from stdin, racing with any other input consumer and potentially hanging against a terminal that never answers, so this module never attempts it. Use conSaveCursor()/conRestoreCursor() instead, which is what most callers actually need and works under VT too.
| con | Stream to query |
| row | Receives the 0-based row |
| col | Receives the 0-based column |
| bool conMoveCursor | ( | ConStream * | con, |
| int16 | drow, | ||
| int16 | dcol | ||
| ) |
Moves the cursor relative to its current position. Positive drow moves down, positive dcol moves right; either may be negative.
On a stream without ConCaps::cursorquery (most VT terminals), this still works even though conGetCursor() would fail – moving relative to the current position doesn't require knowing what that position is.
| con | Destination stream |
| drow | Rows to move (negative moves up) |
| dcol | Columns to move (negative moves left) |
| bool conRestoreCursor | ( | ConStream * | con | ) |
Restores the cursor position most recently saved with conSaveCursor(). A no-op returning false if nothing has been saved.
| con | Stream to restore |
| bool conSaveCursor | ( | ConStream * | con | ) |
Saves the current cursor position for a later conRestoreCursor().
Only one position is remembered at a time; a second conSaveCursor() before a matching conRestoreCursor() overwrites the first.
| con | Stream whose cursor position to save |
| bool conScroll | ( | ConStream * | con, |
| int16 | lines | ||
| ) |
Scrolls the screen content. Positive lines scrolls up, revealing blank lines at the bottom; negative scrolls down, revealing blank lines at the top. The cursor position does not change.
| con | Destination stream |
| lines | Number of lines to scroll (negative scrolls down) |
| bool conSetCursor | ( | ConStream * | con, |
| uint16 | row, | ||
| uint16 | col | ||
| ) |
Moves the cursor to an absolute position.
A no-op returning false if the stream has no cursor capability (see ConCaps::cursor).
| con | Destination stream |
| row | 0-based row |
| col | 0-based column |
| bool conShowCursor | ( | ConStream * | con, |
| bool | show | ||
| ) |
Shows or hides the cursor.
| con | Destination stream |
| show | true to show, false to hide |