зеркало из https://github.com/mozilla/gecko-dev.git
bug 78273, r=ftang/jbetak, sr=blizzard
For the embedding API add "get font list". Used to fill the font pref panel
This commit is contained in:
Родитель
a698fad77c
Коммит
e654438dc3
|
@ -37,6 +37,7 @@
|
|||
#include "nsIImageManager.h"
|
||||
#include "nsDeviceContextBeOS.h"
|
||||
#include "nsImageBeOS.h"
|
||||
#include "nsFontList.h"
|
||||
|
||||
// objects that just require generic constructors
|
||||
|
||||
|
@ -49,6 +50,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsRegionBeOS)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecBeOS)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecFactoryBeOS)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontEnumeratorBeOS)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontList);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerBeOS)
|
||||
|
||||
// our custom constructors
|
||||
|
@ -166,6 +168,11 @@ static nsModuleComponentInfo components[] =
|
|||
// "@mozilla.org/gfx/font_enumerator/beos;1",
|
||||
"@mozilla.org/gfx/fontenumerator;1",
|
||||
nsFontEnumeratorBeOSConstructor },
|
||||
{ "Font List",
|
||||
NS_FONTLIST_CID,
|
||||
// "@mozilla.org/gfx/fontlist;1"
|
||||
NS_FONTLIST_CONTRACTID,
|
||||
nsFontListConstructor },
|
||||
{ "BeOS Screen Manager",
|
||||
NS_SCREENMANAGER_CID,
|
||||
// "@mozilla.org/gfx/screenmanager/beos;1",
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "nsDeviceContextGTK.h"
|
||||
#include "nsImageGTK.h"
|
||||
#include "nsPrintOptionsGTK.h"
|
||||
#include "nsFontList.h"
|
||||
|
||||
// objects that just require generic constructors
|
||||
|
||||
|
@ -50,6 +51,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsRegionGTK)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecGTK)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecFactoryGTK)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontEnumeratorGTK)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontList);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerGtk)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrintOptionsGTK)
|
||||
|
||||
|
@ -173,6 +175,11 @@ static nsModuleComponentInfo components[] =
|
|||
// "@mozilla.org/gfx/font_enumerator/gtk;1",
|
||||
"@mozilla.org/gfx/fontenumerator;1",
|
||||
nsFontEnumeratorGTKConstructor },
|
||||
{ "Font List",
|
||||
NS_FONTLIST_CID,
|
||||
// "@mozilla.org/gfx/fontlist;1"
|
||||
NS_FONTLIST_CONTRACTID,
|
||||
nsFontListConstructor },
|
||||
{ "Gtk Screen Manager",
|
||||
NS_SCREENMANAGER_CID,
|
||||
// "@mozilla.org/gfx/screenmanager/gtk;1",
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "nscore.h"
|
||||
#include "nsIFactory.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsIFontList.h"
|
||||
#include "nsGfxCIID.h"
|
||||
#include "nsFontMetricsMac.h"
|
||||
#include "nsRenderingContextMac.h"
|
||||
|
@ -46,6 +47,7 @@
|
|||
|
||||
static NS_DEFINE_IID(kCFontMetrics, NS_FONT_METRICS_CID);
|
||||
static NS_DEFINE_IID(kCFontEnumerator, NS_FONT_ENUMERATOR_CID);
|
||||
static NS_DEFINE_IID(kCFontList, NS_FONTLIST_CID);
|
||||
static NS_DEFINE_IID(kCRenderingContext, NS_RENDERING_CONTEXT_CID);
|
||||
static NS_DEFINE_IID(kCImage, NS_IMAGE_CID);
|
||||
static NS_DEFINE_IID(kCDeviceContext, NS_DEVICE_CONTEXT_CID);
|
||||
|
@ -157,6 +159,11 @@ nsresult nsGfxFactoryMac::CreateInstance(nsISupports *aOuter,
|
|||
nsFontEnumeratorMac* fe;
|
||||
NS_NEWXPCOM(fe, nsFontEnumeratorMac);
|
||||
inst = (nsISupports *)fe;
|
||||
}
|
||||
else if (mClassID.Equals(kCFontList)) {
|
||||
nsFontList* fl;
|
||||
NS_NEWXPCOM(fl, nsFontList);
|
||||
inst = (nsISupports *)fl;
|
||||
}
|
||||
else if (mClassID.Equals(kCScreenManager)) {
|
||||
NS_NEWXPCOM(inst, nsScreenManagerMac);
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "nsImageOS2.h"
|
||||
#include "nsRegionOS2.h"
|
||||
#include "nsPrintOptionsOS2.h"
|
||||
#include "nsFontList.h"
|
||||
|
||||
// objects that just require generic constructors
|
||||
|
||||
|
@ -50,6 +51,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsRegionOS2)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecOS2)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecFactoryOS2)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontEnumeratorOS2)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontList);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerOS2)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrintOptionsOS2)
|
||||
|
||||
|
@ -173,6 +175,11 @@ static nsModuleComponentInfo components[] =
|
|||
// "@mozilla.org/gfx/font_enumerator/gtk;1",
|
||||
"@mozilla.org/gfx/fontenumerator;1",
|
||||
nsFontEnumeratorOS2Constructor },
|
||||
{ "Font List",
|
||||
NS_FONTLIST_CID,
|
||||
// "@mozilla.org/gfx/fontlist;1"
|
||||
NS_FONTLIST_CONTRACTID,
|
||||
nsFontListConstructor },
|
||||
{ "OS/2 Screen Manager",
|
||||
NS_SCREENMANAGER_CID,
|
||||
// "@mozilla.org/gfx/screenmanager/gtk;1",
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "nsScriptableRegion.h"
|
||||
#include "nsIImageManager.h"
|
||||
#include "nsDeviceContextPh.h"
|
||||
#include "nsFontList.h"
|
||||
|
||||
// objects that just require generic constructors
|
||||
|
||||
|
@ -48,6 +49,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsRegionPh)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecPh)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecFactoryPh)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontEnumeratorPh)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontList);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerPh)
|
||||
|
||||
// our custom constructors
|
||||
|
@ -155,6 +157,11 @@ static nsModuleComponentInfo components[] =
|
|||
NS_FONT_ENUMERATOR_CID,
|
||||
"@mozilla.org/gfx/font_enumerator/Ph;1",
|
||||
nsFontEnumeratorPhConstructor },
|
||||
{ "Font List",
|
||||
NS_FONTLIST_CID,
|
||||
// "@mozilla.org/gfx/fontlist;1"
|
||||
NS_FONTLIST_CONTRACTID,
|
||||
nsFontListConstructor },
|
||||
{ "Ph Screen Manager",
|
||||
NS_SCREENMANAGER_CID,
|
||||
"@mozilla.org/gfx/screenmanager/Ph;1",
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "nsIImageManager.h"
|
||||
#include "nsDeviceContextQT.h"
|
||||
#include "nsImageQT.h"
|
||||
#include "nsFontList.h"
|
||||
|
||||
// objects that just require generic constructors
|
||||
|
||||
|
@ -48,6 +49,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsRegionQT)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecQT)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecFactoryQT)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontEnumeratorQT)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontList);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerQT)
|
||||
|
||||
// our custom constructors
|
||||
|
@ -148,6 +150,11 @@ static nsModuleComponentInfo components[] =
|
|||
NS_FONT_ENUMERATOR_CID,
|
||||
"@mozilla.org/gfx/fontenumerator;1",
|
||||
nsFontEnumeratorQTConstructor },
|
||||
{ "Font List",
|
||||
NS_FONTLIST_CID,
|
||||
// "@mozilla.org/gfx/fontlist;1"
|
||||
NS_FONTLIST_CONTRACTID,
|
||||
nsFontListConstructor },
|
||||
{ "Qt Screen Manager",
|
||||
NS_SCREENMANAGER_CID,
|
||||
"@mozilla.org/gfx/screenmanager;1",
|
||||
|
|
|
@ -36,9 +36,11 @@
|
|||
#include "nsIImageManager.h"
|
||||
#include "nsScreenManagerWin.h"
|
||||
#include "nsPrintOptionsWin.h"
|
||||
#include "nsFontList.h"
|
||||
|
||||
static NS_DEFINE_IID(kCFontMetrics, NS_FONT_METRICS_CID);
|
||||
static NS_DEFINE_IID(kCFontEnumerator, NS_FONT_ENUMERATOR_CID);
|
||||
static NS_DEFINE_IID(kCFontList, NS_FONTLIST_CID);
|
||||
static NS_DEFINE_IID(kCRenderingContext, NS_RENDERING_CONTEXT_CID);
|
||||
static NS_DEFINE_IID(kCImage, NS_IMAGE_CID);
|
||||
static NS_DEFINE_IID(kCBlender, NS_BLENDER_CID);
|
||||
|
@ -214,6 +216,11 @@ nsresult nsGfxFactoryWin::CreateInstance(nsISupports *aOuter,
|
|||
nsFontEnumeratorWin* fe;
|
||||
NS_NEWXPCOM(fe, nsFontEnumeratorWin);
|
||||
inst = (nsISupports *)fe;
|
||||
}
|
||||
else if (mClassID.Equals(kCFontList)) {
|
||||
nsFontList* fl;
|
||||
NS_NEWXPCOM(fl, nsFontList);
|
||||
inst = (nsISupports *)fl;
|
||||
}
|
||||
else if (mClassID.Equals(kCScreenManager)) {
|
||||
NS_NEWXPCOM(inst, nsScreenManagerWin);
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "nsIImageManager.h"
|
||||
#include "nsDeviceContextXlib.h"
|
||||
#include "nsImageXlib.h"
|
||||
#include "nsFontList.h"
|
||||
#include "nsPrintOptionsXlib.h"
|
||||
|
||||
// objects that just require generic constructors
|
||||
|
@ -53,6 +54,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsRegionXlib)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecXlib)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecFactoryXlib)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontEnumeratorXlib)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontList);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerXlib)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrintOptionsXlib)
|
||||
|
||||
|
@ -176,6 +178,11 @@ static nsModuleComponentInfo components[] =
|
|||
// "@mozilla.org/gfx/font_enumerator/xlib;1",
|
||||
"@mozilla.org/gfx/fontenumerator;1",
|
||||
nsFontEnumeratorXlibConstructor },
|
||||
{ "Font List",
|
||||
NS_FONTLIST_CID,
|
||||
// "@mozilla.org/gfx/fontlist;1"
|
||||
NS_FONTLIST_CONTRACTID,
|
||||
nsFontListConstructor },
|
||||
{ "Xlib Screen Manager",
|
||||
NS_SCREENMANAGER_CID,
|
||||
// "@mozilla.org/gfx/screenmanager/xlib;1",
|
||||
|
|
|
@ -124,6 +124,7 @@ static NS_DEFINE_CID(kCRenderingContextCID, NS_RENDERING_CONTEXT_CID);
|
|||
static NS_DEFINE_CID(kCDeviceContextCID, NS_DEVICE_CONTEXT_CID);
|
||||
static NS_DEFINE_CID(kCFontMetricsCID, NS_FONT_METRICS_CID);
|
||||
static NS_DEFINE_CID(kCFontEnumeratorCID, NS_FONT_ENUMERATOR_CID);
|
||||
static NS_DEFINE_CID(kCFontListCID, NS_FONTLIST_CID);
|
||||
static NS_DEFINE_CID(kCImageCID, NS_IMAGE_CID);
|
||||
static NS_DEFINE_CID(kCRegionCID, NS_REGION_CID);
|
||||
static NS_DEFINE_CID(kCScriptableRegionCID, NS_SCRIPTABLE_REGION_CID);
|
||||
|
@ -223,6 +224,7 @@ NS_SetupRegistry()
|
|||
nsComponentManager::RegisterComponentLib(kCDeviceContextCID, "Device Context", "@mozilla.org/gfx/devicecontext;1", GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
nsComponentManager::RegisterComponentLib(kCFontMetricsCID, "Font Metrics", "@mozilla.org/gfx/fontmetrics;1", GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
nsComponentManager::RegisterComponentLib(kCFontEnumeratorCID, "Font Enumerator", "@mozilla.org/gfx/fontenumerator;1", GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
nsComponentManager::RegisterComponentLib(kCFontListCID, "Font List", "@mozilla.org/gfx/fontlist;1", GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
nsComponentManager::RegisterComponentLib(kCImageCID, "Image", "@mozilla.org/gfx/image;1", GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
nsComponentManager::RegisterComponentLib(kCRegionCID, NULL, NULL, GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
nsComponentManager::RegisterComponentLib(kCScriptableRegionCID, "Region", "@mozilla.org/gfx/region;1", GFXWIN_DLL, PR_FALSE, PR_FALSE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче