1 /*
2  * Copyright (c) 2018 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 #ifndef SHELL_TYPES_H__
7 #define SHELL_TYPES_H__
8 
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 enum shell_vt100_color {
15 	SHELL_VT100_COLOR_DEFAULT,
16 	SHELL_VT100_COLOR_BLACK,
17 	SHELL_VT100_COLOR_RED,
18 	SHELL_VT100_COLOR_GREEN,
19 	SHELL_VT100_COLOR_YELLOW,
20 	SHELL_VT100_COLOR_BLUE,
21 	SHELL_VT100_COLOR_MAGENTA,
22 	SHELL_VT100_COLOR_CYAN,
23 	SHELL_VT100_COLOR_WHITE,
24 
25 	VT100_COLOR_END
26 };
27 
28 struct shell_vt100_colors {
29 	enum shell_vt100_color col; /* Text color. */
30 	enum shell_vt100_color bgcol; /* Background color. */
31 };
32 
33 struct shell_multiline_cons {
34 	uint16_t cur_x;     /* horizontal cursor position in edited command line.*/
35 	uint16_t cur_x_end; /* horizontal cursor position at the end of command.*/
36 	uint16_t cur_y;     /* vertical cursor position in edited command.*/
37 	uint16_t cur_y_end; /* vertical cursor position at the end of command.*/
38 	uint16_t terminal_hei; /* terminal screen height.*/
39 	uint16_t terminal_wid; /* terminal screen width.*/
40 	uint8_t name_len;   /*!<console name length.*/
41 };
42 
43 struct shell_vt100_ctx {
44 	struct shell_multiline_cons cons;
45 	struct shell_vt100_colors col;
46 	uint16_t printed_cmd;  /* printed commands counter */
47 };
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif /* SHELL_TYPES_H__ */
54