mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-06 17:39:45 +00:00
evil
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@73 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -37,6 +37,8 @@ MWDECL void MwDispatchUserHandler(MwWidget handle, const char* key, void* handle
|
|||||||
MWDECL void MwSetErrorHandler(MwErrorHandler handler, void* user_data);
|
MWDECL void MwSetErrorHandler(MwErrorHandler handler, void* user_data);
|
||||||
MWDECL void MwDispatchError(int code, const char* message);
|
MWDECL void MwDispatchError(int code, const char* message);
|
||||||
|
|
||||||
|
MWDECL jmp_buf MwGetBeforeStep(MwWidget handle);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <setjmp.h>
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -61,8 +61,9 @@ struct _MwWidget {
|
|||||||
MwWidget* children;
|
MwWidget* children;
|
||||||
MwClass widget_class;
|
MwClass widget_class;
|
||||||
|
|
||||||
int pressed;
|
int pressed;
|
||||||
int close;
|
int close;
|
||||||
|
jmp_buf before_step;
|
||||||
|
|
||||||
void* internal;
|
void* internal;
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,8 @@ int MwPending(MwWidget handle) {
|
|||||||
|
|
||||||
void MwLoop(MwWidget handle) {
|
void MwLoop(MwWidget handle) {
|
||||||
while(!handle->close) {
|
while(!handle->close) {
|
||||||
|
setjmp(handle->before_step);
|
||||||
|
|
||||||
MwStep(handle);
|
MwStep(handle);
|
||||||
|
|
||||||
MwDispatchUserHandler(handle, MwNtickHandler, NULL);
|
MwDispatchUserHandler(handle, MwNtickHandler, NULL);
|
||||||
@@ -273,3 +275,7 @@ void MwDispatchError(int code, const char* message) {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jmp_buf MwGetBeforeStep(MwWidget handle) {
|
||||||
|
return handle->before_step;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user