From bf10a4fdfa40cbe519e6ccb7fb895332da2021d1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 15 May 2013 18:17:18 +0200 Subject: video/out: introduce vo_control for gl_common based VOs Instead of having separate callbacks for each backend-handled feature (like MPGLContext.fullscreen, MPGLContext.border, etc.), pass the VOCTRL responsible for this directly to the backend. This allows removing a bunch of callbacks, that currently must be set even for optional/lesser features (like VOCTRL_BORDER). This requires changes to all VOs using gl_common, as well as all backends that support gl_common. Also introduce VOCTRL_CHECK_EVENTS. vo.check_events is now optional. VO backends can use VOCTRL_CHECK_EVENTS instead to implementing check_events. This has the advantage that the event handling code in VOs doesn't have to be duplicated if vo_control() is used. --- video/out/wayland_common.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'video/out/wayland_common.c') diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 9c1d5ffe55..2e15703709 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -862,3 +862,26 @@ void vo_wayland_update_window_title(struct vo *vo) wl_shell_surface_set_title(w->shell_surface, vo_get_window_title(vo)); } +int vo_wayland_control(struct vo *vo, int *events, int request, void *arg) +{ + switch (request) { + case VOCTRL_CHECK_EVENTS: + *events |= vo_wayland_check_events(vo); + return VO_TRUE; + case VOCTRL_FULLSCREEN: + vo_wayland_fullscreen(vo); + *events |= VO_EVENT_RESIZE; + return VO_TRUE; + case VOCTRL_ONTOP: + vo_wayland_ontop(vo); + return VO_TRUE; + case VOCTRL_BORDER: + vo_wayland_border(vo); + *events |= VO_EVENT_RESIZE; + return VO_TRUE; + case VOCTRL_UPDATE_SCREENINFO: + vo_wayland_update_screeninfo(vo); + return VO_TRUE; + } + return VO_NOTIMPL; +} -- cgit v1.2.3