const nsStyleFont* font = (const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);  aRenderingContext.SetFont(font->mFont); aRenderingContext.SetColor(NS_RGB(0, 0, 0)); aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height); float p2t; aPresContext.GetPixelsToTwips(&p2t); nscoord px3 = NSIntPixelsToTwips(3, p2t); nsAutoString tmp; nsIAtom* atom; mContent->GetTag(atom); if (nsnull != atom) { atom->ToString(tmp); NS_RELEASE(atom); aRenderingContext.DrawString(tmp, px3, px3); } } #else  if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer && nsnull != mInstanceOwner) { mInstanceOwner->Paint(aDirtyRect); } #endif  return NS_OK;
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}