Commit 4c40de1f authored by Felix Paul Kühne's avatar Felix Paul Kühne

mac plugin: implement Cocoa Event handling for Mouse and Keys

No drawing yet
parent 79929ae5
/*****************************************************************************
* vlcplugin_mac.cpp: a VLC plugin for Mozilla (Mac interface)
*****************************************************************************
* Copyright (C) 2011 the VideoLAN team
* Copyright (C) 2011-2012 VLC Authors and VideoLAN
* $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Damien Fouilleul <damienf@videolan.org>
* Jean-Paul Saman <jpsaman@videolan.org>
* Cheng Sun <chengsun9@gmail.com>
* Felix Paul Kühne <fkuehne # videolan # org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -105,31 +106,36 @@ bool VlcPluginMac::destroy_windows()
bool VlcPluginMac::handle_event(void *event)
{
// FIXME: implement Cocoa event model, by porting this legacy code:
/*
static UInt32 lastMouseUp = 0;
EventRecord *myEvent = (EventRecord*)event;
NPCocoaEvent* cocoaEvent = (NPCocoaEvent*)event;
switch( myEvent->what )
{
case nullEvent:
return true;
case mouseDown:
if (!event)
return false;
NPCocoaEventType eventType = cocoaEvent->type;
switch (eventType) {
case NPCocoaEventMouseDown:
{
if( (myEvent->when - lastMouseUp) < GetDblTime() )
{
// double click
p_plugin->toggle_fullscreen();
}
if (cocoaEvent->data.mouse.clickCount >= 2)
VlcPluginMac::toggle_fullscreen();
return true;
}
case mouseUp:
lastMouseUp = myEvent->when;
return true;
case keyUp:
case keyDown:
case autoKey:
case NPCocoaEventMouseUp:
case NPCocoaEventKeyUp:
case NPCocoaEventKeyDown:
case NPCocoaEventFocusChanged:
case NPCocoaEventScrollWheel:
return true;
default:
break;
}
/*
EventRecord *myEvent = (EventRecord*)event;
switch( myEvent->what )
{
case updateEvt:
{
const NPWindow& npwindow = p_plugin->getWindow();
......@@ -181,23 +187,6 @@ bool VlcPluginMac::handle_event(void *event)
}
return true;
}
case activateEvt:
return false;
case NPEventType_GetFocusEvent:
case NPEventType_LoseFocusEvent:
return true;
case NPEventType_AdjustCursorEvent:
return false;
case NPEventType_MenuCommandEvent:
return false;
case NPEventType_ClippingChangedEvent:
return false;
case NPEventType_ScrollingBeginsEvent:
return true;
case NPEventType_ScrollingEndsEvent:
return true;
default:
;
}
*/
return VlcPluginBase::handle_event(event);
......
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