forked from pyrite-dev/milsko
nvm
This commit is contained in:
parent
6af4c73905
commit
8a5a2f0f02
2 changed files with 18 additions and 23 deletions
|
|
@ -138,12 +138,6 @@ MWDECL void MwLoop(MwWidget handle);
|
|||
*/
|
||||
MWDECL int MwStep(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Runs the stuff needed after one event loop
|
||||
* @param handle Widget
|
||||
*/
|
||||
MWDECL void MwAfterStep(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Check if any event is pending
|
||||
* @param handle Widget
|
||||
|
|
|
|||
35
src/core.c
35
src/core.c
|
|
@ -410,6 +410,22 @@ static void clean_destroy_queue(MwWidget handle) {
|
|||
arrfree(handle->destroy_queue);
|
||||
}
|
||||
|
||||
static void MwAfterStep(MwWidget handle) {
|
||||
#ifdef PERIODIC
|
||||
if(handle->top_step) {
|
||||
int i;
|
||||
|
||||
for(i = 0; i < arrlen(handle->draw_queue); i++) {
|
||||
DRAW(handle->draw_queue[i]);
|
||||
}
|
||||
|
||||
arrfree(handle->draw_queue);
|
||||
}
|
||||
#else
|
||||
(void)handle;
|
||||
#endif
|
||||
}
|
||||
|
||||
int MwStep(MwWidget handle) {
|
||||
int i;
|
||||
MwWidget* widgets = NULL;
|
||||
|
|
@ -428,6 +444,8 @@ int MwStep(MwWidget handle) {
|
|||
|
||||
handle->prop_event = 1;
|
||||
|
||||
if(handle->top_step) MwAfterStep(handle);
|
||||
|
||||
clean_destroy_queue(handle);
|
||||
if(handle->parent == NULL && handle->destroyed) {
|
||||
MwFreeWidget(handle);
|
||||
|
|
@ -436,22 +454,6 @@ int MwStep(MwWidget handle) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void MwAfterStep(MwWidget handle) {
|
||||
#ifdef PERIODIC
|
||||
if(handle->top_step) {
|
||||
int i;
|
||||
|
||||
for(i = 0; i < arrlen(handle->draw_queue); i++) {
|
||||
DRAW(handle->draw_queue[i]);
|
||||
}
|
||||
|
||||
arrfree(handle->draw_queue);
|
||||
}
|
||||
#else
|
||||
(void)handle;
|
||||
#endif
|
||||
}
|
||||
|
||||
int MwPending(MwWidget handle) {
|
||||
int i;
|
||||
for(i = 0; i < arrlen(handle->children); i++) {
|
||||
|
|
@ -474,7 +476,6 @@ void MwLoop(MwWidget handle) {
|
|||
if((v = MwStep(handle)) != 0) break;
|
||||
}
|
||||
if(v != 0) break;
|
||||
MwAfterStep(handle);
|
||||
|
||||
for(i = 0; i < arrlen(handle->tick_list); i++) {
|
||||
MwDispatch(handle->tick_list[i], tick);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue