kILookAndFeelIID, (void **)&mLookAndFeel);
NS_GET_IID(nsILookAndFeel), (void **)&mLookAndFeel);
NS_IMETHODIMP CornerView::Paint(nsIRenderingContext& rc, const nsRect& rect,                                  PRUint32 aPaintFlags, PRBool &aResult){  if (mVis == nsViewVisibility_kShow)  {    nsRect  brect;    nscolor bgcolor;    GetBounds(brect);    brect.x = brect.y = 0;    if (nsnull == mLookAndFeel)    {      nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull,                                         kILookAndFeelIID, (void **)&mLookAndFeel);    }    if (nsnull != mLookAndFeel)      mLookAndFeel->GetColor(nsILookAndFeel::eColor_WidgetBackground, bgcolor);    else      bgcolor = NS_RGB(192, 192, 192);    rc.SetColor(bgcolor);    rc.FillRect(brect);    if (PR_TRUE == mShowQuality)    {      nscolor tcolor, bcolor;      //display quality indicator      rc.Translate(brect.x, brect.y);      rc.SetColor(NS_RGB(0, 0, 0));      rc.FillEllipse(NSToCoordFloor(brect.width * 0.15f),                     NSToCoordFloor(brect.height * 0.15f),                     NSToCoordRound(brect.width * 0.7f),    // XXX should use NSToCoordCeil ??                     NSToCoordRound(brect.height * 0.7f));  // XXX should use NSToCoordCeil ??      if (mQuality == nsContentQuality_kGood)        rc.SetColor(NS_RGB(0, 255, 0));      else if (mQuality == nsContentQuality_kFair)        rc.SetColor(NS_RGB(255, 176, 0));      else if (mQuality == nsContentQuality_kPoor)        rc.SetColor(NS_RGB(255, 0, 0));      else        rc.SetColor(NS_RGB(0, 0, 255));      //hey, notice that these numbers don't add up... that's because      //something funny happens on windows when the *right* numbers are      //used. MMP      rc.FillEllipse(NSToCoordRound(brect.width * 0.23f),  // XXX should use NSToCoordCeil ??                     NSToCoordRound(brect.height * 0.23f), // XXX should use NSToCoordCeil ??                     nscoord(brect.width * 0.46f),                     nscoord(brect.height * 0.46f));      rc.GetColor(bcolor);      tcolor = bcolor;      //this is inefficient, but compact...      tcolor = NS_RGB((int)min(NS_GET_R(bcolor) + 40, 255),                       (int)min(NS_GET_G(bcolor) + 40, 255),                      (int)min(NS_GET_B(bcolor) + 40, 255));      rc.SetColor(tcolor);      rc.FillEllipse(NSToCoordRound(brect.width * 0.34f),  // XXX should use NSToCoordCeil ??                     NSToCoordRound(brect.height * 0.34f), // XXX should use NSToCoordCeil ??                     nscoord(brect.width * 0.28f),                     nscoord(brect.height * 0.28f));      tcolor = NS_RGB((int)min(NS_GET_R(bcolor) + 120, 255),                       (int)min(NS_GET_G(bcolor) + 120, 255),                      (int)min(NS_GET_B(bcolor) + 120, 255));      rc.SetColor(tcolor);      rc.FillEllipse(NSToCoordRound(brect.width * 0.32f),  // XXX should use NSToCoordCeil ??                     NSToCoordRound(brect.height * 0.32f), // XXX should use NSToCoordCeil ??                     nscoord(brect.width * 0.17f),                     nscoord(brect.height * 0.17f));    }  }  aResult = PR_TRUE;  return NS_OK;}