зеркало из https://github.com/mozilla/pjs.git
adding set/get DPI calls for the pdf surface
This commit is contained in:
Родитель
2a668e8f9e
Коммит
e6490e1390
|
@ -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;
|
||||||
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче