git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@73 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-09-30 03:14:02 +00:00
parent b39742be52
commit a65d77ae2d
4 changed files with 12 additions and 2 deletions

View File

@@ -37,6 +37,8 @@ MWDECL void MwDispatchUserHandler(MwWidget handle, const char* key, void* handle
MWDECL void MwSetErrorHandler(MwErrorHandler handler, void* user_data);
MWDECL void MwDispatchError(int code, const char* message);
MWDECL jmp_buf MwGetBeforeStep(MwWidget handle);
#ifdef __cplusplus
}
#endif

View File

@@ -6,6 +6,7 @@
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <setjmp.h>
#ifdef _WIN32
#include <windows.h>
#else

View File

@@ -63,6 +63,7 @@ struct _MwWidget {
int pressed;
int close;
jmp_buf before_step;
void* internal;

View File

@@ -142,6 +142,8 @@ int MwPending(MwWidget handle) {
void MwLoop(MwWidget handle) {
while(!handle->close) {
setjmp(handle->before_step);
MwStep(handle);
MwDispatchUserHandler(handle, MwNtickHandler, NULL);
@@ -273,3 +275,7 @@ void MwDispatchError(int code, const char* message) {
exit(1);
}
}
jmp_buf MwGetBeforeStep(MwWidget handle) {
return handle->before_step;
}