feat: MontaukOS installer app, toml config, app directory with manifests, and more
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
* app_devexplorer.cpp
|
||||
* MontaukOS Desktop - Device Explorer launcher (spawns standalone devexplorer.elf)
|
||||
* Copyright (c) 2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
#include "apps_common.hpp"
|
||||
|
||||
void open_devexplorer(DesktopState* ds) {
|
||||
(void)ds;
|
||||
montauk::spawn("0:/os/devexplorer.elf");
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
* app_disks.cpp
|
||||
* Copyright (c) 2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
#include "apps_common.hpp"
|
||||
|
||||
void open_disks(DesktopState* ds) {
|
||||
(void)ds;
|
||||
montauk::spawn("0:/os/disks.elf");
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
* app_doom.cpp
|
||||
* MontaukOS Desktop - DOOM launcher (spawns standalone doom.elf)
|
||||
* Copyright (c) 2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
#include "apps_common.hpp"
|
||||
|
||||
void open_doom(DesktopState* ds) {
|
||||
(void)ds;
|
||||
montauk::spawn("0:/games/doom.elf");
|
||||
}
|
||||
@@ -92,7 +92,12 @@ static void filemanager_read_drives(FileManagerState* fm) {
|
||||
fm->at_drives_root = true;
|
||||
fm->current_path[0] = '\0';
|
||||
|
||||
for (int d = 0; d < FM_MAX_DRIVES; d++) {
|
||||
int drives[FM_MAX_DRIVES];
|
||||
int driveCount = montauk::drivelist(drives, FM_MAX_DRIVES);
|
||||
|
||||
for (int di = 0; di < driveCount; di++) {
|
||||
int d = drives[di];
|
||||
int i = fm->entry_count;
|
||||
char probe[8];
|
||||
if (d < 10) {
|
||||
probe[0] = '0' + d;
|
||||
@@ -106,21 +111,16 @@ static void filemanager_read_drives(FileManagerState* fm) {
|
||||
probe[3] = '/';
|
||||
probe[4] = '\0';
|
||||
}
|
||||
const char* tmp[1];
|
||||
int r = montauk::readdir(probe, tmp, 1);
|
||||
if (r >= 0) {
|
||||
int i = fm->entry_count;
|
||||
char label[64];
|
||||
montauk::strcpy(label, "Drive ");
|
||||
str_append(label, probe, 64);
|
||||
montauk::strncpy(fm->entry_names[i], label, 63);
|
||||
fm->entry_types[i] = 3; // drive
|
||||
fm->entry_sizes[i] = 0;
|
||||
fm->is_dir[i] = true;
|
||||
fm->drive_indices[i] = d;
|
||||
fm->entry_count++;
|
||||
if (fm->entry_count >= 64) break;
|
||||
}
|
||||
char label[64];
|
||||
montauk::strcpy(label, "Drive ");
|
||||
str_append(label, probe, 64);
|
||||
montauk::strncpy(fm->entry_names[i], label, 63);
|
||||
fm->entry_types[i] = 3; // drive
|
||||
fm->entry_sizes[i] = 0;
|
||||
fm->is_dir[i] = true;
|
||||
fm->drive_indices[i] = d;
|
||||
fm->entry_count++;
|
||||
if (fm->entry_count >= 64) break;
|
||||
}
|
||||
|
||||
fm->selected = -1;
|
||||
@@ -688,13 +688,13 @@ static void filemanager_on_mouse(Window* win, MouseEvent& ev) {
|
||||
}
|
||||
str_append(fullpath, fm->entry_names[clicked_idx], 512);
|
||||
if (is_image_file(fm->entry_names[clicked_idx])) {
|
||||
montauk::spawn("0:/os/imageviewer.elf", fullpath);
|
||||
montauk::spawn("0:/apps/imageviewer/imageviewer.elf", fullpath);
|
||||
} else if (is_font_file(fm->entry_names[clicked_idx])) {
|
||||
montauk::spawn("0:/os/fontpreview.elf", fullpath);
|
||||
montauk::spawn("0:/apps/fontpreview/fontpreview.elf", fullpath);
|
||||
} else if (is_pdf_file(fm->entry_names[clicked_idx])) {
|
||||
montauk::spawn("0:/os/pdfviewer.elf", fullpath);
|
||||
montauk::spawn("0:/apps/pdfviewer/pdfviewer.elf", fullpath);
|
||||
} else if (is_spreadsheet_file(fm->entry_names[clicked_idx])) {
|
||||
montauk::spawn("0:/os/spreadsheet.elf", fullpath);
|
||||
montauk::spawn("0:/apps/spreadsheet/spreadsheet.elf", fullpath);
|
||||
} else if (fm->desktop) {
|
||||
open_texteditor_with_file(fm->desktop, fullpath);
|
||||
}
|
||||
@@ -744,13 +744,13 @@ static void filemanager_on_mouse(Window* win, MouseEvent& ev) {
|
||||
}
|
||||
str_append(fullpath, fm->entry_names[clicked_idx], 512);
|
||||
if (is_image_file(fm->entry_names[clicked_idx])) {
|
||||
montauk::spawn("0:/os/imageviewer.elf", fullpath);
|
||||
montauk::spawn("0:/apps/imageviewer/imageviewer.elf", fullpath);
|
||||
} else if (is_font_file(fm->entry_names[clicked_idx])) {
|
||||
montauk::spawn("0:/os/fontpreview.elf", fullpath);
|
||||
montauk::spawn("0:/apps/fontpreview/fontpreview.elf", fullpath);
|
||||
} else if (is_pdf_file(fm->entry_names[clicked_idx])) {
|
||||
montauk::spawn("0:/os/pdfviewer.elf", fullpath);
|
||||
montauk::spawn("0:/apps/pdfviewer/pdfviewer.elf", fullpath);
|
||||
} else if (is_spreadsheet_file(fm->entry_names[clicked_idx])) {
|
||||
montauk::spawn("0:/os/spreadsheet.elf", fullpath);
|
||||
montauk::spawn("0:/apps/spreadsheet/spreadsheet.elf", fullpath);
|
||||
} else if (fm->desktop) {
|
||||
open_texteditor_with_file(fm->desktop, fullpath);
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
* app_spreadsheet.cpp
|
||||
* MontaukOS Desktop - Spreadsheet launcher (spawns standalone spreadsheet.elf)
|
||||
* Copyright (c) 2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
#include "apps_common.hpp"
|
||||
|
||||
void open_spreadsheet(DesktopState* ds) {
|
||||
(void)ds;
|
||||
montauk::spawn("0:/os/spreadsheet.elf");
|
||||
}
|
||||
@@ -17,12 +17,7 @@ static constexpr int TERM_TAB_GAP = 4;
|
||||
static constexpr int TERM_PLUS_W = 28;
|
||||
static constexpr int TERM_PLUS_PAD = 8;
|
||||
|
||||
// Compute the x-offset for left-aligned tabs within bar_w
|
||||
static int term_tabs_origin(int bar_w, int tab_count) {
|
||||
(void)bar_w;
|
||||
(void)tab_count;
|
||||
return 8;
|
||||
}
|
||||
static constexpr int TERM_TAB_PAD = 8;
|
||||
|
||||
struct TermTabState {
|
||||
TerminalState* tabs[TERM_MAX_TABS];
|
||||
@@ -150,7 +145,7 @@ static void terminal_on_draw(Window* win, Framebuffer& fb) {
|
||||
c.fill_rect(0, 0, cr.w, TERM_TAB_BAR_H, bar_bg);
|
||||
|
||||
int fh = system_font_height();
|
||||
int tab_x = term_tabs_origin(cr.w, tts->tab_count);
|
||||
int tab_x = TERM_TAB_PAD;
|
||||
|
||||
for (int i = 0; i < tts->tab_count; i++) {
|
||||
bool active = (i == tts->active_tab);
|
||||
@@ -241,7 +236,7 @@ static void terminal_on_mouse(Window* win, MouseEvent& ev) {
|
||||
|
||||
if (ly >= TERM_TAB_BAR_H) return; // click in terminal area, ignore
|
||||
|
||||
int tab_x = term_tabs_origin(cr.w, tts->tab_count);
|
||||
int tab_x = TERM_TAB_PAD;
|
||||
for (int i = 0; i < tts->tab_count; i++) {
|
||||
if (lx >= tab_x && lx < tab_x + TERM_TAB_W) {
|
||||
// Check if click is on the close "x" (last 24px of tab)
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
/*
|
||||
* app_weather.cpp
|
||||
* MontaukOS Desktop - Weather app launcher
|
||||
* Spawns weather.elf as a standalone Window Server process
|
||||
* Copyright (c) 2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
#include "apps_common.hpp"
|
||||
|
||||
void open_weather(DesktopState* ds) {
|
||||
(void)ds;
|
||||
montauk::spawn("0:/os/weather.elf");
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
/*
|
||||
* app_wiki.cpp
|
||||
* MontaukOS Desktop - Wikipedia launcher
|
||||
* Spawns wikipedia.elf as a standalone Window Server process
|
||||
* Copyright (c) 2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
#include "apps_common.hpp"
|
||||
|
||||
void open_wiki(DesktopState* ds) {
|
||||
(void)ds;
|
||||
montauk::spawn("0:/os/wikipedia.elf");
|
||||
}
|
||||
@@ -156,7 +156,7 @@ inline void format_size(char* buf, int size) {
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Forward declarations for app launchers
|
||||
// Forward declarations for app launchers (embedded apps only)
|
||||
// ============================================================================
|
||||
|
||||
void open_terminal(DesktopState* ds);
|
||||
@@ -166,16 +166,10 @@ void open_calculator(DesktopState* ds);
|
||||
void open_texteditor(DesktopState* ds);
|
||||
void open_texteditor_with_file(DesktopState* ds, const char* path);
|
||||
void open_klog(DesktopState* ds);
|
||||
void open_wiki(DesktopState* ds);
|
||||
void open_weather(DesktopState* ds);
|
||||
void open_procmgr(DesktopState* ds);
|
||||
void open_mandelbrot(DesktopState* ds);
|
||||
void open_devexplorer(DesktopState* ds);
|
||||
void open_settings(DesktopState* ds);
|
||||
void open_doom(DesktopState* ds);
|
||||
void open_reboot_dialog(DesktopState* ds);
|
||||
void open_wordprocessor(DesktopState* ds);
|
||||
void open_spreadsheet(DesktopState* ds);
|
||||
void open_shutdown_dialog(DesktopState* ds);
|
||||
void open_disks(DesktopState* ds);
|
||||
void desktop_poll_external_windows(DesktopState* ds);
|
||||
|
||||
Reference in New Issue
Block a user