adding set/get DPI calls for the pdf surface

This commit is contained in:
pavlov%pavlov.net 2006-02-02 21:09:06 +00:00
Родитель 2a668e8f9e
Коммит e6490e1390
2 изменённых файлов: 22 добавлений и 2 удалений

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

@ -40,8 +40,6 @@
#include "gfxASurface.h" #include "gfxASurface.h"
#include <cairo-pdf.h>
class NS_EXPORT gfxPDFSurface : public gfxASurface { class NS_EXPORT gfxPDFSurface : public gfxASurface {
THEBES_DECL_ISUPPORTS_INHERITED THEBES_DECL_ISUPPORTS_INHERITED
@ -51,8 +49,12 @@ public:
double height_in_points); double height_in_points);
virtual ~gfxPDFSurface(); virtual ~gfxPDFSurface();
void SetDPI(double x, double y);
void GetDPI(double *xDPI, double *yDPI);
private: private:
double mXDPI;
double mYDPI;
}; };
#endif /* GFX_WINDOWSSURFACE_H */ #endif /* GFX_WINDOWSSURFACE_H */

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

@ -37,9 +37,12 @@
#include "gfxPDFSurface.h" #include "gfxPDFSurface.h"
#include <cairo-pdf.h>
THEBES_IMPL_REFCOUNTING(gfxPDFSurface) THEBES_IMPL_REFCOUNTING(gfxPDFSurface)
gfxPDFSurface::gfxPDFSurface(const char *filename, double width, double height) gfxPDFSurface::gfxPDFSurface(const char *filename, double width, double height)
: mXDPI(-1), mYDPI(-1)
{ {
Init(cairo_pdf_surface_create(filename, width, height)); Init(cairo_pdf_surface_create(filename, width, height));
} }
@ -48,3 +51,18 @@ gfxPDFSurface::~gfxPDFSurface()
{ {
Destroy(); Destroy();
} }
void
gfxPDFSurface::SetDPI(double xDPI, double yDPI)
{
mXDPI = xDPI;
mYDPI = yDPI;
cairo_pdf_surface_set_dpi(CairoSurface(), xDPI, yDPI);
}
void
gfxPDFSurface::GetDPI(double *xDPI, double *yDPI)
{
*xDPI = mXDPI;
*yDPI = mYDPI;
}