LibVT: Shave down VT::Attribute from 8 bytes to 3 bytes

We have one of these per character in the terminal buffers, so it's a
decent haircut. :^)
This commit is contained in:
Andreas Kling 2019-08-13 12:59:58 +02:00
parent 4fb02c78a9
commit ca9592d56f
Notes: sideshowbarker 2024-07-19 12:42:21 +09:00
2 changed files with 4 additions and 7 deletions

View File

@ -3,9 +3,6 @@
namespace VT {
u8 Attribute::default_foreground_color = 7;
u8 Attribute::default_background_color = 0;
Terminal::Terminal(TerminalClient& client)
: m_client(client)
{

View File

@ -19,8 +19,8 @@ public:
struct Attribute {
Attribute() { reset(); }
static u8 default_foreground_color;
static u8 default_background_color;
static const u8 default_foreground_color = 7;
static const u8 default_background_color = 0;
void reset()
{
@ -31,7 +31,7 @@ struct Attribute {
u8 foreground_color;
u8 background_color;
enum Flags {
enum Flags : u8 {
NoAttributes = 0x00,
Bold = 0x01,
Italic = 0x02,
@ -45,7 +45,7 @@ struct Attribute {
// TODO: it would be really nice if we had a helper for enums that
// exposed bit ops for class enums...
int flags = Flags::NoAttributes;
u8 flags = Flags::NoAttributes;
bool operator==(const Attribute& other) const
{