From 2674b6e76892bfa8bbe7779ee439cf8dd98c276f Mon Sep 17 00:00:00 2001 From: "kjh-5727%comcast.net" Date: Sat, 9 Dec 2006 17:18:56 +0000 Subject: [PATCH] Bug 360485 - Factor out nsIDeviceContextSpecFactory. Part 1: changed files. r=pavlov, sr=roc. git-svn-id: svn://10.0.0.236/trunk@216801 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/photon/Makefile.in | 1 - mozilla/gfx/src/photon/nsGfxFactoryPh.cpp | 7 ----- mozilla/gfx/src/qt/Makefile.in | 1 - mozilla/gfx/src/qt/nsDeviceContextSpecQt.cpp | 4 ++- mozilla/gfx/src/qt/nsDeviceContextSpecQt.h | 2 +- mozilla/gfx/src/qt/nsGfxFactoryQt.cpp | 6 ---- mozilla/gfx/src/xlib/Makefile.in | 1 - .../gfx/src/xlib/nsDeviceContextSpecXlib.cpp | 5 ++-- .../gfx/src/xlib/nsDeviceContextSpecXlib.h | 2 +- mozilla/gfx/src/xlib/nsGfxFactoryXlib.cpp | 8 ----- mozilla/layout/base/nsDocumentViewer.cpp | 10 ++----- mozilla/layout/printing/nsPrintEngine.cpp | 30 +++++++------------ mozilla/widget/public/Makefile.in | 1 - mozilla/widget/public/nsIDeviceContextSpec.h | 19 ++++++++++-- mozilla/widget/public/nsWidgetsCID.h | 8 ++--- mozilla/widget/src/beos/Makefile.in | 1 - .../widget/src/beos/nsDeviceContextSpecB.cpp | 4 ++- .../widget/src/beos/nsDeviceContextSpecB.h | 8 +++-- mozilla/widget/src/beos/nsWidgetFactory.cpp | 8 ----- .../widget/src/build/nsWinWidgetFactory.cpp | 6 ---- mozilla/widget/src/cocoa/Makefile.in | 1 - mozilla/widget/src/cocoa/nsWidgetFactory.mm | 6 ---- mozilla/widget/src/gtk2/Makefile.in | 1 - .../widget/src/gtk2/nsDeviceContextSpecG.cpp | 5 ++-- .../widget/src/gtk2/nsDeviceContextSpecG.h | 2 +- mozilla/widget/src/gtk2/nsWidgetFactory.cpp | 7 ----- mozilla/widget/src/mac/Makefile.in | 1 - .../widget/src/mac/nsDeviceContextSpecX.cpp | 7 +++++ mozilla/widget/src/mac/nsDeviceContextSpecX.h | 6 ++++ mozilla/widget/src/mac/nsWidgetFactory.cpp | 6 ---- mozilla/widget/src/os2/Makefile.in | 1 - .../widget/src/os2/nsDeviceContextSpecOS2.cpp | 4 ++- .../widget/src/os2/nsDeviceContextSpecOS2.h | 6 ++-- mozilla/widget/src/os2/nsWidgetFactory.cpp | 5 ---- mozilla/widget/src/windows/Makefile.in | 1 - 35 files changed, 74 insertions(+), 117 deletions(-) diff --git a/mozilla/gfx/src/photon/Makefile.in b/mozilla/gfx/src/photon/Makefile.in index 1228ba5c500..1aa043544a0 100644 --- a/mozilla/gfx/src/photon/Makefile.in +++ b/mozilla/gfx/src/photon/Makefile.in @@ -67,7 +67,6 @@ REQUIRES = xpcom \ CPPSRCS = \ nsDeviceContextPh.cpp \ - nsDeviceContextSpecFactoryP.cpp \ nsDeviceContextSpecPh.cpp \ nsDrawingSurfacePh.cpp \ nsFontMetricsPh.cpp \ diff --git a/mozilla/gfx/src/photon/nsGfxFactoryPh.cpp b/mozilla/gfx/src/photon/nsGfxFactoryPh.cpp index c78f799a94c..19d275a7982 100644 --- a/mozilla/gfx/src/photon/nsGfxFactoryPh.cpp +++ b/mozilla/gfx/src/photon/nsGfxFactoryPh.cpp @@ -45,7 +45,6 @@ #include "nsFontMetricsPh.h" #include "nsRenderingContextPh.h" #include "nsDeviceContextSpecPh.h" -#include "nsDeviceContextSpecFactoryP.h" #include "nsScreenManagerPh.h" #include "nsScriptableRegion.h" #include "nsDeviceContextPh.h" @@ -63,7 +62,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsImagePh) NS_GENERIC_FACTORY_CONSTRUCTOR(nsBlender) 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) @@ -157,11 +155,6 @@ static const nsModuleComponentInfo components[] = "@mozilla.org/gfx/devicecontextspec;1", nsDeviceContextSpecPhConstructor }, - { "Ph Device Context Spec Factory", - NS_DEVICE_CONTEXT_SPEC_FACTORY_CID, - "@mozilla.org/gfx/devicecontextspecfactory;1", - nsDeviceContextSpecFactoryPhConstructor }, - { "PrintSettings Service", NS_PRINTSETTINGSSERVICE_CID, "@mozilla.org/gfx/printsettings-service;1", diff --git a/mozilla/gfx/src/qt/Makefile.in b/mozilla/gfx/src/qt/Makefile.in index 12f6749a106..473b21ea271 100644 --- a/mozilla/gfx/src/qt/Makefile.in +++ b/mozilla/gfx/src/qt/Makefile.in @@ -70,7 +70,6 @@ REQUIRES = xpcom \ CPPSRCS = \ nsDeviceContextQt.cpp \ - nsDeviceContextSpecFactoryQt.cpp \ nsDeviceContextSpecQt.cpp \ nsDrawingSurfaceQt.cpp \ nsFontMetricsQt.cpp \ diff --git a/mozilla/gfx/src/qt/nsDeviceContextSpecQt.cpp b/mozilla/gfx/src/qt/nsDeviceContextSpecQt.cpp index e92e132bdbc..126e28f78da 100644 --- a/mozilla/gfx/src/qt/nsDeviceContextSpecQt.cpp +++ b/mozilla/gfx/src/qt/nsDeviceContextSpecQt.cpp @@ -280,7 +280,9 @@ NS_IMPL_ISUPPORTS1(nsDeviceContextSpecQt, * * ** Please update the other toolkits when changing this function. */ -NS_IMETHODIMP nsDeviceContextSpecQt::Init(nsIPrintSettings *aPS) +NS_IMETHODIMP nsDeviceContextSpecQt::Init(nsIWidget *aWidget, + nsIPrintSettings* aPS, + PRBool aIsPrintPreview) { DO_PR_DEBUG_LOG(("nsDeviceContextSpecQt::Init(aPS=%p\n", aPS)); nsresult rv = NS_ERROR_FAILURE; diff --git a/mozilla/gfx/src/qt/nsDeviceContextSpecQt.h b/mozilla/gfx/src/qt/nsDeviceContextSpecQt.h index 89cd8604adc..743beb8fac0 100644 --- a/mozilla/gfx/src/qt/nsDeviceContextSpecQt.h +++ b/mozilla/gfx/src/qt/nsDeviceContextSpecQt.h @@ -81,7 +81,7 @@ public: NS_DECL_ISUPPORTS - NS_IMETHOD Init(nsIPrintSettings* aPS); + NS_IMETHOD Init(nsIWidget *aWidget, nsIPrintSettings* aPS, PRBool aIsPrintPreview); NS_IMETHOD ClosePrintManager(); NS_IMETHOD GetToPrinter(PRBool &aToPrinter); diff --git a/mozilla/gfx/src/qt/nsGfxFactoryQt.cpp b/mozilla/gfx/src/qt/nsGfxFactoryQt.cpp index b6e8e76441f..b999266beed 100644 --- a/mozilla/gfx/src/qt/nsGfxFactoryQt.cpp +++ b/mozilla/gfx/src/qt/nsGfxFactoryQt.cpp @@ -46,7 +46,6 @@ #include "nsFontMetricsQt.h" #include "nsRenderingContextQt.h" #include "nsDeviceContextSpecQt.h" -#include "nsDeviceContextSpecFactoryQt.h" #include "nsScreenManagerQt.h" #include "nsScriptableRegion.h" #include "nsDeviceContextQt.h" @@ -69,7 +68,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsImageQt) NS_GENERIC_FACTORY_CONSTRUCTOR(nsBlender) 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) @@ -144,10 +142,6 @@ static const nsModuleComponentInfo components[] = NS_DEVICE_CONTEXT_SPEC_CID, "@mozilla.org/gfx/devicecontextspec;1", nsDeviceContextSpecQtConstructor }, - { "Qt Device Context Spec Factory", - NS_DEVICE_CONTEXT_SPEC_FACTORY_CID, - "@mozilla.org/gfx/devicecontextspecfactory;1", - nsDeviceContextSpecFactoryQtConstructor }, { "Qt Font Enumerator", NS_FONT_ENUMERATOR_CID, "@mozilla.org/gfx/fontenumerator;1", diff --git a/mozilla/gfx/src/xlib/Makefile.in b/mozilla/gfx/src/xlib/Makefile.in index 712f8641857..a2b01560ea7 100644 --- a/mozilla/gfx/src/xlib/Makefile.in +++ b/mozilla/gfx/src/xlib/Makefile.in @@ -85,7 +85,6 @@ X11SHARED_LCPPSRCS = \ CPPSRCS = \ $(X11SHARED_LCPPSRCS) \ - nsDeviceContextSpecFactoryX.cpp \ nsDeviceContextSpecXlib.cpp \ nsDeviceContextXlib.cpp \ nsDrawingSurfaceXlib.cpp \ diff --git a/mozilla/gfx/src/xlib/nsDeviceContextSpecXlib.cpp b/mozilla/gfx/src/xlib/nsDeviceContextSpecXlib.cpp index 30acaa21918..c51bc322526 100644 --- a/mozilla/gfx/src/xlib/nsDeviceContextSpecXlib.cpp +++ b/mozilla/gfx/src/xlib/nsDeviceContextSpecXlib.cpp @@ -426,8 +426,9 @@ NS_IMPL_ISUPPORTS1(nsDeviceContextSpecXlib, * * ** Please update the other toolkits when changing this function. */ -NS_IMETHODIMP nsDeviceContextSpecXlib::Init(nsIPrintSettings *aPS, - PRBool aIsPrintPreview) +NS_IMETHODIMP nsDeviceContextSpecXlib::Init(nsIWidget *aWidget, + nsIPrintSettings* aPS, + PRBool aIsPrintPreview) { DO_PR_DEBUG_LOG(("nsDeviceContextSpecXlib::Init(aPS=%p)\n", aPS)); nsresult rv = NS_ERROR_FAILURE; diff --git a/mozilla/gfx/src/xlib/nsDeviceContextSpecXlib.h b/mozilla/gfx/src/xlib/nsDeviceContextSpecXlib.h index e3e2f51c1c2..979e7bd5b4c 100644 --- a/mozilla/gfx/src/xlib/nsDeviceContextSpecXlib.h +++ b/mozilla/gfx/src/xlib/nsDeviceContextSpecXlib.h @@ -76,7 +76,7 @@ public: NS_DECL_ISUPPORTS - NS_IMETHOD Init(nsIPrintSettings* aPS, PRBool aIsPrintPreview); + NS_IMETHOD Init(nsIWidget *aWidget, nsIPrintSettings* aPS, PRBool aIsPrintPreview); NS_IMETHOD ClosePrintManager(); NS_IMETHOD GetToPrinter(PRBool &aToPrinter); diff --git a/mozilla/gfx/src/xlib/nsGfxFactoryXlib.cpp b/mozilla/gfx/src/xlib/nsGfxFactoryXlib.cpp index 919b745daec..755e34deb00 100644 --- a/mozilla/gfx/src/xlib/nsGfxFactoryXlib.cpp +++ b/mozilla/gfx/src/xlib/nsGfxFactoryXlib.cpp @@ -48,8 +48,6 @@ #include "nsRenderingContextXlib.h" // aka nsDeviceContextSpecXlib.h #include "nsDeviceContextSpecXlib.h" -// aka nsDeviceContextSpecFactoryXlib.h -#include "nsDeviceContextSpecFactoryX.h" #include "nsScriptableRegion.h" #include "nsDeviceContextXlib.h" #include "nsImageXlib.h" @@ -67,7 +65,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsImageXlib) NS_GENERIC_FACTORY_CONSTRUCTOR(nsBlender) 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_INIT(nsPrintOptionsXlib, Init) @@ -155,11 +152,6 @@ static const nsModuleComponentInfo components[] = // "@mozilla.org/gfx/device_context_spec/xlib;1", "@mozilla.org/gfx/devicecontextspec;1", nsDeviceContextSpecXlibConstructor }, - { "Xlib Device Context Spec Factory", - NS_DEVICE_CONTEXT_SPEC_FACTORY_CID, - // "@mozilla.org/gfx/device_context_spec_factory/xlib;1", - "@mozilla.org/gfx/devicecontextspecfactory;1", - nsDeviceContextSpecFactoryXlibConstructor }, { "PrintSettings Service", NS_PRINTSETTINGSSERVICE_CID, // "@mozilla.org/gfx/printsettings-service;1", diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index c2494583009..f72e6b116ad 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -78,7 +78,6 @@ #include "nsWidgetsCID.h" #include "nsIDeviceContext.h" #include "nsIDeviceContextSpec.h" -#include "nsIDeviceContextSpecFactory.h" #include "nsIViewManager.h" #include "nsIView.h" #include "nsView.h" // For nsView::GetViewFor @@ -194,10 +193,7 @@ static const char sPrintOptionsContractID[] = "@mozilla.org/gfx/printset #include //switch to page layout -#include "nsIDeviceContextSpecFactory.h" -#include "nsIDeviceContextSpec.h" #include "nsGfxCIID.h" -static NS_DEFINE_IID(kDeviceContextSpecFactoryCID, NS_DEVICE_CONTEXT_SPEC_FACTORY_CID); #ifdef NS_DEBUG @@ -852,15 +848,15 @@ DocumentViewerImpl::InitInternal(nsIWidget* aParentWidget, #ifdef NS_PRINT_PREVIEW if (mIsPageMode) { nsCOMPtr devctx; - nsCOMPtr devspec; - nsCOMPtr factory = do_CreateInstance(kDeviceContextSpecFactoryCID); + nsCOMPtr devspec = + do_CreateInstance("@mozilla.org/gfx/devicecontextspec;1"); // XXX CRASHES ON OOM. YUM. WOULD SOMEONE PLEASE FIX ME. // PERHAPS SOMEONE SHOULD HAVE REVIEWED THIS CODE. // XXX I have no idea how critical this code is, so i'm not fixing it. // In fact I'm just adding a line that makes this block // get compiled *less* often. // mWindow has been initialized by preceding call to MakeWindow - factory->CreateDeviceContextSpec(mWindow, mPresContext->GetPrintSettings(), *getter_AddRefs(devspec), PR_FALSE); + devspec->Init(mWindow, mPresContext->GetPrintSettings(), PR_FALSE); // XXX CRASHES ON OOM under at least // nsPrintJobFactoryPS::CreatePrintJob. WOULD SOMEONE PLEASE FIX ME. // PERHAPS SOMEONE SHOULD HAVE REVIEWED THIS CODE. diff --git a/mozilla/layout/printing/nsPrintEngine.cpp b/mozilla/layout/printing/nsPrintEngine.cpp index 7a19d28cccc..aff94bc344a 100644 --- a/mozilla/layout/printing/nsPrintEngine.cpp +++ b/mozilla/layout/printing/nsPrintEngine.cpp @@ -131,7 +131,6 @@ static const char kPrintingPromptService[] = "@mozilla.org/embedcomp/printingpro #include "nsWidgetsCID.h" #include "nsIDeviceContext.h" #include "nsIDeviceContextSpec.h" -#include "nsIDeviceContextSpecFactory.h" #include "nsIViewManager.h" #include "nsIView.h" @@ -223,8 +222,6 @@ static void DumpPrintObjectsTreeLayout(nsPrintObject * aPO,nsIDeviceContext * aD static NS_DEFINE_CID(kViewManagerCID, NS_VIEW_MANAGER_CID); static NS_DEFINE_CID(kWidgetCID, NS_CHILD_CID); -static NS_DEFINE_IID(kDeviceContextSpecFactoryCID, NS_DEVICE_CONTEXT_SPEC_FACTORY_CID); - NS_IMPL_ISUPPORTS1(nsPrintEngine, nsIObserver) //--------------------------------------------------- @@ -642,15 +639,11 @@ nsPrintEngine::Print(nsIPrintSettings* aPrintSettings, } #endif - /* create factory (incl. create print dialog) */ - nsCOMPtr factory = - do_CreateInstance(kDeviceContextSpecFactoryCID, &rv); + // create a DeviceSpec to confirm that a printing subsystem is + // available. It will be initialized after getting print settings. + nsCOMPtr devspec = + do_CreateInstance("@mozilla.org/gfx/devicecontextspec;1", &rv); if (NS_SUCCEEDED(rv)) { -#ifdef DEBUG_dcone - printf("PRINT JOB STARTING\n"); -#endif - - nsCOMPtr devspec; mPrt->mPrintDC = nsnull; // XXX why? #ifdef NS_DEBUG @@ -703,8 +696,9 @@ nsPrintEngine::Print(nsIPrintSettings* aPrintSettings, return CleanupOnFailure(rv, PR_TRUE); } - // Create DeviceSpec for Printing - rv = factory->CreateDeviceContextSpec(mWindow, mPrt->mPrintSettings, *getter_AddRefs(devspec), PR_FALSE); + // Initialize the DevSpec created earlier, now that we have + // print settings. + rv = devspec->Init(mWindow, mPrt->mPrintSettings, PR_FALSE); // If the page was intended to be destroyed while we were in the print dialog // then we need to clean up and abort the printing. @@ -1019,12 +1013,10 @@ nsPrintEngine::PrintPreview(nsIPrintSettings* aPrintSettings, #endif nsCOMPtr ppDC; - nsCOMPtr factory = do_CreateInstance(kDeviceContextSpecFactoryCID); - if (factory) { - nsCOMPtr devspec; - nsCOMPtr dx; - rv = factory->CreateDeviceContextSpec(mWindow, mPrt->mPrintSettings, - *getter_AddRefs(devspec), PR_TRUE); + nsCOMPtr devspec = + do_CreateInstance("@mozilla.org/gfx/devicecontextspec;1"); + if (devspec) { + rv = devspec->Init(mWindow, mPrt->mPrintSettings, PR_TRUE); if (NS_SUCCEEDED(rv)) { rv = mDeviceContext->GetDeviceContextFor(devspec, *getter_AddRefs(ppDC)); if (NS_SUCCEEDED(rv)) { diff --git a/mozilla/widget/public/Makefile.in b/mozilla/widget/public/Makefile.in index 7b987905ba1..df2080313f9 100644 --- a/mozilla/widget/public/Makefile.in +++ b/mozilla/widget/public/Makefile.in @@ -64,7 +64,6 @@ EXPORTS = \ nsIPluginWidget.h \ nsINativeKeyBindings.h \ nsIDeviceContextSpec.h \ - nsIDeviceContextSpecFactory.h \ $(NULL) ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) diff --git a/mozilla/widget/public/nsIDeviceContextSpec.h b/mozilla/widget/public/nsIDeviceContextSpec.h index e76b8b2dc50..99f97f976d9 100644 --- a/mozilla/widget/public/nsIDeviceContextSpec.h +++ b/mozilla/widget/public/nsIDeviceContextSpec.h @@ -39,20 +39,35 @@ #define nsIDeviceContextSpec_h___ #include "nsIDeviceContext.h" +#include "prtypes.h" + +class nsIWidget; +class nsIPrintSettings; #ifdef MOZ_CAIRO_GFX class gfxASurface; #endif #define NS_IDEVICE_CONTEXT_SPEC_IID \ -{ 0x001eeff2, 0x72f3, 0x4d65, \ -{ 0xb0, 0x92, 0x35, 0x88, 0xb0, 0x1e, 0x48, 0xd2 } } +{ 0x205c614f, 0x39f8, 0x42e1, \ +{ 0x92, 0x53, 0x04, 0x9b, 0x48, 0xc3, 0xcb, 0xd8 } } class nsIDeviceContextSpec : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDEVICE_CONTEXT_SPEC_IID) + /** + * Initialize the device context spec. + * @param aWidget A widget a dialog can be hosted in + * @param aPrintSettings Print settings for the print operation + * @param aIsPrintPreview True if creating Spec for PrintPreview + * @return NS_OK or a suitable error code. + */ + NS_IMETHOD Init(nsIWidget *aWidget, + nsIPrintSettings* aPrintSettings, + PRBool aIsPrintPreview) = 0; + #ifdef MOZ_CAIRO_GFX NS_IMETHOD GetSurfaceForPrinter(gfxASurface **nativeSurface) = 0; diff --git a/mozilla/widget/public/nsWidgetsCID.h b/mozilla/widget/public/nsWidgetsCID.h index 8da81b484c4..620a7f0c7c8 100644 --- a/mozilla/widget/public/nsWidgetsCID.h +++ b/mozilla/widget/public/nsWidgetsCID.h @@ -149,12 +149,8 @@ //Printing //----------------------------------------------------------- #define NS_DEVICE_CONTEXT_SPEC_CID \ -{ 0xd7193600, 0x78e0, 0x11d2, \ -{ 0xa8, 0x46, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9 } } - -#define NS_DEVICE_CONTEXT_SPEC_FACTORY_CID \ -{ 0xec5bebb0, 0x7b51, 0x11d2, \ -{ 0xa8, 0x48, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9 } } +{ 0xd3f69889, 0xe13a, 0x4321, \ +{ 0x98, 0x0c, 0xa3, 0x93, 0x32, 0xe2, 0x1f, 0x34 } } #define NS_PRINTSETTINGSSERVICE_CID \ { 0x841387c8, 0x72e6, 0x484b, \ diff --git a/mozilla/widget/src/beos/Makefile.in b/mozilla/widget/src/beos/Makefile.in index 2b9065244eb..f194ad8fe6f 100644 --- a/mozilla/widget/src/beos/Makefile.in +++ b/mozilla/widget/src/beos/Makefile.in @@ -89,7 +89,6 @@ CPPSRCS = \ nsChildView.cpp \ nsScreenBeOS.cpp \ nsScreenManagerBeOS.cpp \ - nsDeviceContextSpecFactoryB.cpp \ nsDeviceContextSpecB.cpp \ nsPrintOptionsBeOS.cpp \ $(NULL) diff --git a/mozilla/widget/src/beos/nsDeviceContextSpecB.cpp b/mozilla/widget/src/beos/nsDeviceContextSpecB.cpp index 1b485dca798..9bc5859a3fa 100644 --- a/mozilla/widget/src/beos/nsDeviceContextSpecB.cpp +++ b/mozilla/widget/src/beos/nsDeviceContextSpecB.cpp @@ -148,7 +148,9 @@ NS_IMPL_RELEASE(nsDeviceContextSpecBeOS) * @update dc 2/15/98 * @update syd 3/2/99 */ -NS_IMETHODIMP nsDeviceContextSpecBeOS::Init(nsIPrintSettings* aPS) +NS_IMETHODIMP nsDeviceContextSpecBeOS::Init(nsIWidget *aWidget, + nsIPrintSettings* aPS, + PRBool aIsPrintPreview) { nsresult rv = NS_ERROR_FAILURE; NS_ASSERTION(nsnull != aPS, "No print settings."); diff --git a/mozilla/widget/src/beos/nsDeviceContextSpecB.h b/mozilla/widget/src/beos/nsDeviceContextSpecB.h index 7d96bb2f135..35c251a5060 100644 --- a/mozilla/widget/src/beos/nsDeviceContextSpecB.h +++ b/mozilla/widget/src/beos/nsDeviceContextSpecB.h @@ -68,10 +68,14 @@ public: /** * Initialize the nsDeviceContextSpecBeOS for use. This will allocate a printrecord for use * @update dc 2/16/98 - * @param aIsPrintPreview if PR_TRUE, creating Spec for PrintPreview + * @param aWidget Unused + * @param aPS Settings for this print job + * @param aIsPrintPreview Unused * @return error status */ - NS_IMETHOD Init(nsIPrintSettings* aPS); + NS_IMETHOD Init(nsIWidget *aWidget, + nsIPrintSettings* aPS, + PRBool aIsPrintPreview); /** diff --git a/mozilla/widget/src/beos/nsWidgetFactory.cpp b/mozilla/widget/src/beos/nsWidgetFactory.cpp index a2a94309182..11af2a5bed2 100644 --- a/mozilla/widget/src/beos/nsWidgetFactory.cpp +++ b/mozilla/widget/src/beos/nsWidgetFactory.cpp @@ -59,8 +59,6 @@ // Printing: // aka nsDeviceContextSpecBeOS.h #include "nsDeviceContextSpecB.h" -// aka nsDeviceContextSpecFactoryBeOS.h -#include "nsDeviceContextSpecFactoryB.h" #include "nsPrintOptionsBeOS.h" #include "nsPrintSession.h" @@ -88,7 +86,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard) NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerBeOS) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecBeOS) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecFactoryBeOS) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintOptionsBeOS, Init) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSession, Init) NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrinterEnumeratorBeOS) @@ -160,11 +157,6 @@ static const nsModuleComponentInfo components[] = // "@mozilla.org/gfx/device_context_spec/beos;1", "@mozilla.org/gfx/devicecontextspec;1", nsDeviceContextSpecBeOSConstructor }, - { "BeOS Device Context Spec Factory", - NS_DEVICE_CONTEXT_SPEC_FACTORY_CID, - // "@mozilla.org/gfx/device_context_spec_factory/beos;1", - "@mozilla.org/gfx/devicecontextspecfactory;1", - nsDeviceContextSpecFactoryBeOSConstructor }, { "BeOS Printer Enumerator", NS_PRINTER_ENUMERATOR_CID, // "@mozilla.org/gfx/printer_enumerator/beos;1", diff --git a/mozilla/widget/src/build/nsWinWidgetFactory.cpp b/mozilla/widget/src/build/nsWinWidgetFactory.cpp index f4109514394..bcf707c3925 100644 --- a/mozilla/widget/src/build/nsWinWidgetFactory.cpp +++ b/mozilla/widget/src/build/nsWinWidgetFactory.cpp @@ -65,7 +65,6 @@ // printing #include "nsDeviceContextSpecWin.h" -#include "nsDeviceContextSpecFactoryW.h" #include "nsPrintOptionsWin.h" #include "nsPrintSession.h" @@ -93,7 +92,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintOptionsWin, Init) NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrinterEnumeratorWin) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSession, Init) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecWin) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecFactoryWin) static const nsModuleComponentInfo components[] = { @@ -176,10 +174,6 @@ static const nsModuleComponentInfo components[] = NS_DEVICE_CONTEXT_SPEC_CID, "@mozilla.org/gfx/devicecontextspec;1", nsDeviceContextSpecWinConstructor }, - { "nsDeviceContextSpecFactoryWin", - NS_DEVICE_CONTEXT_SPEC_FACTORY_CID, - "@mozilla.org/gfx/devicecontextspecfactory;1", - nsDeviceContextSpecFactoryWinConstructor }, }; NS_IMPL_NSGETMODULE_WITH_CTOR_DTOR(nsWidgetModule, components, diff --git a/mozilla/widget/src/cocoa/Makefile.in b/mozilla/widget/src/cocoa/Makefile.in index 3692d5ceceb..1d88efe14bb 100644 --- a/mozilla/widget/src/cocoa/Makefile.in +++ b/mozilla/widget/src/cocoa/Makefile.in @@ -91,7 +91,6 @@ EXPORTS = \ $(NULL) MAC_LCPPSRCS = \ - nsDeviceContextSpecFactoryM.cpp \ nsDeviceContextSpecX.cpp \ nsPrintOptionsX.cpp \ nsPrintSettingsX.cpp \ diff --git a/mozilla/widget/src/cocoa/nsWidgetFactory.mm b/mozilla/widget/src/cocoa/nsWidgetFactory.mm index c54463dec7c..6755f4505d8 100644 --- a/mozilla/widget/src/cocoa/nsWidgetFactory.mm +++ b/mozilla/widget/src/cocoa/nsWidgetFactory.mm @@ -66,7 +66,6 @@ #include "nsNativeScrollbar.h" #include "nsScreenManagerCocoa.h" #include "nsDeviceContextSpecX.h" -#include "nsDeviceContextSpecFactoryM.h" #include "nsPrintOptionsX.h" #include "nsPrintSessionX.h" @@ -87,7 +86,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService) NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerCocoa) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecX) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecFactoryMac) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintOptionsX, Init) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSessionX, Init) @@ -195,10 +193,6 @@ static const nsModuleComponentInfo gComponents[] = NS_DEVICE_CONTEXT_SPEC_CID, "@mozilla.org/gfx/devicecontextspec;1", nsDeviceContextSpecXConstructor }, - { "nsDeviceContextSpecFactory", - NS_DEVICE_CONTEXT_SPEC_FACTORY_CID, - "@mozilla.org/gfx/devicecontextspecfactory;1", - nsDeviceContextSpecFactoryMacConstructor }, { "PrintSettings Service", NS_PRINTSETTINGSSERVICE_CID, "@mozilla.org/gfx/printsettings-service;1", diff --git a/mozilla/widget/src/gtk2/Makefile.in b/mozilla/widget/src/gtk2/Makefile.in index 9ebbef9a494..b0d913435cb 100644 --- a/mozilla/widget/src/gtk2/Makefile.in +++ b/mozilla/widget/src/gtk2/Makefile.in @@ -106,7 +106,6 @@ CPPSRCS = \ nsNativeKeyBindings.cpp \ nsScreenGtk.cpp \ nsScreenManagerGtk.cpp \ - nsDeviceContextSpecFactoryG.cpp \ nsDeviceContextSpecG.cpp \ nsPrintOptionsGTK.cpp \ nsImageToPixbuf.cpp \ diff --git a/mozilla/widget/src/gtk2/nsDeviceContextSpecG.cpp b/mozilla/widget/src/gtk2/nsDeviceContextSpecG.cpp index f5bc73ade99..33e6fc3fb2e 100644 --- a/mozilla/widget/src/gtk2/nsDeviceContextSpecG.cpp +++ b/mozilla/widget/src/gtk2/nsDeviceContextSpecG.cpp @@ -469,8 +469,9 @@ NS_IMETHODIMP nsDeviceContextSpecGTK::GetSurfaceForPrinter(gfxASurface **aSurfac * * ** Please update the other toolkits when changing this function. */ -NS_IMETHODIMP nsDeviceContextSpecGTK::Init(nsIPrintSettings *aPS, - PRBool aIsPrintPreview) +NS_IMETHODIMP nsDeviceContextSpecGTK::Init(nsIWidget *aWidget, + nsIPrintSettings* aPS, + PRBool aIsPrintPreview) { DO_PR_DEBUG_LOG(("nsDeviceContextSpecGTK::Init(aPS=%p)\n", aPS)); nsresult rv = NS_ERROR_FAILURE; diff --git a/mozilla/widget/src/gtk2/nsDeviceContextSpecG.h b/mozilla/widget/src/gtk2/nsDeviceContextSpecG.h index 66759656b91..d9551e1a7f4 100644 --- a/mozilla/widget/src/gtk2/nsDeviceContextSpecG.h +++ b/mozilla/widget/src/gtk2/nsDeviceContextSpecG.h @@ -87,7 +87,7 @@ public: NS_IMETHOD GetSurfaceForPrinter(gfxASurface **surface); #endif - NS_IMETHOD Init(nsIPrintSettings* aPS, PRBool aIsPrintPreview); + NS_IMETHOD Init(nsIWidget *aWidget, nsIPrintSettings* aPS, PRBool aIsPrintPreview); NS_IMETHOD ClosePrintManager(); NS_IMETHOD BeginDocument(PRUnichar * aTitle, PRUnichar * aPrintToFileName, PRInt32 aStartPage, PRInt32 aEndPage); NS_IMETHOD EndDocument(); diff --git a/mozilla/widget/src/gtk2/nsWidgetFactory.cpp b/mozilla/widget/src/gtk2/nsWidgetFactory.cpp index 328fd6b0e59..bcb867b417a 100644 --- a/mozilla/widget/src/gtk2/nsWidgetFactory.cpp +++ b/mozilla/widget/src/gtk2/nsWidgetFactory.cpp @@ -56,7 +56,6 @@ #include "nsPrintOptionsGTK.h" #include "nsPrintSession.h" #include "nsDeviceContextSpecG.h" -#include "nsDeviceContextSpecFactoryG.h" #include "nsIPrefService.h" #include "nsIPrefBranch.h" #include "nsImageToPixbuf.h" @@ -89,7 +88,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService) NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound) NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerGtk) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecGTK) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecFactoryGTK) #ifdef NATIVE_THEME_SUPPORT NS_GENERIC_FACTORY_CONSTRUCTOR(nsNativeThemeGTK) #endif @@ -266,11 +264,6 @@ static const nsModuleComponentInfo components[] = // "@mozilla.org/gfx/device_context_spec/gtk;1", "@mozilla.org/gfx/devicecontextspec;1", nsDeviceContextSpecGTKConstructor }, - { "Gtk Device Context Spec Factory", - NS_DEVICE_CONTEXT_SPEC_FACTORY_CID, - // "@mozilla.org/gfx/device_context_spec_factory/gtk;1", - "@mozilla.org/gfx/devicecontextspecfactory;1", - nsDeviceContextSpecFactoryGTKConstructor }, { "Image to gdk-pixbuf converter", NS_IMAGE_TO_PIXBUF_CID, "@mozilla.org/widget/image-to-gdk-pixbuf;1", diff --git a/mozilla/widget/src/mac/Makefile.in b/mozilla/widget/src/mac/Makefile.in index cd23fa96add..b322e9f86ba 100644 --- a/mozilla/widget/src/mac/Makefile.in +++ b/mozilla/widget/src/mac/Makefile.in @@ -115,7 +115,6 @@ CPPSRCS = nsAppShell.cpp \ nsNativeScrollbar.cpp \ nsScreenMac.cpp \ nsScreenManagerMac.cpp \ - nsDeviceContextSpecFactoryM.cpp \ nsDeviceContextSpecX.cpp \ nsPrintOptionsX.cpp \ nsPrintSettingsX.cpp \ diff --git a/mozilla/widget/src/mac/nsDeviceContextSpecX.cpp b/mozilla/widget/src/mac/nsDeviceContextSpecX.cpp index 5a09015f6f8..822fae516d4 100644 --- a/mozilla/widget/src/mac/nsDeviceContextSpecX.cpp +++ b/mozilla/widget/src/mac/nsDeviceContextSpecX.cpp @@ -87,6 +87,13 @@ NS_IMPL_ISUPPORTS2(nsDeviceContextSpecX, nsIDeviceContextSpec, nsIPrintingContex * Initialize the nsDeviceContextSpecMac * @update dc 12/02/98 */ +NS_IMETHODIMP nsDeviceContextSpecX::Init(nsIWidget *aWidget, + nsIPrintSettings* aPS, + PRBool aIsPrintPreview) +{ + return Init(aPS, aIsPrintPreview); +} + NS_IMETHODIMP nsDeviceContextSpecX::Init(nsIPrintSettings* aPS, PRBool aIsPrintPreview) { nsresult rv; diff --git a/mozilla/widget/src/mac/nsDeviceContextSpecX.h b/mozilla/widget/src/mac/nsDeviceContextSpecX.h index 2171dc94e23..775d47bcb04 100644 --- a/mozilla/widget/src/mac/nsDeviceContextSpecX.h +++ b/mozilla/widget/src/mac/nsDeviceContextSpecX.h @@ -70,9 +70,15 @@ public: /** * Initialize the nsDeviceContextSpecX for use. This will allocate a printrecord for use * @update dc 12/02/98 + * @param aWidget Unused + * @param aPS Settings for this print job * @param aIsPrintPreview TRUE if doing print preview, FALSE if normal printing. * @return error status + * + * The three-argument form of this function is defined by + * nsIDeviceContextSpec. The two-argument form is from nsIPrintingContext. */ + NS_IMETHOD Init(nsIWidget *aWidget, nsIPrintSettings* aPS, PRBool aIsPrintPreview); NS_IMETHOD Init(nsIPrintSettings* aPS, PRBool aIsPrintPreview); /** diff --git a/mozilla/widget/src/mac/nsWidgetFactory.cpp b/mozilla/widget/src/mac/nsWidgetFactory.cpp index 5637deaf95e..3a2f8c8c73a 100644 --- a/mozilla/widget/src/mac/nsWidgetFactory.cpp +++ b/mozilla/widget/src/mac/nsWidgetFactory.cpp @@ -70,7 +70,6 @@ #include "nsPrintOptionsX.h" #include "nsPrintSessionX.h" #include "nsDeviceContextSpecX.h" -#include "nsDeviceContextSpecFactoryM.h" NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacWindow) NS_GENERIC_FACTORY_CONSTRUCTOR(ChildWindow) @@ -94,7 +93,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerMac) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintOptionsX, Init) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSessionX, Init) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecX) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecFactoryMac) static const nsModuleComponentInfo gComponents[] = { @@ -186,10 +184,6 @@ static const nsModuleComponentInfo gComponents[] = NS_DEVICE_CONTEXT_SPEC_CID, "@mozilla.org/gfx/devicecontextspec;1", nsDeviceContextSpecXConstructor }, - { "nsDeviceContextSpecFactory", - NS_DEVICE_CONTEXT_SPEC_FACTORY_CID, - "@mozilla.org/gfx/devicecontextspecfactory;1", - nsDeviceContextSpecFactoryMacConstructor }, { "PrintSettings Service", NS_PRINTSETTINGSSERVICE_CID, "@mozilla.org/gfx/printsettings-service;1", diff --git a/mozilla/widget/src/os2/Makefile.in b/mozilla/widget/src/os2/Makefile.in index 1eaf073cb24..658744b11ba 100644 --- a/mozilla/widget/src/os2/Makefile.in +++ b/mozilla/widget/src/os2/Makefile.in @@ -89,7 +89,6 @@ CPPSRCS = \ nsScreenOS2.cpp \ nsScreenManagerOS2.cpp \ nsDeviceContextSpecOS2.cpp \ - nsDeviceContextSpecFactoryO.cpp \ nsPrintOptionsOS2.cpp \ $(NULL) diff --git a/mozilla/widget/src/os2/nsDeviceContextSpecOS2.cpp b/mozilla/widget/src/os2/nsDeviceContextSpecOS2.cpp index 9e9d8012a43..1042d9bf5b2 100644 --- a/mozilla/widget/src/os2/nsDeviceContextSpecOS2.cpp +++ b/mozilla/widget/src/os2/nsDeviceContextSpecOS2.cpp @@ -281,7 +281,9 @@ NS_IMPL_RELEASE(nsDeviceContextSpecOS2) * * ** Please update the other toolkits when changing this function. */ -NS_IMETHODIMP nsDeviceContextSpecOS2::Init(nsIPrintSettings* aPS, PRBool aIsPrintPreview) +NS_IMETHODIMP nsDeviceContextSpecOS2::Init(nsIWidget *aWidget, + nsIPrintSettings* aPS, + PRBool aIsPrintPreview) { nsresult rv = NS_ERROR_FAILURE; diff --git a/mozilla/widget/src/os2/nsDeviceContextSpecOS2.h b/mozilla/widget/src/os2/nsDeviceContextSpecOS2.h index efb444e17e4..de5805d3bf5 100644 --- a/mozilla/widget/src/os2/nsDeviceContextSpecOS2.h +++ b/mozilla/widget/src/os2/nsDeviceContextSpecOS2.h @@ -81,10 +81,12 @@ public: /** * Initialize the nsDeviceContextSpecOS2 for use. This will allocate a printrecord for use * @update dc 2/16/98 - * @param aIsPrintPreview if PR_TRUE, creating Spec for PrintPreview + * @param aWidget Unused + * @param aPS Settings for this print job + * @param aIsPrintPreview if PR_TRUE, creating Spec for PrintPreview * @return error status */ - NS_IMETHOD Init(nsIPrintSettings* aPS, PRBool aIsPrintPreview); + NS_IMETHOD Init(nsIWidget *aWidget, nsIPrintSettings* aPS, PRBool aIsPrintPreview); NS_IMETHOD ClosePrintManager(); diff --git a/mozilla/widget/src/os2/nsWidgetFactory.cpp b/mozilla/widget/src/os2/nsWidgetFactory.cpp index 34e3378190f..a6137643fba 100644 --- a/mozilla/widget/src/os2/nsWidgetFactory.cpp +++ b/mozilla/widget/src/os2/nsWidgetFactory.cpp @@ -174,11 +174,6 @@ static const nsModuleComponentInfo components[] = // "@mozilla.org/gfx/device_context_spec/gtk;1", "@mozilla.org/gfx/devicecontextspec;1", nsDeviceContextSpecOS2Constructor }, - { "OS/2 Device Context Spec Factory", - NS_DEVICE_CONTEXT_SPEC_FACTORY_CID, - // "@mozilla.org/gfx/device_context_spec_factory/gtk;1", - "@mozilla.org/gfx/devicecontextspecfactory;1", - nsDeviceContextSpecFactoryOS2Constructor }, { "PrintSettings Service", NS_PRINTSETTINGSSERVICE_CID, // "@mozilla.org/gfx/printsettings-service;1", diff --git a/mozilla/widget/src/windows/Makefile.in b/mozilla/widget/src/windows/Makefile.in index 0ad55a4281b..c89a5bb5009 100644 --- a/mozilla/widget/src/windows/Makefile.in +++ b/mozilla/widget/src/windows/Makefile.in @@ -93,7 +93,6 @@ CPPSRCS = \ nsPrintOptionsWin.cpp \ nsPrintSettingsWin.cpp \ nsDeviceContextSpecWin.cpp \ - nsDeviceContextSpecFactoryW.cpp \ $(NULL) ifneq ($(OS_ARCH), WINCE)