@@ -252,8 +252,8 @@ extern int _caca_getticks(caca_timer_t *); | |||||
/* Internal event functions */ | /* Internal event functions */ | ||||
extern void _caca_handle_resize(caca_display_t *); | extern void _caca_handle_resize(caca_display_t *); | ||||
#if defined(USE_SLANG) || defined(USE_NCURSES) || defined(USE_CONIO) || defined(USE_GL) | #if defined(USE_SLANG) || defined(USE_NCURSES) || defined(USE_CONIO) || defined(USE_GL) | ||||
extern void _push_event(caca_display_t *, caca_privevent_t *); | |||||
extern int _pop_event(caca_display_t *, caca_privevent_t *); | |||||
extern void _caca_push_event(caca_display_t *, caca_privevent_t *); | |||||
extern int _caca_pop_event(caca_display_t *, caca_privevent_t *); | |||||
#endif | #endif | ||||
/* Internal window functions */ | /* Internal window functions */ | ||||
@@ -151,7 +151,7 @@ static int conio_get_event(caca_display_t *dp, caca_privevent_t *ev) | |||||
release = *ev; | release = *ev; | ||||
release.type = CACA_EVENT_KEY_RELEASE; | release.type = CACA_EVENT_KEY_RELEASE; | ||||
_push_event(dp, &release); | |||||
_caca_push_event(dp, &release); | |||||
return 1; | return 1; | ||||
} | } | ||||
@@ -374,7 +374,7 @@ static int gl_get_event_inner(caca_display_t *dp, caca_privevent_t *ev) | |||||
if(dp->drv.p->mouse_clicked) | if(dp->drv.p->mouse_clicked) | ||||
{ | { | ||||
_push_event(dp, ev); | |||||
_caca_push_event(dp, ev); | |||||
ev->type = CACA_EVENT_MOUSE_PRESS; | ev->type = CACA_EVENT_MOUSE_PRESS; | ||||
ev->data.mouse.button = dp->drv.p->mouse_button; | ev->data.mouse.button = dp->drv.p->mouse_button; | ||||
dp->drv.p->mouse_clicked = 0; | dp->drv.p->mouse_clicked = 0; | ||||
@@ -482,9 +482,9 @@ static int ncurses_get_event(caca_display_t *dp, caca_privevent_t *ev) | |||||
switch(mevent.bstate) | switch(mevent.bstate) | ||||
{ | { | ||||
#define PRESS(x) ev->data.mouse.button = x; \ | #define PRESS(x) ev->data.mouse.button = x; \ | ||||
ev->type = CACA_EVENT_MOUSE_PRESS; _push_event(dp, ev) | |||||
ev->type = CACA_EVENT_MOUSE_PRESS; _caca_push_event(dp, ev) | |||||
#define RELEASE(x) ev->data.mouse.button = x; \ | #define RELEASE(x) ev->data.mouse.button = x; \ | ||||
ev->type = CACA_EVENT_MOUSE_RELEASE; _push_event(dp, ev) | |||||
ev->type = CACA_EVENT_MOUSE_RELEASE; _caca_push_event(dp, ev) | |||||
#define CLICK(x) PRESS(x); RELEASE(x) | #define CLICK(x) PRESS(x); RELEASE(x) | ||||
case BUTTON1_PRESSED: PRESS(1); break; | case BUTTON1_PRESSED: PRESS(1); break; | ||||
case BUTTON1_RELEASED: RELEASE(1); break; | case BUTTON1_RELEASED: RELEASE(1); break; | ||||
@@ -530,7 +530,7 @@ static int ncurses_get_event(caca_display_t *dp, caca_privevent_t *ev) | |||||
} | } | ||||
if(dp->mouse.x == mevent.x && dp->mouse.y == mevent.y) | if(dp->mouse.x == mevent.x && dp->mouse.y == mevent.y) | ||||
return _pop_event(dp, ev); | |||||
return _caca_pop_event(dp, ev); | |||||
dp->mouse.x = mevent.x; | dp->mouse.x = mevent.x; | ||||
dp->mouse.y = mevent.y; | dp->mouse.y = mevent.y; | ||||
@@ -403,12 +403,12 @@ static int slang_get_event(caca_display_t *dp, caca_privevent_t *ev) | |||||
ev->data.mouse.button = button; | ev->data.mouse.button = button; | ||||
ev->type = CACA_EVENT_MOUSE_PRESS; | ev->type = CACA_EVENT_MOUSE_PRESS; | ||||
_push_event(dp, ev); | |||||
_caca_push_event(dp, ev); | |||||
ev->type = CACA_EVENT_MOUSE_RELEASE; | ev->type = CACA_EVENT_MOUSE_RELEASE; | ||||
_push_event(dp, ev); | |||||
_caca_push_event(dp, ev); | |||||
if(dp->mouse.x == x && dp->mouse.y == y) | if(dp->mouse.x == x && dp->mouse.y == y) | ||||
return _pop_event(dp, ev); | |||||
return _caca_pop_event(dp, ev); | |||||
dp->mouse.x = x; | dp->mouse.x = x; | ||||
dp->mouse.y = y; | dp->mouse.y = y; | ||||
@@ -380,7 +380,7 @@ static int _get_next_event(caca_display_t *dp, caca_privevent_t *ev) | |||||
&& dp->events.autorepeat_ticks > AUTOREPEAT_THRESHOLD | && dp->events.autorepeat_ticks > AUTOREPEAT_THRESHOLD | ||||
&& dp->events.autorepeat_ticks > AUTOREPEAT_RATE) | && dp->events.autorepeat_ticks > AUTOREPEAT_RATE) | ||||
{ | { | ||||
_push_event(dp, ev); | |||||
_caca_push_event(dp, ev); | |||||
dp->events.autorepeat_ticks -= AUTOREPEAT_RATE; | dp->events.autorepeat_ticks -= AUTOREPEAT_RATE; | ||||
*ev = dp->events.last_key_event; | *ev = dp->events.last_key_event; | ||||
return 1; | return 1; | ||||
@@ -403,7 +403,7 @@ static int _get_next_event(caca_display_t *dp, caca_privevent_t *ev) | |||||
&& (dp->events.last_key_ticks > AUTOREPEAT_THRESHOLD | && (dp->events.last_key_ticks > AUTOREPEAT_THRESHOLD | ||||
|| (ev->type & CACA_EVENT_KEY_PRESS))) | || (ev->type & CACA_EVENT_KEY_PRESS))) | ||||
{ | { | ||||
_push_event(dp, ev); | |||||
_caca_push_event(dp, ev); | |||||
*ev = dp->events.last_key_event; | *ev = dp->events.last_key_event; | ||||
ev->type = CACA_EVENT_KEY_RELEASE; | ev->type = CACA_EVENT_KEY_RELEASE; | ||||
dp->events.last_key_event.type = CACA_EVENT_NONE; | dp->events.last_key_event.type = CACA_EVENT_NONE; | ||||
@@ -425,7 +425,7 @@ static int _get_next_event(caca_display_t *dp, caca_privevent_t *ev) | |||||
static int _lowlevel_event(caca_display_t *dp, caca_privevent_t *ev) | static int _lowlevel_event(caca_display_t *dp, caca_privevent_t *ev) | ||||
{ | { | ||||
#if defined(USE_SLANG) || defined(USE_NCURSES) || defined(USE_CONIO) | #if defined(USE_SLANG) || defined(USE_NCURSES) || defined(USE_CONIO) | ||||
int ret = _pop_event(dp, ev); | |||||
int ret = _caca_pop_event(dp, ev); | |||||
if(ret) | if(ret) | ||||
return ret; | return ret; | ||||
@@ -435,7 +435,7 @@ static int _lowlevel_event(caca_display_t *dp, caca_privevent_t *ev) | |||||
} | } | ||||
#if defined(USE_SLANG) || defined(USE_NCURSES) || defined(USE_CONIO) || defined(USE_GL) | #if defined(USE_SLANG) || defined(USE_NCURSES) || defined(USE_CONIO) || defined(USE_GL) | ||||
void _push_event(caca_display_t *dp, caca_privevent_t *ev) | |||||
void _caca_push_event(caca_display_t *dp, caca_privevent_t *ev) | |||||
{ | { | ||||
if(!ev->type || dp->events.queue == EVENTBUF_LEN) | if(!ev->type || dp->events.queue == EVENTBUF_LEN) | ||||
return; | return; | ||||
@@ -443,7 +443,7 @@ void _push_event(caca_display_t *dp, caca_privevent_t *ev) | |||||
dp->events.queue++; | dp->events.queue++; | ||||
} | } | ||||
int _pop_event(caca_display_t *dp, caca_privevent_t *ev) | |||||
int _caca_pop_event(caca_display_t *dp, caca_privevent_t *ev) | |||||
{ | { | ||||
int i; | int i; | ||||