mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1399787 - Part 7. Have PrintTargetEMF launch the PDFium process. r=jwatt
MozReview-Commit-ID: CVfB81ifV2p --HG-- extra : rebase_source : 64aae1ffdd9a6dc109192a28e0350b72aa0e54b2
This commit is contained in:
parent
5f60bfad5a
commit
6fc6c63d6d
@ -6,6 +6,7 @@
|
||||
#include "PrintTargetEMF.h"
|
||||
#include "nsAnonymousTemporaryFile.h"
|
||||
#include "nsIFile.h"
|
||||
#include "mozilla/widget/PDFiumProcessParent.h"
|
||||
|
||||
using mozilla::gfx::DrawTarget;
|
||||
|
||||
@ -18,6 +19,13 @@ PrintTargetEMF::PrintTargetEMF(HDC aDC, const IntSize& aSize)
|
||||
{
|
||||
}
|
||||
|
||||
PrintTargetEMF::~PrintTargetEMF()
|
||||
{
|
||||
if (mPDFiumProcess) {
|
||||
mPDFiumProcess->Delete();
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ already_AddRefed<PrintTargetEMF>
|
||||
PrintTargetEMF::CreateOrNull(HDC aDC, const IntSize& aSizeInPoints)
|
||||
{
|
||||
@ -51,6 +59,9 @@ PrintTargetEMF::BeginPrinting(const nsAString& aTitle,
|
||||
|
||||
::StartDocW(mPrinterDC, &docinfo);
|
||||
|
||||
mPDFiumProcess = new PDFiumProcessParent();
|
||||
NS_ENSURE_TRUE(mPDFiumProcess->Launch(), NS_ERROR_FAILURE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,12 @@
|
||||
/* include windows.h for the HDC definitions that we need. */
|
||||
#include <windows.h>
|
||||
|
||||
namespace mozilla {
|
||||
namespace widget {
|
||||
class PDFiumProcessParent;
|
||||
}
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
@ -26,6 +32,7 @@ class PrintTargetEMF final : public mozilla::gfx::PrintTarget
|
||||
{
|
||||
public:
|
||||
typedef gfx::IntSize IntSize;
|
||||
typedef mozilla::widget::PDFiumProcessParent PDFiumProcessParent;
|
||||
|
||||
static already_AddRefed<PrintTargetEMF>
|
||||
CreateOrNull(HDC aDC, const IntSize& aSizeInPoints);
|
||||
@ -48,11 +55,13 @@ public:
|
||||
|
||||
private:
|
||||
PrintTargetEMF(HDC aDC, const IntSize& aSize);
|
||||
~PrintTargetEMF() override;
|
||||
|
||||
nsString mTitle;
|
||||
RefPtr<PrintTargetSkPDF> mTargetForCurrentPage;
|
||||
nsCOMPtr<nsIFile> mPDFFileForOnePage;
|
||||
RefPtr<PrintTargetSkPDF> mRefTarget;
|
||||
PDFiumProcessParent* mPDFiumProcess;
|
||||
HDC mPrinterDC;
|
||||
};
|
||||
|
||||
|
@ -27,6 +27,7 @@ EXPORTS.mozilla.widget += [
|
||||
'PDFiumEngineShim.h',
|
||||
'PDFiumParent.h',
|
||||
'PDFiumProcessChild.h',
|
||||
'PDFiumProcessParent.h',
|
||||
'PDFViaEMFPrintHelper.h',
|
||||
'WinCompositorWidget.h',
|
||||
'WinMessages.h',
|
||||
|
Loading…
Reference in New Issue
Block a user