feat: spreadsheet cell resizing
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user