feat: spreadsheet cell resizing

This commit is contained in:
2026-03-06 16:46:15 +01:00
parent 3985188baa
commit 729c227b35
15 changed files with 194 additions and 5 deletions
+2
View File
@@ -213,6 +213,8 @@ namespace Montauk {
return (int64_t)Sys_WinSetScale((int)frame->arg1);
case SYS_WINGETSCALE:
return (int64_t)Sys_WinGetScale();
case SYS_WINSETCURSOR:
return (int64_t)Sys_WinSetCursor((int)frame->arg1, (int)frame->arg2);
case SYS_MEMSTATS:
Sys_MemStats((MemStats*)frame->arg1);
return 0;
+3 -1
View File
@@ -124,6 +124,7 @@ namespace Montauk {
static constexpr uint64_t SYS_WINRESIZE = 64;
static constexpr uint64_t SYS_WINSETSCALE = 65;
static constexpr uint64_t SYS_WINGETSCALE = 66;
static constexpr uint64_t SYS_WINSETCURSOR = 68;
/* Process.hpp */
static constexpr uint64_t SYS_PROCLIST = 61;
@@ -205,7 +206,8 @@ namespace Montauk {
char title[64];
int32_t width, height;
uint8_t dirty;
uint8_t _pad[3];
uint8_t cursor; // 0=arrow, 1=resize_h, 2=resize_v
uint8_t _pad[2];
};
struct WinCreateResult {
+9
View File
@@ -153,6 +153,7 @@ namespace WinServer {
info.width = g_slots[i].width;
info.height = g_slots[i].height;
info.dirty = g_slots[i].dirty ? 1 : 0;
info.cursor = g_slots[i].cursor;
g_slots[i].dirty = false; // clear dirty after read
count++;
}
@@ -246,6 +247,14 @@ namespace WinServer {
return 0;
}
int SetCursor(int windowId, int callerPid, int cursor) {
if (windowId < 0 || windowId >= MaxWindows) return -1;
WindowSlot& slot = g_slots[windowId];
if (!slot.used || slot.ownerPid != callerPid) return -1;
slot.cursor = (uint8_t)cursor;
return 0;
}
int SetScale(int scale) {
if (scale < 0) scale = 0;
if (scale > 2) scale = 2;
+2
View File
@@ -27,6 +27,7 @@ namespace WinServer {
Montauk::WinEvent events[MaxEvents];
int eventHead, eventTail;
bool dirty;
uint8_t cursor; // cursor style requested by app (0=arrow, 1=resize_h, 2=resize_v)
};
int Create(int ownerPid, uint64_t ownerPml4, const char* title, int w, int h,
@@ -40,6 +41,7 @@ namespace WinServer {
int Resize(int windowId, int callerPid, uint64_t ownerPml4, int newW, int newH,
uint64_t& heapNext, uint64_t& outVa);
void CleanupProcess(int pid);
int SetCursor(int windowId, int callerPid, int cursor);
int SetScale(int scale);
int GetScale();
+4
View File
@@ -65,6 +65,10 @@ namespace Montauk {
return (r == 0) ? outVa : 0;
}
static int Sys_WinSetCursor(int windowId, int cursor) {
return WinServer::SetCursor(windowId, Sched::GetCurrentPid(), cursor);
}
static int Sys_WinSetScale(int scale) {
return WinServer::SetScale(scale);
}