From 4784732b7b18f1627c72a40d57a911490bb4b04d Mon Sep 17 00:00:00 2001 From: Cococry Date: Sat, 17 Aug 2024 14:50:52 +0200 Subject: [PATCH] Added api/include folder --- api/include/ragnar/api.h | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 api/include/ragnar/api.h diff --git a/api/include/ragnar/api.h b/api/include/ragnar/api.h new file mode 100644 index 0000000..e2b104e --- /dev/null +++ b/api/include/ragnar/api.h @@ -0,0 +1,52 @@ +#pragma once + +#include +#include + +typedef int32_t RgWindow; + +#define RG_INVALID_WINDOW -1 + +typedef enum { + RgCommandTerminate, + RgCommandGetWindows, + RgCommandKillWindow, + RgCommandFocusWindow, + RgCommandNextWindow, + RgCommandFirstWindow, + RgCommandGetFocus, + RgCommandGetMonitorFocus, + RgCommandGetCursor, + RgCommandGetWindowArea, +} RgCommandType; + +typedef struct { + float x, y; +} Rgv2; + +typedef struct { + Rgv2 pos, size; +} RgArea; + +void rg_set_trace_logging(bool logging); + +int32_t rg_cmd_terminate(uint32_t exitcode); + +int32_t rg_cmd_get_windows(RgWindow** wins, uint32_t* numwins); + +int32_t rg_cmd_kill_window(RgWindow win); + +int32_t rg_cmd_focus_window(RgWindow win); + +int32_t rg_cmd_next_window(RgWindow win, RgWindow* next); + +int32_t rg_cmd_first_window(RgWindow* first); + +int32_t rg_cmd_get_focus(RgWindow* focus); + +int32_t rg_cmd_get_monitor_focus(int32_t* idx); + +int32_t rg_cmd_get_cursor(Rgv2* cursor); + +int32_t rg_cmd_get_window_area(RgWindow win, RgArea* area); +