LibreOffice Module vcl (master) 1
print.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <sal/types.h>
23#include <sal/log.hxx>
25#include <o3tl/safeint.hxx>
26#include <tools/debug.hxx>
27#include <tools/helpers.hxx>
28
29#include <vcl/QueueInfo.hxx>
30#include <vcl/event.hxx>
31#include <vcl/virdev.hxx>
32#include <vcl/print.hxx>
34
35#include <jobset.h>
36#include <print.h>
37#include <ImplOutDevData.hxx>
41#include <impfontcache.hxx>
42#include <print.hrc>
43#include <salgdi.hxx>
44#include <salinst.hxx>
45#include <salprn.hxx>
46#include <salptype.hxx>
47#include <salvd.hxx>
48#include <svdata.hxx>
49
50#include <com/sun/star/beans/XPropertySet.hpp>
51#include <com/sun/star/configuration/theDefaultProvider.hpp>
52#include <com/sun/star/container/XNameAccess.hpp>
53#include <com/sun/star/lang/XMultiServiceFactory.hpp>
54#include <com/sun/star/uno/Sequence.h>
55
57
58namespace
59{
60 Paper ImplGetPaperFormat( tools::Long nWidth100thMM, tools::Long nHeight100thMM )
61 {
62 PaperInfo aInfo(nWidth100thMM, nHeight100thMM);
63 aInfo.doSloppyFit();
64 return aInfo.getPaper();
65 }
66
67 const PaperInfo& ImplGetEmptyPaper()
68 {
69 static PaperInfo aInfo(PAPER_USER);
70 return aInfo;
71 }
72}
73
75{
76 const ImplJobSetup& rConstData = rJobSetup.ImplGetConstData();
77
78 if ( !rConstData.GetPaperWidth() || !rConstData.GetPaperHeight() )
79 {
80 if ( rConstData.GetPaperFormat() != PAPER_USER )
81 {
82 PaperInfo aInfo(rConstData.GetPaperFormat());
83
84 ImplJobSetup& rData = rJobSetup.ImplGetData();
85 rData.SetPaperWidth( aInfo.getWidth() );
86 rData.SetPaperHeight( aInfo.getHeight() );
87 }
88 }
89 else if ( rConstData.GetPaperFormat() == PAPER_USER )
90 {
91 Paper ePaper = ImplGetPaperFormat( rConstData.GetPaperWidth(), rConstData.GetPaperHeight() );
92 if ( ePaper != PAPER_USER )
93 rJobSetup.ImplGetData().SetPaperFormat(ePaper);
94 }
95}
96
98 const Point& rDestPt, const Size& rDestSize,
99 const Point& rSrcPtPixel, const Size& rSrcSizePixel )
100{
101 Point aDestPt( LogicToPixel( rDestPt ) );
102 Size aDestSz( LogicToPixel( rDestSize ) );
103 tools::Rectangle aSrcRect( rSrcPtPixel, rSrcSizePixel );
104
105 aSrcRect.Normalize();
106
107 if( rBmp.IsEmpty() || !aSrcRect.GetWidth() || !aSrcRect.GetHeight() || !aDestSz.Width() || !aDestSz.Height() )
108 return;
109
110 Bitmap aPaint( rBmp );
112
113 // mirrored horizontally
114 if( aDestSz.Width() < 0 )
115 {
116 aDestSz.setWidth( -aDestSz.Width() );
117 aDestPt.AdjustX( -( aDestSz.Width() - 1 ) );
118 nMirrFlags |= BmpMirrorFlags::Horizontal;
119 }
120
121 // mirrored vertically
122 if( aDestSz.Height() < 0 )
123 {
124 aDestSz.setHeight( -aDestSz.Height() );
125 aDestPt.AdjustY( -( aDestSz.Height() - 1 ) );
126 nMirrFlags |= BmpMirrorFlags::Vertical;
127 }
128
129 // source cropped?
130 if( aSrcRect != tools::Rectangle( Point(), aPaint.GetSizePixel() ) )
131 {
132 aPaint.Crop( aSrcRect );
133 }
134
135 // destination mirrored
136 if( nMirrFlags != BmpMirrorFlags::NONE )
137 {
138 aPaint.Mirror( nMirrFlags );
139 }
140
141 // we always want to have a mask
142 AlphaMask aAlphaMask(aSrcRect.GetSize());
143 aAlphaMask.Erase( 0 );
144
145 // do painting
146 const tools::Long nSrcWidth = aSrcRect.GetWidth(), nSrcHeight = aSrcRect.GetHeight();
147 tools::Long nX, nY; // , nWorkX, nWorkY, nWorkWidth, nWorkHeight;
148 std::unique_ptr<tools::Long[]> pMapX(new tools::Long[ nSrcWidth + 1 ]);
149 std::unique_ptr<tools::Long[]> pMapY(new tools::Long[ nSrcHeight + 1 ]);
150 const bool bOldMap = mbMap;
151
152 mbMap = false;
153
154 // create forward mapping tables
155 for( nX = 0; nX <= nSrcWidth; nX++ )
156 pMapX[ nX ] = aDestPt.X() + FRound( static_cast<double>(aDestSz.Width()) * nX / nSrcWidth );
157
158 for( nY = 0; nY <= nSrcHeight; nY++ )
159 pMapY[ nY ] = aDestPt.Y() + FRound( static_cast<double>(aDestSz.Height()) * nY / nSrcHeight );
160
161 tools::Rectangle rectangle { Point(0,0), aSrcRect.GetSize() };
162 const Point aMapPt(pMapX[rectangle.Left()], pMapY[rectangle.Top()]);
163 const Size aMapSz( pMapX[rectangle.Right() + 1] - aMapPt.X(), // pMapX[L + W] -> L + ((R - L) + 1) -> R + 1
164 pMapY[rectangle.Bottom() + 1] - aMapPt.Y()); // same for Y
165 Bitmap aBandBmp(aPaint);
166
167 DrawBitmap(aMapPt, aMapSz, Point(), aBandBmp.GetSizePixel(), aBandBmp);
168
169 mbMap = bOldMap;
170}
171
173 const basegfx::B2DHomMatrix& /*aFullTransform*/,
174 const BitmapEx& /*rBitmapEx*/,
175 double /*fAlpha*/)
176{
177 // printers can't draw bitmaps directly
178 return false;
179}
180
182 const basegfx::B2DHomMatrix& /*aFullTransform*/,
183 basegfx::B2DRange& /*aVisibleRange*/,
184 double& /*fMaximumArea*/)
185{
186 // deliberately do nothing - you can't reduce the
187 // target range for a printer at all
188 return true;
189}
190
191void Printer::DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSize,
192 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
193 BitmapEx& rBmpEx )
194{
195 if( rBmpEx.IsAlpha() )
196 {
197 // #107169# For true alpha bitmaps, no longer masking the
198 // bitmap, but perform a full alpha blend against a white
199 // background here.
200 Bitmap aBmp( rBmpEx.GetBitmap() );
201 aBmp.Blend( rBmpEx.GetAlphaMask(), COL_WHITE );
202 DrawBitmap( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, aBmp );
203 }
204 else
205 {
206 Bitmap aBmp( rBmpEx.GetBitmap() );
207 ImplPrintTransparent( aBmp, rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel );
208 }
209}
210
212 sal_uInt16 nTransparencePercent )
213{
214 // #110958# Disable alpha VDev, we perform the necessary
215 VirtualDevice* pOldAlphaVDev = mpAlphaVDev;
216
217 // operation explicitly further below.
218 if( mpAlphaVDev )
219 mpAlphaVDev = nullptr;
220
221 GDIMetaFile* pOldMetaFile = mpMetaFile;
222 mpMetaFile = nullptr;
223
224 mpMetaFile = pOldMetaFile;
225
226 // #110958# Restore disabled alpha VDev
227 mpAlphaVDev = pOldAlphaVDev;
228
229 tools::Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() );
230 const Size aDPISize( LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch)) );
231 const tools::Long nBaseExtent = std::max<tools::Long>( FRound( aDPISize.Width() / 300. ), 1 );
232 tools::Long nMove;
233 const sal_uInt16 nTrans = ( nTransparencePercent < 13 ) ? 0 :
234 ( nTransparencePercent < 38 ) ? 25 :
235 ( nTransparencePercent < 63 ) ? 50 :
236 ( nTransparencePercent < 88 ) ? 75 : 100;
237
238 switch( nTrans )
239 {
240 case 25: nMove = nBaseExtent * 3; break;
241 case 50: nMove = nBaseExtent * 4; break;
242 case 75: nMove = nBaseExtent * 6; break;
243
244 // #i112959# very transparent (88 < nTransparencePercent <= 99)
245 case 100: nMove = nBaseExtent * 8; break;
246
247 // #i112959# not transparent (nTransparencePercent < 13)
248 default: nMove = 0; break;
249 }
250
254 const bool bOldMap = mbMap;
255 EnableMapMode( false );
256
257 if(nMove)
258 {
259 tools::Rectangle aRect( aPolyRect.TopLeft(), Size( aPolyRect.GetWidth(), nBaseExtent ) );
260 while( aRect.Top() <= aPolyRect.Bottom() )
261 {
262 DrawRect( aRect );
263 aRect.Move( 0, nMove );
264 }
265
266 aRect = tools::Rectangle( aPolyRect.TopLeft(), Size( nBaseExtent, aPolyRect.GetHeight() ) );
267 while( aRect.Left() <= aPolyRect.Right() )
268 {
269 DrawRect( aRect );
270 aRect.Move( nMove, 0 );
271 }
272 }
273 else
274 {
275 // #i112959# if not transparent, draw full rectangle in clip region
276 DrawRect( aPolyRect );
277 }
278
279 EnableMapMode( bOldMap );
280 Pop();
281
282 mpMetaFile = pOldMetaFile;
283
284 // #110958# Restore disabled alpha VDev
285 mpAlphaVDev = pOldAlphaVDev;
286}
287
288void Printer::DrawOutDev( const Point& /*rDestPt*/, const Size& /*rDestSize*/,
289 const Point& /*rSrcPt*/, const Size& /*rSrcSize*/ )
290{
291 SAL_WARN( "vcl.gdi", "Don't use OutputDevice::DrawOutDev(...) with printer devices!" );
292}
293
294void Printer::DrawOutDev( const Point& /*rDestPt*/, const Size& /*rDestSize*/,
295 const Point& /*rSrcPt*/, const Size& /*rSrcSize*/,
296 const OutputDevice& /*rOutDev*/ )
297{
298 SAL_WARN( "vcl.gdi", "Don't use OutputDevice::DrawOutDev(...) with printer devices!" );
299}
300
301void Printer::CopyArea( const Point& /*rDestPt*/,
302 const Point& /*rSrcPt*/, const Size& /*rSrcSize*/,
303 bool /*bWindowInvalidate*/ )
304{
305 SAL_WARN( "vcl.gdi", "Don't use OutputDevice::CopyArea(...) with printer devices!" );
306}
307
309{
310 Point aPageOffset = Point( 0, 0 ) - this->GetPageOffsetPixel();
311 Size aSize = this->GetPaperSizePixel();
312 return tools::Rectangle( aPageOffset, aSize );
313}
314
315void Printer::SetPrinterOptions( const vcl::printer::Options& i_rOptions )
316{
317 *mpPrinterOptions = i_rOptions;
318}
319
321{
322 // due to a "hotfix" for AOO bug i55719, this needs to return false
323 return false;
324}
325
327{
330}
331
333{
334}
335
337{
338}
339
340void ImplPrnQueueList::Add( std::unique_ptr<SalPrinterQueueInfo> pData )
341{
342 std::unordered_map< OUString, sal_Int32 >::iterator it =
343 m_aNameToIndex.find( pData->maPrinterName );
344 if( it == m_aNameToIndex.end() )
345 {
346 m_aNameToIndex[ pData->maPrinterName ] = m_aQueueInfos.size();
347 m_aPrinterList.push_back( pData->maPrinterName );
348 m_aQueueInfos.push_back( ImplPrnQueueData() );
349 m_aQueueInfos.back().mpQueueInfo = nullptr;
350 m_aQueueInfos.back().mpSalQueueInfo = std::move(pData);
351 }
352 else // this should not happen, but ...
353 {
354 ImplPrnQueueData& rData = m_aQueueInfos[ it->second ];
355 rData.mpQueueInfo.reset();
356 rData.mpSalQueueInfo = std::move(pData);
357 }
358}
359
360ImplPrnQueueData* ImplPrnQueueList::Get( const OUString& rPrinter )
361{
362 ImplPrnQueueData* pData = nullptr;
363 std::unordered_map<OUString,sal_Int32>::iterator it =
364 m_aNameToIndex.find( rPrinter );
365 if( it != m_aNameToIndex.end() )
366 pData = &m_aQueueInfos[it->second];
367 return pData;
368}
369
371{
372 ImplSVData* pSVData = ImplGetSVData();
373
375
376 static const char* pEnv = getenv( "SAL_DISABLE_PRINTERLIST" );
377 if( !pEnv || !*pEnv )
378 pSVData->mpDefInst->GetPrinterQueueInfo( pSVData->maGDIData.mpPrinterQueueList.get() );
379}
380
382{
383 ImplSVData* pSVData = ImplGetSVData();
384 pSVData->maGDIData.mpPrinterQueueList.reset();
385}
386
387const std::vector<OUString>& Printer::GetPrinterQueues()
388{
389 ImplSVData* pSVData = ImplGetSVData();
390 if ( !pSVData->maGDIData.mpPrinterQueueList )
392 assert(pSVData->maGDIData.mpPrinterQueueList && "mpPrinterQueueList exists by now");
393 return pSVData->maGDIData.mpPrinterQueueList->m_aPrinterList;
394}
395
396const QueueInfo* Printer::GetQueueInfo( const OUString& rPrinterName, bool bStatusUpdate )
397{
398 ImplSVData* pSVData = ImplGetSVData();
399
400 if ( !pSVData->maGDIData.mpPrinterQueueList )
402
403 if ( !pSVData->maGDIData.mpPrinterQueueList )
404 return nullptr;
405
406 ImplPrnQueueData* pInfo = pSVData->maGDIData.mpPrinterQueueList->Get( rPrinterName );
407 if( pInfo )
408 {
409 if( !pInfo->mpQueueInfo || bStatusUpdate )
410 pSVData->mpDefInst->GetPrinterQueueState( pInfo->mpSalQueueInfo.get() );
411
412 if ( !pInfo->mpQueueInfo )
413 pInfo->mpQueueInfo.reset(new QueueInfo);
414
415 pInfo->mpQueueInfo->maPrinterName = pInfo->mpSalQueueInfo->maPrinterName;
416 pInfo->mpQueueInfo->maDriver = pInfo->mpSalQueueInfo->maDriver;
417 pInfo->mpQueueInfo->maLocation = pInfo->mpSalQueueInfo->maLocation;
418 pInfo->mpQueueInfo->maComment = pInfo->mpSalQueueInfo->maComment;
419 pInfo->mpQueueInfo->mnStatus = pInfo->mpSalQueueInfo->mnStatus;
420 pInfo->mpQueueInfo->mnJobs = pInfo->mpSalQueueInfo->mnJobs;
421 return pInfo->mpQueueInfo.get();
422 }
423 return nullptr;
424}
425
427{
428 static const char* pEnv = getenv( "SAL_DISABLE_DEFAULTPRINTER" );
429 if( !pEnv || !*pEnv )
430 {
431 ImplSVData* pSVData = ImplGetSVData();
432
433 return pSVData->mpDefInst->GetDefaultPrinter();
434 }
435 return OUString();
436}
437
439{
440 mbDevOutput = false;
441 mbDefPrinter = false;
443 mnPageQueueSize = 0;
444 mnCopyCount = 1;
445 mbCollateCopy = false;
446 mbPrinting = false;
447 mbJobActive = false;
448 mbPrintFile = false;
449 mbInPrintPage = false;
450 mbNewJobSetup = false;
451 mbSinglePrintJobs = false;
452 mpInfoPrinter = nullptr;
453 mpPrinter = nullptr;
454 mpDisplayDev = nullptr;
455 mpPrinterOptions.reset(new vcl::printer::Options);
456
457 // Add printer to the list
458 ImplSVData* pSVData = ImplGetSVData();
460 mpPrev = nullptr;
461 if ( mpNext )
462 mpNext->mpPrev = this;
463 pSVData->maGDIData.mpFirstPrinter = this;
464}
465
467{
469
470 if ( mpGraphics )
471 return true;
472
473 mbInitLineColor = true;
474 mbInitFillColor = true;
475 mbInitFont = true;
476 mbInitTextColor = true;
477 mbInitClipRegion = true;
478
479 ImplSVData* pSVData = ImplGetSVData();
480
481 if ( mpJobGraphics )
483 else if ( mpDisplayDev )
484 {
485 const VirtualDevice* pVirDev = mpDisplayDev;
486 mpGraphics = pVirDev->mpVirDev->AcquireGraphics();
487 // if needed retry after releasing least recently used virtual device graphics
488 while ( !mpGraphics )
489 {
490 if ( !pSVData->maGDIData.mpLastVirGraphics )
491 break;
493 mpGraphics = pVirDev->mpVirDev->AcquireGraphics();
494 }
495 // update global LRU list of virtual device graphics
496 if ( mpGraphics )
497 {
499 pSVData->maGDIData.mpFirstVirGraphics = const_cast<Printer*>(this);
500 if ( mpNextGraphics )
501 mpNextGraphics->mpPrevGraphics = const_cast<Printer*>(this);
502 if ( !pSVData->maGDIData.mpLastVirGraphics )
503 pSVData->maGDIData.mpLastVirGraphics = const_cast<Printer*>(this);
504 }
505 }
506 else
507 {
509 // if needed retry after releasing least recently used printer graphics
510 while ( !mpGraphics )
511 {
512 if ( !pSVData->maGDIData.mpLastPrnGraphics )
513 break;
516 }
517 // update global LRU list of printer graphics
518 if ( mpGraphics )
519 {
521 pSVData->maGDIData.mpFirstPrnGraphics = const_cast<Printer*>(this);
522 if ( mpNextGraphics )
523 mpNextGraphics->mpPrevGraphics = const_cast<Printer*>(this);
524 if ( !pSVData->maGDIData.mpLastPrnGraphics )
525 pSVData->maGDIData.mpLastPrnGraphics = const_cast<Printer*>(this);
526 }
527 }
528
529 if ( mpGraphics )
530 {
533 }
534
535 return mpGraphics != nullptr;
536}
537
539{
541 mbNewFont = true;
542 mbInitFont = true;
543
544 mpFontInstance.clear();
545 mpFontFaceCollection.reset();
546}
547
549{
551
552 if ( !mpGraphics )
553 return;
554
555 // release the fonts of the physically released graphics device
556 if( bRelease )
558
559 ImplSVData* pSVData = ImplGetSVData();
560
561 Printer* pPrinter = this;
562
563 if ( !pPrinter->mpJobGraphics )
564 {
565 if ( pPrinter->mpDisplayDev )
566 {
567 VirtualDevice* pVirDev = pPrinter->mpDisplayDev;
568 if ( bRelease )
569 pVirDev->mpVirDev->ReleaseGraphics( mpGraphics );
570 // remove from global LRU list of virtual device graphics
571 if ( mpPrevGraphics )
573 else
575 if ( mpNextGraphics )
577 else
579 }
580 else
581 {
582 if ( bRelease )
584 // remove from global LRU list of printer graphics
585 if ( mpPrevGraphics )
587 else
588 pSVData->maGDIData.mpFirstPrnGraphics = static_cast<Printer*>(mpNextGraphics.get());
589 if ( mpNextGraphics )
591 else
592 pSVData->maGDIData.mpLastPrnGraphics = static_cast<Printer*>(mpPrevGraphics.get());
593 }
594 }
595
596 mpGraphics = nullptr;
597 mpPrevGraphics = nullptr;
598 mpNextGraphics = nullptr;
599}
600
601void Printer::ReleaseGraphics(bool bRelease)
602{
603 ImplReleaseGraphics(bRelease);
604}
605
607{
608 ImplSVData* pSVData = ImplGetSVData();
609 // #i74084# update info for this specific SalPrinterQueueInfo
610 pSVData->mpDefInst->GetPrinterQueueState( pInfo );
611
612 // Test whether the driver actually matches the JobSetup
614 if ( rData.GetDriverData() )
615 {
616 if ( rData.GetPrinterName() != pInfo->maPrinterName ||
617 rData.GetDriver() != pInfo->maDriver )
618 {
619 std::free( const_cast<sal_uInt8*>(rData.GetDriverData()) );
620 rData.SetDriverData(nullptr);
621 rData.SetDriverDataLen(0);
622 }
623 }
624
625 // Remember printer name
627 maDriver = pInfo->maDriver;
628
629 // Add printer name to JobSetup
631 rData.SetDriver( maDriver );
632
633 mpInfoPrinter = pSVData->mpDefInst->CreateInfoPrinter( pInfo, &rData );
634 mpPrinter = nullptr;
635 mpJobGraphics = nullptr;
637
638 if ( !mpInfoPrinter )
639 {
641 return;
642 }
643
644 // we need a graphics
645 if ( !AcquireGraphics() )
646 {
648 return;
649 }
650
651 // Init data
653 mxFontCollection = std::make_shared<vcl::font::PhysicalFontCollection>();
654 mxFontCache = std::make_shared<ImplFontCache>();
656}
657
659{
660 ImplSVData* pSVData = ImplGetSVData();
661
662 mpInfoPrinter = nullptr;
663 mpPrinter = nullptr;
664 mpJobGraphics = nullptr;
665
671}
672
673void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
674 const Point& rDestPt, const Size& rDestSize,
675 const Point& rSrcPtPixel, const Size& rSrcSizePixel )
676{
677 Point aDestPt( LogicToPixel( rDestPt ) );
678 Size aDestSz( LogicToPixel( rDestSize ) );
679 tools::Rectangle aSrcRect( rSrcPtPixel, rSrcSizePixel );
680
681 aSrcRect.Normalize();
682
683 if( !(!rMask.IsEmpty() && aSrcRect.GetWidth() && aSrcRect.GetHeight() && aDestSz.Width() && aDestSz.Height()) )
684 return;
685
686 Bitmap aMask( rMask );
688
691
692 // mirrored horizontally
693 if( aDestSz.Width() < 0 )
694 {
695 aDestSz.setWidth( -aDestSz.Width() );
696 aDestPt.AdjustX( -( aDestSz.Width() - 1 ) );
697 nMirrFlags |= BmpMirrorFlags::Horizontal;
698 }
699
700 // mirrored vertically
701 if( aDestSz.Height() < 0 )
702 {
703 aDestSz.setHeight( -aDestSz.Height() );
704 aDestPt.AdjustY( -( aDestSz.Height() - 1 ) );
705 nMirrFlags |= BmpMirrorFlags::Vertical;
706 }
707
708 // source cropped?
709 if( aSrcRect != tools::Rectangle( Point(), aMask.GetSizePixel() ) )
710 aMask.Crop( aSrcRect );
711
712 // destination mirrored
713 if( nMirrFlags != BmpMirrorFlags::NONE)
714 aMask.Mirror( nMirrFlags );
715
716 // do painting
717 const tools::Long nSrcWidth = aSrcRect.GetWidth(), nSrcHeight = aSrcRect.GetHeight();
718 tools::Long nX, nY; //, nWorkX, nWorkY, nWorkWidth, nWorkHeight;
719 std::unique_ptr<tools::Long[]> pMapX( new tools::Long[ nSrcWidth + 1 ] );
720 std::unique_ptr<tools::Long[]> pMapY( new tools::Long[ nSrcHeight + 1 ] );
721 GDIMetaFile* pOldMetaFile = mpMetaFile;
722 const bool bOldMap = mbMap;
723
724 mpMetaFile = nullptr;
725 mbMap = false;
727 SetLineColor( rMaskColor );
728 SetFillColor( rMaskColor );
731
732 // create forward mapping tables
733 for( nX = 0; nX <= nSrcWidth; nX++ )
734 pMapX[ nX ] = aDestPt.X() + FRound( static_cast<double>(aDestSz.Width()) * nX / nSrcWidth );
735
736 for( nY = 0; nY <= nSrcHeight; nY++ )
737 pMapY[ nY ] = aDestPt.Y() + FRound( static_cast<double>(aDestSz.Height()) * nY / nSrcHeight );
738
739 // walk through all rectangles of mask
740 const vcl::Region aWorkRgn(aMask.CreateRegion(COL_BLACK, tools::Rectangle(Point(), aMask.GetSizePixel())));
741 RectangleVector aRectangles;
742 aWorkRgn.GetRegionRectangles(aRectangles);
743
744 for (auto const& rectangle : aRectangles)
745 {
746 const Point aMapPt(pMapX[rectangle.Left()], pMapY[rectangle.Top()]);
747 const Size aMapSz(
748 pMapX[rectangle.Right() + 1] - aMapPt.X(), // pMapX[L + W] -> L + ((R - L) + 1) -> R + 1
749 pMapY[rectangle.Bottom() + 1] - aMapPt.Y()); // same for Y
750
751 DrawRect(tools::Rectangle(aMapPt, aMapSz));
752 }
753
754 Pop();
755 mbMap = bOldMap;
756 mpMetaFile = pOldMetaFile;
757}
758
759SalPrinterQueueInfo* Printer::ImplGetQueueInfo( const OUString& rPrinterName,
760 const OUString* pDriver )
761{
762 ImplSVData* pSVData = ImplGetSVData();
763 if ( !pSVData->maGDIData.mpPrinterQueueList )
765
766 ImplPrnQueueList* pPrnList = pSVData->maGDIData.mpPrinterQueueList.get();
767 if ( pPrnList && !pPrnList->m_aQueueInfos.empty() )
768 {
769 // first search for the printer name directly
770 ImplPrnQueueData* pInfo = pPrnList->Get( rPrinterName );
771 if( pInfo )
772 return pInfo->mpSalQueueInfo.get();
773
774 // then search case insensitive
775 for(const ImplPrnQueueData & rQueueInfo : pPrnList->m_aQueueInfos)
776 {
777 if( rQueueInfo.mpSalQueueInfo->maPrinterName.equalsIgnoreAsciiCase( rPrinterName ) )
778 return rQueueInfo.mpSalQueueInfo.get();
779 }
780
781 // then search for driver name
782 if ( pDriver )
783 {
784 for(const ImplPrnQueueData & rQueueInfo : pPrnList->m_aQueueInfos)
785 {
786 if( rQueueInfo.mpSalQueueInfo->maDriver == *pDriver )
787 return rQueueInfo.mpSalQueueInfo.get();
788 }
789 }
790
791 // then the default printer
792 pInfo = pPrnList->Get( GetDefaultPrinterName() );
793 if( pInfo )
794 return pInfo->mpSalQueueInfo.get();
795
796 // last chance: the first available printer
797 return pPrnList->m_aQueueInfos[0].mpSalQueueInfo.get();
798 }
799
800 return nullptr;
801}
802
804{
805 // we need a graphics
806 if ( !AcquireGraphics() )
807 return;
808
813 maPaperSize );
814}
815
817{
819}
820
822{
823 // use display-equivalent step size calculation
824 tools::Long nInc = (nMinRect < 800) ? 10 : 20;
825
826 return nInc;
827}
828
831{
832 ImplInitData();
834 if ( pInfo )
835 {
836 ImplInit( pInfo );
837 if ( !IsDisplayPrinter() )
838 mbDefPrinter = true;
839 }
840 else
842}
843
844Printer::Printer( const JobSetup& rJobSetup )
846 , maJobSetup(rJobSetup)
847{
848 ImplInitData();
849 const ImplJobSetup& rConstData = rJobSetup.ImplGetConstData();
850 OUString aDriver = rConstData.GetDriver();
852 &aDriver );
853 if ( pInfo )
854 {
855 ImplInit( pInfo );
856 SetJobSetup( rJobSetup );
857 }
858 else
859 {
862 }
863}
864
865Printer::Printer( const QueueInfo& rQueueInfo )
867{
868 ImplInitData();
870 &rQueueInfo.GetDriver() );
871 if ( pInfo )
872 ImplInit( pInfo );
873 else
875}
876
877Printer::Printer( const OUString& rPrinterName )
879{
880 ImplInitData();
881 SalPrinterQueueInfo* pInfo = ImplGetQueueInfo( rPrinterName, nullptr );
882 if ( pInfo )
883 ImplInit( pInfo );
884 else
886}
887
889{
890 disposeOnce();
891}
892
894{
895 SAL_WARN_IF( IsPrinting(), "vcl.gdi", "Printer::~Printer() - Job is printing" );
896 SAL_WARN_IF( IsJobActive(), "vcl.gdi", "Printer::~Printer() - Job is active" );
897
898 mpPrinterOptions.reset();
899
901 if ( mpInfoPrinter )
903 if ( mpDisplayDev )
905 else
906 {
907 // OutputDevice Dtor is trying the same thing; that why we need to set
908 // the FontEntry to NULL here
909 // TODO: consolidate duplicate cleanup by Printer and OutputDevice
910 mpFontInstance.clear();
911 mpFontFaceCollection.reset();
912 mxFontCache.reset();
913 // font list deleted by OutputDevice dtor
914 }
915
916 // Add printer from the list
917 ImplSVData* pSVData = ImplGetSVData();
918 if ( mpPrev )
920 else
922 if ( mpNext )
924
925 mpPrev.clear();
926 mpNext.clear();
928}
929
931{
932 Size aBrdSize(LogicToPixel(Size(20, 20), MapMode(MapUnit::Map100thMM)));
933
934 if (!aBrdSize.Width())
935 aBrdSize.setWidth(1);
936
937 if (!aBrdSize.Height())
938 aBrdSize.setHeight(1);
939
940 return aBrdSize;
941}
942
944{
945 if ( IsDisplayPrinter() )
946 return 0;
947
948 if( mpInfoPrinter )
950 else
951 return 0;
952}
953
955{
956 switch ( eFeature )
957 {
968 }
969
970 return true;
971}
972
973bool Printer::SetJobSetup( const JobSetup& rSetup )
974{
976 return false;
977
978 JobSetup aJobSetup = rSetup;
979
981 if ( mpInfoPrinter->SetPrinterData( &aJobSetup.ImplGetData() ) )
982 {
983 ImplUpdateJobSetupPaper( aJobSetup );
984 mbNewJobSetup = true;
985 maJobSetup = aJobSetup;
988 return true;
989 }
990
991 return false;
992}
993
995{
996 if ( IsDisplayPrinter() )
997 return false;
998
999 if ( IsJobActive() || IsPrinting() )
1000 return false;
1001
1002 JobSetup aJobSetup = maJobSetup;
1003 ImplJobSetup& rData = aJobSetup.ImplGetData();
1004 rData.SetPrinterSetupMode( eMode );
1005 // TODO: orig page size
1006
1007 if (!pWindow)
1008 {
1009 vcl::Window* pDefWin = ImplGetDefaultWindow();
1010 pWindow = pDefWin ? pDefWin->GetFrameWeld() : nullptr;
1011 }
1012 if( !pWindow )
1013 return false;
1014
1016 ImplSVData* pSVData = ImplGetSVData();
1017 pSVData->maAppData.mnModalMode++;
1019 bool bSetup = mpInfoPrinter->Setup(pWindow, &rData);
1020 pSVData->maAppData.mnModalMode--;
1022 if ( bSetup )
1023 {
1024 ImplUpdateJobSetupPaper( aJobSetup );
1025 mbNewJobSetup = true;
1026 maJobSetup = aJobSetup;
1029 return true;
1030 }
1031 return false;
1032}
1033
1034bool Printer::SetPrinterProps( const Printer* pPrinter )
1035{
1036 if ( IsJobActive() || IsPrinting() )
1037 return false;
1038
1039 ImplSVData* pSVData = ImplGetSVData();
1040
1041 mbDefPrinter = pPrinter->mbDefPrinter;
1042 maPrintFile = pPrinter->maPrintFile;
1043 mbPrintFile = pPrinter->mbPrintFile;
1044 mnCopyCount = pPrinter->mnCopyCount;
1045 mbCollateCopy = pPrinter->mbCollateCopy;
1046 mnPageQueueSize = pPrinter->mnPageQueueSize;
1047 *mpPrinterOptions = *pPrinter->mpPrinterOptions;
1048
1049 if ( pPrinter->IsDisplayPrinter() )
1050 {
1051 // Destroy old printer
1052 if ( !IsDisplayPrinter() )
1053 {
1056 mpFontInstance.clear();
1057 mpFontFaceCollection.reset();
1058 // clean up font list
1059 mxFontCache.reset();
1060 mxFontCollection.reset();
1061
1062 mbInitFont = true;
1063 mbNewFont = true;
1064 mpInfoPrinter = nullptr;
1065 }
1066
1067 // Construct new printer
1069 return true;
1070 }
1071
1072 // Destroy old printer?
1073 if ( GetName() != pPrinter->GetName() )
1074 {
1076 if ( mpDisplayDev )
1077 {
1079 }
1080 else
1081 {
1083
1084 mpFontInstance.clear();
1085 mpFontFaceCollection.reset();
1086 mxFontCache.reset();
1087 mxFontCollection.reset();
1088 mbInitFont = true;
1089 mbNewFont = true;
1090 mpInfoPrinter = nullptr;
1091 }
1092
1093 // Construct new printer
1094 OUString aDriver = pPrinter->GetDriverName();
1095 SalPrinterQueueInfo* pInfo = ImplGetQueueInfo( pPrinter->GetName(), &aDriver );
1096 if ( pInfo )
1097 {
1098 ImplInit( pInfo );
1099 SetJobSetup( pPrinter->GetJobSetup() );
1100 }
1101 else
1103 }
1104 else
1105 SetJobSetup( pPrinter->GetJobSetup() );
1106
1107 return false;
1108}
1109
1111{
1112 if ( mbInPrintPage )
1113 return false;
1114
1115 if ( maJobSetup.ImplGetConstData().GetOrientation() != eOrientation )
1116 {
1117 JobSetup aJobSetup = maJobSetup;
1118 ImplJobSetup& rData = aJobSetup.ImplGetData();
1119
1120 rData.SetOrientation(eOrientation);
1121
1122 if ( IsDisplayPrinter() )
1123 {
1124 mbNewJobSetup = true;
1125 maJobSetup = aJobSetup;
1126 return true;
1127 }
1128
1131 {
1132 ImplUpdateJobSetupPaper( aJobSetup );
1133 mbNewJobSetup = true;
1134 maJobSetup = aJobSetup;
1137 return true;
1138 }
1139 else
1140 return false;
1141 }
1142
1143 return true;
1144}
1145
1147{
1149}
1150
1151bool Printer::SetPaperBin( sal_uInt16 nPaperBin )
1152{
1153 if ( mbInPrintPage )
1154 return false;
1155
1156 if ( maJobSetup.ImplGetConstData().GetPaperBin() != nPaperBin &&
1157 nPaperBin < GetPaperBinCount() )
1158 {
1159 JobSetup aJobSetup = maJobSetup;
1160 ImplJobSetup& rData = aJobSetup.ImplGetData();
1161 rData.SetPaperBin(nPaperBin);
1162
1163 if ( IsDisplayPrinter() )
1164 {
1165 mbNewJobSetup = true;
1166 maJobSetup = aJobSetup;
1167 return true;
1168 }
1169
1172 {
1173 ImplUpdateJobSetupPaper( aJobSetup );
1174 mbNewJobSetup = true;
1175 maJobSetup = aJobSetup;
1178 return true;
1179 }
1180 else
1181 return false;
1182 }
1183
1184 return true;
1185}
1186
1187sal_uInt16 Printer::GetPaperBin() const
1188{
1190}
1191
1193{
1195}
1196
1197// dear loplugins, DO NOT REMOVE this code
1198// it will be used in follow-up commits
1199void Printer::SetPrinterSettingsPreferred( bool bPaperSizeFromSetup)
1200{
1201 if ( maJobSetup.ImplGetConstData().GetPapersizeFromSetup() != bPaperSizeFromSetup )
1202 {
1203 JobSetup aJobSetup = maJobSetup;
1204 ImplJobSetup& rData = aJobSetup.ImplGetData();
1205 rData.SetPapersizeFromSetup(bPaperSizeFromSetup);
1206
1207 mbNewJobSetup = true;
1208 maJobSetup = aJobSetup;
1209 }
1210}
1211
1212// Map user paper format to an available printer paper format
1214{
1215 ImplJobSetup& rData = aJobSetup.ImplGetData();
1216
1217 // The angle that a landscape page will be turned counterclockwise wrt to portrait.
1218 int nLandscapeAngle = mpInfoPrinter ? mpInfoPrinter->GetLandscapeAngle( &maJobSetup.ImplGetConstData() ) : 900;
1219 int nPaperCount = GetPaperInfoCount();
1220 PaperInfo aInfo(rData.GetPaperWidth(), rData.GetPaperHeight());
1221
1222 // Compare all paper formats and get the appropriate one
1223 for ( int i = 0; i < nPaperCount; i++ )
1224 {
1225 const PaperInfo& rPaperInfo = GetPaperInfo( i );
1226
1227 if ( aInfo.sloppyEqual(rPaperInfo) )
1228 {
1229 rData.SetPaperFormat(
1230 ImplGetPaperFormat( rPaperInfo.getWidth(),
1231 rPaperInfo.getHeight() ));
1233 return;
1234 }
1235 }
1236
1237 // If the printer supports landscape orientation, check paper sizes again
1238 // with landscape orientation. This is necessary as a printer driver provides
1239 // all paper sizes with portrait orientation only!!
1240 if ( !(rData.GetPaperFormat() == PAPER_USER &&
1241 nLandscapeAngle != 0 &&
1243 return;
1244
1245 const tools::Long nRotatedWidth = rData.GetPaperHeight();
1246 const tools::Long nRotatedHeight = rData.GetPaperWidth();
1247 PaperInfo aRotatedInfo(nRotatedWidth, nRotatedHeight);
1248
1249 for ( int i = 0; i < nPaperCount; i++ )
1250 {
1251 const PaperInfo& rPaperInfo = GetPaperInfo( i );
1252
1253 if ( aRotatedInfo.sloppyEqual( rPaperInfo ) )
1254 {
1255 rData.SetPaperFormat(
1256 ImplGetPaperFormat( rPaperInfo.getWidth(),
1257 rPaperInfo.getHeight() ));
1259 return;
1260 }
1261 }
1262}
1263
1265{
1266 if ( mbInPrintPage )
1267 return;
1268
1269 if ( maJobSetup.ImplGetConstData().GetPaperFormat() == ePaper )
1270 return;
1271
1272 JobSetup aJobSetup = maJobSetup;
1273 ImplJobSetup& rData = aJobSetup.ImplGetData();
1274
1275 rData.SetPaperFormat( ePaper );
1276 if ( ePaper != PAPER_USER )
1277 {
1278 PaperInfo aInfo(ePaper);
1279 rData.SetPaperWidth( aInfo.getWidth() );
1280 rData.SetPaperHeight( aInfo.getHeight() );
1281 }
1282
1283 if ( IsDisplayPrinter() )
1284 {
1285 mbNewJobSetup = true;
1286 maJobSetup = aJobSetup;
1287 return;
1288 }
1289
1291 if ( ePaper == PAPER_USER )
1292 ImplFindPaperFormatForUserSize( aJobSetup );
1294 {
1295 ImplUpdateJobSetupPaper( aJobSetup );
1296 mbNewJobSetup = true;
1297 maJobSetup = aJobSetup;
1300 }
1301}
1302
1304{
1305 if ( mbInPrintPage )
1306 return false;
1307
1308 const Size aPixSize = LogicToPixel( rSize );
1309 const Size aPageSize = PixelToLogic(aPixSize, MapMode(MapUnit::Map100thMM));
1310 bool bNeedToChange(maJobSetup.ImplGetConstData().GetPaperWidth() != aPageSize.Width() ||
1312
1313 if(!bNeedToChange)
1314 {
1315 // #i122984# only need to change when Paper is different from PAPER_USER and
1316 // the mapped Paper which will created below in the call to ImplFindPaperFormatForUserSize
1317 // and will replace maJobSetup.ImplGetConstData()->GetPaperFormat(). This leads to
1318 // unnecessary JobSetups, e.g. when printing a multi-page fax, but also with
1319 // normal print
1320 const Paper aPaper = ImplGetPaperFormat(aPageSize.Width(), aPageSize.Height());
1321
1322 bNeedToChange = maJobSetup.ImplGetConstData().GetPaperFormat() != PAPER_USER &&
1324 }
1325
1326 if(bNeedToChange)
1327 {
1328 JobSetup aJobSetup = maJobSetup;
1329 ImplJobSetup& rData = aJobSetup.ImplGetData();
1330 rData.SetPaperFormat( PAPER_USER );
1331 rData.SetPaperWidth( aPageSize.Width() );
1332 rData.SetPaperHeight( aPageSize.Height() );
1334
1335 if ( IsDisplayPrinter() )
1336 {
1337 mbNewJobSetup = true;
1338 maJobSetup = aJobSetup;
1339 return true;
1340 }
1341
1343 ImplFindPaperFormatForUserSize( aJobSetup );
1344
1345 // Changing the paper size can also change the orientation!
1347 {
1348 ImplUpdateJobSetupPaper( aJobSetup );
1349 mbNewJobSetup = true;
1350 maJobSetup = aJobSetup;
1353 return true;
1354 }
1355 else
1356 return false;
1357 }
1358
1359 return true;
1360}
1361
1363{
1364 if( ! mpInfoPrinter )
1365 return 0;
1368 return mpInfoPrinter->m_aPaperFormats.size();
1369}
1370
1372{
1373 ImplSVData* pSVData = ImplGetSVData();
1374 if( pSVData->maPaperNames.empty() )
1375 {
1376 // This array must (probably) match exactly the enum Paper in <i18nutil/paper.hxx>
1377 static const int PaperIndex[] =
1378 {
1392 };
1393 static_assert(SAL_N_ELEMENTS(PaperIndex) == SAL_N_ELEMENTS(RID_STR_PAPERNAMES), "localized paper name count wrong");
1394 for (size_t i = 0; i < SAL_N_ELEMENTS(PaperIndex); ++i)
1395 pSVData->maPaperNames[PaperIndex[i]] = VclResId(RID_STR_PAPERNAMES[i]);
1396 }
1397
1398 std::unordered_map<int,OUString>::const_iterator it = pSVData->maPaperNames.find( static_cast<int>(ePaper) );
1399 return (it != pSVData->maPaperNames.end()) ? it->second : OUString();
1400}
1401
1402const PaperInfo& Printer::GetPaperInfo( int nPaper ) const
1403{
1404 if( ! mpInfoPrinter )
1405 return ImplGetEmptyPaper();
1408 if( mpInfoPrinter->m_aPaperFormats.empty() || nPaper < 0 || o3tl::make_unsigned(nPaper) >= mpInfoPrinter->m_aPaperFormats.size() )
1409 return ImplGetEmptyPaper();
1410 return mpInfoPrinter->m_aPaperFormats[nPaper];
1411}
1412
1413Size Printer::GetPaperSize( int nPaper ) const
1414{
1415 PaperInfo aInfo = GetPaperInfo( nPaper );
1416 return PixelToLogic( Size( aInfo.getWidth(), aInfo.getHeight() ) );
1417}
1418
1420{
1421 if ( mbInPrintPage )
1422 return;
1423
1424 if ( maJobSetup.ImplGetConstData().GetDuplexMode() == eDuplex )
1425 return;
1426
1427 JobSetup aJobSetup = maJobSetup;
1428 ImplJobSetup& rData = aJobSetup.ImplGetData();
1429
1430 rData.SetDuplexMode( eDuplex );
1431
1432 if ( IsDisplayPrinter() )
1433 {
1434 mbNewJobSetup = true;
1435 maJobSetup = aJobSetup;
1436 return;
1437 }
1438
1441 {
1442 ImplUpdateJobSetupPaper( aJobSetup );
1443 mbNewJobSetup = true;
1444 maJobSetup = aJobSetup;
1447 }
1448}
1449
1451{
1453}
1454
1456{
1458}
1459
1461{
1463}
1464
1466{
1467 if ( IsDisplayPrinter() )
1468 return 0;
1469
1471}
1472
1473OUString Printer::GetPaperBinName( sal_uInt16 nPaperBin ) const
1474{
1475 if ( IsDisplayPrinter() )
1476 return OUString();
1477
1478 if ( nPaperBin < GetPaperBinCount() )
1480 else
1481 return OUString();
1482}
1483
1484void Printer::SetCopyCount( sal_uInt16 nCopy, bool bCollate )
1485{
1486 mnCopyCount = nCopy;
1487 mbCollateCopy = bCollate;
1488}
1489
1491{
1492 ErrCode nVCLError;
1493 switch ( nError )
1494 {
1496 nVCLError = ERRCODE_NONE;
1497 break;
1499 nVCLError = PRINTER_ABORT;
1500 break;
1501 default:
1502 nVCLError = PRINTER_GENERALERROR;
1503 break;
1504 }
1505
1506 return nVCLError;
1507}
1508
1510{
1511 if ( !IsJobActive() )
1512 return;
1513
1514 SAL_WARN_IF( mbInPrintPage, "vcl.gdi", "Printer::EndJob() - StartPage() without EndPage() called" );
1515
1516 mbJobActive = false;
1517
1518 if ( mpPrinter )
1519 {
1521
1522 mbPrinting = false;
1523
1524 mbDevOutput = false;
1525 mpPrinter->EndJob();
1526 mpPrinter.reset();
1527 }
1528}
1529
1531{
1532 if ( !IsJobActive() )
1533 return;
1534
1535 if ( !mpPrinter )
1536 return;
1537
1538 SalGraphics* pGraphics = mpPrinter->StartPage( &maJobSetup.ImplGetData(),
1539 mbNewJobSetup );
1540 if ( pGraphics )
1541 {
1543 mpJobGraphics = pGraphics;
1544 }
1545 mbDevOutput = true;
1546
1547 // PrintJob not aborted ???
1548 if ( IsJobActive() )
1549 mbInPrintPage = true;
1550}
1551
1553{
1554 if ( !IsJobActive() )
1555 return;
1556
1557 mbInPrintPage = false;
1558
1559 if ( mpPrinter )
1560 {
1562 mpPrinter->EndPage();
1563 mbDevOutput = false;
1564
1565 mpJobGraphics = nullptr;
1566 mbNewJobSetup = false;
1567 }
1568}
1569
1571{
1572 ImplSVData* pSVData = ImplGetSVData();
1573 ImplPrnQueueList* pPrnList = pSVData->maGDIData.mpPrinterQueueList.get();
1574
1575 if ( !pPrnList )
1576 return;
1577
1578 std::unique_ptr<ImplPrnQueueList> pNewList(new ImplPrnQueueList);
1579 pSVData->mpDefInst->GetPrinterQueueInfo( pNewList.get() );
1580
1581 bool bChanged = pPrnList->m_aQueueInfos.size() != pNewList->m_aQueueInfos.size();
1582 for( decltype(pPrnList->m_aQueueInfos)::size_type i = 0; ! bChanged && i < pPrnList->m_aQueueInfos.size(); i++ )
1583 {
1584 ImplPrnQueueData& rInfo = pPrnList->m_aQueueInfos[i];
1585 ImplPrnQueueData& rNewInfo = pNewList->m_aQueueInfos[i];
1586 if( ! rInfo.mpSalQueueInfo || ! rNewInfo.mpSalQueueInfo || // sanity check
1587 rInfo.mpSalQueueInfo->maPrinterName != rNewInfo.mpSalQueueInfo->maPrinterName )
1588 {
1589 bChanged = true;
1590 }
1591 }
1592 if( !bChanged )
1593 return;
1594
1596 pSVData->maGDIData.mpPrinterQueueList = std::move(pNewList);
1597
1598 Application* pApp = GetpApp();
1599 if( pApp )
1600 {
1604 }
1605}
1606
1608{
1609 return true;
1610}
1611
1612void Printer::ClipAndDrawGradientMetafile ( const Gradient &rGradient, const tools::PolyPolygon &rPolyPoly )
1613{
1614 const tools::Rectangle aBoundRect( rPolyPoly.GetBoundRect() );
1615
1617 IntersectClipRegion(vcl::Region(rPolyPoly));
1618 DrawGradient( aBoundRect, rGradient );
1619 Pop();
1620}
1621
1623{
1624 pFontEntry->mnOrientation = pFontEntry->mxFontMetric->GetOrientation();
1625}
1626
1628{
1629 return aRegion;
1630}
1631
1632Bitmap Printer::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
1633{
1634 SAL_WARN("vcl.gdi", "GetBitmap(): This should never be called on by a Printer instance");
1635
1636 return OutputDevice::GetBitmap( rSrcPt, rSize );
1637}
1638
1639css::awt::DeviceInfo Printer::GetDeviceInfo() const
1640{
1641 Size aDevSz = GetPaperSizePixel();
1642 css::awt::DeviceInfo aInfo = GetCommonDeviceInfo(aDevSz);
1643 Size aOutSz = GetOutputSizePixel();
1644 Point aOffset = GetPageOffset();
1645 aInfo.LeftInset = aOffset.X();
1646 aInfo.TopInset = aOffset.Y();
1647 aInfo.RightInset = aDevSz.Width() - aOutSz.Width() - aOffset.X();
1648 aInfo.BottomInset = aDevSz.Height() - aOutSz.Height() - aOffset.Y();
1649 aInfo.Capabilities = 0;
1650
1651 return aInfo;
1652}
1653
1655{
1657 {
1659 mbInitLineColor = true;
1660 }
1661
1662 mpGraphics->SetFillColor(rColor);
1663 mbInitFillColor = true;
1664}
1665
1667{
1668 // FIXME - do we have a bug here? If the linewidth is 0, then we will return
1669 // Size(0, 0) - is this correct?
1670 return Size(nLineWidth, ((nLineWidth*mnDPIX)+(mnDPIY/2))/mnDPIY);
1671}
1672
1674{
1676}
1677
1678/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
sal_Int32 nLineWidth
PrinterSupport
SystemTextColorFlags
void Erase(sal_uInt8 cTransparency)
Definition: alpha.cxx:82
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:237
static void ImplCallEventListenersApplicationDataChanged(void *pData)
Send event to all VCL application event listeners.
Definition: svapp.cxx:684
static void NotifyAllWindows(DataChangedEvent &rDCEvt)
Notify all windows that the application has changed data.
Definition: svapp.cxx:665
const AlphaMask & GetAlphaMask() const
Definition: bitmapex.hxx:71
bool IsAlpha() const
Definition: BitmapEx.cxx:207
Bitmap GetBitmap(Color aTransparentReplaceColor) const
Definition: BitmapEx.cxx:217
bool Blend(const AlphaMask &rAlpha, const Color &rBackgroundColor)
Alpha-blend the given bitmap against a specified uniform background color.
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
bool Convert(BmpConversion eConversion)
Convert bitmap format.
Size GetSizePixel() const
bool IsEmpty() const
vcl::Region CreateRegion(const Color &rColor, const tools::Rectangle &rRect) const
Create region of similar colors in a given rectangle.
vcl::PixelFormat getPixelFormat() const
bool Mirror(BmpMirrorFlags nMirrorFlags)
Mirror the bitmap.
void SetDuplexMode(DuplexMode eDuplexMode)
Definition: jobset.cxx:122
void SetPaperHeight(tools::Long nHeight)
Definition: jobset.cxx:142
bool GetPapersizeFromSetup() const
Definition: jobset.h:94
void SetDriverData(sal_uInt8 *pDriverData)
Definition: jobset.cxx:152
tools::Long GetPaperWidth() const
Definition: jobset.h:82
const sal_uInt8 * GetDriverData() const
Definition: jobset.h:91
void SetPrinterSetupMode(PrinterSetupMode eMode)
Definition: jobset.cxx:162
void SetPaperWidth(tools::Long nWidth)
Definition: jobset.cxx:137
void SetPapersizeFromSetup(bool bPapersizeFromSetup)
Definition: jobset.cxx:157
Orientation GetOrientation() const
Definition: jobset.h:70
void SetPaperBin(sal_uInt16 nPaperBin)
Definition: jobset.cxx:127
tools::Long GetPaperHeight() const
Definition: jobset.h:85
void SetPrinterName(const OUString &rPrinterName)
Definition: jobset.cxx:107
void SetOrientation(Orientation eOrientation)
Definition: jobset.cxx:117
sal_uInt16 GetPaperBin() const
Definition: jobset.h:76
DuplexMode GetDuplexMode() const
Definition: jobset.h:73
void SetPaperFormat(Paper ePaperFormat)
Definition: jobset.cxx:132
const OUString & GetDriver() const
Definition: jobset.h:67
void SetDriver(const OUString &rDriver)
Definition: jobset.cxx:112
const OUString & GetPrinterName() const
Definition: jobset.h:64
void SetDriverDataLen(sal_uInt32 nDriverDataLen)
Definition: jobset.cxx:147
Paper GetPaperFormat() const
Definition: jobset.h:79
ImplPrnQueueData * Get(const OUString &rPrinter)
Definition: print.cxx:360
std::vector< ImplPrnQueueData > m_aQueueInfos
Definition: print.h:55
std::unordered_map< OUString, sal_Int32 > m_aNameToIndex
Definition: print.h:54
std::vector< OUString > m_aPrinterList
Definition: print.h:56
void Add(std::unique_ptr< SalPrinterQueueInfo > pData)
Definition: print.cxx:340
SAL_DLLPRIVATE const ImplJobSetup & ImplGetConstData() const
Definition: jobset.cxx:215
SAL_DLLPRIVATE ImplJobSetup & ImplGetData()
Definition: jobset.cxx:220
FontMetricDataRef mxFontMetric
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
void EnableMapMode(bool bEnable=true)
Definition: map.cxx:589
sal_Int32 mnDPIY
Definition: outdev.hxx:213
virtual void ReleaseGraphics(bool bRelease=true)=0
Release the graphics device, and remove it from the graphics device list.
css::awt::DeviceInfo GetCommonDeviceInfo(Size const &aDevSize) const
Definition: outdev.cxx:716
SAL_DLLPRIVATE void InitLineColor()
Definition: line.cxx:85
bool mbDevOutput
Definition: outdev.hxx:244
std::shared_ptr< ImplFontCache > mxFontCache
Definition: outdev.hxx:262
virtual void dispose() override
Definition: outdev.cxx:144
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1110
Size GetOutputSizePixel() const
Definition: outdev.hxx:314
std::shared_ptr< vcl::font::PhysicalFontCollection > mxFontCollection
Definition: outdev.hxx:261
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:50
GDIMetaFile * mpMetaFile
Definition: outdev.hxx:185
SAL_DLLPRIVATE void InitFillColor()
Definition: fill.cxx:76
bool mbMap
Definition: outdev.hxx:240
void SetLineColor()
Definition: line.cxx:37
bool mbNewFont
Definition: outdev.hxx:254
bool mbInitLineColor
Definition: outdev.hxx:248
tools::Long mnOutWidth
Definition: outdev.hxx:210
SalGraphics * mpGraphics
Graphics context to draw on.
Definition: outdev.hxx:182
bool mbInitFont
Definition: outdev.hxx:250
VclPtr< OutputDevice > mpNextGraphics
Next output device in list.
Definition: outdev.hxx:184
bool mbInitTextColor
Definition: outdev.hxx:251
void SetTextColor(const Color &rColor)
Definition: text.cxx:716
void DrawBitmap(const Point &rDestPt, const Bitmap &rBitmap)
rtl::Reference< LogicalFontInstance > mpFontInstance
Definition: outdev.hxx:186
bool mbInitClipRegion
Definition: outdev.hxx:252
RasterOp meRasterOp
Definition: outdev.hxx:232
void SetFillColor()
Definition: fill.cxx:29
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:879
AntialiasingFlags mnAntialiasing
Definition: outdev.hxx:237
virtual Bitmap GetBitmap(const Point &rSrcPt, const Size &rSize) const
VclPtr< VirtualDevice > mpAlphaVDev
Definition: outdev.hxx:196
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
Definition: stack.cxx:32
void DrawGradient(const tools::Rectangle &rRect, const Gradient &rGradient)
void Pop()
Definition: stack.cxx:91
std::unique_ptr< vcl::font::PhysicalFontFaceCollection > mpFontFaceCollection
Definition: outdev.hxx:187
bool mbLineColor
Definition: outdev.hxx:246
void IntersectClipRegion(const tools::Rectangle &rRect)
sal_Int32 mnDPIX
Definition: outdev.hxx:212
bool mbInitFillColor
Definition: outdev.hxx:249
VclPtr< OutputDevice > mpPrevGraphics
Previous output device in list.
Definition: outdev.hxx:183
tools::Long mnOutHeight
Definition: outdev.hxx:211
SAL_DLLPRIVATE void ImplUpdateFontData()
const Color & GetFillColor() const
Definition: outdev.hxx:515
bool sloppyEqual(const PaperInfo &rOther) const
tools::Long getWidth() const
Paper getPaper() const
void doSloppyFit(bool bAlsoTryRotated=false)
tools::Long getHeight() const
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
VCL_DLLPRIVATE void ImplFindPaperFormatForUserSize(JobSetup &)
Definition: print.cxx:1213
virtual void DrawOutDev(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPt, const Size &rSrcSize) override
Definition: print.cxx:288
Size maPaperSize
Definition: print.hxx:82
static OUString GetDefaultPrinterName()
Definition: print.cxx:426
css::awt::DeviceInfo GetDeviceInfo() const override
Definition: print.cxx:1639
bool mbCollateCopy
Definition: print.hxx:89
OUString maPrintFile
Definition: print.hxx:79
virtual ~Printer() override
Definition: print.cxx:888
VCL_DLLPRIVATE void ImplInitData()
Definition: print.cxx:438
static VCL_DLLPRIVATE ErrCode ImplSalPrinterErrorCodeToVCL(SalPrinterError nError)
Definition: print.cxx:1490
std::unique_ptr< vcl::printer::Options > mpPrinterOptions
Definition: print.hxx:76
bool HasSupport(PrinterSupport eFeature) const
Definition: print.cxx:954
virtual void CopyArea(const Point &rDestPt, const Point &rSrcPt, const Size &rSrcSize, bool bWindowInvalidate=false) override
Definition: print.cxx:301
Printer()
Definition: print.cxx:829
bool SetOrientation(Orientation eOrient)
Definition: print.cxx:1110
sal_uInt16 mnCopyCount
Definition: print.hxx:85
bool mbJobActive
Definition: print.hxx:88
Size GetWaveLineSize(tools::Long nLineWidth) const override
Definition: print.cxx:1666
bool GetPrinterSettingsPreferred() const
Definition: print.cxx:1192
bool Setup(weld::Window *pWindow, PrinterSetupMode eMode=PrinterSetupMode::DocumentGlobal)
Definition: print.cxx:994
VclPtr< Printer > mpPrev
Definition: print.hxx:73
virtual void DrawDeviceMask(const Bitmap &rMask, const Color &rMaskColor, const Point &rDestPt, const Size &rDestSize, const Point &rSrcPtPixel, const Size &rSrcSizePixel) override
Definition: print.cxx:673
bool mbNewJobSetup
Definition: print.hxx:92
VCL_DLLPRIVATE void ImplUpdateFontList()
Definition: print.cxx:816
static VCL_DLLPRIVATE SalPrinterQueueInfo * ImplGetQueueInfo(const OUString &rPrinterName, const OUString *pDriver)
Definition: print.cxx:759
SalInfoPrinter * mpInfoPrinter
Definition: print.hxx:70
virtual void ImplReleaseFonts() override
Definition: print.cxx:538
VCL_DLLPRIVATE void ImplEndPage()
Definition: print.cxx:1552
bool SetPrinterProps(const Printer *pPrinter)
Definition: print.cxx:1034
DuplexMode GetDuplexMode() const
Definition: print.cxx:1450
virtual bool AcquireGraphics() const override
Acquire a graphics device that the output device uses to draw on.
Definition: print.cxx:466
virtual bool HasMirroredGraphics() const override
Definition: print.cxx:320
bool IsJobActive() const
Definition: print.hxx:263
const Point & GetPageOffsetPixel() const
Definition: print.hxx:252
VCL_DLLPRIVATE void ImplInit(SalPrinterQueueInfo *pInfo)
Definition: print.cxx:606
VCL_DLLPRIVATE void ImplUpdatePageData()
Definition: print.cxx:803
OUString maDriver
Definition: print.hxx:78
bool mbSinglePrintJobs
Definition: print.hxx:93
sal_uInt32 GetCapabilities(PrinterCapType nType) const
Definition: print.cxx:943
bool SetJobSetup(const JobSetup &rSetup)
Definition: print.cxx:973
VCL_DLLPRIVATE void EndJob()
Definition: print.cxx:1509
bool mbDefPrinter
Definition: print.hxx:86
bool SetPaperBin(sal_uInt16 nPaperBin)
Definition: print.cxx:1151
SAL_DLLPRIVATE void ImplPrintTransparent(const Bitmap &rBmp, const Point &rDestPt, const Size &rDestSize, const Point &rSrcPtPixel, const Size &rSrcSizePixel)
Definition: print.cxx:97
void SetCopyCount(sal_uInt16 nCopy, bool bCollate)
Definition: print.cxx:1484
const OUString & GetDriverName() const
Definition: print.hxx:195
Point GetPageOffset() const
Definition: print.hxx:253
VCL_DLLPRIVATE void SetPrinterOptions(const vcl::printer::Options &rOptions)
SetPrinterOptions is used internally only now.
Definition: print.cxx:315
void SetPaper(Paper ePaper)
Definition: print.cxx:1264
virtual void ClipAndDrawGradientMetafile(const Gradient &rGradient, const tools::PolyPolygon &rPolyPoly) override
Definition: print.cxx:1612
void SetDuplexMode(DuplexMode)
Definition: print.cxx:1419
vcl::Region ClipToDeviceBounds(vcl::Region aRegion) const override
Perform actual rect clip against outdev dimensions, to generate empty clips whenever one of the value...
Definition: print.cxx:1627
sal_uInt16 GetPaperBinCount() const
Definition: print.cxx:1465
Size GetPaperSize() const
Definition: print.hxx:250
static void updatePrinters()
Checks the printer list and updates it necessary.
Definition: print.cxx:1570
bool mbPrintFile
Definition: print.hxx:90
OUString maPrinterName
Definition: print.hxx:77
int GetPaperInfoCount() const
Definition: print.cxx:1362
static const std::vector< OUString > & GetPrinterQueues()
Definition: print.cxx:387
static OUString GetPaperName(Paper ePaper)
Definition: print.cxx:1371
std::unique_ptr< SalPrinter > mpPrinter
Definition: print.hxx:71
bool mbPrinting
Definition: print.hxx:87
bool SetPaperSizeUser(const Size &rSize)
Definition: print.cxx:1303
sal_uInt16 mnPageQueueSize
Definition: print.hxx:84
static const QueueInfo * GetQueueInfo(const OUString &rPrinterName, bool bStatusUpdate)
Definition: print.cxx:396
bool IsPrinting() const
Definition: print.hxx:261
virtual Bitmap GetBitmap(const Point &rSrcPt, const Size &rSize) const override
Definition: print.cxx:1632
VclPtr< Printer > mpNext
Definition: print.hxx:74
Size GetSizeOfPaper() const
Definition: print.cxx:1460
virtual void ReleaseGraphics(bool bRelease=true) override
Release the graphics device, and remove it from the graphics device list.
Definition: print.cxx:601
bool TransformAndReduceBitmapExToTargetRange(const basegfx::B2DHomMatrix &aFullTransform, basegfx::B2DRange &aVisibleRange, double &fMaximumArea) override
Transform and reduce the area that needs to be drawn of the bitmap and return the new visible range a...
Definition: print.cxx:181
const OUString & GetName() const
Definition: print.hxx:194
virtual Size GetButtonBorderSize() override
Definition: print.cxx:930
Point maPageOffset
Definition: print.hxx:81
const PaperInfo & GetPaperInfo(int nPaper) const
Definition: print.cxx:1402
const Size & GetPaperSizePixel() const
Definition: print.hxx:249
sal_uInt16 GetPaperBin() const
Definition: print.cxx:1187
const JobSetup & GetJobSetup() const
Definition: print.hxx:204
void ImplReleaseGraphics(bool bRelease=true)
Definition: print.cxx:548
VclPtr< VirtualDevice > mpDisplayDev
Definition: print.hxx:75
void SetSystemTextColor(SystemTextColorFlags, bool) override
Definition: print.cxx:1673
Orientation GetOrientation() const
Definition: print.cxx:1146
virtual void EmulateDrawTransparent(const tools::PolyPolygon &rPolyPoly, sal_uInt16 nTransparencePercent) override
Definition: print.cxx:211
virtual void dispose() override
Definition: print.cxx:893
virtual bool UsePolyPolygonForComplexGradient() override
Definition: print.cxx:1607
virtual tools::Rectangle GetBackgroundComponentBounds() const override
Definition: print.cxx:308
bool DrawTransformBitmapExDirect(const basegfx::B2DHomMatrix &aFullTransform, const BitmapEx &rBitmapEx, double fAlpha=1.0) override
Transform and draw a bitmap directly.
Definition: print.cxx:172
SalGraphics * mpJobGraphics
Definition: print.hxx:72
bool IsDisplayPrinter() const
Definition: print.hxx:197
virtual void SetFontOrientation(LogicalFontInstance *const pFontInstance) const override
Definition: print.cxx:1622
ErrCode mnError
Definition: print.hxx:83
VCL_DLLPRIVATE void ImplInitDisplay()
Definition: print.cxx:658
JobSetup maJobSetup
Definition: print.hxx:80
bool mbInPrintPage
Definition: print.hxx:91
void SetPrinterSettingsPreferred(bool bPaperSizeFromSetup)
Definition: print.cxx:1199
VCL_DLLPRIVATE void ImplStartPage()
Definition: print.cxx:1530
Paper GetPaper() const
Definition: print.cxx:1455
virtual tools::Long GetGradientStepCount(tools::Long nMinRect) override
Definition: print.cxx:821
void DrawDeviceBitmapEx(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPtPixel, const Size &rSrcSizePixel, BitmapEx &rBitmapEx) override
Definition: print.cxx:191
OUString GetPaperBinName(sal_uInt16 nPaperBin) const
Definition: print.cxx:1473
void SetWaveLineColors(Color const &rColor, tools::Long) override
Definition: print.cxx:1654
const OUString & GetDriver() const
Definition: QueueInfo.cxx:29
const OUString & GetPrinterName() const
Definition: QueueInfo.cxx:28
virtual void SetXORMode(bool bSet, bool bInvertOnly)=0
virtual void GetResolution(sal_Int32 &rDPIX, sal_Int32 &rDPIY)=0
void setAntiAlias(bool bNew)
Definition: salgdi.hxx:83
virtual void SetLineColor()=0
virtual void SetFillColor()=0
virtual void GetDevFontList(vcl::font::PhysicalFontCollection *)=0
void ReleaseFonts()
Definition: salgdi.hxx:141
virtual void GetPageInfo(const ImplJobSetup *pSetupData, tools::Long &rOutWidth, tools::Long &rOutHeight, Point &rPageOffset, Size &rPaperSize)=0
virtual OUString GetPaperBinName(const ImplJobSetup *pSetupData, sal_uInt16 nPaperBin)=0
virtual sal_uInt16 GetPaperBinCount(const ImplJobSetup *pSetupData)=0
bool m_bPapersInit
Definition: salprn.hxx:55
virtual void InitPaperFormats(const ImplJobSetup *pSetupData)=0
virtual bool SetData(JobSetFlags nFlags, ImplJobSetup *pSetupData)=0
std::vector< PaperInfo > m_aPaperFormats
Definition: salprn.hxx:54
virtual bool Setup(weld::Window *pFrame, ImplJobSetup *pSetupData)=0
virtual int GetLandscapeAngle(const ImplJobSetup *pSetupData)=0
virtual bool SetPrinterData(ImplJobSetup *pSetupData)=0
virtual void ReleaseGraphics(SalGraphics *pGraphics)=0
virtual sal_uInt32 GetCapabilities(const ImplJobSetup *pSetupData, PrinterCapType nType)=0
virtual SalGraphics * AcquireGraphics()=0
virtual void GetPrinterQueueInfo(ImplPrnQueueList *pList)=0
virtual OUString GetDefaultPrinter()=0
virtual void DestroyInfoPrinter(SalInfoPrinter *pPrinter)=0
virtual SalInfoPrinter * CreateInfoPrinter(SalPrinterQueueInfo *pQueueInfo, ImplJobSetup *pSetupData)=0
virtual void GetPrinterQueueState(SalPrinterQueueInfo *pInfo)=0
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void disposeAndClear()
Definition: vclptr.hxx:200
void clear()
Definition: vclptr.hxx:190
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
Definition: vclptr.hxx:127
std::unique_ptr< SalVirtualDevice > mpVirDev
Definition: virdev.hxx:48
tools::Rectangle GetBoundRect() const
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr Size GetSize() const
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
constexpr tools::Long Right() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
void GetRegionRectangles(RectangleVector &rTarget) const
Definition: region.cxx:1674
weld::Window * GetFrameWeld() const
Definition: window2.cxx:884
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define DBG_TESTSOLARMUTEX()
#define PRINTER_GENERALERROR
#define PRINTER_ABORT
#define ERRCODE_NONE
tools::Long FRound(double fVal)
BmpMirrorFlags
Mode eMode
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_N_ELEMENTS(arr)
std::unique_ptr< sal_Int32[]> pData
def rectangle(l)
int i
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
long Long
@ OUTDEV_PRINTER
Definition: outdev.hxx:145
Paper
PAPER_QUARTO
PAPER_A9
PAPER_ENV_C3
PAPER_ENV_9
PAPER_ENV_MONARCH
PAPER_B9_ISO
PAPER_ENV_C7
PAPER_POSTCARD_JP
PAPER_ARCHD
PAPER_LETTER
PAPER_B0_ISO
PAPER_A0
PAPER_ENV_DL
PAPER_ENV_12
PAPER_ENV_11
PAPER_SLIDE_DIA
PAPER_ENV_C4
PAPER_ENV_10
PAPER_A5
PAPER_SCREEN_16_9
PAPER_B5_JIS
PAPER_A4
PAPER_B3_ISO
PAPER_ENV_PERSONAL
PAPER_LETTER_PLUS
PAPER_ENV_14
PAPER_ENV_C2
PAPER_A4_PLUS
PAPER_ONSCREENSHOW_16_9
PAPER_B2_ISO
PAPER_16K_197x273
PAPER_10x11
PAPER_B_PLUS
PAPER_USER
PAPER_SCREEN_4_3
PAPER_KAI32
PAPER_B1_ISO
PAPER_B6_ISO
PAPER_ARCHB
PAPER_B5_ISO
PAPER_DOUBLEPOSTCARD_JP
PAPER_WIDESCREEN
PAPER_KAI32BIG
PAPER_FANFOLD_US
PAPER_ONSCREENSHOW_16_10
PAPER_A10
PAPER_STATEMENT
PAPER_A3
PAPER_16K_195x270
PAPER_SCREEN_16_10
PAPER_LEGAL
PAPER_ARCHC
PAPER_10x14
PAPER_B6_JIS
PAPER_9x11
PAPER_FANFOLD_DE
PAPER_E
PAPER_A_PLUS
PAPER_EXECUTIVE
PAPER_B10_ISO
PAPER_A6
PAPER_A1
PAPER_D
PAPER_ENV_C8
PAPER_A8
PAPER_B8_ISO
PAPER_KAI16
PAPER_15x11
PAPER_B7_ISO
PAPER_TABLOID
PAPER_ENV_ITALY
PAPER_B4_ISO
PAPER_ENV_C65
PAPER_ARCHE
PAPER_ENV_C6
PAPER_ENV_C5
PAPER_ONSCREENSHOW_4_3
PAPER_A2
PAPER_C
PAPER_B4_JIS
PAPER_A7
PAPER_12x11
PAPER_ENV_INVITE
PAPER_FANFOLD_LEGAL_DE
PAPER_ARCHA
PAPER_LEDGER
void ImplUpdateJobSetupPaper(JobSetup &rJobSetup)
Definition: print.cxx:74
void ImplDeletePrnQueueList()
Definition: print.cxx:381
int nImplSysDialog
Definition: print.cxx:56
static void ImplInitPrnQueueList()
Definition: print.cxx:370
DuplexMode
Definition: prntypes.hxx:28
PrinterSetupMode
Definition: prntypes.hxx:86
Orientation
Definition: prntypes.hxx:31
PrinterCapType
Definition: prntypes.hxx:72
constexpr sal_uInt32 QUEUE_JOBS_DONTKNOW
Definition: prntypes.hxx:68
QPRO_FUNC_TYPE nType
std::vector< tools::Rectangle > RectangleVector
Definition: region.hxx:34
SalPrinterError
Definition: salptype.hxx:41
std::unique_ptr< QueueInfo > mpQueueInfo
Definition: print.h:38
std::unique_ptr< SalPrinterQueueInfo > mpSalQueueInfo
Definition: print.h:39
sal_uInt16 mnModalMode
Definition: svdata.hxx:160
SalInstance * mpDefInst
Definition: svdata.hxx:389
ImplSVGDIData maGDIData
Definition: svdata.hxx:398
ImplSVAppData maAppData
Definition: svdata.hxx:397
std::unordered_map< int, OUString > maPaperNames
Definition: svdata.hxx:415
VclPtr< OutputDevice > mpLastVirGraphics
Definition: svdata.hxx:218
VclPtr< Printer > mpFirstPrnGraphics
Definition: svdata.hxx:219
std::unique_ptr< ImplPrnQueueList > mpPrinterQueueList
Definition: svdata.hxx:224
std::shared_ptr< vcl::font::PhysicalFontCollection > mxScreenFontList
Definition: svdata.hxx:225
VclPtr< Printer > mpFirstPrinter
Definition: svdata.hxx:223
std::shared_ptr< ImplFontCache > mxScreenFontCache
Definition: svdata.hxx:226
VclPtr< OutputDevice > mpFirstVirGraphics
Definition: svdata.hxx:217
VclPtr< Printer > mpLastPrnGraphics
Definition: svdata.hxx:220
OUString maPrinterName
Definition: salprn.hxx:39
OUString maDriver
Definition: salprn.hxx:40
PrintQueueFlags mnStatus
Definition: salprn.hxx:43
sal_uInt32 mnJobs
Definition: salprn.hxx:44
Application * GetpApp()
Definition: svapp.cxx:154
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:77
vcl::Window * ImplGetDefaultWindow()
Returns either the application window, or the default GL context window.
Definition: svdata.cxx:212
OUString VclResId(TranslateId aId)
Definition: svdata.cxx:261
unsigned char sal_uInt8