new function MwWindowShouldClose
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
IoI_xD 2026-07-17 21:55:16 -07:00
commit b20a54fb76
2 changed files with 21 additions and 0 deletions

View file

@ -27,6 +27,19 @@ MwInline void MwWindowMakeBorderless(MwWidget handle, int toggle) {
MwVaWidgetExecute(handle, "mwWindowMakeBorderless", NULL, toggle);
}
/*!
* @brief Whether the window should close
* @param handle Widget
* @return bool
*/
MwInline MwBool MwWindowShouldClose(MwWidget handle) {
MwBool res = MwFALSE;
MwVaWidgetExecute(handle, "mwWindowShouldClose", NULL, &res);
return res;
}
#ifdef __cplusplus
}
#endif

View file

@ -35,6 +35,10 @@ static void mwWindowMakeBorderlessImpl(MwWidget handle, int toggle) {
MwLLEndStateChange(handle->lowlevel);
}
static void mwWindowShouldCloseImpl(MwWidget handle, MwBool* out) {
*out = handle->close;
}
static void func_handler(MwWidget handle, const char* name, void* out, va_list va) {
(void)out;
@ -42,6 +46,10 @@ static void func_handler(MwWidget handle, const char* name, void* out, va_list v
int toggle = va_arg(va, int);
mwWindowMakeBorderlessImpl(handle, toggle);
}
if(strcmp(name, "mwWindowShouldClose") == 0) {
MwBool *out = va_arg(va, MwBool*);
mwWindowShouldCloseImpl(handle, out);
}
}
MwClassRec MwWindowClassRec = {
wcreate, /* create */