mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 01:59:14 +03:00
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:
parent
4fb02c78a9
commit
ca9592d56f
Notes:
sideshowbarker
2024-07-19 12:42:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ca9592d56ff
@ -3,9 +3,6 @@
|
|||||||
|
|
||||||
namespace VT {
|
namespace VT {
|
||||||
|
|
||||||
u8 Attribute::default_foreground_color = 7;
|
|
||||||
u8 Attribute::default_background_color = 0;
|
|
||||||
|
|
||||||
Terminal::Terminal(TerminalClient& client)
|
Terminal::Terminal(TerminalClient& client)
|
||||||
: m_client(client)
|
: m_client(client)
|
||||||
{
|
{
|
||||||
|
@ -19,8 +19,8 @@ public:
|
|||||||
struct Attribute {
|
struct Attribute {
|
||||||
Attribute() { reset(); }
|
Attribute() { reset(); }
|
||||||
|
|
||||||
static u8 default_foreground_color;
|
static const u8 default_foreground_color = 7;
|
||||||
static u8 default_background_color;
|
static const u8 default_background_color = 0;
|
||||||
|
|
||||||
void reset()
|
void reset()
|
||||||
{
|
{
|
||||||
@ -31,7 +31,7 @@ struct Attribute {
|
|||||||
u8 foreground_color;
|
u8 foreground_color;
|
||||||
u8 background_color;
|
u8 background_color;
|
||||||
|
|
||||||
enum Flags {
|
enum Flags : u8 {
|
||||||
NoAttributes = 0x00,
|
NoAttributes = 0x00,
|
||||||
Bold = 0x01,
|
Bold = 0x01,
|
||||||
Italic = 0x02,
|
Italic = 0x02,
|
||||||
@ -45,7 +45,7 @@ struct Attribute {
|
|||||||
|
|
||||||
// TODO: it would be really nice if we had a helper for enums that
|
// TODO: it would be really nice if we had a helper for enums that
|
||||||
// exposed bit ops for class enums...
|
// exposed bit ops for class enums...
|
||||||
int flags = Flags::NoAttributes;
|
u8 flags = Flags::NoAttributes;
|
||||||
|
|
||||||
bool operator==(const Attribute& other) const
|
bool operator==(const Attribute& other) const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user