Commit 005ff29b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vout: pass enum for window state instead of boolean (refs #10302)

parent 76d6f98e
......@@ -49,7 +49,7 @@ enum {
VOUT_CONTROL_STEP, /* time_ptr */
VOUT_CONTROL_FULLSCREEN, /* bool */
VOUT_CONTROL_ON_TOP, /* bool */
VOUT_CONTROL_WINDOW_STATE, /* unsigned */
VOUT_CONTROL_DISPLAY_FILLED, /* bool */
VOUT_CONTROL_ZOOM, /* pair */
......
......@@ -499,10 +499,9 @@ void vout_ControlChangeFullscreen(vout_thread_t *vout, bool fullscreen)
vout_control_PushBool(&vout->p->control, VOUT_CONTROL_FULLSCREEN,
fullscreen);
}
void vout_ControlChangeOnTop(vout_thread_t *vout, bool is_on_top)
void vout_ControlChangeWindowState(vout_thread_t *vout, unsigned st)
{
vout_control_PushBool(&vout->p->control, VOUT_CONTROL_ON_TOP,
is_on_top);
vout_control_PushInteger(&vout->p->control, VOUT_CONTROL_WINDOW_STATE, st);
}
void vout_ControlChangeDisplayFilled(vout_thread_t *vout, bool is_filled)
{
......@@ -1254,11 +1253,9 @@ static void ThreadChangeFullscreen(vout_thread_t *vout, bool fullscreen)
vout_SetDisplayFullscreen(vout->p->display.vd, fullscreen);
}
static void ThreadChangeOnTop(vout_thread_t *vout, bool is_on_top)
static void ThreadChangeWindowState(vout_thread_t *vout, unsigned state)
{
vout_SetWindowState(vout->p->display.vd,
is_on_top ? VOUT_WINDOW_STATE_ABOVE :
VOUT_WINDOW_STATE_NORMAL);
vout_SetWindowState(vout->p->display.vd, state);
}
static void ThreadChangeDisplayFilled(vout_thread_t *vout, bool is_filled)
......@@ -1499,8 +1496,8 @@ static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
case VOUT_CONTROL_FULLSCREEN:
ThreadChangeFullscreen(vout, cmd.u.boolean);
break;
case VOUT_CONTROL_ON_TOP:
ThreadChangeOnTop(vout, cmd.u.boolean);
case VOUT_CONTROL_WINDOW_STATE:
ThreadChangeWindowState(vout, cmd.u.integer);
break;
case VOUT_CONTROL_DISPLAY_FILLED:
ThreadChangeDisplayFilled(vout, cmd.u.boolean);
......
......@@ -140,7 +140,7 @@ struct vout_thread_sys_t
/* TODO to move them to vlc_vout.h */
void vout_ControlChangeFullscreen(vout_thread_t *, bool fullscreen);
void vout_ControlChangeOnTop(vout_thread_t *, bool is_on_top);
void vout_ControlChangeWindowState(vout_thread_t *, unsigned state);
void vout_ControlChangeDisplayFilled(vout_thread_t *, bool is_filled);
void vout_ControlChangeZoom(vout_thread_t *, int num, int den);
void vout_ControlChangeSampleAspectRatio(vout_thread_t *, unsigned num, unsigned den);
......
......@@ -59,7 +59,7 @@ static int ScaleCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
static int ZoomCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
static int OnTopCallback( vlc_object_t *, char const *,
static int AboveCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
static int FullscreenCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
......@@ -273,7 +273,7 @@ void vout_IntfInit( vout_thread_t *p_vout )
| VLC_VAR_ISCOMMAND );
text.psz_string = _("Always on top");
var_Change( p_vout, "video-on-top", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_vout, "video-on-top", OnTopCallback, NULL );
var_AddCallback( p_vout, "video-on-top", AboveCallback, NULL );
/* Add a variable to indicate whether we want window decoration or not */
var_Create( p_vout, "video-deco", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
......@@ -622,13 +622,12 @@ static int ZoomCallback( vlc_object_t *obj, char const *name,
return var_SetFloat( obj, "scale", cur.f_float );
}
static int OnTopCallback( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
static int AboveCallback( vlc_object_t *obj, char const *name,
vlc_value_t prev, vlc_value_t cur, void *data )
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
(void)psz_cmd; (void)oldval; (void)p_data;
vout_ControlChangeOnTop( p_vout, newval.b_bool );
vout_ControlChangeWindowState( (vout_thread_t *)obj,
cur.b_bool ? VOUT_WINDOW_STATE_ABOVE : VOUT_WINDOW_STATE_NORMAL );
(void) name; (void) prev; (void) data;
return VLC_SUCCESS;
}
......
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