Commit 8ca5f440 authored by unknown's avatar unknown Committed by Jean-Paul Saman

activex: plugin.cpp: properly translate all booleans to VARIANT_BOOL for events

parent 1ecd16ca
...@@ -1214,17 +1214,16 @@ void VLCPlugin::fireOnMouseObjectEvent(VARIANT_BOOL moved) ...@@ -1214,17 +1214,16 @@ void VLCPlugin::fireOnMouseObjectEvent(VARIANT_BOOL moved)
vlcConnectionPointContainer->fireEvent(DISPID_MouseObjectEvent, &params); vlcConnectionPointContainer->fireEvent(DISPID_MouseObjectEvent, &params);
}; };
#define B(val) ((val) ? 0xFFFF : 0x0000)
static void handle_mouse_button_pressed_event(const libvlc_event_t* event, void *param) static void handle_mouse_button_pressed_event(const libvlc_event_t* event, void *param)
{ {
VLCPlugin *plugin = (VLCPlugin*)param; VLCPlugin *plugin = (VLCPlugin*)param;
VARIANT_BOOL btn_right, btn_center, btn_left, btn_wheel_up, btn_wheel_down; VARIANT_BOOL btn_right, btn_center, btn_left, btn_wheel_up, btn_wheel_down;
#define B(val) ((val) ? 0xFFFF : 0x0000)
btn_right = B(event->u.media_player_mouse_button.mb_right); btn_right = B(event->u.media_player_mouse_button.mb_right);
btn_center = B(event->u.media_player_mouse_button.mb_center); btn_center = B(event->u.media_player_mouse_button.mb_center);
btn_left = B(event->u.media_player_mouse_button.mb_left); btn_left = B(event->u.media_player_mouse_button.mb_left);
btn_wheel_up = B(event->u.media_player_mouse_button.mb_wheel_up); btn_wheel_up = B(event->u.media_player_mouse_button.mb_wheel_up);
btn_wheel_down = B(event->u.media_player_mouse_button.mb_wheel_down); btn_wheel_down = B(event->u.media_player_mouse_button.mb_wheel_down);
#undef B
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);
} }
...@@ -1239,14 +1238,15 @@ static void handle_mouse_moved_event(const libvlc_event_t* event, void *param) ...@@ -1239,14 +1238,15 @@ 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(event->u.media_player_mouse_clicked.clicked); plugin->fireOnMouseClickedEvent(B(event->u.media_player_mouse_clicked.clicked));
} }
static void handle_mouse_object_event(const libvlc_event_t* event, void *param) static void handle_mouse_object_event(const libvlc_event_t* event, void *param)
{ {
VLCPlugin *plugin = (VLCPlugin*)param; VLCPlugin *plugin = (VLCPlugin*)param;
plugin->fireOnMouseObjectEvent(event->u.media_player_mouse_object.moved); plugin->fireOnMouseObjectEvent(B(event->u.media_player_mouse_object.moved));
} }
#undef B
/* */ /* */
......
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