CNDP
22.08.0
|
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <cne_atomic.h>
#include <cne_common.h>
#include <cne_system.h>
#include <cne_tty.h>
Go to the source code of this file.
Macros | |
#define | COLOR_DEFAULT 0xc0dedead |
Typedefs | |
typedef uint8_t | vt_rgb_t |
Enumerations | |
enum | vt_color_e |
enum | vt_attr_e |
Functions | |
_s (vt_pos(int r, int c), tty_printf(vt100_pos, r, c)) _s(vt_top(void) | |
tty_printf (vt100_home)) _s(vt_home(void) | |
tty_printf (vt100_cursor_off)) _s(vt_con(void) | |
tty_printf (vt100_cursor_on)) _s(vt_turn_on(void) | |
tty_printf (vt100_save_cursor)) _s(vt_restore(void) | |
tty_printf (vt100_restore_cursor)) _s(vt_eol(void) | |
tty_printf (vt100_clr_eol)) _s(vt_cbl(void) | |
tty_printf (vt100_clear_left)) _s(vt_cel(void) | |
tty_printf (vt100_clear_line)) _s(vt_clw(void) | |
tty_printf (vt100_clr_eos)) _s(vt_clb(void) | |
tty_printf (vt100_clear_up)) _s(vt_cls(void) | |
tty_printf (vt100_clear_screen)) _s(vt_reverse(void) | |
tty_printf (ESC "[7m")) _s(vt_normal(void) | |
tty_printf (ESC "[0m")) _s(vt_scroll(int r) | |
tty_printf (vt100_scroll_up, r)) _s(vt_scroll_up(int r) | |
tty_printf (vt100_scroll_down, r)) _s(vt_nlines(int r) | |
tty_printf (vt100_move_down_nlines, r)) _s(vt_setw(int t) | |
tty_printf (vt100_setw, t)) _s(vt_cpos(void) | |
tty_printf (vt100_cursor_pos)) _s(vt_cup(int n) | |
tty_printf (vt100_up_lines, n)) _s(vt_cnright(int n) | |
tty_printf (vt100_right_columns, n)) _s(vt_cnleft(int n) | |
tty_printf (vt100_left_columns, n)) _s(vt_newline(void) | |
tty_printf (ESC "[20h")) _s(vt_cright(void) | |
tty_printf (vt100_right_arr)) _s(vt_cleft(void) | |
tty_printf (vt100_left_arr)) _s(vt_bol(void) | |
tty_printf ("\r")) static __inline__ void vt_make_space(int n) | |
static __inline__ void | vt_clr_line (int r) |
static __inline__ void | vt_eol_pos (int r, int c) |
static __inline__ int | vt_center_col (int16_t ncols, const char *msg) |
static __inline__ void | vt_erase (int16_t nrows) |
static __inline__ void | vt_repeat (int16_t r, int16_t c, const char *str, int cnt) |
static __inline__ void | vt_col_repeat (int16_t r, int16_t c, const char *str, int cnt) |
static __inline__ void | vt_fgcolor (vt_color_e color, vt_attr_e attr) |
static __inline__ void | vt_bgcolor (vt_color_e color, vt_attr_e attr) |
static __inline__ void | vt_fgbgcolor (vt_color_e fg, vt_color_e bg, vt_attr_e attr) |
static __inline__ void | vt_color (vt_color_e fg, vt_color_e bg, vt_attr_e attr) |
static __inline__ void | vt_rgb (uint8_t fg_bg, vt_rgb_t r, vt_rgb_t g, vt_rgb_t b) |
static __inline__ int | vt_fgcolor_str (char *str, int len, vt_color_e color, vt_attr_e attr) |
static __inline__ int | vt_bgcolor_str (char *str, int len, vt_color_e color, vt_attr_e attr) |
static __inline__ int | vt_attr_str (char *str, int len, vt_attr_e attr) |
static __inline__ int | vt_fgbgcolor_str (char *str, int len, vt_color_e fg, vt_color_e bg, vt_attr_e attr) |
static __inline__ int | vt_color_str (char *str, int len, vt_color_e fg, vt_color_e bg, vt_attr_e attr) |
static __inline__ int | vt_rgb_str (char *str, int len, uint8_t fg_bg, vt_rgb_t r, vt_rgb_t g, vt_rgb_t b) |
CNDP_API int | vt_color_parse (char *buff, int len) |
CNE cursor and color support for VT100 using ANSI color escape codes.
Definition in file vt100_out.h.
#define COLOR_DEFAULT 0xc0dedead |
Magic number to detect default color
Definition at line 446 of file vt100_out.h.
typedef uint8_t vt_rgb_t |
A single byte to hold lport of a Red/Green/Blue color value
Definition at line 34 of file vt100_out.h.
enum vt_color_e |
ANSI color codes zero based, need to add 30 or 40 for foreground or background color code
Definition at line 38 of file vt100_out.h.
enum vt_attr_e |
ANSI color codes zero based for attributes per color
Definition at line 1020 of file vt100_out.h.
_s | ( | vt_pos(int r, int c) | , |
tty_printf(vt100_pos, r, c) | |||
) |
position cursor to row and column Move cursor to the top left of the screen
tty_printf | ( | vt100_home | ) |
Move cursor to the Home position
Turn cursor off
tty_printf | ( | vt100_cursor_off | ) |
Turn cursor on
Display cursor
tty_printf | ( | vt100_cursor_on | ) |
Hide cursor
Save current cursor position
tty_printf | ( | vt100_save_cursor | ) |
Restore the saved cursor position
tty_printf | ( | vt100_restore_cursor | ) |
Clear from cursor to end of line
tty_printf | ( | vt100_clr_eol | ) |
Clear from cursor to beginning of line
tty_printf | ( | vt100_clear_left | ) |
Clear entire line
tty_printf | ( | vt100_clear_line | ) |
Clear from cursor to end of screen
tty_printf | ( | vt100_clr_eos | ) |
Clear from cursor to beginning of screen
tty_printf | ( | vt100_clear_up | ) |
Clear the screen, more cursor to home
tty_printf | ( | vt100_clear_screen | ) |
Start reverse video
tty_printf | ( | ESC "[7m" | ) |
Stop attribute like reverse and underscore
tty_printf | ( | ESC "[0m" | ) |
Scroll whole screen up r number of lines
tty_printf | ( | vt100_scroll_up | , |
r | |||
) |
Scroll whole screen up r number of lines
Scroll whole screen down r number of lines
tty_printf | ( | vt100_scroll_down | , |
r | |||
) |
Move down nlines plus move to column 1
tty_printf | ( | vt100_move_down_nlines | , |
r | |||
) |
Set window size, from to end of screen
tty_printf | ( | vt100_setw | , |
t | |||
) |
Cursor position report
tty_printf | ( | vt100_cursor_pos | ) |
Cursor up N lines
tty_printf | ( | vt100_up_lines | , |
n | |||
) |
Cursor move right n
characters
tty_printf | ( | vt100_right_columns | , |
n | |||
) |
Cursor move left n
characters
tty_printf | ( | vt100_left_columns | , |
n | |||
) |
New line
tty_printf | ( | ESC "[20h" | ) |
Move one character right
tty_printf | ( | vt100_right_arr | ) |
Move one character left
tty_printf | ( | vt100_left_arr | ) |
Move cursor to beginning of line
tty_printf | ( | "\r" | ) |
scroll or move the cursor down N number of rows
n | The number or rows to move the cursor using newlines |
Definition at line 1200 of file vt100_out.h.
|
static |
Position the cursor to a line and clear the entire line
r | The row number |
Definition at line 1223 of file vt100_out.h.
|
static |
Position cursor to row/column and clear to end of line
r | The row number |
c | The column number |
Definition at line 1238 of file vt100_out.h.
|
static |
Output a message of the current line centered
ncols | The number of columns to use for centering the text on a line |
msg | The message to center |
Definition at line 1255 of file vt100_out.h.
|
static |
Erase the screen by scrolling it off the display, then put cursor at the bottom
nrows | The number of rows to scroll the screen |
Definition at line 1271 of file vt100_out.h.
|
static |
Output a string at a row/column for a number of times
r | The row number |
c | The column number |
str | The string to output |
cnt | The number of times to output the string. |
Definition at line 1292 of file vt100_out.h.
|
static |
Output a column of strings at a given starting row for a given number of times
r | The row number |
c | The column number |
str | The string to output on each row |
cnt | The number of rows to write the at the given column |
Definition at line 1314 of file vt100_out.h.
|
static |
Set the foreground color + attribute at the current cursor position
color | The color identifier for the foreground color |
attr | The type of attribute to apply to the color or text string |
Definition at line 1333 of file vt100_out.h.
|
static |
Set the background color + attribute at the current cursor position
color | The color identifier for the background color |
attr | The type of attribute to apply to the color or text string |
Definition at line 1347 of file vt100_out.h.
|
static |
Set the foreground/background color + attribute at the current cursor position
fg | The color identifier for the foreground color |
bg | The color identifier for the background color |
attr | The type of attribute to apply to the color or text string |
Definition at line 1363 of file vt100_out.h.
|
static |
Main routine to set color for foreground and background and a attribute at the current position
fg | The color identifier for the foreground color, can be VT_NO_CHANGE |
bg | The color identifier for the background color, can be VT_NO_CHANGE |
attr | The type of attribute to apply to the color or text string |
Definition at line 1379 of file vt100_out.h.
Setup for 256 RGB color methods. A routine to output RGB color codes if supported
fg_bg | The combined fore/back ground color value |
r | The red color for RGB |
g | The green color for RGB |
b | The blue color for RGB |
Definition at line 1403 of file vt100_out.h.
|
static |
Set the foreground color + attribute at the current cursor position
str | The string to place the color vt100 bytes |
len | The number of bytes in the str pointer |
color | The color type for the foreground |
attr | The attribute of the string color |
Definition at line 1423 of file vt100_out.h.
|
static |
Set the background color + attribute at the current cursor position
str | The string to place the color vt100 bytes |
len | The number of bytes in the str pointer |
color | The color type for the background |
attr | The attribute of the string color |
Definition at line 1443 of file vt100_out.h.
|
static |
Set the attribute at the current cursor position
str | The string to place the color vt100 bytes |
len | The number of bytes in the str pointer |
attr | The attribute of the string color |
Definition at line 1461 of file vt100_out.h.
|
static |
Set the foreground/background color + attribute at the current cursor position
str | The string to place the color vt100 bytes |
len | The number of bytes in the str pointer |
fg | The color type for the foreground |
bg | The color type for the background |
attr | The attribute of the string color |
Definition at line 1483 of file vt100_out.h.
|
static |
Main routine to set color for foreground and background and attribute at the current position.
str | The string to place the color vt100 bytes |
len | The number of bytes in the str pointer |
fg | The color type for the foreground |
bg | The color type for the background |
attr | The attribute of the string color |
Definition at line 1506 of file vt100_out.h.
|
static |
Setup for 256 RGB color methods. A routine to output RGB color codes if supported
str | The string to place the color vt100 bytes |
len | The number of bytes in the str pointer |
fg_bg | The color type for the foreground/background |
r | The red color for RGB |
g | The green color for RGB |
b | The blue color for RGB |
Definition at line 1537 of file vt100_out.h.
CNDP_API int vt_color_parse | ( | char * | buff, |
int | len | ||
) |
Convert the buffer with color tuples into vt100 color codes.
buff | The buffer to parse for color tuples. |
len | The max length of the buffer, must be large enough to hold the output string. |