From 14c018a80f4908a6540e76e08047dcbf6d9dc059 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 25 Apr 2010 16:13:57 +0000 Subject: Avoid duplicating mouse-movement command-generation code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31091 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/video_out.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libvo/video_out.c') diff --git a/libvo/video_out.c b/libvo/video_out.c index c1786d27ba..fdb75ba8fb 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -446,6 +446,21 @@ void calc_src_dst_rects(int src_width, int src_height, struct vo_rect *src, stru dst->height = dst->bottom - dst->top; } +/** + * 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(int posx, int posy) { + char cmd_str[40]; + if (!enable_mouse_movements) + return; + snprintf(cmd_str, sizeof(cmd_str), "set_mouse_pos %i %i", posx, posy); + mp_input_queue_cmd(mp_input_parse_cmd(cmd_str)); +} + #if defined(CONFIG_FBDEV) || defined(CONFIG_VESA) /* Borrowed from vo_fbdev.c Monitor ranges related functions*/ -- cgit v1.2.3