1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-19 06:57:34 +00:00

Kernel: Mark Console::{hide,show}_cursor methods protected

Only the Console code in the Graphics directory should be able to call
on these methods. The set_cursor method stays public as VirtualConsole
uses that method to change the cursor position.
This commit is contained in:
Liav A 2022-09-20 22:44:48 +03:00 committed by Linus Groh
parent a40f289ee5
commit 0a5416a87a
3 changed files with 9 additions and 6 deletions

View file

@ -50,8 +50,6 @@ public:
virtual bool has_hardware_cursor() const = 0; virtual bool has_hardware_cursor() const = 0;
virtual void set_cursor(size_t x, size_t y) = 0; virtual void set_cursor(size_t x, size_t y) = 0;
virtual void hide_cursor() = 0;
virtual void show_cursor() = 0;
virtual void clear(size_t x, size_t y, size_t length) = 0; virtual void clear(size_t x, size_t y, size_t length) = 0;
virtual void write(size_t x, size_t y, char ch, Color background, Color foreground, bool critical = false) = 0; virtual void write(size_t x, size_t y, char ch, Color background, Color foreground, bool critical = false) = 0;
@ -62,6 +60,9 @@ public:
virtual ~Console() = default; virtual ~Console() = default;
protected: protected:
virtual void hide_cursor() = 0;
virtual void show_cursor() = 0;
Console(size_t width, size_t height) Console(size_t width, size_t height)
: m_width(width) : m_width(width)
, m_height(height) , m_height(height)

View file

@ -24,8 +24,6 @@ public:
virtual bool has_hardware_cursor() const override { return false; } virtual bool has_hardware_cursor() const override { return false; }
virtual void set_cursor(size_t x, size_t y) override; virtual void set_cursor(size_t x, size_t y) override;
virtual void hide_cursor() override;
virtual void show_cursor() override;
virtual void clear(size_t x, size_t y, size_t length) override; virtual void clear(size_t x, size_t y, size_t length) override;
virtual void write(size_t x, size_t y, char ch, Color background, Color foreground, bool critical = false) override; virtual void write(size_t x, size_t y, char ch, Color background, Color foreground, bool critical = false) override;
@ -38,6 +36,9 @@ public:
virtual void set_resolution(size_t width, size_t height, size_t pitch) = 0; virtual void set_resolution(size_t width, size_t height, size_t pitch) = 0;
protected: protected:
virtual void hide_cursor() override;
virtual void show_cursor() override;
GenericFramebufferConsoleImpl(size_t width, size_t height, size_t pitch) GenericFramebufferConsoleImpl(size_t width, size_t height, size_t pitch)
: Console(width, height) : Console(width, height)
, m_pitch(pitch) , m_pitch(pitch)

View file

@ -21,8 +21,6 @@ public:
virtual size_t bytes_per_base_glyph() const override { return 2; } virtual size_t bytes_per_base_glyph() const override { return 2; }
virtual void set_cursor(size_t x, size_t y) override; virtual void set_cursor(size_t x, size_t y) override;
virtual void hide_cursor() override;
virtual void show_cursor() override;
virtual void clear(size_t x, size_t y, size_t length) override; virtual void clear(size_t x, size_t y, size_t length) override;
virtual void write(size_t x, size_t y, char ch, bool critical = false) override; virtual void write(size_t x, size_t y, char ch, bool critical = false) override;
virtual void write(size_t x, size_t y, char ch, Color background, Color foreground, bool critical = false) override; virtual void write(size_t x, size_t y, char ch, Color background, Color foreground, bool critical = false) override;
@ -33,6 +31,9 @@ public:
virtual void disable() override { } virtual void disable() override { }
private: private:
virtual void hide_cursor() override;
virtual void show_cursor() override;
void clear_vga_row(u16 row); void clear_vga_row(u16 row);
explicit VGATextModeConsole(NonnullOwnPtr<Memory::Region>); explicit VGATextModeConsole(NonnullOwnPtr<Memory::Region>);