else if (mClassID.Equals(kCFontEnumerator)) { nsFontEnumeratorGTK* fe; NS_NEWXPCOM(fe, nsFontEnumeratorGTK); inst = (nsISupports *)fe; }
nsresult nsGfxFactoryGTK::CreateInstance(nsISupports *aOuter,                                            const nsIID &aIID,                                            void **aResult)  {    if (aResult == NULL) {      return NS_ERROR_NULL_POINTER;    }    *aResult = NULL;      nsISupports *inst = nsnull;  if (mClassID.Equals(kCFontMetrics)) {    inst = (nsISupports *)new nsFontMetricsGTK();  }  else if (mClassID.Equals(kCDeviceContext)) {    inst = (nsISupports *)new nsDeviceContextGTK();  }  else if (mClassID.Equals(kCRenderingContext)) {    inst = (nsISupports *)new nsRenderingContextGTK();  }  else if (mClassID.Equals(kCImage)) {    inst = (nsISupports *)new nsImageGTK();  }  else if (mClassID.Equals(kCRegion)) {    nsRegionGTK* dcs;    NS_NEWXPCOM(dcs, nsRegionGTK);    inst = (nsISupports *)dcs;  }  else if (mClassID.Equals(kCScriptableRegion)) {    nsCOMPtr<nsIRegion> rgn;    NS_NEWXPCOM(rgn, nsRegionGTK);    if (rgn != nsnull) {      nsCOMPtr<nsIScriptableRegion> scriptableRgn = new nsScriptableRegion(rgn);      inst = scriptableRgn;    }  }  else if (mClassID.Equals(kCBlender)) {    inst = (nsISupports *)new nsBlender;  }  else if (mClassID.Equals(kCDeviceContextSpec)) {    nsDeviceContextSpecGTK* dcs;    NS_NEWXPCOM(dcs, nsDeviceContextSpecGTK);    inst = (nsISupports *)((nsIDeviceContextSpecPS *)dcs);  }  else if (mClassID.Equals(kCDeviceContextSpecFactory)) {    nsDeviceContextSpecFactoryGTK* dcs;    NS_NEWXPCOM(dcs, nsDeviceContextSpecFactoryGTK);    inst = (nsISupports *)dcs;  }          	  if (inst == NULL) {      return NS_ERROR_OUT_OF_MEMORY;    }    NS_ADDREF(inst);  nsresult res = inst->QueryInterface(aIID, aResult);  NS_RELEASE(inst);  return res;  }  