diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-03-15 00:50:41 +1100 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-03-22 02:08:36 +0000 |
commit | f84e7f573dd88cc814bdbc8c1678ed64f1edbf48 (patch) | |
tree | d70eda9aebeacbe13bf09da30175e3249579e5fb /include/vcl/print.hxx | |
parent | 926435ef5ab26e647c09887d471bde25b24e1c16 (diff) |
fdo#74702 Move BitmapEx drawing code to seperate functions
New virtual functions DrawTransformBitmapExDirect() and
TransformReduceBitmapExTargetRange(). Printers cannot do either of
these things so I make it a noop in the Printer class, Window and
VirtualDevice will continue to work as intended.
I have documented these functions in OutputDevice.
Also made some small formatting changes to print.hxx to align tabs.
Change-Id: Idd31d230f95d3b5ea360c72dc8191d47bfd8402b
Reviewed-on: https://gerrit.libreoffice.org/8588
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'include/vcl/print.hxx')
-rw-r--r-- | include/vcl/print.hxx | 62 |
1 files changed, 35 insertions, 27 deletions
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index 408ec66ce33e..deade5f894db 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -155,10 +155,10 @@ private: PrinterTransparencyMode meReducedTransparencyMode; bool mbReduceGradients; PrinterGradientMode meReducedGradientsMode; - sal_uInt16 mnReducedGradientStepCount; + sal_uInt16 mnReducedGradientStepCount; bool mbReduceBitmaps; PrinterBitmapMode meReducedBitmapMode; - sal_uInt16 mnReducedBitmapResolution; + sal_uInt16 mnReducedBitmapResolution; bool mbReducedBitmapsIncludeTransparency; bool mbConvertToGreyscales; bool mbPDFAsStandardPrintJobFormat; @@ -180,7 +180,7 @@ public: PrinterGradientMode GetReducedGradientMode() const { return meReducedGradientsMode; } void SetReducedGradientMode( PrinterGradientMode eMode ) { meReducedGradientsMode = eMode; } - sal_uInt16 GetReducedGradientStepCount() const { return mnReducedGradientStepCount; } + sal_uInt16 GetReducedGradientStepCount() const { return mnReducedGradientStepCount; } void SetReducedGradientStepCount( sal_uInt16 nStepCount ) { mnReducedGradientStepCount = nStepCount; } bool IsReduceBitmaps() const { return mbReduceBitmaps; } @@ -189,7 +189,7 @@ public: PrinterBitmapMode GetReducedBitmapMode() const { return meReducedBitmapMode; } void SetReducedBitmapMode( PrinterBitmapMode eMode ) { meReducedBitmapMode = eMode; } - sal_uInt16 GetReducedBitmapResolution() const { return mnReducedBitmapResolution; } + sal_uInt16 GetReducedBitmapResolution() const { return mnReducedBitmapResolution; } void SetReducedBitmapResolution( sal_uInt16 nResolution ) { mnReducedBitmapResolution = nResolution; } bool IsReducedBitmapIncludesTransparency() const { return mbReducedBitmapsIncludeTransparency; } @@ -286,6 +286,16 @@ protected: const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel ); + bool DrawTransformBitmapExDirect( + const basegfx::B2DHomMatrix& aFullTransform, + const BitmapEx& rBitmapEx); + + bool TransformReduceBitmapExTargetRange( + const basegfx::B2DHomMatrix& aFullTransform, + basegfx::B2DRange &aVisibleRange, + double &fMaximumArea); + + public: Printer(); Printer( const JobSetup& rJobSetup ); @@ -295,17 +305,17 @@ public: static const std::vector< OUString >& GetPrinterQueues(); static const QueueInfo* GetQueueInfo( const OUString& rPrinterName, bool bStatusUpdate ); - static OUString GetDefaultPrinterName(); + static OUString GetDefaultPrinterName(); virtual void Error(); - const OUString& GetName() const { return maPrinterName; } - const OUString& GetDriverName() const { return maDriver; } + const OUString& GetName() const { return maPrinterName; } + const OUString& GetDriverName() const { return maDriver; } bool IsDefPrinter() const { return mbDefPrinter; } bool IsDisplayPrinter() const { return mpDisplayDev != NULL; } bool IsValid() const { return !IsDisplayPrinter(); } - sal_uLong GetCapabilities( sal_uInt16 nType ) const; + sal_uLong GetCapabilities( sal_uInt16 nType ) const; bool HasSupport( PrinterSupport eFeature ) const; bool SetJobSetup( const JobSetup& rSetup ); @@ -330,21 +340,21 @@ public: // the current paper int GetLandscapeAngle() const; bool SetPaperBin( sal_uInt16 nPaperBin ); - sal_uInt16 GetPaperBin() const; + sal_uInt16 GetPaperBin() const; bool SetPaper( Paper ePaper ); bool SetPaperSizeUser( const Size& rSize ); bool SetPaperSizeUser( const Size& rSize, bool bMatchNearest ); - Paper GetPaper() const; - static OUString GetPaperName( Paper ePaper ); + Paper GetPaper() const; + static OUString GetPaperName( Paper ePaper ); // return a UI string for the current paper; i_bPaperUser == false means an empty string for PAPER_USER - OUString GetPaperName( bool i_bPaperUser = true ) const; + OUString GetPaperName( bool i_bPaperUser = true ) const; // returns number of available paper formats int GetPaperInfoCount() const; // returns info about paper format nPaper const PaperInfo& GetPaperInfo( int nPaper ) const; - sal_uInt16 GetPaperBinCount() const; - OUString GetPaperBinName( sal_uInt16 nPaperBin ) const; + sal_uInt16 GetPaperBinCount() const; + OUString GetPaperBinName( sal_uInt16 nPaperBin ) const; const Size& GetPaperSizePixel() const { return maPaperSize; } Size GetPaperSize() const { return PixelToLogic( maPaperSize ); } @@ -352,17 +362,17 @@ public: Point GetPageOffset() const { return PixelToLogic( maPageOffset ); } bool SetCopyCount( sal_uInt16 nCopy, bool bCollate = false ); - sal_uInt16 GetCopyCount() const { return mnCopyCount; } + sal_uInt16 GetCopyCount() const { return mnCopyCount; } bool IsCollateCopy() const { return mbCollateCopy; } bool IsPrinting() const { return mbPrinting; } - const OUString& GetCurJobName() const { return maJobName; } - sal_uInt16 GetCurPage() const { return mnCurPage; } + const OUString& GetCurJobName() const { return maJobName; } + sal_uInt16 GetCurPage() const { return mnCurPage; } bool IsJobActive() const { return mbJobActive; } - sal_uLong GetError() const { return ERRCODE_TOERROR(mnError); } - sal_uLong GetErrorCode() const { return mnError; } + sal_uLong GetError() const { return ERRCODE_TOERROR(mnError); } + sal_uLong GetErrorCode() const { return mnError; } void SetErrorHdl( const Link& rLink ) { maErrorHdl = rLink; } const Link& GetErrorHdl() const { return maErrorHdl; } @@ -372,24 +382,22 @@ public: * sends a DataChanged event of type DATACHANGED_PRINTER * if the printer list changed */ - static void updatePrinters(); + static void updatePrinters(); /** execute a print job starts a print job asynchronously (that is will return */ - static void PrintJob( const boost::shared_ptr<vcl::PrinterController>& i_pController, - const JobSetup& i_rInitSetup - ); + static void PrintJob( const boost::shared_ptr<vcl::PrinterController>& i_pController, + const JobSetup& i_rInitSetup ); - virtual bool HasMirroredGraphics() const; + virtual bool HasMirroredGraphics() const; // implementation detail of PrintJob being asynchronous // not exported, not usable outside vcl - static void SAL_DLLPRIVATE ImplPrintJob( const boost::shared_ptr<vcl::PrinterController>& i_pController, - const JobSetup& i_rInitSetup - ); + static void SAL_DLLPRIVATE ImplPrintJob( const boost::shared_ptr<vcl::PrinterController>& i_pController, + const JobSetup& i_rInitSetup ); }; namespace vcl |