NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("white"), &white); NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("black"), &black);
NS_ColorNameToRGB(NS_LITERAL_STRING("white"), &white); NS_ColorNameToRGB(NS_LITERAL_STRING("black"), &black);
drawtest(nsIRenderingContext *aSurface){nsFont  *font;nsPoint *pointlist;nscolor white,black;  font = new nsFont("Times", NS_FONT_STYLE_NORMAL,NS_FONT_VARIANT_NORMAL,NS_FONT_WEIGHT_BOLD,0,12);  aSurface->SetFont(*font);              // clear surface  NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("white"), &white);  NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("black"), &black);  aSurface->SetColor(white);  aSurface->FillRect(0,0,1000,1000);  aSurface->SetColor(black);  aSurface->DrawRect(20, 20, 100, 100);  aSurface->DrawString(NS_ConvertASCIItoUCS2("This is a Rectangle\0"),20,5);  aSurface->DrawLine(0,0,300,400);  pointlist = new nsPoint[6];  pointlist[0].x = 150;pointlist[0].y = 150;  pointlist[1].x = 200;pointlist[1].y = 150;  pointlist[2].x = 190;pointlist[2].y = 170;  pointlist[3].x = 210;pointlist[3].y = 190;  pointlist[4].x = 175;pointlist[4].y = 175;  pointlist[5].x = 150;pointlist[5].y = 150;  aSurface->DrawPolygon(pointlist,6);  aSurface->DrawString(NS_ConvertASCIItoUCS2("This is a closed Polygon\0"),210,150);  delete [] pointlist;#ifdef WINDOWSBROKEN  pointlist = new nsPoint[5];  pointlist[0].x = 200;pointlist[0].y = 200;  pointlist[1].x = 250;pointlist[1].y = 200;  pointlist[2].x = 240;pointlist[2].y = 220;  pointlist[3].x = 260;pointlist[3].y = 240;  pointlist[4].x = 225;pointlist[4].y = 225;  aSurface->DrawPolygon(pointlist,6);  aSurface->DrawString(NS_ConvertASCIItoUCS2("This is an open Polygon\0"),250,200);  delete [] pointlist;#endif    aSurface->DrawEllipse(30, 150,50,100);  aSurface->DrawString(NS_ConvertASCIItoUCS2("This is an Ellipse\0"),30,140);  return(30);}