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); }
aRenderingContext.SetColor(NS_RGB(192, 192, 192)); aRenderingContext.FillRect(0, 0, mRect.width, mRect.height);  #if !defined(XP_MAC) if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) {  #ifdef _NEW_METHOD_ADDED_  #ifdef XP_WIN nsIPluginInstance * inst; if(NS_OK == GetPluginInstance(inst)) { NS_RELEASE(inst);  nsPluginWindow * window; mInstanceOwner->GetWindow(window); if(window->type == nsPluginWindowType_Drawable) { PRUint32 hdc; aRenderingContext.RetrieveCurrentNativeDC(&hdc); mInstanceOwner->Paint(aDirtyRect, hdc); return NS_OK; } } #endif
void nsPluginInstanceOwner::Paint(const nsRect& aDirtyRect){#ifdef XP_MAC	if (mInstance != NULL) {		nsPluginPort* pluginPort = GetPluginPort();		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);	}#endif//~~~#ifdef XP_WIN	nsPluginEvent pluginEvent;  nsPluginPort* pluginPort = GetPluginPort();  pluginEvent.event = 0x000F; //!!! This is bad, but is it better to include <windows.h> for WM_PAINT only?  pluginEvent.wParam = (uint32)pluginPort;  pluginEvent.lParam = nsnull;	PRBool eventHandled = PR_FALSE;	mInstance->HandleEvent(&pluginEvent, &eventHandled);  ReleasePluginPort(pluginPort);#endif}