Commit 1ce563c4 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Rename libvlc_MediaPlayerMouseObject to libvlc_MediaPlayerMouseGrab

- update activex
- update logo video_filter
- update video_output core
- update libvlc events and media_player
parent 91368656
...@@ -74,7 +74,7 @@ enum libvlc_event_e { ...@@ -74,7 +74,7 @@ enum libvlc_event_e {
libvlc_MediaPlayerMouseMoved, libvlc_MediaPlayerMouseMoved,
libvlc_MediaPlayerMouseButton, libvlc_MediaPlayerMouseButton,
libvlc_MediaPlayerMouseClick, libvlc_MediaPlayerMouseClick,
libvlc_MediaPlayerMouseObject, libvlc_MediaPlayerMouseGrab,
libvlc_MediaListItemAdded=0x200, libvlc_MediaListItemAdded=0x200,
libvlc_MediaListWillAddItem, libvlc_MediaListWillAddItem,
...@@ -234,13 +234,15 @@ typedef struct libvlc_event_t ...@@ -234,13 +234,15 @@ typedef struct libvlc_event_t
struct struct
{ {
int clicked; int x;
int y;
} media_player_mouse_clicked; } media_player_mouse_clicked;
struct struct
{ {
int moved; int x;
} media_player_mouse_object; int y;
} media_player_mouse_grab;
} u; /**< Type-dependent event description */ } u; /**< Type-dependent event description */
} libvlc_event_t; } libvlc_event_t;
......
...@@ -544,8 +544,7 @@ static int Mouse( filter_t *p_filter, vlc_mouse_t *p_mouse, ...@@ -544,8 +544,7 @@ static int Mouse( filter_t *p_filter, vlc_mouse_t *p_mouse,
if( p_sys->p_vout && p_sys->b_mouse_grab ) if( p_sys->p_vout && p_sys->b_mouse_grab )
{ {
/* mouse-object: area of interest */ var_SetCoords( p_sys->p_vout, "mouse-grab", p_sys->i_pos_x, p_sys->i_pos_y );
var_SetBool( p_sys->p_vout, "mouse-object", true );
} }
if( p_sys->b_mouse_grab || b_over ) if( p_sys->b_mouse_grab || b_over )
......
...@@ -188,7 +188,7 @@ library AXVLC ...@@ -188,7 +188,7 @@ library AXVLC
const int DISPID_MouseButtonEvent = 214; const int DISPID_MouseButtonEvent = 214;
const int DISPID_MouseMovedEvent = 215; const int DISPID_MouseMovedEvent = 215;
const int DISPID_MouseClickedEvent = 216; const int DISPID_MouseClickedEvent = 216;
const int DISPID_MouseObjectEvent = 217; const int DISPID_MouseGrabEvent = 217;
[ [
uuid(DF48072F-5EF8-434e-9B40-E2F3AE759B5F), uuid(DF48072F-5EF8-434e-9B40-E2F3AE759B5F),
...@@ -243,9 +243,9 @@ library AXVLC ...@@ -243,9 +243,9 @@ library AXVLC
[id(DISPID_MouseMovedEvent), helpstring("Mouse moved")] [id(DISPID_MouseMovedEvent), helpstring("Mouse moved")]
void MouseMoved([in] long x, [in] long y); void MouseMoved([in] long x, [in] long y);
[id(DISPID_MouseClickedEvent), helpstring("Mouse clicked")] [id(DISPID_MouseClickedEvent), helpstring("Mouse clicked")]
void MouseClicked([in] VARIANT_BOOL clicked); void MouseClicked([in] long x, [in] long y);
[id(DISPID_MouseObjectEvent), helpstring("Mouse selected holds object")] [id(DISPID_MouseGrabEvent), helpstring("Mouse grabs object in video output")]
void MouseObject([in] VARIANT_BOOL moved); void MouseGrab([in] long x, [in] long y);
}; };
[ [
......
/*** Autogenerated by WIDL 1.1.36 from axvlc.idl - Do not edit ***/ /*** Autogenerated by WIDL 1.1.38 from axvlc.idl - Do not edit ***/
#include <rpc.h> #include <rpc.h>
#include <rpcndr.h> #include <rpcndr.h>
......
/*** Autogenerated by WIDL 1.1.36 from axvlc.idl - Do not edit ***/ /*** Autogenerated by WIDL 1.1.38 from axvlc.idl - Do not edit ***/
#include <rpc.h> #include <rpc.h>
#include <rpcndr.h> #include <rpcndr.h>
...@@ -827,7 +827,7 @@ void __RPC_STUB IVLCControl_put_AutoLoop_Stub( ...@@ -827,7 +827,7 @@ void __RPC_STUB IVLCControl_put_AutoLoop_Stub(
#define DISPID_MouseClickedEvent (216) #define DISPID_MouseClickedEvent (216)
#define DISPID_MouseObjectEvent (217) #define DISPID_MouseGrabEvent (217)
/***************************************************************************** /*****************************************************************************
* DVLCEvents dispinterface * DVLCEvents dispinterface
......
...@@ -1187,31 +1187,35 @@ void VLCPlugin::fireOnMouseButtonEvent(VARIANT_BOOL btn_right, VARIANT_BOOL btn_ ...@@ -1187,31 +1187,35 @@ void VLCPlugin::fireOnMouseButtonEvent(VARIANT_BOOL btn_right, VARIANT_BOOL btn_
void VLCPlugin::fireOnMouseMovedEvent(long x, long y) void VLCPlugin::fireOnMouseMovedEvent(long x, long y)
{ {
VARIANT varMoved[2]; VARIANT varCoords[2];
DISPPARAMS params = { varMoved, NULL, 3, 0 }; DISPPARAMS params = { varCoords, NULL, 3, 0 };
varMoved[0].vt = VT_INT; varCoords[0].vt = VT_INT;
varMoved[0].intVal = x; varCoords[0].intVal = x;
varMoved[1].vt = VT_INT; varCoords[1].vt = VT_INT;
varMoved[1].intVal = y; varCoords[1].intVal = y;
vlcConnectionPointContainer->fireEvent(DISPID_MouseMovedEvent, &params); vlcConnectionPointContainer->fireEvent(DISPID_MouseMovedEvent, &params);
}; };
void VLCPlugin::fireOnMouseClickedEvent(VARIANT_BOOL clicked) void VLCPlugin::fireOnMouseClickedEvent(long x, long y)
{ {
VARIANT varClicked; VARIANT varCoords[2];
DISPPARAMS params = { &varClicked, NULL, 1, 0 }; DISPPARAMS params = { varCoords, NULL, 3, 0 };
varClicked.vt = VT_BOOL; varCoords[0].vt = VT_INT;
varClicked.boolVal = clicked; varCoords[0].intVal = x;
varCoords[1].vt = VT_INT;
varCoords[1].intVal = y;
vlcConnectionPointContainer->fireEvent(DISPID_MouseClickedEvent, &params); vlcConnectionPointContainer->fireEvent(DISPID_MouseClickedEvent, &params);
}; };
void VLCPlugin::fireOnMouseObjectEvent(VARIANT_BOOL moved) void VLCPlugin::fireOnMouseGrabEvent(long x, long y)
{ {
VARIANT varMoved; VARIANT varCoords[2];
DISPPARAMS params = { &varMoved, NULL, 1, 0 }; DISPPARAMS params = { varCoords, NULL, 3, 0 };
varMoved.vt = VT_BOOL; varCoords[0].vt = VT_INT;
varMoved.boolVal = moved; varCoords[0].intVal = x;
vlcConnectionPointContainer->fireEvent(DISPID_MouseObjectEvent, &params); varCoords[1].vt = VT_INT;
varCoords[1].intVal = y;
vlcConnectionPointContainer->fireEvent(DISPID_MouseGrabEvent, &params);
}; };
#define B(val) ((val) ? 0xFFFF : 0x0000) #define B(val) ((val) ? 0xFFFF : 0x0000)
...@@ -1227,6 +1231,7 @@ static void handle_mouse_button_pressed_event(const libvlc_event_t* event, void ...@@ -1227,6 +1231,7 @@ static void handle_mouse_button_pressed_event(const libvlc_event_t* event, void
plugin->fireOnMouseButtonEvent(btn_right, btn_center, btn_left, plugin->fireOnMouseButtonEvent(btn_right, btn_center, btn_left,
btn_wheel_up, btn_wheel_down); btn_wheel_up, btn_wheel_down);
} }
#undef B
static void handle_mouse_moved_event(const libvlc_event_t* event, void *param) static void handle_mouse_moved_event(const libvlc_event_t* event, void *param)
{ {
...@@ -1238,15 +1243,16 @@ static void handle_mouse_moved_event(const libvlc_event_t* event, void *param) ...@@ -1238,15 +1243,16 @@ static void handle_mouse_moved_event(const libvlc_event_t* event, void *param)
static void handle_mouse_clicked_event(const libvlc_event_t* event, void *param) static void handle_mouse_clicked_event(const libvlc_event_t* event, void *param)
{ {
VLCPlugin *plugin = (VLCPlugin*)param; VLCPlugin *plugin = (VLCPlugin*)param;
plugin->fireOnMouseClickedEvent(B(event->u.media_player_mouse_clicked.clicked)); plugin->fireOnMouseClickedEvent(event->u.media_player_mouse_clicked.x,
event->u.media_player_mouse_clicked.y);
} }
static void handle_mouse_object_event(const libvlc_event_t* event, void *param) static void handle_mouse_grab_event(const libvlc_event_t* event, void *param)
{ {
VLCPlugin *plugin = (VLCPlugin*)param; VLCPlugin *plugin = (VLCPlugin*)param;
plugin->fireOnMouseObjectEvent(B(event->u.media_player_mouse_object.moved)); plugin->fireOnMouseGrabEvent(event->u.media_player_mouse_grab.x,
event->u.media_player_mouse_grab.y);
} }
#undef B
/* */ /* */
...@@ -1347,8 +1353,8 @@ void VLCPlugin::player_register_events() ...@@ -1347,8 +1353,8 @@ void VLCPlugin::player_register_events()
handle_mouse_moved_event, this); handle_mouse_moved_event, this);
libvlc_event_attach(eventManager, libvlc_MediaPlayerMouseClick, libvlc_event_attach(eventManager, libvlc_MediaPlayerMouseClick,
handle_mouse_clicked_event, this); handle_mouse_clicked_event, this);
libvlc_event_attach(eventManager, libvlc_MediaPlayerMouseObject, libvlc_event_attach(eventManager, libvlc_MediaPlayerMouseGrab,
handle_mouse_object_event, this); handle_mouse_grab_event, this);
} }
} }
...@@ -1395,8 +1401,8 @@ void VLCPlugin::player_unregister_events() ...@@ -1395,8 +1401,8 @@ void VLCPlugin::player_unregister_events()
handle_mouse_moved_event, this); handle_mouse_moved_event, this);
libvlc_event_detach(eventManager, libvlc_MediaPlayerMouseClick, libvlc_event_detach(eventManager, libvlc_MediaPlayerMouseClick,
handle_mouse_clicked_event, this); handle_mouse_clicked_event, this);
libvlc_event_detach(eventManager, libvlc_MediaPlayerMouseObject, libvlc_event_detach(eventManager, libvlc_MediaPlayerMouseGrab,
handle_mouse_object_event, this); handle_mouse_grab_event, this);
} }
} }
......
...@@ -259,8 +259,8 @@ public: ...@@ -259,8 +259,8 @@ public:
VARIANT_BOOL btn_left, VARIANT_BOOL btn_wheel_up, VARIANT_BOOL btn_left, VARIANT_BOOL btn_wheel_up,
VARIANT_BOOL bnt_wheel_down); VARIANT_BOOL bnt_wheel_down);
void fireOnMouseMovedEvent(long x, long y); void fireOnMouseMovedEvent(long x, long y);
void fireOnMouseClickedEvent(VARIANT_BOOL clicked); void fireOnMouseClickedEvent(long x, long y);
void fireOnMouseObjectEvent(VARIANT_BOOL moved); void fireOnMouseGrabEvent(long x, long y);
// controlling IUnknown interface // controlling IUnknown interface
LPUNKNOWN pUnkOuter; LPUNKNOWN pUnkOuter;
......
...@@ -267,35 +267,21 @@ function handleMousePos(event,X,Y) ...@@ -267,35 +267,21 @@ function handleMousePos(event,X,Y)
document.getElementById("cursorTextField").innerHTML = "(" + X + "," + Y + ")"; document.getElementById("cursorTextField").innerHTML = "(" + X + "," + Y + ")";
} }
function handleMouseClick(event,click) function handleMouseClick(event,X,Y)
{ {
if (click) { document.getElementById("clickTextField").innerHTML = "(" + X + "," + Y + ")";
document.getElementById("clickTextField").innerHTML = "yes";
} else {
document.getElementById("clickTextField").innerHTML = "no";
}
} }
function handleMouseObject(event,moved) function handleMouseGrab(event,X,Y)
{ {
var vlc = getVLC("vlc");
if (vlc && vlc.video) {
var newpos = ""; var newpos = "";
if (vlc.video.logo) { newpos = "("+ X + "," + Y + ")";
newpos = "("+ vlc.video.logo.x + "," + vlc.video.logo.y+ ")"; document.getElementById("objectTextField").innerHTML = "grabbed at " + newpos;
}
if (moved) {
document.getElementById("objectTextField").innerHTML = "yes: " + newpos;
} else {
document.getElementById("objectTextField").innerHTML = "no: " + newpos;
}
}
} }
registerVLCEvent('MouseMoved', handleMousePos); registerVLCEvent('MouseMoved', handleMousePos);
registerVLCEvent('MouseClicked', handleMouseClick); registerVLCEvent('MouseClicked', handleMouseClick);
registerVLCEvent('MouseObject', handleMouseObject); registerVLCEvent('MouseGrab', handleMouseGrab);
function doSetSlider() function doSetSlider()
{ {
......
...@@ -69,7 +69,7 @@ static int ...@@ -69,7 +69,7 @@ static int
mouse_clicked( vlc_object_t *p_this, char const *psz_cmd, mouse_clicked( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data ); vlc_value_t oldval, vlc_value_t newval, void *p_data );
static int static int
mouse_object( vlc_object_t *p_this, char const *psz_cmd, mouse_grab( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data ); vlc_value_t oldval, vlc_value_t newval, void *p_data );
/* */ /* */
...@@ -186,7 +186,7 @@ static vout_thread_t *get_vout_thread( libvlc_media_player_t *p_mi ) ...@@ -186,7 +186,7 @@ static vout_thread_t *get_vout_thread( libvlc_media_player_t *p_mi )
var_AddCallback( p_vout, "mouse-button-down", mouse_button, p_mi ); var_AddCallback( p_vout, "mouse-button-down", mouse_button, p_mi );
var_AddCallback( p_vout, "mouse-moved", mouse_moved, p_mi ); var_AddCallback( p_vout, "mouse-moved", mouse_moved, p_mi );
var_AddCallback( p_vout, "mouse-clicked", mouse_clicked, p_mi ); var_AddCallback( p_vout, "mouse-clicked", mouse_clicked, p_mi );
var_AddCallback( p_vout, "mouse-object", mouse_object, p_mi ); var_AddCallback( p_vout, "mouse-grab", mouse_grab, p_mi );
} }
return p_vout; return p_vout;
...@@ -210,7 +210,7 @@ static void release_vout_thread( libvlc_media_player_t *p_mi ) ...@@ -210,7 +210,7 @@ static void release_vout_thread( libvlc_media_player_t *p_mi )
var_DelCallback( p_vout, "mouse-button-down", mouse_button, p_mi ); var_DelCallback( p_vout, "mouse-button-down", mouse_button, p_mi );
var_DelCallback( p_vout, "mouse-moved", mouse_moved, p_mi ); var_DelCallback( p_vout, "mouse-moved", mouse_moved, p_mi );
var_DelCallback( p_vout, "mouse-clicked", mouse_clicked, p_mi ); var_DelCallback( p_vout, "mouse-clicked", mouse_clicked, p_mi );
var_DelCallback( p_vout, "mouse-object", mouse_object, p_mi ); var_DelCallback( p_vout, "mouse-grab", mouse_grab, p_mi );
vlc_object_release( p_vout ); vlc_object_release( p_vout );
p_mi->input.p_vout = NULL; p_mi->input.p_vout = NULL;
...@@ -445,22 +445,24 @@ mouse_clicked( vlc_object_t *p_this, char const *psz_cmd, ...@@ -445,22 +445,24 @@ mouse_clicked( vlc_object_t *p_this, char const *psz_cmd,
libvlc_media_player_t *mp = p_data; libvlc_media_player_t *mp = p_data;
libvlc_event_t event; libvlc_event_t event;
event.type = libvlc_MediaPlayerMouseClick; event.type = libvlc_MediaPlayerMouseClick;
event.u.media_player_mouse_clicked.clicked = newval.b_bool ? 1 : 0; event.u.media_player_mouse_clicked.x = newval.coords.x;
event.u.media_player_mouse_clicked.y = newval.coords.y;
libvlc_event_send(mp->p_event_manager, &event); libvlc_event_send(mp->p_event_manager, &event);
return VLC_SUCCESS; return VLC_SUCCESS;
} }
static int static int
mouse_object( vlc_object_t *p_this, char const *psz_cmd, mouse_grab( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data ) vlc_value_t oldval, vlc_value_t newval, void *p_data )
{ {
VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_this); VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_this);
libvlc_media_player_t *mp = p_data; libvlc_media_player_t *mp = p_data;
libvlc_event_t event; libvlc_event_t event;
event.type = libvlc_MediaPlayerMouseObject; event.type = libvlc_MediaPlayerMouseGrab;
event.u.media_player_mouse_object.moved = (newval.b_bool ? 1 : 0); event.u.media_player_mouse_grab.x = newval.coords.x;
event.u.media_player_mouse_grab.y = newval.coords.y;
libvlc_event_send(mp->p_event_manager, &event); libvlc_event_send(mp->p_event_manager, &event);
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -605,7 +607,7 @@ libvlc_media_player_new( libvlc_instance_t *instance ) ...@@ -605,7 +607,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
register_event(mp, MouseMoved); register_event(mp, MouseMoved);
register_event(mp, MouseButton); register_event(mp, MouseButton);
register_event(mp, MouseClick); register_event(mp, MouseClick);
register_event(mp, MouseObject); register_event(mp, MouseGrab);
/* Attach a var callback to the global object to provide the glue between /* Attach a var callback to the global object to provide the glue between
* vout_thread that generates the event and media_player that re-emits it * vout_thread that generates the event and media_player that re-emits it
......
...@@ -404,7 +404,7 @@ vout_thread_t * vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt ) ...@@ -404,7 +404,7 @@ vout_thread_t * vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
var_Create( p_vout, "mouse-moved", VLC_VAR_COORDS ); var_Create( p_vout, "mouse-moved", VLC_VAR_COORDS );
var_Create( p_vout, "mouse-clicked", VLC_VAR_COORDS ); var_Create( p_vout, "mouse-clicked", VLC_VAR_COORDS );
/* Mouse object (area of interest in a video filter) */ /* Mouse object (area of interest in a video filter) */
var_Create( p_vout, "mouse-object", VLC_VAR_BOOL ); var_Create( p_vout, "mouse-grab", VLC_VAR_COORDS );
/* Attach the new object now so we can use var inheritance below */ /* Attach the new object now so we can use var inheritance below */
vlc_object_attach( p_vout, p_parent ); vlc_object_attach( p_vout, p_parent );
......
...@@ -366,7 +366,7 @@ void vout_IntfInit( vout_thread_t *p_vout ) ...@@ -366,7 +366,7 @@ void vout_IntfInit( vout_thread_t *p_vout )
var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER ); var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-moved", VLC_VAR_COORDS ); var_Create( p_vout, "mouse-moved", VLC_VAR_COORDS );
var_Create( p_vout, "mouse-clicked", VLC_VAR_COORDS ); var_Create( p_vout, "mouse-clicked", VLC_VAR_COORDS );
var_Create( p_vout, "mouse-object", VLC_VAR_BOOL ); var_Create( p_vout, "mouse-grab", VLC_VAR_COORDS );
var_Create( p_vout, "intf-change", VLC_VAR_BOOL ); var_Create( p_vout, "intf-change", VLC_VAR_BOOL );
var_SetBool( p_vout, "intf-change", true ); var_SetBool( p_vout, "intf-change", true );
......
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