⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shell.h

📁 MONA是为数不多的C++语言编写的一个很小的操作系统
💻 H
字号:
#ifndef _MONA_SHELL_#define _MONA_SHELL_#include <sys/types.h>#include <monapi.h>#include <monapi/CString.h>#include <gui/System/Array.h>#define SVR "Shell Server"#define FONT_WIDTH   8#define FONT_HEIGHT 16#define FOREGROUND 0x000000#define BACKGROUND 0xffffff#define APPSDIR  "/APPS"#define STARTDIR "/APPS"/*----------------------------------------------------------------------    Shell----------------------------------------------------------------------*/class Shell {  public:    Shell(bool callAutoExec);    virtual ~Shell();  public:    void run();    void onKeyDown(int keycode, int modifiers);    void printPrompt(const MonAPI::CString& prefix = NULL);    void drawCaret(bool erase = false);    inline bool getHasExited() { return this->hasExited; }  protected:    void backspace();    void commandChar(char c);    void commandExecute(bool prompt);    bool commandExecute(_A<MonAPI::CString> args);
    void commandTerminate();    void putHistory(const MonAPI::CString& command);    MonAPI::CString getHistory();    int isInternalCommand(const MonAPI::CString& command);    bool internalCommandExecute(int command, _A<MonAPI::CString> args);    _A<MonAPI::CString> parseCommandLine();    int makeApplicationList();    MonAPI::CString getParentDirectory(const MonAPI::CString& dir);    MonAPI::CString mergeDirectory(const MonAPI::CString& dir1, const MonAPI::CString& dir2);    void printFiles(const MonAPI::CString& dir);    void executeMSH(const MonAPI::CString& msh);    void checkCaretPosition();  protected:    char commandLine[1024];    int position;    HList<MonAPI::CString> history;    HList<MonAPI::CString> apps;    MonAPI::CString current;    bool hasExited, callAutoExec, doExec;
    dword waiting;    dword self;    MonAPI::Screen screen;    int prevX, prevY;};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -