Bug 393695 - Kill old gfx code in nsDeviceContextSpec with OS
p=Jonathan Steele <xfsunoles@gmail.com> r+sr+a=roc git-svn-id: svn://10.0.0.236/trunk@233770 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -44,9 +44,7 @@
|
||||
class nsIWidget;
|
||||
class nsIPrintSettings;
|
||||
|
||||
#ifdef MOZ_CAIRO_GFX
|
||||
class gfxASurface;
|
||||
#endif
|
||||
|
||||
#define NS_IDEVICE_CONTEXT_SPEC_IID \
|
||||
{ 0x205c614f, 0x39f8, 0x42e1, \
|
||||
@@ -68,7 +66,6 @@ public:
|
||||
nsIPrintSettings* aPrintSettings,
|
||||
PRBool aIsPrintPreview) = 0;
|
||||
|
||||
#ifdef MOZ_CAIRO_GFX
|
||||
NS_IMETHOD GetSurfaceForPrinter(gfxASurface **nativeSurface) = 0;
|
||||
|
||||
NS_IMETHOD BeginDocument(PRUnichar* aTitle,
|
||||
@@ -79,9 +76,6 @@ public:
|
||||
NS_IMETHOD EndDocument() = 0;
|
||||
NS_IMETHOD BeginPage() = 0;
|
||||
NS_IMETHOD EndPage() = 0;
|
||||
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDeviceContextSpec,
|
||||
|
||||
@@ -329,7 +329,6 @@ nsresult nsDeviceContextSpecOS2::GetPRTQUEUE( PRTQUEUE *&p)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef MOZ_CAIRO_GFX
|
||||
NS_IMETHODIMP nsDeviceContextSpecOS2::GetSurfaceForPrinter(gfxASurface **nativeSurface)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
@@ -357,7 +356,6 @@ NS_IMETHODIMP nsDeviceContextSpecOS2::EndPage()
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Printer Enumerator
|
||||
nsPrinterEnumeratorOS2::nsPrinterEnumeratorOS2()
|
||||
|
||||
@@ -96,14 +96,12 @@ public:
|
||||
|
||||
NS_IMETHOD GetPRTQUEUE(PRTQUEUE *&p);
|
||||
|
||||
#ifdef MOZ_CAIRO_GFX
|
||||
NS_IMETHOD GetSurfaceForPrinter(gfxASurface **nativeSurface);
|
||||
NS_IMETHOD BeginDocument(PRUnichar* aTitle, PRUnichar* aPrintToFileName,
|
||||
PRInt32 aStartPage, PRInt32 aEndPage);
|
||||
NS_IMETHOD EndDocument();
|
||||
NS_IMETHOD BeginPage();
|
||||
NS_IMETHOD EndPage();
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Destructor for nsDeviceContextSpecOS2, this will release the printrecord
|
||||
|
||||
@@ -51,10 +51,9 @@
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsStringEnumerator.h"
|
||||
#ifdef MOZ_CAIRO_GFX
|
||||
|
||||
#include "gfxPDFSurface.h"
|
||||
#include "gfxWindowsSurface.h"
|
||||
#endif
|
||||
|
||||
#include "nsIFileStreams.h"
|
||||
#include "nsUnitConversion.h"
|
||||
@@ -181,11 +180,9 @@ nsDeviceContextSpecWin::nsDeviceContextSpecWin()
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
#ifdef MOZ_CAIRO_GFX
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsDeviceContextSpecWin, nsIDeviceContextSpec)
|
||||
#else
|
||||
NS_IMPL_ISUPPORTS2(nsDeviceContextSpecWin, nsIDeviceContextSpec, nsISupportsVoid)
|
||||
#endif
|
||||
|
||||
nsDeviceContextSpecWin::~nsDeviceContextSpecWin()
|
||||
{
|
||||
SetDeviceName(nsnull);
|
||||
@@ -515,7 +512,6 @@ static void CleanAndCopyString(char*& aStr, char* aNewStr)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MOZ_CAIRO_GFX
|
||||
NS_IMETHODIMP nsDeviceContextSpecWin::GetSurfaceForPrinter(gfxASurface **surface)
|
||||
{
|
||||
NS_ASSERTION(mDevMode, "DevMode can't be NULL here");
|
||||
@@ -565,24 +561,6 @@ NS_IMETHODIMP nsDeviceContextSpecWin::GetSurfaceForPrinter(gfxASurface **surface
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// nsISupportsVoid impl stuff. goes away when we turn on cairo.
|
||||
NS_IMETHODIMP nsDeviceContextSpecWin::GetData(void **data)
|
||||
{
|
||||
NS_ASSERTION(mDevMode, "DevMode can't be NULL here");
|
||||
|
||||
if (mDevMode) {
|
||||
HDC dc = ::CreateDC(mDriverName, mDeviceName, NULL, mDevMode);
|
||||
*data = (void*)dc;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
void nsDeviceContextSpecWin::SetDeviceName(char* aDeviceName)
|
||||
{
|
||||
|
||||
@@ -47,16 +47,12 @@
|
||||
#include <windows.h>
|
||||
|
||||
class nsDeviceContextSpecWin : public nsIDeviceContextSpec
|
||||
#ifndef MOZ_CAIRO_GFX
|
||||
, public nsISupportsVoid
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
nsDeviceContextSpecWin();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
#ifdef MOZ_CAIRO_GFX
|
||||
NS_IMETHOD GetSurfaceForPrinter(gfxASurface **surface);
|
||||
NS_IMETHOD BeginDocument(PRUnichar* aTitle,
|
||||
PRUnichar* aPrintToFileName,
|
||||
@@ -65,13 +61,6 @@ public:
|
||||
NS_IMETHOD EndDocument() { return NS_ERROR_NOT_IMPLEMENTED; }
|
||||
NS_IMETHOD BeginPage() { return NS_ERROR_NOT_IMPLEMENTED; }
|
||||
NS_IMETHOD EndPage() { return NS_ERROR_NOT_IMPLEMENTED; }
|
||||
#else
|
||||
// kill these when we move to CAIRO_GFX
|
||||
NS_IMETHOD GetType(PRUint16 *aType) { *aType = nsISupportsPrimitive::TYPE_VOID; return NS_OK; }
|
||||
NS_IMETHOD GetData(void * *aData);
|
||||
NS_IMETHOD SetData(void * aData) { return NS_ERROR_FAILURE; }
|
||||
NS_IMETHOD ToString(char **_retval) { return NS_ERROR_FAILURE; }
|
||||
#endif
|
||||
|
||||
NS_IMETHOD Init(nsIWidget* aWidget, nsIPrintSettings* aPS, PRBool aIsPrintPreview);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user