Bug 360485 - Factor out nsIDeviceContextSpecFactory. Part 1: changed files. r=pavlov, sr=roc.

This commit is contained in:
kjh-5727%comcast.net 2006-12-09 17:18:56 +00:00
parent cfeaeb9b95
commit 5f49ed61b9
35 changed files with 74 additions and 117 deletions

View File

@ -67,7 +67,6 @@ REQUIRES = xpcom \
CPPSRCS = \
nsDeviceContextPh.cpp \
nsDeviceContextSpecFactoryP.cpp \
nsDeviceContextSpecPh.cpp \
nsDrawingSurfacePh.cpp \
nsFontMetricsPh.cpp \

View File

@ -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",

View File

@ -70,7 +70,6 @@ REQUIRES = xpcom \
CPPSRCS = \
nsDeviceContextQt.cpp \
nsDeviceContextSpecFactoryQt.cpp \
nsDeviceContextSpecQt.cpp \
nsDrawingSurfaceQt.cpp \
nsFontMetricsQt.cpp \

View File

@ -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;

View File

@ -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);

View File

@ -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",

View File

@ -85,7 +85,6 @@ X11SHARED_LCPPSRCS = \
CPPSRCS = \
$(X11SHARED_LCPPSRCS) \
nsDeviceContextSpecFactoryX.cpp \
nsDeviceContextSpecXlib.cpp \
nsDeviceContextXlib.cpp \
nsDrawingSurfaceXlib.cpp \

View File

@ -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;

View File

@ -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);

View File

@ -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",

View File

@ -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 <stdio.h>
//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<nsIDeviceContext> devctx;
nsCOMPtr<nsIDeviceContextSpec> devspec;
nsCOMPtr<nsIDeviceContextSpecFactory> factory = do_CreateInstance(kDeviceContextSpecFactoryCID);
nsCOMPtr<nsIDeviceContextSpec> 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.

View File

@ -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<nsIDeviceContextSpecFactory> 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<nsIDeviceContextSpec> devspec =
do_CreateInstance("@mozilla.org/gfx/devicecontextspec;1", &rv);
if (NS_SUCCEEDED(rv)) {
#ifdef DEBUG_dcone
printf("PRINT JOB STARTING\n");
#endif
nsCOMPtr<nsIDeviceContextSpec> 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<nsIDeviceContext> ppDC;
nsCOMPtr<nsIDeviceContextSpecFactory> factory = do_CreateInstance(kDeviceContextSpecFactoryCID);
if (factory) {
nsCOMPtr<nsIDeviceContextSpec> devspec;
nsCOMPtr<nsIDeviceContext> dx;
rv = factory->CreateDeviceContextSpec(mWindow, mPrt->mPrintSettings,
*getter_AddRefs(devspec), PR_TRUE);
nsCOMPtr<nsIDeviceContextSpec> 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)) {

View File

@ -64,7 +64,6 @@ EXPORTS = \
nsIPluginWidget.h \
nsINativeKeyBindings.h \
nsIDeviceContextSpec.h \
nsIDeviceContextSpecFactory.h \
$(NULL)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))

View File

@ -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;

View File

@ -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, \

View File

@ -89,7 +89,6 @@ CPPSRCS = \
nsChildView.cpp \
nsScreenBeOS.cpp \
nsScreenManagerBeOS.cpp \
nsDeviceContextSpecFactoryB.cpp \
nsDeviceContextSpecB.cpp \
nsPrintOptionsBeOS.cpp \
$(NULL)

View File

@ -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.");

View File

@ -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);
/**

View File

@ -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",

View File

@ -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,

View File

@ -91,7 +91,6 @@ EXPORTS = \
$(NULL)
MAC_LCPPSRCS = \
nsDeviceContextSpecFactoryM.cpp \
nsDeviceContextSpecX.cpp \
nsPrintOptionsX.cpp \
nsPrintSettingsX.cpp \

View File

@ -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",

View File

@ -106,7 +106,6 @@ CPPSRCS = \
nsNativeKeyBindings.cpp \
nsScreenGtk.cpp \
nsScreenManagerGtk.cpp \
nsDeviceContextSpecFactoryG.cpp \
nsDeviceContextSpecG.cpp \
nsPrintOptionsGTK.cpp \
nsImageToPixbuf.cpp \

View File

@ -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;

View File

@ -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();

View File

@ -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",

View File

@ -115,7 +115,6 @@ CPPSRCS = nsAppShell.cpp \
nsNativeScrollbar.cpp \
nsScreenMac.cpp \
nsScreenManagerMac.cpp \
nsDeviceContextSpecFactoryM.cpp \
nsDeviceContextSpecX.cpp \
nsPrintOptionsX.cpp \
nsPrintSettingsX.cpp \

View File

@ -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;

View File

@ -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);
/**

View File

@ -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",

View File

@ -89,7 +89,6 @@ CPPSRCS = \
nsScreenOS2.cpp \
nsScreenManagerOS2.cpp \
nsDeviceContextSpecOS2.cpp \
nsDeviceContextSpecFactoryO.cpp \
nsPrintOptionsOS2.cpp \
$(NULL)

View File

@ -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;

View File

@ -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();

View File

@ -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",

View File

@ -93,7 +93,6 @@ CPPSRCS = \
nsPrintOptionsWin.cpp \
nsPrintSettingsWin.cpp \
nsDeviceContextSpecWin.cpp \
nsDeviceContextSpecFactoryW.cpp \
$(NULL)
ifneq ($(OS_ARCH), WINCE)