Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/terminal.h
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
* attributes, like colors. Right now term_char_t is composed as | * attributes, like colors. Right now term_char_t is composed as | ||||
* follows: | * follows: | ||||
* | * | ||||
* Bits Meaning | * Bits Meaning | ||||
* 0-20: Character value | * 0-20: Character value | ||||
* 21-25: Bold, underline, blink, reverse, right part of CJK fullwidth character | * 21-25: Bold, underline, blink, reverse, right part of CJK fullwidth character | ||||
* 26-28: Foreground color | * 26-28: Foreground color | ||||
* 29-31: Background color | * 29-31: Background color | ||||
* 32: Used by VT accessibility layer | |||||
* 33-63: Unused | |||||
*/ | */ | ||||
typedef uint32_t term_char_t; | typedef uint64_t term_char_t; | ||||
#define TCHAR_CHARACTER(c) ((c) & 0x1fffff) | #define TCHAR_CHARACTER(c) ((c) & 0x1fffff) | ||||
#define TCHAR_FORMAT(c) (((c) >> 21) & 0x1f) | #define TCHAR_FORMAT(c) (((c) >> 21) & 0x1f) | ||||
#define TCHAR_FGCOLOR(c) (((c) >> 26) & 0x7) | #define TCHAR_FGCOLOR(c) (((c) >> 26) & 0x7) | ||||
#define TCHAR_BGCOLOR(c) (((c) >> 29) & 0x7) | #define TCHAR_BGCOLOR(c) (((c) >> 29) & 0x7) | ||||
#define TCHAR_ACCESSIBILITY(c) (((c) >> 32) & 0x1) | |||||
/* bit used by VT accessibility layer */ | |||||
#define TACCESSIBILITY ((term_char_t)1 << 32) | |||||
typedef teken_attr_t term_attr_t; | typedef teken_attr_t term_attr_t; | ||||
typedef teken_color_t term_color_t; | typedef teken_color_t term_color_t; | ||||
#define TCOLOR_FG(c) (((c) & 0x7) << 26) | #define TCOLOR_FG(c) (((c) & 0x7) << 26) | ||||
#define TCOLOR_BG(c) (((c) & 0x7) << 29) | #define TCOLOR_BG(c) ((term_char_t)((c) & 0x7) << 29) | ||||
#define TCOLOR_LIGHT(c) ((c) | 0x8) | #define TCOLOR_LIGHT(c) ((c) | 0x8) | ||||
#define TCOLOR_DARK(c) ((c) & ~0x8) | #define TCOLOR_DARK(c) ((c) & ~0x8) | ||||
#define TFORMAT(c) (((c) & 0x1f) << 21) | #define TFORMAT(c) (((c) & 0x1f) << 21) | ||||
/* syscons(4) compatible color attributes for foreground text */ | /* syscons(4) compatible color attributes for foreground text */ | ||||
#define FG_BLACK TCOLOR_FG(TC_BLACK) | #define FG_BLACK TCOLOR_FG(TC_BLACK) | ||||
#define FG_BLUE TCOLOR_FG(TC_BLUE) | #define FG_BLUE TCOLOR_FG(TC_BLUE) | ||||
▲ Show 20 Lines • Show All 147 Lines • Show Last 20 Lines |