Commit 43132559 authored by Rafaël Carré's avatar Rafaël Carré

fix #1387 (update to new libcaca api)

Cherry-picked from [82ca50d3]
parent c18d84a4
......@@ -4111,6 +4111,13 @@ then
VLC_ADD_PLUGINS([caca])
VLC_ADD_CFLAGS([caca],[`${CACA_CONFIG} --cflags`])
VLC_ADD_LDFLAGS([caca],[`${CACA_CONFIG} --plugin-libs`])
AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <caca.h>
caca_event_t ev;]],
[[ev.type = 0;]]
)],
[],
[AC_DEFINE(CACA_EVENT_OPAQUE, [1], ["Define if struct caca_event is opaque and must not be accessed directly"])]
)
fi
fi
......
......@@ -306,14 +306,22 @@ static int Manage( vout_thread_t *p_vout )
vlc_value_t val;
#ifdef CACA_API_VERSION_1
#ifdef CACA_EVENT_OPAQUE
switch( caca_get_event_type( &ev ) )
#else
switch( ev.type )
#endif /* CACA_EVENT_OPAQUE */
#else
switch( ev )
#endif
{
case CACA_EVENT_KEY_RELEASE:
#ifdef CACA_API_VERSION_1
#ifdef CACA_EVENT_OPAQUE
switch( caca_get_event_key_ch( &ev ) )
#else
switch( ev.data.key.ch )
#endif /* CACA_EVENT_OPAQUE */
#else
switch( ev & 0x00ffffff )
#endif
......@@ -336,10 +344,22 @@ static int Manage( vout_thread_t *p_vout )
break;
#ifdef CACA_API_VERSION_1
case CACA_EVENT_MOUSE_MOTION:
val.i_int = ev.data.mouse.x * p_vout->render.i_width
val.i_int =
#ifdef CACA_EVENT_OPAQUE
caca_get_event_mouse_x( &ev )
#else
ev.data.mouse.x
#endif /* CACA_EVENT_OPAQUE */
* p_vout->render.i_width
/ cucul_get_canvas_width( p_vout->p_sys->p_cv );
var_Set( p_vout, "mouse-x", val );
val.i_int = ev.data.mouse.y * p_vout->render.i_height
val.i_int =
#ifdef CACA_EVENT_OPAQUE
caca_get_event_mouse_y( &ev )
#else
ev.data.mouse.y
#endif /* CACA_EVENT_OPAQUE */
* p_vout->render.i_height
/ cucul_get_canvas_height( p_vout->p_sys->p_cv );
var_Set( p_vout, "mouse-y", val );
val.b_bool = VLC_TRUE;
......
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