Kernel/Graphics: Remove unused overloaded write methods of Console

If we happen to print a string, we could use a StringView instead. For
now, let's remove them entirely.
This commit is contained in:
Liav A 2021-05-28 13:11:34 +03:00 committed by Linus Groh
parent 01d7c1b722
commit e8d85b0694
Notes: sideshowbarker 2024-07-18 16:57:06 +09:00
5 changed files with 1 additions and 46 deletions

View File

@ -56,9 +56,7 @@ public:
virtual void clear(size_t x, size_t y, size_t length) const = 0;
virtual void write(size_t x, size_t y, char ch, Color background, Color foreground) const = 0;
virtual void write(size_t x, size_t y, String, Color background, Color foreground) const = 0;
virtual void write(size_t x, size_t y, char ch) const = 0;
virtual void write(size_t x, size_t y, String) const = 0;
virtual void write(char ch) const = 0;
virtual ~Console() { }

View File

@ -339,18 +339,10 @@ void FramebufferConsole::write(size_t x, size_t y, char ch, Color background, Co
}
}
void FramebufferConsole::write(size_t, size_t, String, Color, Color) const
{
TODO();
}
void FramebufferConsole::write(size_t x, size_t y, char ch) const
{
write(x, y, ch, m_default_background_color, m_default_foreground_color);
}
void FramebufferConsole::write(size_t, size_t, String) const
{
TODO();
}
void FramebufferConsole::write(char ch) const
{

View File

@ -33,9 +33,7 @@ public:
virtual void clear(size_t x, size_t y, size_t length) const override;
virtual void write(size_t x, size_t y, char ch, Color background, Color foreground) const override;
virtual void write(size_t x, size_t y, String cstring, Color background, Color foreground) const override;
virtual void write(size_t x, size_t y, char ch) const override;
virtual void write(size_t x, size_t y, String) const override;
virtual void write(char ch) const override;
virtual void enable() override;

View File

@ -132,22 +132,7 @@ void TextModeConsole::write(size_t x, size_t y, char ch) const
m_y = 0;
}
}
void TextModeConsole::write(size_t x, size_t y, String cstring) const
{
ScopedSpinLock lock(m_vga_lock);
auto* buf = (u16*)(m_current_vga_window + (x * 2) + (y * width() * 2));
u16 color_mask = (m_default_foreground_color << 8) | (m_default_background_color << 12);
for (size_t index = 0; index < cstring.length(); index++) {
buf[index] = color_mask | cstring[index];
}
m_x = x + cstring.length();
if (m_x >= max_column()) {
m_x = 0;
m_y = y + 1;
if (m_y >= max_row())
m_y = 0;
}
}
void TextModeConsole::write(size_t x, size_t y, char ch, Color background, Color foreground) const
{
ScopedSpinLock lock(m_vga_lock);
@ -161,22 +146,6 @@ void TextModeConsole::write(size_t x, size_t y, char ch, Color background, Color
m_y = 0;
}
}
void TextModeConsole::write(size_t x, size_t y, String cstring, Color background, Color foreground) const
{
ScopedSpinLock lock(m_vga_lock);
auto* buf = (u16*)(m_current_vga_window + (x * 2) + (y * width() * 2));
u16 color_mask = foreground << 8 | background << 12;
for (size_t index = 0; index < cstring.length(); index++) {
buf[index] = color_mask | cstring[index];
}
m_x = x + cstring.length();
if (m_x >= max_column()) {
m_x = 0;
m_y = y + 1;
if (m_y >= max_row())
m_y = 0;
}
}
void TextModeConsole::clear_vga_row(u16 row)
{

View File

@ -26,9 +26,7 @@ public:
virtual void show_cursor() override;
virtual void clear(size_t x, size_t y, size_t length) const override;
virtual void write(size_t x, size_t y, char ch) const override;
virtual void write(size_t x, size_t y, String cstring) const override;
virtual void write(size_t x, size_t y, char ch, Color background, Color foreground) const override;
virtual void write(size_t x, size_t y, String, Color background, Color foreground) const override;
virtual void write(char ch) const override;
virtual void enable() override { }