feat(Terminal): Enhance terminal UI with panel updates and new BoxUI utility functions
feat(Timekeeping): Implement time initialization and month string representation refactor(Panic): Improve panic output formatting and add boxed UI elements refactor(UEFI): Expand UEFI header and structure definitions for better clarity refactor(IoPort): Comment out unimplemented IO functions for future work
This commit is contained in:
@@ -1,11 +1,33 @@
|
||||
/*
|
||||
* Terminal.cpp
|
||||
* Terminal implementation
|
||||
* Copyright (c) 2025 Daniel Hammer
|
||||
*/
|
||||
|
||||
#include "Terminal.hpp"
|
||||
#include "../Libraries/flanterm/src/flanterm_backends/fb.h"
|
||||
#include "../Libraries/flanterm/src/flanterm.h"
|
||||
|
||||
#include "../Libraries/String.hpp"
|
||||
#include <CppLib/CString.hpp>
|
||||
|
||||
namespace Kt {
|
||||
flanterm_context *ctx;
|
||||
std::size_t g_terminal_width = 0;
|
||||
|
||||
void UpdatePanelBar(CString panelText) {
|
||||
kout << "\033[s";
|
||||
kout << "\033[H";
|
||||
|
||||
int panelWidth = g_terminal_width / 9;
|
||||
|
||||
kout << "\033[44m" << "\033[97m";
|
||||
kout << panelText;
|
||||
for (int i = static_cast<int>(Lib::strlen(panelText)); i < panelWidth; ++i)
|
||||
kout << " ";
|
||||
kout << "\033[0m";
|
||||
kout << "\033[u";
|
||||
}
|
||||
|
||||
void Initialize(std::uint32_t *framebuffer, std::size_t width, std::size_t height, std::size_t pitch,
|
||||
std::uint8_t red_mask_size, std::uint8_t red_mask_shift,
|
||||
@@ -29,6 +51,11 @@ namespace Kt {
|
||||
0, 0,
|
||||
0
|
||||
);
|
||||
|
||||
g_terminal_width = width;
|
||||
|
||||
UpdatePanelBar("Initializing...");
|
||||
kout << "\n\n\n";
|
||||
}
|
||||
|
||||
void Putchar(char c) {
|
||||
@@ -38,4 +65,5 @@ namespace Kt {
|
||||
void Print(const char *text) {
|
||||
flanterm_write(ctx, text, Lib::strlen(text));
|
||||
}
|
||||
|
||||
};
|
||||
@@ -1,3 +1,9 @@
|
||||
/*
|
||||
* Terminal.hpp
|
||||
* Terminal implementation
|
||||
* Copyright (c) 2025 Daniel Hammer
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
@@ -36,6 +42,8 @@ namespace Kt
|
||||
void Putchar(char c);
|
||||
void Print(const char *text);
|
||||
|
||||
void UpdatePanelBar(const char* panelText);
|
||||
|
||||
inline base base_custom(int custom)
|
||||
{
|
||||
return (base)custom;
|
||||
|
||||
Reference in New Issue
Block a user