fixing bug 329455. patch from Yamashita Makoto <makotoy@ms.u-tokyo.ac.jp>. r=me

This commit is contained in:
pavlov%pavlov.net 2006-03-10 00:20:03 +00:00
Родитель 73f1a70a04
Коммит 4877de3e8e
3 изменённых файлов: 43 добавлений и 0 удалений

Просмотреть файл

@ -75,6 +75,14 @@ ifdef ACCESSIBILITY
REQUIRES += accessibility
endif
ifdef MOZ_ENABLE_CAIRO_GFX
REQUIRES += thebes cairo
ifdef MOZ_ENABLE_GLITZ
REQUIRES += glitz glitzagl
endif
endif
GFX_LCPPSRCS = \
nsRepeater.cpp \
nsWatchTask.cpp \
@ -137,6 +145,10 @@ EXTRA_DSO_LDOPTS += \
-lgkgfx \
$(NULL)
ifdef MOZ_ENABLE_CAIRO_GFX
EXTRA_DSO_LDOPTS += -lthebes
endif
GARBAGE += $(GFX_LCPPSRCS)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -48,6 +48,10 @@
#include "nsIPrintOptions.h"
#include "nsIPrintSettingsX.h"
#ifdef MOZ_CAIRO_GFX
#include "gfxQuartzSurface.h"
#endif
/** -------------------------------------------------------
* Construct the nsDeviceContextSpecX
* @update dc 12/02/98
@ -199,3 +203,27 @@ NS_IMETHODIMP nsDeviceContextSpecX::GetPageRect(double* aTop, double* aLeft, dou
*aBottom = pageRect.bottom, *aRight = pageRect.right;
return NS_OK;
}
#ifdef MOZ_CAIRO_GFX
NS_IMETHODIMP nsDeviceContextSpecX::GetSurfaceForPrinter(gfxASurface **surface)
{
#if 0
// open this when cairo-mac / cairo-cocoa printing is ready
double top, left, bottom, right;
GetPageRect(&top, &left, &bottom, &right);
nsRefPtr<gfxASurface> newSurface = new gfxQuartzSurface(gfxASurface::ImageFormatRGB24, right - left, bottom - top, PR_TRUE);
if (newSurface) {
*surface = newSurface;
NS_ADDREF(*surface);
return NS_OK;
}
NS_WARNING("GetSurfaceForPrinter failed to create gfxQuartzSurface.");
#endif
*surface = nsnull;
return NS_ERROR_FAILURE;
}
#endif

Просмотреть файл

@ -55,6 +55,9 @@ public:
nsDeviceContextSpecX();
NS_DECL_ISUPPORTS
#ifdef MOZ_CAIRO_GFX
NS_IMETHOD GetSurfaceForPrinter(gfxASurface **surface);
#endif
/**
* Initialize the nsDeviceContextSpecX for use. This will allocate a printrecord for use