aboutsummaryrefslogtreecommitdiff
path: root/include/ricochet/render
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-04-11 03:40:54 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-04-11 03:40:54 +0800
commit617b10ded3722a8c2d615fbee5dd256f5f3c6a7f (patch)
tree59c92d6e4cca03cad29e9b341af7572cfe75ef2c /include/ricochet/render
parentd68d4495395cabc10407e088b6781bf7ee5035e1 (diff)
downloadrwebbrowser-617b10ded3722a8c2d615fbee5dd256f5f3c6a7f.tar.gz
rwebbrowser-617b10ded3722a8c2d615fbee5dd256f5f3c6a7f.tar.xz
feat: implement terminal renderer and integrate into browser core
Diffstat (limited to 'include/ricochet/render')
-rw-r--r--include/ricochet/render/renderer.hh43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/ricochet/render/renderer.hh b/include/ricochet/render/renderer.hh
new file mode 100644
index 0000000..8a5c463
--- /dev/null
+++ b/include/ricochet/render/renderer.hh
@@ -0,0 +1,43 @@
+/*
+ * Ricochet - A minimalist CLI web browser for fast, distraction-free navigation.
+ * Copyright (C) 2026 Richard Qin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "ricochet/parser/dom_tree.hh"
+
+namespace ricochet::render {
+
+class Renderer
+{
+public:
+ Renderer() = default;
+ ~Renderer() = default;
+
+ Renderer( const Renderer& ) = delete;
+ Renderer& operator=( const Renderer& ) = delete;
+ Renderer( Renderer&& ) = delete;
+ Renderer& operator=( Renderer&& ) = delete;
+
+ /**
+ * @brief Traverse the DOM tree and output the formatted result to the terminal using ANSI escape codes
+ * @param node The root node of the DOM tree
+ */
+ void render( const parser::DomNode& node ) const;
+};
+
+} // namespace ricochet::render \ No newline at end of file