Commit 3bda2242 authored by Felix Paul Kühne's avatar Felix Paul Kühne

caopengllayer: add implicit API to handle mouse events

Since CALayer doesn't have access to the mouse, it is the container view's duty to feed this info if desired
parent 5e177435
...@@ -474,4 +474,45 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name) ...@@ -474,4 +474,45 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
// do not release anything here, we do that when closing the module // do not release anything here, we do that when closing the module
} }
- (void)mouseButtonDown:(int)buttonNumber
{
@synchronized (self) {
if (_vd) {
if (buttonNumber == 0)
vout_display_SendEventMousePressed (_vd, MOUSE_BUTTON_LEFT);
else if (buttonNumber == 1)
vout_display_SendEventMousePressed (_vd, MOUSE_BUTTON_RIGHT);
else
vout_display_SendEventMousePressed (_vd, MOUSE_BUTTON_CENTER);
}
}
}
- (void)mouseButtonUp:(int)buttonNumber
{
@synchronized (self) {
if (_vd) {
if (buttonNumber == 0)
vout_display_SendEventMouseReleased (_vd, MOUSE_BUTTON_LEFT);
else if (buttonNumber == 1)
vout_display_SendEventMouseReleased (_vd, MOUSE_BUTTON_RIGHT);
else
vout_display_SendEventMouseReleased (_vd, MOUSE_BUTTON_CENTER);
}
}
}
- (void)mouseMovedToX:(double)xValue Y:(double)yValue
{
@synchronized (self) {
if (_vd) {
vout_display_SendMouseMovedDisplayCoordinates (_vd,
ORIENT_NORMAL,
xValue,
yValue,
&_vd->sys->place);
}
}
}
@end @end
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