summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-10-23 14:01:24 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2018-10-24 14:42:26 +0200
commit6217cfd414ee86b160313c0a71b7d62e1eb3db14 (patch)
tree1471e49de2c68a0cc4d0f42bfb37dc8bffb883bf /include
parenta27d9845935149005342c74736a961068e6bf242 (diff)
Introduce OutputDevice type OUTDEV_PDF
Originally I thought mpPDFWriter can be used to create PDF from any OutputDevice, but it's actually just set for the internal VirtualDevice of the PDF writer. So this gets rid of all the special mpPDFWriter and GetPDFWriter() handling and replaces it with checks for OUTDEV_PDF. But since ImplPDFWriter used to be a OUTDEV_VIRDEV, this also introduces OutputDevice::IsVirtual(), which now replaces most of the direct OUTDEV_VIRDEV checks. Change-Id: I11824143b6b8833ecc81119762448cbdf1145dbc Reviewed-on: https://gerrit.libreoffice.org/62257 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'include')
-rw-r--r--include/svx/sdrpaintwindow.hxx2
-rw-r--r--include/vcl/outdev.hxx10
-rw-r--r--include/vcl/print.hxx2
-rw-r--r--include/vcl/virdev.hxx14
4 files changed, 16 insertions, 12 deletions
diff --git a/include/svx/sdrpaintwindow.hxx b/include/svx/sdrpaintwindow.hxx
index 92d928da71d2..c99c578f0da3 100644
--- a/include/svx/sdrpaintwindow.hxx
+++ b/include/svx/sdrpaintwindow.hxx
@@ -115,7 +115,7 @@ public:
bool OutputToWindow() const { return (OUTDEV_WINDOW == mpOutputDevice->GetOutDevType()); }
// Is OutDev a VirtualDevice?
- bool OutputToVirtualDevice() const { return (OUTDEV_VIRDEV == mpOutputDevice->GetOutDevType()); }
+ bool OutputIsVirtualDevice() const { return mpOutputDevice->IsVirtual(); }
// Is OutDev a recording MetaFile?
bool OutputToRecordingMetaFile() const;
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 4980757a4b1a..04bd178ed300 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -298,7 +298,7 @@ namespace o3tl
template<> struct typed_flags<InvertFlags> : is_typed_flags<InvertFlags, 0x0007> {};
}
-enum OutDevType { OUTDEV_WINDOW, OUTDEV_PRINTER, OUTDEV_VIRDEV };
+enum OutDevType { OUTDEV_WINDOW, OUTDEV_PRINTER, OUTDEV_VIRDEV, OUTDEV_PDF };
enum class OutDevViewType { DontKnow, PrintPreview, SlideShow };
@@ -346,7 +346,6 @@ private:
std::unique_ptr<OutDevStateStack> mpOutDevStateStack;
std::unique_ptr<ImplOutDevData> mpOutDevData;
std::vector< VCLXGraphics* >* mpUnoGraphicsList;
- VclPtr<OutputDevice> mpPDFWriter;
vcl::ExtOutDevData* mpExtOutDevData;
// TEMP TEMP TEMP
@@ -542,6 +541,10 @@ public:
}
OutDevType GetOutDevType() const { return meOutDevType; }
+ bool IsVirtual() const
+ {
+ return (meOutDevType == OUTDEV_VIRDEV) || (meOutDevType == OUTDEV_PDF);
+ }
/** Query an OutputDevice to see whether it supports a specific operation
@@ -549,8 +552,6 @@ public:
*/
bool SupportsOperation( OutDevSupportType ) const;
- vcl::PDFWriterImpl* GetPDFWriter() const;
-
void SetExtOutDevData( vcl::ExtOutDevData* pExtOutDevData ) { mpExtOutDevData = pExtOutDevData; }
vcl::ExtOutDevData* GetExtOutDevData() const { return mpExtOutDevData; }
@@ -1290,7 +1291,6 @@ protected:
SAL_DLLPRIVATE const LogicalFontInstance* GetFontInstance() const;
SAL_DLLPRIVATE long GetEmphasisAscent() const { return mnEmphasisAscent; }
SAL_DLLPRIVATE long GetEmphasisDescent() const { return mnEmphasisDescent; }
- SAL_DLLPRIVATE void SetPDFWriter(vcl::PDFWriterImpl* pPDFWriter);
virtual void InitFont() const;
virtual void SetFontOrientation( LogicalFontInstance* const pFontInstance ) const;
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index d5f4f6d86635..ae3c773cf934 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -44,11 +44,11 @@ struct SalPrinterQueueInfo;
class SalPrinter;
class VirtualDevice;
enum class SalPrinterError;
-namespace vcl { class Window; }
namespace vcl {
class PrinterController;
class PrintDialog;
+ class Window;
}
namespace weld { class Window; }
diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx
index f608b5797844..48bd4ff4c507 100644
--- a/include/vcl/virdev.hxx
+++ b/include/vcl/virdev.hxx
@@ -21,8 +21,8 @@
#define INCLUDED_VCL_VIRDEV_HXX
#include <vcl/dllapi.h>
-#include <vcl/salgtype.hxx>
#include <vcl/outdev.hxx>
+#include <vcl/salgtype.hxx>
#include <memory>
class SalVirtualDevice;
@@ -89,8 +89,12 @@ protected:
Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to
indicate: take default screen depth. Only DeviceFormat::BITMASK
is the other possibility to denote a binary mask.
+
+ @param eOutDevType
+ This real virtual output device type.
*/
- explicit VirtualDevice(const OutputDevice* pCompDev, DeviceFormat eFormat, DeviceFormat eAlphaFormat);
+ explicit VirtualDevice(const OutputDevice* pCompDev, DeviceFormat eFormat,
+ DeviceFormat eAlphaFormat, OutDevType eOutDevType);
public:
@@ -102,7 +106,7 @@ public:
is the other possibility to denote a binary mask.
*/
explicit VirtualDevice(DeviceFormat eFormat = DeviceFormat::DEFAULT)
- : VirtualDevice(nullptr, eFormat, DeviceFormat::NONE) {}
+ : VirtualDevice(nullptr, eFormat, DeviceFormat::NONE, OUTDEV_VIRDEV) {}
/** Create a virtual device of size 1x1
@@ -116,7 +120,7 @@ public:
*/
explicit VirtualDevice(const OutputDevice& rCompDev,
DeviceFormat eFormat = DeviceFormat::DEFAULT)
- : VirtualDevice(&rCompDev, eFormat, DeviceFormat::NONE) {}
+ : VirtualDevice(&rCompDev, eFormat, DeviceFormat::NONE, OUTDEV_VIRDEV) {}
/** Create a virtual device of size 1x1 with alpha channel
@@ -135,7 +139,7 @@ public:
*/
explicit VirtualDevice(const OutputDevice& rCompDev,
DeviceFormat eFormat, DeviceFormat eAlphaFormat)
- : VirtualDevice(&rCompDev, eFormat, eAlphaFormat) {}
+ : VirtualDevice(&rCompDev, eFormat, eAlphaFormat, OUTDEV_VIRDEV) {}
/** Create a virtual device using an existing system dependent device or graphics context
Any rendering will happen directly on the context and not on any intermediate bitmap.