feat: rename 'ZenithOS' => 'MontaukOS' and fix build system issues
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* canvas.hpp
|
||||
* ZenithOS Canvas — drawing primitives for pixel buffer (uint32_t*) targets
|
||||
* MontaukOS Canvas — drawing primitives for pixel buffer (uint32_t*) targets
|
||||
* Mirrors Framebuffer API but operates directly on app content buffers.
|
||||
* Copyright (c) 2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* desktop.hpp
|
||||
* ZenithOS desktop state and compositor declarations
|
||||
* MontaukOS desktop state and compositor declarations
|
||||
* Copyright (c) 2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,7 @@ struct DesktopState {
|
||||
int window_count;
|
||||
int focused_window;
|
||||
|
||||
Zenith::MouseState mouse;
|
||||
Montauk::MouseState mouse;
|
||||
uint8_t prev_buttons;
|
||||
|
||||
bool app_menu_open;
|
||||
@@ -92,7 +92,7 @@ struct DesktopState {
|
||||
int ctx_menu_x, ctx_menu_y;
|
||||
|
||||
bool net_popup_open;
|
||||
Zenith::NetCfg cached_net_cfg;
|
||||
Montauk::NetCfg cached_net_cfg;
|
||||
uint64_t net_cfg_last_poll;
|
||||
Rect net_icon_rect;
|
||||
|
||||
@@ -111,6 +111,6 @@ void desktop_raise_window(DesktopState* ds, int idx);
|
||||
void desktop_draw_panel(DesktopState* ds);
|
||||
void desktop_draw_window(DesktopState* ds, int idx);
|
||||
void desktop_handle_mouse(DesktopState* ds);
|
||||
void desktop_handle_keyboard(DesktopState* ds, const Zenith::KeyEvent& key);
|
||||
void desktop_handle_keyboard(DesktopState* ds, const Montauk::KeyEvent& key);
|
||||
|
||||
} // namespace gui
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* draw.hpp
|
||||
* ZenithOS drawing primitives (lines, circles, rounded rects, cursor)
|
||||
* MontaukOS drawing primitives (lines, circles, rounded rects, cursor)
|
||||
* Copyright (c) 2025 Daniel Hammer
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* font.hpp
|
||||
* ZenithOS text rendering — TrueType with bitmap fallback
|
||||
* MontaukOS text rendering — TrueType with bitmap fallback
|
||||
* Copyright (c) 2025 Daniel Hammer
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* framebuffer.hpp
|
||||
* ZenithOS double-buffered framebuffer abstraction
|
||||
* MontaukOS double-buffered framebuffer abstraction
|
||||
* Copyright (c) 2025 Daniel Hammer
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <zenith/syscall.h>
|
||||
#include <montauk/syscall.h>
|
||||
#include "gui/gui.hpp"
|
||||
|
||||
namespace gui {
|
||||
@@ -20,15 +20,15 @@ class Framebuffer {
|
||||
|
||||
public:
|
||||
Framebuffer() : hw_fb(nullptr), back_buf(nullptr), fb_width(0), fb_height(0), fb_pitch(0) {
|
||||
Zenith::FbInfo info;
|
||||
zenith::fb_info(&info);
|
||||
Montauk::FbInfo info;
|
||||
montauk::fb_info(&info);
|
||||
|
||||
fb_width = (int)info.width;
|
||||
fb_height = (int)info.height;
|
||||
fb_pitch = (int)info.pitch;
|
||||
|
||||
hw_fb = (uint32_t*)zenith::fb_map();
|
||||
back_buf = (uint32_t*)zenith::alloc((uint64_t)fb_height * fb_pitch);
|
||||
hw_fb = (uint32_t*)montauk::fb_map();
|
||||
back_buf = (uint32_t*)montauk::alloc((uint64_t)fb_height * fb_pitch);
|
||||
}
|
||||
|
||||
int width() const { return fb_width; }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* gui.hpp
|
||||
* ZenithOS core GUI types and utilities
|
||||
* MontaukOS core GUI types and utilities
|
||||
* Copyright (c) 2025 Daniel Hammer
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* svg.hpp
|
||||
* ZenithOS SVG icon parser and scanline rasterizer
|
||||
* MontaukOS SVG icon parser and scanline rasterizer
|
||||
* Handles the Flat-Remix symbolic icon subset (path, circle, rect)
|
||||
* All math uses 16.16 fixed-point -- NO floating point.
|
||||
* Copyright (c) 2025 Daniel Hammer
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#pragma once
|
||||
#include "gui/gui.hpp"
|
||||
#include <zenith/syscall.h>
|
||||
#include <montauk/syscall.h>
|
||||
|
||||
namespace gui {
|
||||
|
||||
@@ -321,7 +321,7 @@ struct SvgEdgeList {
|
||||
int capacity;
|
||||
|
||||
void init(int cap) {
|
||||
edges = (SvgEdge*)zenith::alloc(cap * sizeof(SvgEdge));
|
||||
edges = (SvgEdge*)montauk::alloc(cap * sizeof(SvgEdge));
|
||||
count = 0;
|
||||
capacity = cap;
|
||||
}
|
||||
@@ -800,7 +800,7 @@ inline void svg_rasterize(const SvgEdgeList& el, uint32_t* pixels, int w, int h,
|
||||
// Temporary array for x-intersections on each scanline
|
||||
// Allocate enough for all edges (each edge can intersect at most once per scanline)
|
||||
int maxIsect = el.count + 16;
|
||||
fixed_t* isect = (fixed_t*)zenith::alloc(maxIsect * sizeof(fixed_t));
|
||||
fixed_t* isect = (fixed_t*)montauk::alloc(maxIsect * sizeof(fixed_t));
|
||||
|
||||
for (int y = 0; y < h; ++y) {
|
||||
// Scanline center in fixed-point
|
||||
@@ -858,7 +858,7 @@ inline void svg_rasterize(const SvgEdgeList& el, uint32_t* pixels, int w, int h,
|
||||
}
|
||||
}
|
||||
|
||||
zenith::free(isect);
|
||||
montauk::free(isect);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -1018,7 +1018,7 @@ inline void svg_rasterize_blend(const SvgEdgeList& el, uint32_t* pixels, int w,
|
||||
if (el.count == 0) return;
|
||||
|
||||
int maxIsect = el.count + 16;
|
||||
fixed_t* isect = (fixed_t*)zenith::alloc(maxIsect * sizeof(fixed_t));
|
||||
fixed_t* isect = (fixed_t*)montauk::alloc(maxIsect * sizeof(fixed_t));
|
||||
|
||||
uint32_t fr = (fill >> 16) & 0xFF;
|
||||
uint32_t fg = (fill >> 8) & 0xFF;
|
||||
@@ -1081,7 +1081,7 @@ inline void svg_rasterize_blend(const SvgEdgeList& el, uint32_t* pixels, int w,
|
||||
}
|
||||
}
|
||||
|
||||
zenith::free(isect);
|
||||
montauk::free(isect);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -1091,7 +1091,7 @@ inline SvgIcon svg_render(const char* svg_data, int svg_len, int target_w, int t
|
||||
SvgIcon icon;
|
||||
icon.width = target_w;
|
||||
icon.height = target_h;
|
||||
icon.pixels = (uint32_t*)zenith::alloc(target_w * target_h * sizeof(uint32_t));
|
||||
icon.pixels = (uint32_t*)montauk::alloc(target_w * target_h * sizeof(uint32_t));
|
||||
// Clear to transparent
|
||||
svg_memset(icon.pixels, 0, target_w * target_h * sizeof(uint32_t));
|
||||
|
||||
@@ -1359,7 +1359,7 @@ inline SvgIcon svg_render(const char* svg_data, int svg_len, int target_w, int t
|
||||
++p;
|
||||
}
|
||||
|
||||
zenith::free(el.edges);
|
||||
montauk::free(el.edges);
|
||||
return icon;
|
||||
}
|
||||
|
||||
@@ -1367,20 +1367,20 @@ inline SvgIcon svg_render(const char* svg_data, int svg_len, int target_w, int t
|
||||
// Load SVG from VFS and render
|
||||
// ---------------------------------------------------------------------------
|
||||
inline SvgIcon svg_load(const char* vfs_path, int target_w, int target_h, Color fill_color) {
|
||||
int fd = zenith::open(vfs_path);
|
||||
int fd = montauk::open(vfs_path);
|
||||
if (fd < 0) {
|
||||
return {nullptr, 0, 0};
|
||||
}
|
||||
|
||||
uint64_t size = zenith::getsize(fd);
|
||||
uint64_t size = montauk::getsize(fd);
|
||||
if (size == 0 || size > SVG_MAX_FILE_SIZE) {
|
||||
zenith::close(fd);
|
||||
montauk::close(fd);
|
||||
return {nullptr, 0, 0};
|
||||
}
|
||||
|
||||
char* buf = (char*)zenith::alloc(size + 1);
|
||||
zenith::read(fd, (uint8_t*)buf, 0, size);
|
||||
zenith::close(fd);
|
||||
char* buf = (char*)montauk::alloc(size + 1);
|
||||
montauk::read(fd, (uint8_t*)buf, 0, size);
|
||||
montauk::close(fd);
|
||||
buf[size] = '\0';
|
||||
|
||||
// 4x supersampling: render at 4x resolution, then downsample with box filter
|
||||
@@ -1389,12 +1389,12 @@ inline SvgIcon svg_load(const char* vfs_path, int target_w, int target_h, Color
|
||||
int hi_h = target_h * SS;
|
||||
|
||||
SvgIcon hi = svg_render(buf, (int)size, hi_w, hi_h, fill_color);
|
||||
zenith::free(buf);
|
||||
montauk::free(buf);
|
||||
|
||||
if (!hi.pixels) return {nullptr, 0, 0};
|
||||
|
||||
// Allocate final icon at target resolution
|
||||
uint32_t* out = (uint32_t*)zenith::alloc(target_w * target_h * 4);
|
||||
uint32_t* out = (uint32_t*)montauk::alloc(target_w * target_h * 4);
|
||||
for (int i = 0; i < target_w * target_h; i++) out[i] = 0;
|
||||
|
||||
// Downsample: average each SSxSS block using premultiplied alpha
|
||||
@@ -1432,7 +1432,7 @@ inline SvgIcon svg_load(const char* vfs_path, int target_w, int target_h, Color
|
||||
}
|
||||
}
|
||||
|
||||
zenith::free(hi.pixels);
|
||||
montauk::free(hi.pixels);
|
||||
return {out, target_w, target_h};
|
||||
}
|
||||
|
||||
@@ -1440,7 +1440,7 @@ inline SvgIcon svg_load(const char* vfs_path, int target_w, int target_h, Color
|
||||
// Free icon pixel data
|
||||
// ---------------------------------------------------------------------------
|
||||
inline void svg_free(SvgIcon& icon) {
|
||||
if (icon.pixels) zenith::free(icon.pixels);
|
||||
if (icon.pixels) montauk::free(icon.pixels);
|
||||
icon.pixels = nullptr;
|
||||
icon.width = 0;
|
||||
icon.height = 0;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* terminal.hpp
|
||||
* ZenithOS terminal emulator with ANSI escape sequence support
|
||||
* MontaukOS terminal emulator with ANSI escape sequence support
|
||||
* Copyright (c) 2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "gui/gui.hpp"
|
||||
#include "gui/font.hpp"
|
||||
#include <zenith/syscall.h>
|
||||
#include <zenith/string.h>
|
||||
#include <montauk/syscall.h>
|
||||
#include <montauk/string.h>
|
||||
#include <Api/Syscall.hpp>
|
||||
|
||||
namespace gui {
|
||||
@@ -102,8 +102,8 @@ static inline void terminal_init_cells(TerminalState* t, int cols, int rows) {
|
||||
t->child_pid = 0;
|
||||
|
||||
int total_cells = cols * rows;
|
||||
t->cells = (TermCell*)zenith::alloc(total_cells * sizeof(TermCell));
|
||||
t->alt_cells = (TermCell*)zenith::alloc(total_cells * sizeof(TermCell));
|
||||
t->cells = (TermCell*)montauk::alloc(total_cells * sizeof(TermCell));
|
||||
t->alt_cells = (TermCell*)montauk::alloc(total_cells * sizeof(TermCell));
|
||||
for (int i = 0; i < total_cells; i++) {
|
||||
t->cells[i] = {' ', colors::TERM_FG, colors::TERM_BG};
|
||||
t->alt_cells[i] = {' ', colors::TERM_FG, colors::TERM_BG};
|
||||
@@ -114,8 +114,8 @@ static inline void terminal_init(TerminalState* t, int cols, int rows) {
|
||||
terminal_init_cells(t, cols, rows);
|
||||
t->cursor_visible = true;
|
||||
|
||||
t->child_pid = zenith::spawn_redir("0:/os/shell.elf");
|
||||
zenith::childio_settermsz(t->child_pid, cols, rows);
|
||||
t->child_pid = montauk::spawn_redir("0:/os/shell.elf");
|
||||
montauk::childio_settermsz(t->child_pid, cols, rows);
|
||||
}
|
||||
|
||||
static inline void terminal_put_char(TerminalState* t, char ch) {
|
||||
@@ -537,8 +537,8 @@ static inline void terminal_resize(TerminalState* t, int new_cols, int new_rows)
|
||||
if (new_cols < 1 || new_rows < 1) return;
|
||||
|
||||
int new_total = new_cols * new_rows;
|
||||
TermCell* new_cells = (TermCell*)zenith::alloc(new_total * sizeof(TermCell));
|
||||
TermCell* new_alt = (TermCell*)zenith::alloc(new_total * sizeof(TermCell));
|
||||
TermCell* new_cells = (TermCell*)montauk::alloc(new_total * sizeof(TermCell));
|
||||
TermCell* new_alt = (TermCell*)montauk::alloc(new_total * sizeof(TermCell));
|
||||
|
||||
// Clear new buffers
|
||||
for (int i = 0; i < new_total; i++) {
|
||||
@@ -562,8 +562,8 @@ static inline void terminal_resize(TerminalState* t, int new_cols, int new_rows)
|
||||
}
|
||||
}
|
||||
|
||||
if (t->cells) zenith::mfree(t->cells);
|
||||
if (t->alt_cells) zenith::mfree(t->alt_cells);
|
||||
if (t->cells) montauk::mfree(t->cells);
|
||||
if (t->alt_cells) montauk::mfree(t->alt_cells);
|
||||
|
||||
t->cells = new_cells;
|
||||
t->alt_cells = new_alt;
|
||||
@@ -580,20 +580,20 @@ static inline void terminal_resize(TerminalState* t, int new_cols, int new_rows)
|
||||
|
||||
// Notify child process of new terminal size
|
||||
if (t->child_pid > 0) {
|
||||
zenith::childio_settermsz(t->child_pid, new_cols, new_rows);
|
||||
montauk::childio_settermsz(t->child_pid, new_cols, new_rows);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void terminal_handle_key(TerminalState* t, const Zenith::KeyEvent& key) {
|
||||
static inline void terminal_handle_key(TerminalState* t, const Montauk::KeyEvent& key) {
|
||||
if (t->child_pid > 0) {
|
||||
zenith::childio_writekey(t->child_pid, &key);
|
||||
montauk::childio_writekey(t->child_pid, &key);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void terminal_poll(TerminalState* t) {
|
||||
if (t->child_pid <= 0) return;
|
||||
char buf[512];
|
||||
int n = zenith::childio_read(t->child_pid, buf, sizeof(buf));
|
||||
int n = montauk::childio_read(t->child_pid, buf, sizeof(buf));
|
||||
if (n > 0) {
|
||||
terminal_feed(t, buf, n);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* truetype.hpp
|
||||
* ZenithOS TrueType font rendering via stb_truetype
|
||||
* MontaukOS TrueType font rendering via stb_truetype
|
||||
* Copyright (c) 2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <zenith/syscall.h>
|
||||
#include <zenith/heap.h>
|
||||
#include <zenith/string.h>
|
||||
#include <montauk/syscall.h>
|
||||
#include <montauk/heap.h>
|
||||
#include <montauk/string.h>
|
||||
#include "gui/gui.hpp"
|
||||
#include "gui/framebuffer.hpp"
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
#define STBTT_cos(x) stb_cos(x)
|
||||
#define STBTT_acos(x) stb_acos(x)
|
||||
#define STBTT_fabs(x) stb_fabs(x)
|
||||
#define STBTT_malloc(x,u) ((void)(u), zenith::malloc(x))
|
||||
#define STBTT_free(x,u) ((void)(u), zenith::mfree(x))
|
||||
#define STBTT_memcpy(d,s,n) zenith::memcpy(d,s,n)
|
||||
#define STBTT_memset(d,v,n) zenith::memset(d,v,n)
|
||||
#define STBTT_strlen(x) zenith::slen(x)
|
||||
#define STBTT_malloc(x,u) ((void)(u), montauk::malloc(x))
|
||||
#define STBTT_free(x,u) ((void)(u), montauk::mfree(x))
|
||||
#define STBTT_memcpy(d,s,n) montauk::memcpy(d,s,n)
|
||||
#define STBTT_memset(d,v,n) montauk::memset(d,v,n)
|
||||
#define STBTT_strlen(x) montauk::slen(x)
|
||||
#define STBTT_assert(x) ((void)(x))
|
||||
#endif
|
||||
|
||||
@@ -69,26 +69,26 @@ struct TrueTypeFont {
|
||||
data = nullptr;
|
||||
cache_count = 0;
|
||||
|
||||
int fd = zenith::open(vfs_path);
|
||||
int fd = montauk::open(vfs_path);
|
||||
if (fd < 0) return false;
|
||||
|
||||
uint64_t size = zenith::getsize(fd);
|
||||
uint64_t size = montauk::getsize(fd);
|
||||
if (size == 0 || size > 1024 * 1024) {
|
||||
zenith::close(fd);
|
||||
montauk::close(fd);
|
||||
return false;
|
||||
}
|
||||
|
||||
data = (uint8_t*)zenith::alloc(size);
|
||||
data = (uint8_t*)montauk::alloc(size);
|
||||
if (!data) {
|
||||
zenith::close(fd);
|
||||
montauk::close(fd);
|
||||
return false;
|
||||
}
|
||||
|
||||
zenith::read(fd, data, 0, size);
|
||||
zenith::close(fd);
|
||||
montauk::read(fd, data, 0, size);
|
||||
montauk::close(fd);
|
||||
|
||||
if (!stbtt_InitFont(&info, data, stbtt_GetFontOffsetForIndex(data, 0))) {
|
||||
zenith::free(data);
|
||||
montauk::free(data);
|
||||
data = nullptr;
|
||||
return false;
|
||||
}
|
||||
@@ -145,7 +145,7 @@ struct TrueTypeFont {
|
||||
g->yoff = y0;
|
||||
|
||||
if (g->width > 0 && g->height > 0) {
|
||||
g->bitmap = (uint8_t*)zenith::malloc(g->width * g->height);
|
||||
g->bitmap = (uint8_t*)montauk::malloc(g->width * g->height);
|
||||
stbtt_MakeCodepointBitmap(&info, g->bitmap, g->width, g->height,
|
||||
g->width, gc->scale, gc->scale, codepoint);
|
||||
}
|
||||
@@ -314,10 +314,10 @@ namespace fonts {
|
||||
|
||||
inline bool init() {
|
||||
auto load = [](const char* path) -> TrueTypeFont* {
|
||||
TrueTypeFont* f = (TrueTypeFont*)zenith::malloc(sizeof(TrueTypeFont));
|
||||
zenith::memset(f, 0, sizeof(TrueTypeFont));
|
||||
TrueTypeFont* f = (TrueTypeFont*)montauk::malloc(sizeof(TrueTypeFont));
|
||||
montauk::memset(f, 0, sizeof(TrueTypeFont));
|
||||
if (!f->init(path)) {
|
||||
zenith::mfree(f);
|
||||
montauk::mfree(f);
|
||||
return nullptr;
|
||||
}
|
||||
return f;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* widgets.hpp
|
||||
* ZenithOS GUI widget toolkit (Label, Button, TextBox, Scrollbar)
|
||||
* MontaukOS GUI widget toolkit (Label, Button, TextBox, Scrollbar)
|
||||
* Copyright (c) 2025 Daniel Hammer
|
||||
*/
|
||||
|
||||
@@ -227,7 +227,7 @@ struct TextBox {
|
||||
}
|
||||
}
|
||||
|
||||
void handle_key(const Zenith::KeyEvent& key) {
|
||||
void handle_key(const Montauk::KeyEvent& key) {
|
||||
if (!focused || !key.pressed) return;
|
||||
|
||||
if (key.ascii == '\b' || key.scancode == 0x0E) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* window.hpp
|
||||
* ZenithOS window management types
|
||||
* MontaukOS window management types
|
||||
* Copyright (c) 2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
@@ -32,7 +32,7 @@ static constexpr int MIN_WINDOW_H = 80;
|
||||
struct Window;
|
||||
using WindowDrawCallback = void (*)(Window* win, Framebuffer& fb);
|
||||
using WindowMouseCallback = void (*)(Window* win, MouseEvent& ev);
|
||||
using WindowKeyCallback = void (*)(Window* win, const Zenith::KeyEvent& key);
|
||||
using WindowKeyCallback = void (*)(Window* win, const Montauk::KeyEvent& key);
|
||||
using WindowCloseCallback = void (*)(Window* win);
|
||||
using WindowPollCallback = void (*)(Window* win);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user