Commit cb047ed8 authored by Gildas Bazin's avatar Gildas Bazin

* modules/video_output/opengl.c: forward mouse events from opengl-provider module.

* src/video_output/*: moved some stuff from video_output.c to vout_intf.c.
parent 712aa6ba
......@@ -73,6 +73,9 @@ static int Control ( vout_thread_t *, int, va_list );
static inline int GetAlignedSize( int );
static int SendEvents( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
......@@ -170,6 +173,12 @@ static int CreateVout( vlc_object_t *p_this )
p_vout->pf_display = DisplayVideo;
p_vout->pf_control = Control;
/* Forward events from the opengl provider */
var_AddCallback( p_sys->p_vout, "mouse-x", SendEvents, p_vout );
var_AddCallback( p_sys->p_vout, "mouse-y", SendEvents, p_vout );
var_AddCallback( p_sys->p_vout, "mouse-moved", SendEvents, p_vout );
var_AddCallback( p_sys->p_vout, "mouse-clicked", SendEvents, p_vout );
return VLC_SUCCESS;
}
......@@ -447,3 +456,12 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
else
return vout_vaControlDefault( p_vout, i_query, args );
}
/*****************************************************************************
* SendEvents: forward mouse and keyboard events to the parent p_vout
*****************************************************************************/
static int SendEvents( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *_p_vout )
{
return var_Set( (vlc_object_t *)_p_vout, psz_var, newval );
}
......@@ -290,17 +290,6 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
p_vout->pf_control = 0;
p_vout->p_parent_intf = 0;
/* Mouse coordinates */
var_Create( p_vout, "mouse-x", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-y", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-moved", VLC_VAR_BOOL );
var_Create( p_vout, "mouse-clicked", VLC_VAR_INTEGER );
var_Create( p_vout, "intf-change", VLC_VAR_BOOL );
val.b_bool = VLC_TRUE;
var_Set( p_vout, "intf-change", val );
/* Initialize locks */
vlc_mutex_init( p_vout, &p_vout->picture_lock );
vlc_mutex_init( p_vout, &p_vout->subpicture_lock );
......
......@@ -222,6 +222,17 @@ void vout_IntfInit( vout_thread_t *p_vout )
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
}
var_AddCallback( p_vout, "fullscreen", FullscreenCallback, NULL );
/* Mouse coordinates */
var_Create( p_vout, "mouse-x", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-y", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-moved", VLC_VAR_BOOL );
var_Create( p_vout, "mouse-clicked", VLC_VAR_INTEGER );
var_Create( p_vout, "intf-change", VLC_VAR_BOOL );
val.b_bool = VLC_TRUE;
var_Set( p_vout, "intf-change", val );
}
/*****************************************************************************
......
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