From 4c533fbb16b99c4b28fbd968d81bb0b44e3084b5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 27 Jul 2014 21:53:29 +0200 Subject: vo: remove vo_mouse_movement() wrapper So that VO backends don't have to access the VO just for that. --- video/out/cocoa_common.m | 2 +- video/out/vo.c | 14 -------------- video/out/vo.h | 3 --- video/out/vo_caca.c | 8 +++----- video/out/vo_sdl.c | 2 +- video/out/w32_common.c | 4 ++-- video/out/wayland_common.c | 4 ++-- video/out/x11_common.c | 5 +++-- 8 files changed, 12 insertions(+), 30 deletions(-) (limited to 'video') diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 2c3b5dafb2..094236884b 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -716,7 +716,7 @@ void *vo_cocoa_cgl_pixel_format(struct vo *vo) } - (void)signalMouseMovement:(NSPoint)point { - vo_mouse_movement(self.vout, point.x, point.y); + mp_input_set_mouse_pos(self.vout->input_ctx, point.x, point.y); [self recalcMovableByWindowBackground:point]; } diff --git a/video/out/vo.c b/video/out/vo.c index db6a97eb26..2a640d8ea3 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -405,20 +405,6 @@ const char *vo_get_window_title(struct vo *vo) return vo->window_title; } -/** - * Generates a mouse movement message if those are enable and sends it - * to the "main" MPlayer. - * - * \param posx new x position of mouse - * \param posy new y position of mouse - */ -void vo_mouse_movement(struct vo *vo, int posx, int posy) -{ - if (!vo->opts->enable_mouse_movements) - return; - mp_input_set_mouse_pos(vo->input_ctx, posx, posy); -} - /** * \brief lookup an integer in a table, table must have 0 as the last key * \param key key to search for diff --git a/video/out/vo.h b/video/out/vo.h index cc1fd6c23a..409ee926dc 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -293,9 +293,6 @@ struct mp_keymap { }; int lookup_keymap_table(const struct mp_keymap *map, int key); -void vo_mouse_movement(struct vo *vo, int posx, int posy); -void vo_drop_files(struct vo *vo, int num_files, char **files); - struct mp_osd_res; void vo_get_src_dst_rects(struct vo *vo, struct mp_rect *out_src, struct mp_rect *out_dst, struct mp_osd_res *out_osd); diff --git a/video/out/vo_caca.c b/video/out/vo_caca.c index 00b9e23123..bcef78534c 100644 --- a/video/out/vo_caca.c +++ b/video/out/vo_caca.c @@ -178,16 +178,14 @@ static void check_events(struct vo *vo) mp_input_put_key(vo->input_ctx, MP_KEY_CLOSE_WIN); break; case CACA_EVENT_MOUSE_MOTION: - vo_mouse_movement(vo, cev.data.mouse.x, cev.data.mouse.y); + mp_input_set_mouse_pos(vo->input_ctx, cev.data.mouse.x, cev.data.mouse.y); break; case CACA_EVENT_MOUSE_PRESS: - if (vo->opts->enable_mouse_movements) - mp_input_put_key(vo->input_ctx, + mp_input_put_key(vo->input_ctx, (MP_MOUSE_BTN0 + cev.data.mouse.button - 1) | MP_KEY_STATE_DOWN); break; case CACA_EVENT_MOUSE_RELEASE: - if (vo->opts->enable_mouse_movements) - mp_input_put_key(vo->input_ctx, + mp_input_put_key(vo->input_ctx, (MP_MOUSE_BTN0 + cev.data.mouse.button - 1) | MP_KEY_STATE_UP); break; case CACA_EVENT_KEY_PRESS: diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c index 6fe09d2691..9b52fc08be 100644 --- a/video/out/vo_sdl.c +++ b/video/out/vo_sdl.c @@ -603,7 +603,7 @@ static void check_events(struct vo *vo) break; } case SDL_MOUSEMOTION: - vo_mouse_movement(vo, ev.motion.x, ev.motion.y); + mp_input_set_mouse_pos(vo->input_ctx, ev.motion.x, ev.motion.y); break; case SDL_MOUSEBUTTONDOWN: mp_input_put_key(vo->input_ctx, diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 6d894000f5..33b6cdfa63 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -623,7 +623,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, if (x != w32->mouse_x || y != w32->mouse_y) { w32->mouse_x = x; w32->mouse_y = y; - vo_mouse_movement(w32->vo, x, y); + mp_input_set_mouse_pos(w32->input_ctx, x, y); } break; } @@ -664,7 +664,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, mouse_button |= mod_state(w32); mp_input_put_key(w32->input_ctx, mouse_button); - if (w32->opts->enable_mouse_movements) { + if (mp_input_mouse_enabled(w32->input_ctx)) { int x = GET_X_LPARAM(lParam); int y = GET_Y_LPARAM(lParam); diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index fe6142c89a..1feb0080d4 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -340,8 +340,8 @@ static void pointer_handle_motion(void *data, wl->window.mouse_x = wl_fixed_to_int(sx_w); wl->window.mouse_y = wl_fixed_to_int(sy_w); - vo_mouse_movement(wl->vo, wl->window.mouse_x, - wl->window.mouse_y); + mp_input_set_mouse_pos(wl->vo->input_ctx, wl->window.mouse_x, + wl->window.mouse_y); } static void pointer_handle_button(void *data, diff --git a/video/out/x11_common.c b/video/out/x11_common.c index f43c5c03a8..539d66e641 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -835,7 +835,8 @@ int vo_x11_check_events(struct vo *vo) }; x11_send_ewmh_msg(x11, "_NET_WM_MOVERESIZE", params); } else { - vo_mouse_movement(vo, Event.xmotion.x, Event.xmotion.y); + mp_input_set_mouse_pos(vo->input_ctx, Event.xmotion.x, + Event.xmotion.y); } x11->win_drag_button1_down = false; break; @@ -1560,7 +1561,7 @@ static void vo_x11_selectinput_witherr(struct vo *vo, Window w, long event_mask) { - if (!vo->opts->enable_mouse_movements) + if (!mp_input_mouse_enabled(vo->input_ctx)) event_mask &= ~(PointerMotionMask | ButtonPressMask | ButtonReleaseMask); XSelectInput(display, w, NoEventMask); -- cgit v1.2.3