Commit ebd7ad93 authored by Simon Morlat's avatar Simon Morlat
Browse files

add method to discard events from the event queue

parent b2ad8c3b
......@@ -49,6 +49,11 @@ void ms_set_global_event_queue(MSEventQueue *q);
**/
void ms_event_queue_pump(MSEventQueue *q);
/**
* Discard all pending events.
**/
void ms_event_queue_skip(MSEventQueue *q);
/**
* Destroys an event queue.
**/
......
......@@ -111,6 +111,15 @@ void ms_set_global_event_queue(MSEventQueue *q){
ms_global_event_queue=q;
}
void ms_event_queue_skip(MSEventQueue *q){
int bufsize=q->size;
q->lim=q->buffer+bufsize;
q->freeroom=bufsize;
q->wptr=q->rptr=q->buffer;
q->endptr=q->lim;
}
void ms_event_queue_pump(MSEventQueue *q){
while(read_event(q)){
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment