Skip to content
Permalink
Browse files
2010-10-18 Stuart Morgan <stuartmorgan@chromium.org>
        Reviewed by Eric Seidel.

        Switch to using the new Carbon NPAPI event declarations, and remove
        the old ones.

        https://bugs.webkit.org/show_bug.cgi?id=40784

        * bridge/npapi.h:
        * plugins/mac/PluginViewMac.mm:
        (WebCore::PluginView::setFocus):
        (WebCore::PluginView::handleMouseEvent):
2010-10-18  Stuart Morgan  <stuartmorgan@chromium.org>

        Reviewed by Eric Seidel.

        Switch to using the new Carbon NPAPI event declarations, and remove
        the old ones.

        https://bugs.webkit.org/show_bug.cgi?id=40784

        * Plugins/WebNetscapePluginEventHandlerCarbon.mm:
        (WebNetscapePluginEventHandlerCarbon::mouseEntered):
        (WebNetscapePluginEventHandlerCarbon::mouseExited):
        (WebNetscapePluginEventHandlerCarbon::mouseMoved):
        (WebNetscapePluginEventHandlerCarbon::focusChanged):
2010-10-18  Stuart Morgan  <stuartmorgan@chromium.org>

        Reviewed by Eric Seidel.

        Switch to using the new Carbon NPAPI event declarations, and remove
        the old ones.

        https://bugs.webkit.org/show_bug.cgi?id=40784

        * DumpRenderTree/TestNetscapePlugIn/main.cpp:
        (handleEventCarbon):

Canonical link: https://commits.webkit.org/60545@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@69979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Oct 18, 2010
1 parent b2b0f87 commit dd230040381bb29768d6790948fd9cbeefef3ced
Showing 7 changed files with 55 additions and 18 deletions.
@@ -1,3 +1,17 @@
2010-10-18 Stuart Morgan <stuartmorgan@chromium.org>

Reviewed by Eric Seidel.

Switch to using the new Carbon NPAPI event declarations, and remove
the old ones.

https://bugs.webkit.org/show_bug.cgi?id=40784

* bridge/npapi.h:
* plugins/mac/PluginViewMac.mm:
(WebCore::PluginView::setFocus):
(WebCore::PluginView::handleMouseEvent):

2010-10-18 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Yury Semikhatsky.
@@ -676,10 +676,6 @@ enum NPEventType {
NPEventType_ScrollingBeginsEvent = 1000,
NPEventType_ScrollingEndsEvent
};
/* Obsolete versions of the above */
#define getFocusEvent (osEvt + 16)
#define loseFocusEvent (osEvt + 17)
#define adjustCursorEvent (osEvt + 18)
#endif /* NP_NO_CARBON */

#endif /* XP_MACOSX */
@@ -359,7 +359,7 @@ static inline IntPoint topLevelOffsetFor(PlatformWidget widget)

#ifndef NP_NO_CARBON
EventRecord record;
record.what = getFocusEvent;
record.what = NPEventType_GetFocusEvent;
record.message = 0;
record.when = TickCount();
record.where = globalMousePosForPlugin();
@@ -576,9 +576,9 @@ static inline IntPoint topLevelOffsetFor(PlatformWidget widget)
m_lastMousePos = mousePosForPlugin(event);
return;
} else if (event->type() == eventNames().mouseoverEvent) {
record.what = adjustCursorEvent;
record.what = NPEventType_AdjustCursorEvent;
} else if (event->type() == eventNames().mouseoutEvent) {
record.what = adjustCursorEvent;
record.what = NPEventType_AdjustCursorEvent;
} else if (event->type() == eventNames().mousedownEvent) {
record.what = mouseDown;
// The plugin needs focus to receive keyboard events
@@ -600,7 +600,7 @@ static inline IntPoint topLevelOffsetFor(PlatformWidget widget)
record.modifiers |= controlKey;

if (!dispatchNPEvent(record)) {
if (record.what == adjustCursorEvent)
if (record.what == NPEventType_AdjustCursorEvent)
return; // Signals that the plugin wants a normal cursor

LOG(Events, "PluginView::handleMouseEvent(): Mouse event type %d at %d,%d not accepted",
@@ -1,3 +1,18 @@
2010-10-18 Stuart Morgan <stuartmorgan@chromium.org>

Reviewed by Eric Seidel.

Switch to using the new Carbon NPAPI event declarations, and remove
the old ones.

https://bugs.webkit.org/show_bug.cgi?id=40784

* Plugins/WebNetscapePluginEventHandlerCarbon.mm:
(WebNetscapePluginEventHandlerCarbon::mouseEntered):
(WebNetscapePluginEventHandlerCarbon::mouseExited):
(WebNetscapePluginEventHandlerCarbon::mouseMoved):
(WebNetscapePluginEventHandlerCarbon::focusChanged):

2010-10-18 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Timothy Hatcher.
@@ -174,7 +174,7 @@ static void getCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent)
EventRecord event;

getCarbonEvent(&event, theEvent);
event.what = adjustCursorEvent;
event.what = NPEventType_AdjustCursorEvent;

BOOL acceptedEvent;
acceptedEvent = sendEvent(&event);
@@ -187,7 +187,7 @@ static void getCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent)
EventRecord event;

getCarbonEvent(&event, theEvent);
event.what = adjustCursorEvent;
event.what = NPEventType_AdjustCursorEvent;

BOOL acceptedEvent;
acceptedEvent = sendEvent(&event);
@@ -204,7 +204,7 @@ static void getCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent)
EventRecord event;

getCarbonEvent(&event, theEvent);
event.what = adjustCursorEvent;
event.what = NPEventType_AdjustCursorEvent;

BOOL acceptedEvent;
acceptedEvent = sendEvent(&event);
@@ -271,14 +271,14 @@ static UInt32 keyMessageForEvent(NSEvent *event)
getCarbonEvent(&event);
bool acceptedEvent;
if (hasFocus) {
event.what = getFocusEvent;
event.what = NPEventType_GetFocusEvent;
acceptedEvent = sendEvent(&event);
LOG(PluginEvents, "NPP_HandleEvent(getFocusEvent): %d", acceptedEvent);
LOG(PluginEvents, "NPP_HandleEvent(NPEventType_GetFocusEvent): %d", acceptedEvent);
installKeyEventHandler();
} else {
event.what = loseFocusEvent;
event.what = NPEventType_LoseFocusEvent;
acceptedEvent = sendEvent(&event);
LOG(PluginEvents, "NPP_HandleEvent(loseFocusEvent): %d", acceptedEvent);
LOG(PluginEvents, "NPP_HandleEvent(NPEventType_LoseFocusEvent): %d", acceptedEvent);
removeKeyEventHandler();
}
}
@@ -1,3 +1,15 @@
2010-10-18 Stuart Morgan <stuartmorgan@chromium.org>

Reviewed by Eric Seidel.

Switch to using the new Carbon NPAPI event declarations, and remove
the old ones.

https://bugs.webkit.org/show_bug.cgi?id=40784

* DumpRenderTree/TestNetscapePlugIn/main.cpp:
(handleEventCarbon):

2010-10-18 David Levin <levin@chromium.org>

Reviewed by Adam Barth.
@@ -462,13 +462,13 @@ static int16_t handleEventCarbon(NPP instance, PluginObject* obj, EventRecord* e
pluginLog(instance, "kHighLevelEvent");
break;
// NPAPI events
case getFocusEvent:
case NPEventType_LoseFocusEvent:
pluginLog(instance, "getFocusEvent");
break;
case loseFocusEvent:
case NPEventType_LoseFocusEvent:
pluginLog(instance, "loseFocusEvent");
break;
case adjustCursorEvent:
case NPEventType_AdjustCursorEvent:
pluginLog(instance, "adjustCursorEvent");
break;
default:

0 comments on commit dd23004

Please sign in to comment.