1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:57:46 +00:00

Terminal: Fix some missing text attributes

Probably doesn't actually change much yet since we don't support many
text rendering options, but it's at least good to have the options, and
to record things we don't yet support too.
This commit is contained in:
Robin Burchell 2019-05-29 21:10:08 +02:00 committed by Andreas Kling
parent 96db775ac1
commit 004a630bfe
2 changed files with 66 additions and 7 deletions

View file

@ -77,18 +77,35 @@ private:
struct Attribute {
Attribute() { reset(); }
static byte default_foreground_color;
static byte default_background_color;
void reset()
{
foreground_color = 7;
background_color = 0;
//bold = false;
foreground_color = default_foreground_color;
background_color = default_background_color;
flags = Flags::NoAttributes;
}
byte foreground_color;
byte background_color;
//bool bold : 1;
enum Flags {
NoAttributes = 0x00,
Bold = 0x01,
Italic = 0x02,
Underline = 0x04,
Negative = 0x08,
Blink = 0x10,
};
// TODO: it would be really nice if we had a helper for enums that
// exposed bit ops for class enums...
int flags = Flags::NoAttributes;
bool operator==(const Attribute& other) const
{
return foreground_color == other.foreground_color && background_color == other.background_color;
return foreground_color == other.foreground_color && background_color == other.background_color && flags == other.flags;
}
bool operator!=(const Attribute& other) const
{