NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("white"), &white); NS_ColorNameToRGB(NS_ConvertASCIItoUCS2("red"), &black);
NS_ColorNameToRGB(NS_LITERAL_STRING("white"), &white); NS_ColorNameToRGB(NS_LITERAL_STRING("red"), &black);
arctest(nsIRenderingContext *aSurface){nsFont  *font;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("red"), &black);  aSurface->SetColor(white);  aSurface->FillRect(0,0,1000,1000);  aSurface->SetColor(black);  aSurface->DrawArc(20, 20,50,100,(float)0.0,(float)90.0);  aSurface->FillArc(70, 20,50,100,(float)0.0,(float)90.0);  aSurface->DrawArc(150, 20,50,100,(float)90.0,(float)0.0);  aSurface->DrawString(NS_ConvertASCIItoUCS2("0 to 90\0"),20,8);  aSurface->DrawString(NS_ConvertASCIItoUCS2("Reverse (eg 90 to 0)\0"),120,8);  aSurface->DrawArc(20, 140,100,50,(float)130.0,(float)180.0);  aSurface->FillArc(70, 140,100,50,(float)130.0,(float)180.0);  aSurface->DrawArc(150, 140,100,50,(float)180.0,(float)130.0);  aSurface->DrawString(NS_ConvertASCIItoUCS2("130 to 180\0"),20,130);  aSurface->DrawArc(20, 200,50,100,(float)170.0,(float)300.0);  aSurface->FillArc(70, 200,50,100,(float)170.0,(float)300.0);  aSurface->DrawArc(150, 200,50,100,(float)300.0,(float)170.0);  aSurface->DrawString(NS_ConvertASCIItoUCS2("170 to 300\0"),20,190);  return(30);}