forked from Bananymous/banan-os
Kernel: Move cursor handling from TTY -> TerminalDriver
This commit is contained in:
@@ -11,29 +11,38 @@ namespace Kernel
|
||||
public:
|
||||
static BAN::ErrorOr<BAN::RefPtr<FramebufferTerminalDriver>> create(BAN::RefPtr<FramebufferDevice>);
|
||||
|
||||
virtual uint32_t width() const override { return m_framebuffer_device->width() / m_font.width(); }
|
||||
virtual uint32_t height() const override { return m_framebuffer_device->height() / m_font.height(); }
|
||||
uint32_t width() const override { return m_framebuffer_device->width() / m_font.width(); }
|
||||
uint32_t height() const override { return m_framebuffer_device->height() / m_font.height(); }
|
||||
|
||||
virtual void putchar_at(uint16_t, uint32_t, uint32_t, Color, Color) override;
|
||||
virtual bool scroll(Color) override;
|
||||
virtual void clear(Color) override;
|
||||
void putchar_at(uint16_t, uint32_t, uint32_t, Color, Color) override;
|
||||
bool scroll(Color) override;
|
||||
void clear(Color) override;
|
||||
|
||||
virtual void set_cursor_position(uint32_t, uint32_t) override;
|
||||
void set_cursor_shown(bool) override;
|
||||
void set_cursor_position(uint32_t, uint32_t) override;
|
||||
|
||||
virtual bool has_font() const override { return true; }
|
||||
bool has_font() const override { return true; }
|
||||
|
||||
virtual void set_font(LibFont::Font&& font) override { m_font = BAN::move(font); };
|
||||
virtual const LibFont::Font& font() const override { return m_font; };
|
||||
BAN::ErrorOr<void> set_font(LibFont::Font&& font) override;
|
||||
const LibFont::Font& font() const override { return m_font; };
|
||||
|
||||
private:
|
||||
FramebufferTerminalDriver(BAN::RefPtr<FramebufferDevice> framebuffer_device)
|
||||
: m_framebuffer_device(framebuffer_device)
|
||||
{ }
|
||||
|
||||
void read_cursor();
|
||||
void show_cursor(bool use_data);
|
||||
|
||||
private:
|
||||
BAN::RefPtr<FramebufferDevice> m_framebuffer_device;
|
||||
LibFont::Font m_font;
|
||||
static constexpr Color s_cursor_color = TerminalColor::BRIGHT_WHITE;
|
||||
|
||||
uint32_t m_cursor_x { 0 };
|
||||
uint32_t m_cursor_y { 0 };
|
||||
bool m_cursor_shown { true };
|
||||
BAN::Vector<uint32_t> m_cursor_data;
|
||||
static constexpr Color m_cursor_color = TerminalColor::BRIGHT_WHITE;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user