Meta: Add files to repository

This commit is contained in:
Alec Murphy 2025-03-25 07:32:23 -04:00
parent 80a0428b66
commit 39198164cd
1029 changed files with 78311 additions and 0 deletions

53
Include/Gui.HC Normal file
View file

@ -0,0 +1,53 @@
U0 @gui_event_loop(CTask* task)
{
Fs->ipc = task->ipc;
IpcMessage* msg;
while (1) {
msg = Ipc.MsgRecv();
if (msg) {
switch (msg->type) {
// TODO:
case CPZ_MSG_WIN_WIDGET_DESTROY:
@gui_widget_destroy(msg->payload);
case CPZ_MSG_WIN_MOVE_TO:
break;
case CPZ_MSG_WIN_KEY_PRESS:
if (msg->payload(Window*)->callback.keypress)
msg->payload(Window*)->callback.keypress(msg->payload, msg->i64);
@gui_window_repaint(msg->payload, msg->type);
Compositor.theme.window_repaint(msg->payload, msg->type);
if (msg->payload(Window*)->callback.repaint)
msg->payload(Window*)->callback.repaint(msg->payload);
break;
case CPZ_MSG_WIN_MOUSE_AT:
if (msg->payload(Window*)->callback.mouseat)
msg->payload(Window*)->callback.mouseat(msg->payload);
@gui_window_repaint(msg->payload, msg->type);
Compositor.theme.window_repaint(msg->payload, msg->type);
if (msg->payload(Window*)->callback.repaint)
msg->payload(Window*)->callback.repaint(msg->payload);
break;
case CPZ_MSG_WIN_MOUSE_WHEEL:
case CPZ_MSG_WIN_LEFT_BTN_UP:
case CPZ_MSG_WIN_LEFT_BTN_DOWN:
case CPZ_MSG_WIN_RIGHT_BTN_UP:
case CPZ_MSG_WIN_RIGHT_BTN_DOWN:
case CPZ_MSG_WIN_REPAINT:
@gui_window_repaint(msg->payload, msg->type);
Compositor.theme.window_repaint(msg->payload, msg->type);
if (msg->payload(Window*)->callback.repaint)
msg->payload(Window*)->callback.repaint(msg->payload);
break;
// FIXME: add CPZ_MSG_WIN_RESIZE
default:
break;
}
Free(msg);
}
Sleep(1);
}
}
Ipc.InitQueue(Fs);
Spawn(&@gui_event_loop, Fs, Fs->task_name, 1);
System.Log(Fs, "Task running at 0x%08x", Fs);