EventRecord updateEvent; ::OSEventAvail(0, &updateEvent); updateEvent.what = updateEvt; updateEvent.message = UInt32(pluginPort->port);
EventRecord updateEvent; InitializeEventRecord(&updateEvent); updateEvent.what = updateEvt; updateEvent.message = UInt32(pluginPort->port);
nsEventStatus pluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent){  nsEventStatus rv = nsEventStatus_eIgnore;  if (!mInstance || !mWindow)   // if the instance or the window is null, we shouldn't be here    return rv;#ifdef XP_MAC    //if (mWidget != NULL) {  // check for null mWidget        EventRecord* event = (EventRecord*)anEvent.nativeMsg;        if (event == NULL || event->what == nullEvent ||            anEvent.message == NS_KEY_PRESS           ||            anEvent.message == NS_CONTEXTMENU_MESSAGE_START) {            EventRecord macEvent;            GUItoMacEvent(anEvent, macEvent);            event = &macEvent;            if (event->what == updateEvt) {              nsPluginPort* pluginPort = GetPluginPort();                // Add in child windows absolute position to get make the dirty rect                // relative to the top-level window.                nscoord absWidgetX = 0;                nscoord absWidgetY = 0;               nsRect widgetClip(0,0,0,0);               GetWidgetPosAndClip(mWindow,absWidgetX,absWidgetY,widgetClip);               //mViewer->GetBounds(widgetClip);               //absWidgetX = widgetClip.x;               //absWidgetY = widgetClip.y;                               // set the port    mPluginWindow.x = absWidgetX;    mPluginWindow.y = absWidgetY;    // fix up the clipping region    mPluginWindow.clipRect.top = widgetClip.y;    mPluginWindow.clipRect.left = widgetClip.x;    mPluginWindow.clipRect.bottom =  mPluginWindow.clipRect.top + widgetClip.height;    mPluginWindow.clipRect.right =  mPluginWindow.clipRect.left + widgetClip.width;      EventRecord updateEvent;    ::OSEventAvail(0, &updateEvent);    updateEvent.what = updateEvt;    updateEvent.message = UInt32(pluginPort->port);    nsPluginEvent pluginEvent = { &updateEvent, nsPluginPlatformWindowRef(pluginPort->port) };    PRBool eventHandled = PR_FALSE;    mInstance->HandleEvent(&pluginEvent, &eventHandled);     }                        return  nsEventStatus_eConsumeNoDefault;                    }        //nsPluginPort* port = (nsPluginPort*)mWidget->GetNativeData(NS_NATIVE_PLUGIN_PORT);        nsPluginPort* port = (nsPluginPort*)mWindow->GetNativeData(NS_NATIVE_PLUGIN_PORT);        nsPluginEvent pluginEvent = { event, nsPluginPlatformWindowRef(port->port) };        PRBool eventHandled = PR_FALSE;        mInstance->HandleEvent(&pluginEvent, &eventHandled);        if (eventHandled && anEvent.message != NS_MOUSE_LEFT_BUTTON_DOWN)            rv = nsEventStatus_eConsumeNoDefault;   // }#endif//~~~#ifdef XP_WIN        nsPluginEvent * pPluginEvent = (nsPluginEvent *)anEvent.nativeMsg;        PRBool eventHandled = PR_FALSE;        mInstance->HandleEvent(pPluginEvent, &eventHandled);        if (eventHandled)            rv = nsEventStatus_eConsumeNoDefault;#endif  return rv;}