From d400369084107104f51fe217d5781c8d7bd07ff9 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 10 Mar 2025 00:20:31 +0530 Subject: Add dumb command parser --- include/CommandParser.hpp | 31 +++++++++++++++++++++++++++++++ include/widgets/MainWindow.hpp | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 include/CommandParser.hpp (limited to 'include') diff --git a/include/CommandParser.hpp b/include/CommandParser.hpp new file mode 100644 index 0000000..128b5f4 --- /dev/null +++ b/include/CommandParser.hpp @@ -0,0 +1,31 @@ +#pragma once + +#include +#include + +enum CommandType { + Noop, + LuaEval, + Open, + TabOpen, + TabNext, + TabPrev, +}; + +class Cmd { +public: + CommandType command; + QStringList args; + + Cmd(CommandType command = Noop, QStringList args = QStringList()) + : command(command), args(args) {} +}; + +class CommandParser { +public: + CommandParser(); + Cmd parse(QString command); + +private: + CommandType toCommandType(QString cmd); +}; diff --git a/include/widgets/MainWindow.hpp b/include/widgets/MainWindow.hpp index 15e2889..7f54ce2 100644 --- a/include/widgets/MainWindow.hpp +++ b/include/widgets/MainWindow.hpp @@ -2,6 +2,7 @@ #include #include +#include #include #include "LuaRuntime.hpp" @@ -23,4 +24,5 @@ private: BrowserManager *browserManager; CommandInput *commandInput; LuaRuntime *luaRuntime; + QStackedLayout *layout; }; -- cgit v1.3.1