forked from Bananymous/banan-os
40 lines
578 B
C++
40 lines
578 B
C++
#pragma once
|
|
|
|
#include <BAN/String.h>
|
|
#include <kernel/Input.h>
|
|
#include <kernel/TTY.h>
|
|
|
|
namespace Kernel
|
|
{
|
|
|
|
class Shell
|
|
{
|
|
public:
|
|
Shell(const Shell&) = delete;
|
|
|
|
static Shell& Get();
|
|
|
|
void SetTTY(TTY* tty);
|
|
|
|
void Run();
|
|
|
|
private:
|
|
Shell();
|
|
void PrintPrompt();
|
|
void ProcessCommand(const BAN::Vector<BAN::StringView>&);
|
|
void KeyEventCallback(Input::KeyEvent);
|
|
void MouseMoveEventCallback(Input::MouseMoveEvent);
|
|
|
|
private:
|
|
TTY* m_tty;
|
|
BAN::String m_buffer;
|
|
|
|
struct
|
|
{
|
|
bool exists = false;
|
|
int32_t x = 0;
|
|
int32_t y = 0;
|
|
} m_mouse_pos;
|
|
};
|
|
|
|
} |