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
97void Printer::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask,
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 ), aMask( rMask );
112
115
116 // mirrored horizontally
117 if( aDestSz.Width() < 0 )
118 {
119 aDestSz.setWidth( -aDestSz.Width() );
120 aDestPt.AdjustX( -( aDestSz.Width() - 1 ) );
121 nMirrFlags |= BmpMirrorFlags::Horizontal;
122 }
123
124 // mirrored vertically
125 if( aDestSz.Height() < 0 )
126 {
127 aDestSz.setHeight( -aDestSz.Height() );
128 aDestPt.AdjustY( -( aDestSz.Height() - 1 ) );
129 nMirrFlags |= BmpMirrorFlags::Vertical;
130 }
131
132 // source cropped?
133 if( aSrcRect != tools::Rectangle( Point(), aPaint.GetSizePixel() ) )
134 {
135 aPaint.Crop( aSrcRect );
136 aMask.Crop( aSrcRect );
137 }
138
139 // destination mirrored
140 if( nMirrFlags != BmpMirrorFlags::NONE )
141 {
142 aPaint.Mirror( nMirrFlags );
143 aMask.Mirror( nMirrFlags );
144 }
145
146 // we always want to have a mask
147 if( aMask.IsEmpty() )
148 {
149 aMask = Bitmap(aSrcRect.GetSize(), vcl::PixelFormat::N1_BPP);
150 aMask.Erase( COL_BLACK );
151 }
152
153 // do painting
154 const tools::Long nSrcWidth = aSrcRect.GetWidth(), nSrcHeight = aSrcRect.GetHeight();
155 tools::Long nX, nY; // , nWorkX, nWorkY, nWorkWidth, nWorkHeight;
156 std::unique_ptr<tools::Long[]> pMapX(new tools::Long[ nSrcWidth + 1 ]);
157 std::unique_ptr<tools::Long[]> pMapY(new tools::Long[ nSrcHeight + 1 ]);
158 const bool bOldMap = mbMap;
159
160 mbMap = false;
161
162 // create forward mapping tables
163 for( nX = 0; nX <= nSrcWidth; nX++ )
164 pMapX[ nX ] = aDestPt.X() + FRound( static_cast<double>(aDestSz.Width()) * nX / nSrcWidth );
165
166 for( nY = 0; nY <= nSrcHeight; nY++ )
167 pMapY[ nY ] = aDestPt.Y() + FRound( static_cast<double>(aDestSz.Height()) * nY / nSrcHeight );
168
169 // walk through all rectangles of mask
170 const vcl::Region aWorkRgn(aMask.CreateRegion(COL_BLACK, tools::Rectangle(Point(), aMask.GetSizePixel())));
171 RectangleVector aRectangles;
172 aWorkRgn.GetRegionRectangles(aRectangles);
173
174 for (auto const& rectangle : aRectangles)
175 {
176 const Point aMapPt(pMapX[rectangle.Left()], pMapY[rectangle.Top()]);
177 const Size aMapSz( pMapX[rectangle.Right() + 1] - aMapPt.X(), // pMapX[L + W] -> L + ((R - L) + 1) -> R + 1
178 pMapY[rectangle.Bottom() + 1] - aMapPt.Y()); // same for Y
179 Bitmap aBandBmp(aPaint);
180
181 aBandBmp.Crop(rectangle);
182 DrawBitmap(aMapPt, aMapSz, Point(), aBandBmp.GetSizePixel(), aBandBmp);
183 }
184
185 mbMap = bOldMap;
186
187}
188
190 const basegfx::B2DHomMatrix& /*aFullTransform*/,
191 const BitmapEx& /*rBitmapEx*/,
192 double /*fAlpha*/)
193{
194 // printers can't draw bitmaps directly
195 return false;
196}
197
199 const basegfx::B2DHomMatrix& /*aFullTransform*/,
200 basegfx::B2DRange& /*aVisibleRange*/,
201 double& /*fMaximumArea*/)
202{
203 // deliberately do nothing - you can't reduce the
204 // target range for a printer at all
205 return true;
206}
207
208void Printer::DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSize,
209 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
210 BitmapEx& rBmpEx )
211{
212 if( rBmpEx.IsAlpha() )
213 {
214 // #107169# For true alpha bitmaps, no longer masking the
215 // bitmap, but perform a full alpha blend against a white
216 // background here.
217 Bitmap aBmp( rBmpEx.GetBitmap() );
218 aBmp.Blend( rBmpEx.GetAlpha(), COL_WHITE );
219 DrawBitmap( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, aBmp );
220 }
221 else
222 {
223 Bitmap aBmp( rBmpEx.GetBitmap() );
224 ImplPrintTransparent( aBmp, Bitmap(), rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel );
225 }
226}
227
229 sal_uInt16 nTransparencePercent )
230{
231 // #110958# Disable alpha VDev, we perform the necessary
232 VirtualDevice* pOldAlphaVDev = mpAlphaVDev;
233
234 // operation explicitly further below.
235 if( mpAlphaVDev )
236 mpAlphaVDev = nullptr;
237
238 GDIMetaFile* pOldMetaFile = mpMetaFile;
239 mpMetaFile = nullptr;
240
241 mpMetaFile = pOldMetaFile;
242
243 // #110958# Restore disabled alpha VDev
244 mpAlphaVDev = pOldAlphaVDev;
245
246 tools::Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() );
247 const Size aDPISize( LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch)) );
248 const tools::Long nBaseExtent = std::max<tools::Long>( FRound( aDPISize.Width() / 300. ), 1 );
249 tools::Long nMove;
250 const sal_uInt16 nTrans = ( nTransparencePercent < 13 ) ? 0 :
251 ( nTransparencePercent < 38 ) ? 25 :
252 ( nTransparencePercent < 63 ) ? 50 :
253 ( nTransparencePercent < 88 ) ? 75 : 100;
254
255 switch( nTrans )
256 {
257 case 25: nMove = nBaseExtent * 3; break;
258 case 50: nMove = nBaseExtent * 4; break;
259 case 75: nMove = nBaseExtent * 6; break;
260
261 // #i112959# very transparent (88 < nTransparencePercent <= 99)
262 case 100: nMove = nBaseExtent * 8; break;
263
264 // #i112959# not transparent (nTransparencePercent < 13)
265 default: nMove = 0; break;
266 }
267
271 const bool bOldMap = mbMap;
272 EnableMapMode( false );
273
274 if(nMove)
275 {
276 tools::Rectangle aRect( aPolyRect.TopLeft(), Size( aPolyRect.GetWidth(), nBaseExtent ) );
277 while( aRect.Top() <= aPolyRect.Bottom() )
278 {
279 DrawRect( aRect );
280 aRect.Move( 0, nMove );
281 }
282
283 aRect = tools::Rectangle( aPolyRect.TopLeft(), Size( nBaseExtent, aPolyRect.GetHeight() ) );
284 while( aRect.Left() <= aPolyRect.Right() )
285 {
286 DrawRect( aRect );
287 aRect.Move( nMove, 0 );
288 }
289 }
290 else
291 {
292 // #i112959# if not transparent, draw full rectangle in clip region
293 DrawRect( aPolyRect );
294 }
295
296 EnableMapMode( bOldMap );
297 Pop();
298
299 mpMetaFile = pOldMetaFile;
300
301 // #110958# Restore disabled alpha VDev
302 mpAlphaVDev = pOldAlphaVDev;
303}
304
305void Printer::DrawOutDev( const Point& /*rDestPt*/, const Size& /*rDestSize*/,
306 const Point& /*rSrcPt*/, const Size& /*rSrcSize*/ )
307{
308 SAL_WARN( "vcl.gdi", "Don't use OutputDevice::DrawOutDev(...) with printer devices!" );
309}
310
311void Printer::DrawOutDev( const Point& /*rDestPt*/, const Size& /*rDestSize*/,
312 const Point& /*rSrcPt*/, const Size& /*rSrcSize*/,
313 const OutputDevice& /*rOutDev*/ )
314{
315 SAL_WARN( "vcl.gdi", "Don't use OutputDevice::DrawOutDev(...) with printer devices!" );
316}
317
318void Printer::CopyArea( const Point& /*rDestPt*/,
319 const Point& /*rSrcPt*/, const Size& /*rSrcSize*/,
320 bool /*bWindowInvalidate*/ )
321{
322 SAL_WARN( "vcl.gdi", "Don't use OutputDevice::CopyArea(...) with printer devices!" );
323}
324
326{
327 Point aPageOffset = Point( 0, 0 ) - this->GetPageOffsetPixel();
328 Size aSize = this->GetPaperSizePixel();
329 return tools::Rectangle( aPageOffset, aSize );
330}
331
332void Printer::SetPrinterOptions( const vcl::printer::Options& i_rOptions )
333{
334 *mpPrinterOptions = i_rOptions;
335}
336
338{
339 // due to a "hotfix" for AOO bug i55719, this needs to return false
340 return false;
341}
342
344{
347}
348
350{
351}
352
354{
355}
356
357void ImplPrnQueueList::Add( std::unique_ptr<SalPrinterQueueInfo> pData )
358{
359 std::unordered_map< OUString, sal_Int32 >::iterator it =
360 m_aNameToIndex.find( pData->maPrinterName );
361 if( it == m_aNameToIndex.end() )
362 {
363 m_aNameToIndex[ pData->maPrinterName ] = m_aQueueInfos.size();
364 m_aPrinterList.push_back( pData->maPrinterName );
365 m_aQueueInfos.push_back( ImplPrnQueueData() );
366 m_aQueueInfos.back().mpQueueInfo = nullptr;
367 m_aQueueInfos.back().mpSalQueueInfo = std::move(pData);
368 }
369 else // this should not happen, but ...
370 {
371 ImplPrnQueueData& rData = m_aQueueInfos[ it->second ];
372 rData.mpQueueInfo.reset();
373 rData.mpSalQueueInfo = std::move(pData);
374 }
375}
376
377ImplPrnQueueData* ImplPrnQueueList::Get( const OUString& rPrinter )
378{
379 ImplPrnQueueData* pData = nullptr;
380 std::unordered_map<OUString,sal_Int32>::iterator it =
381 m_aNameToIndex.find( rPrinter );
382 if( it != m_aNameToIndex.end() )
383 pData = &m_aQueueInfos[it->second];
384 return pData;
385}
386
388{
389 ImplSVData* pSVData = ImplGetSVData();
390
392
393 static const char* pEnv = getenv( "SAL_DISABLE_PRINTERLIST" );
394 if( !pEnv || !*pEnv )
395 pSVData->mpDefInst->GetPrinterQueueInfo( pSVData->maGDIData.mpPrinterQueueList.get() );
396}
397
399{
400 ImplSVData* pSVData = ImplGetSVData();
401 pSVData->maGDIData.mpPrinterQueueList.reset();
402}
403
404const std::vector<OUString>& Printer::GetPrinterQueues()
405{
406 ImplSVData* pSVData = ImplGetSVData();
407 if ( !pSVData->maGDIData.mpPrinterQueueList )
409 assert(pSVData->maGDIData.mpPrinterQueueList && "mpPrinterQueueList exists by now");
410 return pSVData->maGDIData.mpPrinterQueueList->m_aPrinterList;
411}
412
413const QueueInfo* Printer::GetQueueInfo( const OUString& rPrinterName, bool bStatusUpdate )
414{
415 ImplSVData* pSVData = ImplGetSVData();
416
417 if ( !pSVData->maGDIData.mpPrinterQueueList )
419
420 if ( !pSVData->maGDIData.mpPrinterQueueList )
421 return nullptr;
422
423 ImplPrnQueueData* pInfo = pSVData->maGDIData.mpPrinterQueueList->Get( rPrinterName );
424 if( pInfo )
425 {
426 if( !pInfo->mpQueueInfo || bStatusUpdate )
427 pSVData->mpDefInst->GetPrinterQueueState( pInfo->mpSalQueueInfo.get() );
428
429 if ( !pInfo->mpQueueInfo )
430 pInfo->mpQueueInfo.reset(new QueueInfo);
431
432 pInfo->mpQueueInfo->maPrinterName = pInfo->mpSalQueueInfo->maPrinterName;
433 pInfo->mpQueueInfo->maDriver = pInfo->mpSalQueueInfo->maDriver;
434 pInfo->mpQueueInfo->maLocation = pInfo->mpSalQueueInfo->maLocation;
435 pInfo->mpQueueInfo->maComment = pInfo->mpSalQueueInfo->maComment;
436 pInfo->mpQueueInfo->mnStatus = pInfo->mpSalQueueInfo->mnStatus;
437 pInfo->mpQueueInfo->mnJobs = pInfo->mpSalQueueInfo->mnJobs;
438 return pInfo->mpQueueInfo.get();
439 }
440 return nullptr;
441}
442
444{
445 static const char* pEnv = getenv( "SAL_DISABLE_DEFAULTPRINTER" );
446 if( !pEnv || !*pEnv )
447 {
448 ImplSVData* pSVData = ImplGetSVData();
449
450 return pSVData->mpDefInst->GetDefaultPrinter();
451 }
452 return OUString();
453}
454
456{
457 mbDevOutput = false;
458 mbDefPrinter = false;
460 mnPageQueueSize = 0;
461 mnCopyCount = 1;
462 mbCollateCopy = false;
463 mbPrinting = false;
464 mbJobActive = false;
465 mbPrintFile = false;
466 mbInPrintPage = false;
467 mbNewJobSetup = false;
468 mbSinglePrintJobs = false;
469 mpInfoPrinter = nullptr;
470 mpPrinter = nullptr;
471 mpDisplayDev = nullptr;
472 mpPrinterOptions.reset(new vcl::printer::Options);
473
474 // Add printer to the list
475 ImplSVData* pSVData = ImplGetSVData();
477 mpPrev = nullptr;
478 if ( mpNext )
479 mpNext->mpPrev = this;
480 pSVData->maGDIData.mpFirstPrinter = this;
481}
482
484{
486
487 if ( mpGraphics )
488 return true;
489
490 mbInitLineColor = true;
491 mbInitFillColor = true;
492 mbInitFont = true;
493 mbInitTextColor = true;
494 mbInitClipRegion = true;
495
496 ImplSVData* pSVData = ImplGetSVData();
497
498 if ( mpJobGraphics )
500 else if ( mpDisplayDev )
501 {
502 const VirtualDevice* pVirDev = mpDisplayDev;
503 mpGraphics = pVirDev->mpVirDev->AcquireGraphics();
504 // if needed retry after releasing least recently used virtual device graphics
505 while ( !mpGraphics )
506 {
507 if ( !pSVData->maGDIData.mpLastVirGraphics )
508 break;
510 mpGraphics = pVirDev->mpVirDev->AcquireGraphics();
511 }
512 // update global LRU list of virtual device graphics
513 if ( mpGraphics )
514 {
516 pSVData->maGDIData.mpFirstVirGraphics = const_cast<Printer*>(this);
517 if ( mpNextGraphics )
518 mpNextGraphics->mpPrevGraphics = const_cast<Printer*>(this);
519 if ( !pSVData->maGDIData.mpLastVirGraphics )
520 pSVData->maGDIData.mpLastVirGraphics = const_cast<Printer*>(this);
521 }
522 }
523 else
524 {
526 // if needed retry after releasing least recently used printer graphics
527 while ( !mpGraphics )
528 {
529 if ( !pSVData->maGDIData.mpLastPrnGraphics )
530 break;
533 }
534 // update global LRU list of printer graphics
535 if ( mpGraphics )
536 {
538 pSVData->maGDIData.mpFirstPrnGraphics = const_cast<Printer*>(this);
539 if ( mpNextGraphics )
540 mpNextGraphics->mpPrevGraphics = const_cast<Printer*>(this);
541 if ( !pSVData->maGDIData.mpLastPrnGraphics )
542 pSVData->maGDIData.mpLastPrnGraphics = const_cast<Printer*>(this);
543 }
544 }
545
546 if ( mpGraphics )
547 {
550 }
551
552 return mpGraphics != nullptr;
553}
554
556{
558 mbNewFont = true;
559 mbInitFont = true;
560
561 mpFontInstance.clear();
562 mpFontFaceCollection.reset();
563}
564
566{
568
569 if ( !mpGraphics )
570 return;
571
572 // release the fonts of the physically released graphics device
573 if( bRelease )
575
576 ImplSVData* pSVData = ImplGetSVData();
577
578 Printer* pPrinter = this;
579
580 if ( !pPrinter->mpJobGraphics )
581 {
582 if ( pPrinter->mpDisplayDev )
583 {
584 VirtualDevice* pVirDev = pPrinter->mpDisplayDev;
585 if ( bRelease )
586 pVirDev->mpVirDev->ReleaseGraphics( mpGraphics );
587 // remove from global LRU list of virtual device graphics
588 if ( mpPrevGraphics )
590 else
592 if ( mpNextGraphics )
594 else
596 }
597 else
598 {
599 if ( bRelease )
601 // remove from global LRU list of printer graphics
602 if ( mpPrevGraphics )
604 else
605 pSVData->maGDIData.mpFirstPrnGraphics = static_cast<Printer*>(mpNextGraphics.get());
606 if ( mpNextGraphics )
608 else
609 pSVData->maGDIData.mpLastPrnGraphics = static_cast<Printer*>(mpPrevGraphics.get());
610 }
611 }
612
613 mpGraphics = nullptr;
614 mpPrevGraphics = nullptr;
615 mpNextGraphics = nullptr;
616}
617
618void Printer::ReleaseGraphics(bool bRelease)
619{
620 ImplReleaseGraphics(bRelease);
621}
622
624{
625 ImplSVData* pSVData = ImplGetSVData();
626 // #i74084# update info for this specific SalPrinterQueueInfo
627 pSVData->mpDefInst->GetPrinterQueueState( pInfo );
628
629 // Test whether the driver actually matches the JobSetup
631 if ( rData.GetDriverData() )
632 {
633 if ( rData.GetPrinterName() != pInfo->maPrinterName ||
634 rData.GetDriver() != pInfo->maDriver )
635 {
636 std::free( const_cast<sal_uInt8*>(rData.GetDriverData()) );
637 rData.SetDriverData(nullptr);
638 rData.SetDriverDataLen(0);
639 }
640 }
641
642 // Remember printer name
644 maDriver = pInfo->maDriver;
645
646 // Add printer name to JobSetup
648 rData.SetDriver( maDriver );
649
650 mpInfoPrinter = pSVData->mpDefInst->CreateInfoPrinter( pInfo, &rData );
651 mpPrinter = nullptr;
652 mpJobGraphics = nullptr;
654
655 if ( !mpInfoPrinter )
656 {
658 return;
659 }
660
661 // we need a graphics
662 if ( !AcquireGraphics() )
663 {
665 return;
666 }
667
668 // Init data
670 mxFontCollection = std::make_shared<vcl::font::PhysicalFontCollection>();
671 mxFontCache = std::make_shared<ImplFontCache>();
673}
674
676{
677 ImplSVData* pSVData = ImplGetSVData();
678
679 mpInfoPrinter = nullptr;
680 mpPrinter = nullptr;
681 mpJobGraphics = nullptr;
682
688}
689
690void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
691 const Point& rDestPt, const Size& rDestSize,
692 const Point& rSrcPtPixel, const Size& rSrcSizePixel )
693{
694 Point aDestPt( LogicToPixel( rDestPt ) );
695 Size aDestSz( LogicToPixel( rDestSize ) );
696 tools::Rectangle aSrcRect( rSrcPtPixel, rSrcSizePixel );
697
698 aSrcRect.Normalize();
699
700 if( !(!rMask.IsEmpty() && aSrcRect.GetWidth() && aSrcRect.GetHeight() && aDestSz.Width() && aDestSz.Height()) )
701 return;
702
703 Bitmap aMask( rMask );
705
708
709 // mirrored horizontally
710 if( aDestSz.Width() < 0 )
711 {
712 aDestSz.setWidth( -aDestSz.Width() );
713 aDestPt.AdjustX( -( aDestSz.Width() - 1 ) );
714 nMirrFlags |= BmpMirrorFlags::Horizontal;
715 }
716
717 // mirrored vertically
718 if( aDestSz.Height() < 0 )
719 {
720 aDestSz.setHeight( -aDestSz.Height() );
721 aDestPt.AdjustY( -( aDestSz.Height() - 1 ) );
722 nMirrFlags |= BmpMirrorFlags::Vertical;
723 }
724
725 // source cropped?
726 if( aSrcRect != tools::Rectangle( Point(), aMask.GetSizePixel() ) )
727 aMask.Crop( aSrcRect );
728
729 // destination mirrored
730 if( nMirrFlags != BmpMirrorFlags::NONE)
731 aMask.Mirror( nMirrFlags );
732
733 // do painting
734 const tools::Long nSrcWidth = aSrcRect.GetWidth(), nSrcHeight = aSrcRect.GetHeight();
735 tools::Long nX, nY; //, nWorkX, nWorkY, nWorkWidth, nWorkHeight;
736 std::unique_ptr<tools::Long[]> pMapX( new tools::Long[ nSrcWidth + 1 ] );
737 std::unique_ptr<tools::Long[]> pMapY( new tools::Long[ nSrcHeight + 1 ] );
738 GDIMetaFile* pOldMetaFile = mpMetaFile;
739 const bool bOldMap = mbMap;
740
741 mpMetaFile = nullptr;
742 mbMap = false;
744 SetLineColor( rMaskColor );
745 SetFillColor( rMaskColor );
748
749 // create forward mapping tables
750 for( nX = 0; nX <= nSrcWidth; nX++ )
751 pMapX[ nX ] = aDestPt.X() + FRound( static_cast<double>(aDestSz.Width()) * nX / nSrcWidth );
752
753 for( nY = 0; nY <= nSrcHeight; nY++ )
754 pMapY[ nY ] = aDestPt.Y() + FRound( static_cast<double>(aDestSz.Height()) * nY / nSrcHeight );
755
756 // walk through all rectangles of mask
757 const vcl::Region aWorkRgn(aMask.CreateRegion(COL_BLACK, tools::Rectangle(Point(), aMask.GetSizePixel())));
758 RectangleVector aRectangles;
759 aWorkRgn.GetRegionRectangles(aRectangles);
760
761 for (auto const& rectangle : aRectangles)
762 {
763 const Point aMapPt(pMapX[rectangle.Left()], pMapY[rectangle.Top()]);
764 const Size aMapSz(
765 pMapX[rectangle.Right() + 1] - aMapPt.X(), // pMapX[L + W] -> L + ((R - L) + 1) -> R + 1
766 pMapY[rectangle.Bottom() + 1] - aMapPt.Y()); // same for Y
767
768 DrawRect(tools::Rectangle(aMapPt, aMapSz));
769 }
770
771 Pop();
772 mbMap = bOldMap;
773 mpMetaFile = pOldMetaFile;
774}
775
776SalPrinterQueueInfo* Printer::ImplGetQueueInfo( const OUString& rPrinterName,
777 const OUString* pDriver )
778{
779 ImplSVData* pSVData = ImplGetSVData();
780 if ( !pSVData->maGDIData.mpPrinterQueueList )
782
783 ImplPrnQueueList* pPrnList = pSVData->maGDIData.mpPrinterQueueList.get();
784 if ( pPrnList && !pPrnList->m_aQueueInfos.empty() )
785 {
786 // first search for the printer name directly
787 ImplPrnQueueData* pInfo = pPrnList->Get( rPrinterName );
788 if( pInfo )
789 return pInfo->mpSalQueueInfo.get();
790
791 // then search case insensitive
792 for(const ImplPrnQueueData & rQueueInfo : pPrnList->m_aQueueInfos)
793 {
794 if( rQueueInfo.mpSalQueueInfo->maPrinterName.equalsIgnoreAsciiCase( rPrinterName ) )
795 return rQueueInfo.mpSalQueueInfo.get();
796 }
797
798 // then search for driver name
799 if ( pDriver )
800 {
801 for(const ImplPrnQueueData & rQueueInfo : pPrnList->m_aQueueInfos)
802 {
803 if( rQueueInfo.mpSalQueueInfo->maDriver == *pDriver )
804 return rQueueInfo.mpSalQueueInfo.get();
805 }
806 }
807
808 // then the default printer
809 pInfo = pPrnList->Get( GetDefaultPrinterName() );
810 if( pInfo )
811 return pInfo->mpSalQueueInfo.get();
812
813 // last chance: the first available printer
814 return pPrnList->m_aQueueInfos[0].mpSalQueueInfo.get();
815 }
816
817 return nullptr;
818}
819
821{
822 // we need a graphics
823 if ( !AcquireGraphics() )
824 return;
825
830 maPaperSize );
831}
832
834{
836}
837
839{
840 // use display-equivalent step size calculation
841 tools::Long nInc = (nMinRect < 800) ? 10 : 20;
842
843 return nInc;
844}
845
848{
849 ImplInitData();
851 if ( pInfo )
852 {
853 ImplInit( pInfo );
854 if ( !IsDisplayPrinter() )
855 mbDefPrinter = true;
856 }
857 else
859}
860
861Printer::Printer( const JobSetup& rJobSetup )
863 , maJobSetup(rJobSetup)
864{
865 ImplInitData();
866 const ImplJobSetup& rConstData = rJobSetup.ImplGetConstData();
867 OUString aDriver = rConstData.GetDriver();
869 &aDriver );
870 if ( pInfo )
871 {
872 ImplInit( pInfo );
873 SetJobSetup( rJobSetup );
874 }
875 else
876 {
879 }
880}
881
882Printer::Printer( const QueueInfo& rQueueInfo )
884{
885 ImplInitData();
887 &rQueueInfo.GetDriver() );
888 if ( pInfo )
889 ImplInit( pInfo );
890 else
892}
893
894Printer::Printer( const OUString& rPrinterName )
896{
897 ImplInitData();
898 SalPrinterQueueInfo* pInfo = ImplGetQueueInfo( rPrinterName, nullptr );
899 if ( pInfo )
900 ImplInit( pInfo );
901 else
903}
904
906{
907 disposeOnce();
908}
909
911{
912 SAL_WARN_IF( IsPrinting(), "vcl.gdi", "Printer::~Printer() - Job is printing" );
913 SAL_WARN_IF( IsJobActive(), "vcl.gdi", "Printer::~Printer() - Job is active" );
914
915 mpPrinterOptions.reset();
916
918 if ( mpInfoPrinter )
920 if ( mpDisplayDev )
922 else
923 {
924 // OutputDevice Dtor is trying the same thing; that why we need to set
925 // the FontEntry to NULL here
926 // TODO: consolidate duplicate cleanup by Printer and OutputDevice
927 mpFontInstance.clear();
928 mpFontFaceCollection.reset();
929 mxFontCache.reset();
930 // font list deleted by OutputDevice dtor
931 }
932
933 // Add printer from the list
934 ImplSVData* pSVData = ImplGetSVData();
935 if ( mpPrev )
937 else
939 if ( mpNext )
941
942 mpPrev.clear();
943 mpNext.clear();
945}
946
948{
949 Size aBrdSize(LogicToPixel(Size(20, 20), MapMode(MapUnit::Map100thMM)));
950
951 if (!aBrdSize.Width())
952 aBrdSize.setWidth(1);
953
954 if (!aBrdSize.Height())
955 aBrdSize.setHeight(1);
956
957 return aBrdSize;
958}
959
961{
962 if ( IsDisplayPrinter() )
963 return 0;
964
965 if( mpInfoPrinter )
967 else
968 return 0;
969}
970
972{
973 switch ( eFeature )
974 {
985 }
986
987 return true;
988}
989
990bool Printer::SetJobSetup( const JobSetup& rSetup )
991{
993 return false;
994
995 JobSetup aJobSetup = rSetup;
996
998 if ( mpInfoPrinter->SetPrinterData( &aJobSetup.ImplGetData() ) )
999 {
1000 ImplUpdateJobSetupPaper( aJobSetup );
1001 mbNewJobSetup = true;
1002 maJobSetup = aJobSetup;
1005 return true;
1006 }
1007
1008 return false;
1009}
1010
1012{
1013 if ( IsDisplayPrinter() )
1014 return false;
1015
1016 if ( IsJobActive() || IsPrinting() )
1017 return false;
1018
1019 JobSetup aJobSetup = maJobSetup;
1020 ImplJobSetup& rData = aJobSetup.ImplGetData();
1021 rData.SetPrinterSetupMode( eMode );
1022 // TODO: orig page size
1023
1024 if (!pWindow)
1025 {
1026 vcl::Window* pDefWin = ImplGetDefaultWindow();
1027 pWindow = pDefWin ? pDefWin->GetFrameWeld() : nullptr;
1028 }
1029 if( !pWindow )
1030 return false;
1031
1033 ImplSVData* pSVData = ImplGetSVData();
1034 pSVData->maAppData.mnModalMode++;
1036 bool bSetup = mpInfoPrinter->Setup(pWindow, &rData);
1037 pSVData->maAppData.mnModalMode--;
1039 if ( bSetup )
1040 {
1041 ImplUpdateJobSetupPaper( aJobSetup );
1042 mbNewJobSetup = true;
1043 maJobSetup = aJobSetup;
1046 return true;
1047 }
1048 return false;
1049}
1050
1051bool Printer::SetPrinterProps( const Printer* pPrinter )
1052{
1053 if ( IsJobActive() || IsPrinting() )
1054 return false;
1055
1056 ImplSVData* pSVData = ImplGetSVData();
1057
1058 mbDefPrinter = pPrinter->mbDefPrinter;
1059 maPrintFile = pPrinter->maPrintFile;
1060 mbPrintFile = pPrinter->mbPrintFile;
1061 mnCopyCount = pPrinter->mnCopyCount;
1062 mbCollateCopy = pPrinter->mbCollateCopy;
1063 mnPageQueueSize = pPrinter->mnPageQueueSize;
1064 *mpPrinterOptions = *pPrinter->mpPrinterOptions;
1065
1066 if ( pPrinter->IsDisplayPrinter() )
1067 {
1068 // Destroy old printer
1069 if ( !IsDisplayPrinter() )
1070 {
1073 mpFontInstance.clear();
1074 mpFontFaceCollection.reset();
1075 // clean up font list
1076 mxFontCache.reset();
1077 mxFontCollection.reset();
1078
1079 mbInitFont = true;
1080 mbNewFont = true;
1081 mpInfoPrinter = nullptr;
1082 }
1083
1084 // Construct new printer
1086 return true;
1087 }
1088
1089 // Destroy old printer?
1090 if ( GetName() != pPrinter->GetName() )
1091 {
1093 if ( mpDisplayDev )
1094 {
1096 }
1097 else
1098 {
1100
1101 mpFontInstance.clear();
1102 mpFontFaceCollection.reset();
1103 mxFontCache.reset();
1104 mxFontCollection.reset();
1105 mbInitFont = true;
1106 mbNewFont = true;
1107 mpInfoPrinter = nullptr;
1108 }
1109
1110 // Construct new printer
1111 OUString aDriver = pPrinter->GetDriverName();
1112 SalPrinterQueueInfo* pInfo = ImplGetQueueInfo( pPrinter->GetName(), &aDriver );
1113 if ( pInfo )
1114 {
1115 ImplInit( pInfo );
1116 SetJobSetup( pPrinter->GetJobSetup() );
1117 }
1118 else
1120 }
1121 else
1122 SetJobSetup( pPrinter->GetJobSetup() );
1123
1124 return false;
1125}
1126
1128{
1129 if ( mbInPrintPage )
1130 return false;
1131
1132 if ( maJobSetup.ImplGetConstData().GetOrientation() != eOrientation )
1133 {
1134 JobSetup aJobSetup = maJobSetup;
1135 ImplJobSetup& rData = aJobSetup.ImplGetData();
1136
1137 rData.SetOrientation(eOrientation);
1138
1139 if ( IsDisplayPrinter() )
1140 {
1141 mbNewJobSetup = true;
1142 maJobSetup = aJobSetup;
1143 return true;
1144 }
1145
1148 {
1149 ImplUpdateJobSetupPaper( aJobSetup );
1150 mbNewJobSetup = true;
1151 maJobSetup = aJobSetup;
1154 return true;
1155 }
1156 else
1157 return false;
1158 }
1159
1160 return true;
1161}
1162
1164{
1166}
1167
1168bool Printer::SetPaperBin( sal_uInt16 nPaperBin )
1169{
1170 if ( mbInPrintPage )
1171 return false;
1172
1173 if ( maJobSetup.ImplGetConstData().GetPaperBin() != nPaperBin &&
1174 nPaperBin < GetPaperBinCount() )
1175 {
1176 JobSetup aJobSetup = maJobSetup;
1177 ImplJobSetup& rData = aJobSetup.ImplGetData();
1178 rData.SetPaperBin(nPaperBin);
1179
1180 if ( IsDisplayPrinter() )
1181 {
1182 mbNewJobSetup = true;
1183 maJobSetup = aJobSetup;
1184 return true;
1185 }
1186
1189 {
1190 ImplUpdateJobSetupPaper( aJobSetup );
1191 mbNewJobSetup = true;
1192 maJobSetup = aJobSetup;
1195 return true;
1196 }
1197 else
1198 return false;
1199 }
1200
1201 return true;
1202}
1203
1204sal_uInt16 Printer::GetPaperBin() const
1205{
1207}
1208
1210{
1212}
1213
1214// dear loplugins, DO NOT REMOVE this code
1215// it will be used in follow-up commits
1216void Printer::SetPrinterSettingsPreferred( bool bPaperSizeFromSetup)
1217{
1218 if ( maJobSetup.ImplGetConstData().GetPapersizeFromSetup() != bPaperSizeFromSetup )
1219 {
1220 JobSetup aJobSetup = maJobSetup;
1221 ImplJobSetup& rData = aJobSetup.ImplGetData();
1222 rData.SetPapersizeFromSetup(bPaperSizeFromSetup);
1223
1224 mbNewJobSetup = true;
1225 maJobSetup = aJobSetup;
1226 }
1227}
1228
1229// Map user paper format to an available printer paper format
1231{
1232 ImplJobSetup& rData = aJobSetup.ImplGetData();
1233
1234 // The angle that a landscape page will be turned counterclockwise wrt to portrait.
1235 int nLandscapeAngle = mpInfoPrinter ? mpInfoPrinter->GetLandscapeAngle( &maJobSetup.ImplGetConstData() ) : 900;
1236 int nPaperCount = GetPaperInfoCount();
1237 PaperInfo aInfo(rData.GetPaperWidth(), rData.GetPaperHeight());
1238
1239 // Compare all paper formats and get the appropriate one
1240 for ( int i = 0; i < nPaperCount; i++ )
1241 {
1242 const PaperInfo& rPaperInfo = GetPaperInfo( i );
1243
1244 if ( aInfo.sloppyEqual(rPaperInfo) )
1245 {
1246 rData.SetPaperFormat(
1247 ImplGetPaperFormat( rPaperInfo.getWidth(),
1248 rPaperInfo.getHeight() ));
1250 return;
1251 }
1252 }
1253
1254 // If the printer supports landscape orientation, check paper sizes again
1255 // with landscape orientation. This is necessary as a printer driver provides
1256 // all paper sizes with portrait orientation only!!
1257 if ( !(rData.GetPaperFormat() == PAPER_USER &&
1258 nLandscapeAngle != 0 &&
1260 return;
1261
1262 const tools::Long nRotatedWidth = rData.GetPaperHeight();
1263 const tools::Long nRotatedHeight = rData.GetPaperWidth();
1264 PaperInfo aRotatedInfo(nRotatedWidth, nRotatedHeight);
1265
1266 for ( int i = 0; i < nPaperCount; i++ )
1267 {
1268 const PaperInfo& rPaperInfo = GetPaperInfo( i );
1269
1270 if ( aRotatedInfo.sloppyEqual( rPaperInfo ) )
1271 {
1272 rData.SetPaperFormat(
1273 ImplGetPaperFormat( rPaperInfo.getWidth(),
1274 rPaperInfo.getHeight() ));
1276 return;
1277 }
1278 }
1279}
1280
1282{
1283 if ( mbInPrintPage )
1284 return;
1285
1286 if ( maJobSetup.ImplGetConstData().GetPaperFormat() == ePaper )
1287 return;
1288
1289 JobSetup aJobSetup = maJobSetup;
1290 ImplJobSetup& rData = aJobSetup.ImplGetData();
1291
1292 rData.SetPaperFormat( ePaper );
1293 if ( ePaper != PAPER_USER )
1294 {
1295 PaperInfo aInfo(ePaper);
1296 rData.SetPaperWidth( aInfo.getWidth() );
1297 rData.SetPaperHeight( aInfo.getHeight() );
1298 }
1299
1300 if ( IsDisplayPrinter() )
1301 {
1302 mbNewJobSetup = true;
1303 maJobSetup = aJobSetup;
1304 return;
1305 }
1306
1308 if ( ePaper == PAPER_USER )
1309 ImplFindPaperFormatForUserSize( aJobSetup );
1311 {
1312 ImplUpdateJobSetupPaper( aJobSetup );
1313 mbNewJobSetup = true;
1314 maJobSetup = aJobSetup;
1317 }
1318}
1319
1321{
1322 if ( mbInPrintPage )
1323 return false;
1324
1325 const Size aPixSize = LogicToPixel( rSize );
1326 const Size aPageSize = PixelToLogic(aPixSize, MapMode(MapUnit::Map100thMM));
1327 bool bNeedToChange(maJobSetup.ImplGetConstData().GetPaperWidth() != aPageSize.Width() ||
1329
1330 if(!bNeedToChange)
1331 {
1332 // #i122984# only need to change when Paper is different from PAPER_USER and
1333 // the mapped Paper which will created below in the call to ImplFindPaperFormatForUserSize
1334 // and will replace maJobSetup.ImplGetConstData()->GetPaperFormat(). This leads to
1335 // unnecessary JobSetups, e.g. when printing a multi-page fax, but also with
1336 // normal print
1337 const Paper aPaper = ImplGetPaperFormat(aPageSize.Width(), aPageSize.Height());
1338
1339 bNeedToChange = maJobSetup.ImplGetConstData().GetPaperFormat() != PAPER_USER &&
1341 }
1342
1343 if(bNeedToChange)
1344 {
1345 JobSetup aJobSetup = maJobSetup;
1346 ImplJobSetup& rData = aJobSetup.ImplGetData();
1347 rData.SetPaperFormat( PAPER_USER );
1348 rData.SetPaperWidth( aPageSize.Width() );
1349 rData.SetPaperHeight( aPageSize.Height() );
1351
1352 if ( IsDisplayPrinter() )
1353 {
1354 mbNewJobSetup = true;
1355 maJobSetup = aJobSetup;
1356 return true;
1357 }
1358
1360 ImplFindPaperFormatForUserSize( aJobSetup );
1361
1362 // Changing the paper size can also change the orientation!
1364 {
1365 ImplUpdateJobSetupPaper( aJobSetup );
1366 mbNewJobSetup = true;
1367 maJobSetup = aJobSetup;
1370 return true;
1371 }
1372 else
1373 return false;
1374 }
1375
1376 return true;
1377}
1378
1380{
1381 if( ! mpInfoPrinter )
1382 return 0;
1385 return mpInfoPrinter->m_aPaperFormats.size();
1386}
1387
1389{
1390 ImplSVData* pSVData = ImplGetSVData();
1391 if( pSVData->maPaperNames.empty() )
1392 {
1393 // This array must (probably) match exactly the enum Paper in <i18nutil/paper.hxx>
1394 static const int PaperIndex[] =
1395 {
1409 };
1410 static_assert(SAL_N_ELEMENTS(PaperIndex) == SAL_N_ELEMENTS(RID_STR_PAPERNAMES), "localized paper name count wrong");
1411 for (size_t i = 0; i < SAL_N_ELEMENTS(PaperIndex); ++i)
1412 pSVData->maPaperNames[PaperIndex[i]] = VclResId(RID_STR_PAPERNAMES[i]);
1413 }
1414
1415 std::unordered_map<int,OUString>::const_iterator it = pSVData->maPaperNames.find( static_cast<int>(ePaper) );
1416 return (it != pSVData->maPaperNames.end()) ? it->second : OUString();
1417}
1418
1419const PaperInfo& Printer::GetPaperInfo( int nPaper ) const
1420{
1421 if( ! mpInfoPrinter )
1422 return ImplGetEmptyPaper();
1425 if( mpInfoPrinter->m_aPaperFormats.empty() || nPaper < 0 || o3tl::make_unsigned(nPaper) >= mpInfoPrinter->m_aPaperFormats.size() )
1426 return ImplGetEmptyPaper();
1427 return mpInfoPrinter->m_aPaperFormats[nPaper];
1428}
1429
1430Size Printer::GetPaperSize( int nPaper ) const
1431{
1432 PaperInfo aInfo = GetPaperInfo( nPaper );
1433 return PixelToLogic( Size( aInfo.getWidth(), aInfo.getHeight() ) );
1434}
1435
1437{
1438 if ( mbInPrintPage )
1439 return;
1440
1441 if ( maJobSetup.ImplGetConstData().GetDuplexMode() == eDuplex )
1442 return;
1443
1444 JobSetup aJobSetup = maJobSetup;
1445 ImplJobSetup& rData = aJobSetup.ImplGetData();
1446
1447 rData.SetDuplexMode( eDuplex );
1448
1449 if ( IsDisplayPrinter() )
1450 {
1451 mbNewJobSetup = true;
1452 maJobSetup = aJobSetup;
1453 return;
1454 }
1455
1458 {
1459 ImplUpdateJobSetupPaper( aJobSetup );
1460 mbNewJobSetup = true;
1461 maJobSetup = aJobSetup;
1464 }
1465}
1466
1468{
1470}
1471
1473{
1475}
1476
1478{
1480}
1481
1483{
1484 if ( IsDisplayPrinter() )
1485 return 0;
1486
1488}
1489
1490OUString Printer::GetPaperBinName( sal_uInt16 nPaperBin ) const
1491{
1492 if ( IsDisplayPrinter() )
1493 return OUString();
1494
1495 if ( nPaperBin < GetPaperBinCount() )
1497 else
1498 return OUString();
1499}
1500
1501void Printer::SetCopyCount( sal_uInt16 nCopy, bool bCollate )
1502{
1503 mnCopyCount = nCopy;
1504 mbCollateCopy = bCollate;
1505}
1506
1508{
1509 ErrCode nVCLError;
1510 switch ( nError )
1511 {
1513 nVCLError = ERRCODE_NONE;
1514 break;
1516 nVCLError = PRINTER_ABORT;
1517 break;
1518 default:
1519 nVCLError = PRINTER_GENERALERROR;
1520 break;
1521 }
1522
1523 return nVCLError;
1524}
1525
1527{
1528 if ( !IsJobActive() )
1529 return;
1530
1531 SAL_WARN_IF( mbInPrintPage, "vcl.gdi", "Printer::EndJob() - StartPage() without EndPage() called" );
1532
1533 mbJobActive = false;
1534
1535 if ( mpPrinter )
1536 {
1538
1539 mbPrinting = false;
1540
1541 mbDevOutput = false;
1542 mpPrinter->EndJob();
1543 mpPrinter.reset();
1544 }
1545}
1546
1548{
1549 if ( !IsJobActive() )
1550 return;
1551
1552 if ( !mpPrinter )
1553 return;
1554
1555 SalGraphics* pGraphics = mpPrinter->StartPage( &maJobSetup.ImplGetData(),
1556 mbNewJobSetup );
1557 if ( pGraphics )
1558 {
1560 mpJobGraphics = pGraphics;
1561 }
1562 mbDevOutput = true;
1563
1564 // PrintJob not aborted ???
1565 if ( IsJobActive() )
1566 mbInPrintPage = true;
1567}
1568
1570{
1571 if ( !IsJobActive() )
1572 return;
1573
1574 mbInPrintPage = false;
1575
1576 if ( mpPrinter )
1577 {
1579 mpPrinter->EndPage();
1580 mbDevOutput = false;
1581
1582 mpJobGraphics = nullptr;
1583 mbNewJobSetup = false;
1584 }
1585}
1586
1588{
1589 ImplSVData* pSVData = ImplGetSVData();
1590 ImplPrnQueueList* pPrnList = pSVData->maGDIData.mpPrinterQueueList.get();
1591
1592 if ( !pPrnList )
1593 return;
1594
1595 std::unique_ptr<ImplPrnQueueList> pNewList(new ImplPrnQueueList);
1596 pSVData->mpDefInst->GetPrinterQueueInfo( pNewList.get() );
1597
1598 bool bChanged = pPrnList->m_aQueueInfos.size() != pNewList->m_aQueueInfos.size();
1599 for( decltype(pPrnList->m_aQueueInfos)::size_type i = 0; ! bChanged && i < pPrnList->m_aQueueInfos.size(); i++ )
1600 {
1601 ImplPrnQueueData& rInfo = pPrnList->m_aQueueInfos[i];
1602 ImplPrnQueueData& rNewInfo = pNewList->m_aQueueInfos[i];
1603 if( ! rInfo.mpSalQueueInfo || ! rNewInfo.mpSalQueueInfo || // sanity check
1604 rInfo.mpSalQueueInfo->maPrinterName != rNewInfo.mpSalQueueInfo->maPrinterName )
1605 {
1606 bChanged = true;
1607 }
1608 }
1609 if( !bChanged )
1610 return;
1611
1613 pSVData->maGDIData.mpPrinterQueueList = std::move(pNewList);
1614
1615 Application* pApp = GetpApp();
1616 if( pApp )
1617 {
1621 }
1622}
1623
1625{
1626 return true;
1627}
1628
1629void Printer::ClipAndDrawGradientMetafile ( const Gradient &rGradient, const tools::PolyPolygon &rPolyPoly )
1630{
1631 const tools::Rectangle aBoundRect( rPolyPoly.GetBoundRect() );
1632
1634 IntersectClipRegion(vcl::Region(rPolyPoly));
1635 DrawGradient( aBoundRect, rGradient );
1636 Pop();
1637}
1638
1640{
1641 pFontEntry->mnOrientation = pFontEntry->mxFontMetric->GetOrientation();
1642}
1643
1645{
1646 return aRegion;
1647}
1648
1649Bitmap Printer::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
1650{
1651 SAL_WARN("vcl.gdi", "GetBitmap(): This should never be called on by a Printer instance");
1652
1653 return OutputDevice::GetBitmap( rSrcPt, rSize );
1654}
1655
1656css::awt::DeviceInfo Printer::GetDeviceInfo() const
1657{
1658 Size aDevSz = GetPaperSizePixel();
1659 css::awt::DeviceInfo aInfo = GetCommonDeviceInfo(aDevSz);
1660 Size aOutSz = GetOutputSizePixel();
1661 Point aOffset = GetPageOffset();
1662 aInfo.LeftInset = aOffset.X();
1663 aInfo.TopInset = aOffset.Y();
1664 aInfo.RightInset = aDevSz.Width() - aOutSz.Width() - aOffset.X();
1665 aInfo.BottomInset = aDevSz.Height() - aOutSz.Height() - aOffset.Y();
1666 aInfo.Capabilities = 0;
1667
1668 return aInfo;
1669}
1670
1672{
1674 {
1676 mbInitLineColor = true;
1677 }
1678
1679 mpGraphics->SetFillColor(rColor);
1680 mbInitFillColor = true;
1681}
1682
1684{
1685 // FIXME - do we have a bug here? If the linewidth is 0, then we will return
1686 // Size(0, 0) - is this correct?
1687 return Size(nLineWidth, ((nLineWidth*mnDPIX)+(mnDPIY/2))/mnDPIY);
1688}
1689
1691{
1693}
1694
1695/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
sal_Int32 nLineWidth
PrinterSupport
SystemTextColorFlags
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:233
static void ImplCallEventListenersApplicationDataChanged(void *pData)
Send event to all VCL application event listeners.
Definition: svapp.cxx:807
static void NotifyAllWindows(DataChangedEvent &rDCEvt)
Notify all windows that the application has changed data.
Definition: svapp.cxx:788
AlphaMask GetAlpha() const
Definition: BitmapEx.cxx:215
bool IsAlpha() const
Definition: BitmapEx.cxx:193
Bitmap GetBitmap(Color aTransparentReplaceColor) const
Definition: BitmapEx.cxx:203
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.
bool Erase(const Color &rFillColor)
Fill the entire bitmap with the given color.
Definition: bitmappaint.cxx:34
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:377
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:357
SAL_DLLPRIVATE const ImplJobSetup & ImplGetConstData() const
Definition: jobset.cxx:215
SAL_DLLPRIVATE ImplJobSetup & ImplGetData()
Definition: jobset.cxx:220
ImplFontMetricDataRef mxFontMetric
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:171
void EnableMapMode(bool bEnable=true)
Definition: map.cxx:602
sal_Int32 mnDPIY
Definition: outdev.hxx:214
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:245
std::shared_ptr< ImplFontCache > mxFontCache
Definition: outdev.hxx:263
virtual void dispose() override
Definition: outdev.cxx:144
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1123
Size GetOutputSizePixel() const
Definition: outdev.hxx:315
std::shared_ptr< vcl::font::PhysicalFontCollection > mxFontCollection
Definition: outdev.hxx:262
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:50
GDIMetaFile * mpMetaFile
Definition: outdev.hxx:186
SAL_DLLPRIVATE void InitFillColor()
Definition: fill.cxx:76
bool mbMap
Definition: outdev.hxx:241
void SetLineColor()
Definition: line.cxx:37
bool mbNewFont
Definition: outdev.hxx:255
bool mbInitLineColor
Definition: outdev.hxx:249
tools::Long mnOutWidth
Definition: outdev.hxx:211
SalGraphics * mpGraphics
Graphics context to draw on.
Definition: outdev.hxx:183
bool mbInitFont
Definition: outdev.hxx:251
VclPtr< OutputDevice > mpNextGraphics
Next output device in list.
Definition: outdev.hxx:185
bool mbInitTextColor
Definition: outdev.hxx:252
void SetTextColor(const Color &rColor)
Definition: text.cxx:716
void DrawBitmap(const Point &rDestPt, const Bitmap &rBitmap)
rtl::Reference< LogicalFontInstance > mpFontInstance
Definition: outdev.hxx:187
bool mbInitClipRegion
Definition: outdev.hxx:253
RasterOp meRasterOp
Definition: outdev.hxx:233
void SetFillColor()
Definition: fill.cxx:29
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:892
AntialiasingFlags mnAntialiasing
Definition: outdev.hxx:238
virtual Bitmap GetBitmap(const Point &rSrcPt, const Size &rSize) const
VclPtr< VirtualDevice > mpAlphaVDev
Definition: outdev.hxx:197
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:188
bool mbLineColor
Definition: outdev.hxx:247
void IntersectClipRegion(const tools::Rectangle &rRect)
sal_Int32 mnDPIX
Definition: outdev.hxx:213
bool mbInitFillColor
Definition: outdev.hxx:250
VclPtr< OutputDevice > mpPrevGraphics
Previous output device in list.
Definition: outdev.hxx:184
tools::Long mnOutHeight
Definition: outdev.hxx:212
SAL_DLLPRIVATE void ImplUpdateFontData()
const Color & GetFillColor() const
Definition: outdev.hxx:516
bool sloppyEqual(const PaperInfo &rOther) const
tools::Long getWidth() const
Paper getPaper() const
void doSloppyFit(bool bAlsoTryRotated=false)
tools::Long getHeight() const
VCL_DLLPRIVATE void ImplFindPaperFormatForUserSize(JobSetup &)
Definition: print.cxx:1230
virtual void DrawOutDev(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPt, const Size &rSrcSize) override
Definition: print.cxx:305
Size maPaperSize
Definition: print.hxx:82
static OUString GetDefaultPrinterName()
Definition: print.cxx:443
css::awt::DeviceInfo GetDeviceInfo() const override
Definition: print.cxx:1656
bool mbCollateCopy
Definition: print.hxx:89
OUString maPrintFile
Definition: print.hxx:79
virtual ~Printer() override
Definition: print.cxx:905
VCL_DLLPRIVATE void ImplInitData()
Definition: print.cxx:455
static VCL_DLLPRIVATE ErrCode ImplSalPrinterErrorCodeToVCL(SalPrinterError nError)
Definition: print.cxx:1507
std::unique_ptr< vcl::printer::Options > mpPrinterOptions
Definition: print.hxx:76
bool HasSupport(PrinterSupport eFeature) const
Definition: print.cxx:971
virtual void CopyArea(const Point &rDestPt, const Point &rSrcPt, const Size &rSrcSize, bool bWindowInvalidate=false) override
Definition: print.cxx:318
Printer()
Definition: print.cxx:846
bool SetOrientation(Orientation eOrient)
Definition: print.cxx:1127
sal_uInt16 mnCopyCount
Definition: print.hxx:85
bool mbJobActive
Definition: print.hxx:88
Size GetWaveLineSize(tools::Long nLineWidth) const override
Definition: print.cxx:1683
bool GetPrinterSettingsPreferred() const
Definition: print.cxx:1209
bool Setup(weld::Window *pWindow, PrinterSetupMode eMode=PrinterSetupMode::DocumentGlobal)
Definition: print.cxx:1011
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:690
bool mbNewJobSetup
Definition: print.hxx:92
VCL_DLLPRIVATE void ImplUpdateFontList()
Definition: print.cxx:833
static VCL_DLLPRIVATE SalPrinterQueueInfo * ImplGetQueueInfo(const OUString &rPrinterName, const OUString *pDriver)
Definition: print.cxx:776
SalInfoPrinter * mpInfoPrinter
Definition: print.hxx:70
virtual void ImplReleaseFonts() override
Definition: print.cxx:555
VCL_DLLPRIVATE void ImplEndPage()
Definition: print.cxx:1569
bool SetPrinterProps(const Printer *pPrinter)
Definition: print.cxx:1051
DuplexMode GetDuplexMode() const
Definition: print.cxx:1467
virtual bool AcquireGraphics() const override
Acquire a graphics device that the output device uses to draw on.
Definition: print.cxx:483
virtual bool HasMirroredGraphics() const override
Definition: print.cxx:337
bool IsJobActive() const
Definition: print.hxx:263
const Point & GetPageOffsetPixel() const
Definition: print.hxx:252
VCL_DLLPRIVATE void ImplInit(SalPrinterQueueInfo *pInfo)
Definition: print.cxx:623
VCL_DLLPRIVATE void ImplUpdatePageData()
Definition: print.cxx:820
OUString maDriver
Definition: print.hxx:78
bool mbSinglePrintJobs
Definition: print.hxx:93
sal_uInt32 GetCapabilities(PrinterCapType nType) const
Definition: print.cxx:960
bool SetJobSetup(const JobSetup &rSetup)
Definition: print.cxx:990
VCL_DLLPRIVATE void EndJob()
Definition: print.cxx:1526
bool mbDefPrinter
Definition: print.hxx:86
bool SetPaperBin(sal_uInt16 nPaperBin)
Definition: print.cxx:1168
void SetCopyCount(sal_uInt16 nCopy, bool bCollate)
Definition: print.cxx:1501
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:332
void SetPaper(Paper ePaper)
Definition: print.cxx:1281
virtual void ClipAndDrawGradientMetafile(const Gradient &rGradient, const tools::PolyPolygon &rPolyPoly) override
Definition: print.cxx:1629
void SetDuplexMode(DuplexMode)
Definition: print.cxx:1436
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:1644
sal_uInt16 GetPaperBinCount() const
Definition: print.cxx:1482
Size GetPaperSize() const
Definition: print.hxx:250
static void updatePrinters()
Checks the printer list and updates it necessary.
Definition: print.cxx:1587
bool mbPrintFile
Definition: print.hxx:90
OUString maPrinterName
Definition: print.hxx:77
int GetPaperInfoCount() const
Definition: print.cxx:1379
static const std::vector< OUString > & GetPrinterQueues()
Definition: print.cxx:404
static OUString GetPaperName(Paper ePaper)
Definition: print.cxx:1388
std::unique_ptr< SalPrinter > mpPrinter
Definition: print.hxx:71
bool mbPrinting
Definition: print.hxx:87
bool SetPaperSizeUser(const Size &rSize)
Definition: print.cxx:1320
sal_uInt16 mnPageQueueSize
Definition: print.hxx:84
static const QueueInfo * GetQueueInfo(const OUString &rPrinterName, bool bStatusUpdate)
Definition: print.cxx:413
bool IsPrinting() const
Definition: print.hxx:261
virtual Bitmap GetBitmap(const Point &rSrcPt, const Size &rSize) const override
Definition: print.cxx:1649
VclPtr< Printer > mpNext
Definition: print.hxx:74
Size GetSizeOfPaper() const
Definition: print.cxx:1477
virtual void ReleaseGraphics(bool bRelease=true) override
Release the graphics device, and remove it from the graphics device list.
Definition: print.cxx:618
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:198
const OUString & GetName() const
Definition: print.hxx:194
virtual Size GetButtonBorderSize() override
Definition: print.cxx:947
Point maPageOffset
Definition: print.hxx:81
const PaperInfo & GetPaperInfo(int nPaper) const
Definition: print.cxx:1419
const Size & GetPaperSizePixel() const
Definition: print.hxx:249
sal_uInt16 GetPaperBin() const
Definition: print.cxx:1204
const JobSetup & GetJobSetup() const
Definition: print.hxx:204
void ImplReleaseGraphics(bool bRelease=true)
Definition: print.cxx:565
VclPtr< VirtualDevice > mpDisplayDev
Definition: print.hxx:75
void SetSystemTextColor(SystemTextColorFlags, bool) override
Definition: print.cxx:1690
Orientation GetOrientation() const
Definition: print.cxx:1163
virtual void EmulateDrawTransparent(const tools::PolyPolygon &rPolyPoly, sal_uInt16 nTransparencePercent) override
Definition: print.cxx:228
virtual void dispose() override
Definition: print.cxx:910
virtual bool UsePolyPolygonForComplexGradient() override
Definition: print.cxx:1624
virtual tools::Rectangle GetBackgroundComponentBounds() const override
Definition: print.cxx:325
bool DrawTransformBitmapExDirect(const basegfx::B2DHomMatrix &aFullTransform, const BitmapEx &rBitmapEx, double fAlpha=1.0) override
Transform and draw a bitmap directly.
Definition: print.cxx:189
SalGraphics * mpJobGraphics
Definition: print.hxx:72
bool IsDisplayPrinter() const
Definition: print.hxx:197
virtual void SetFontOrientation(LogicalFontInstance *const pFontInstance) const override
Definition: print.cxx:1639
ErrCode mnError
Definition: print.hxx:83
VCL_DLLPRIVATE void ImplInitDisplay()
Definition: print.cxx:675
JobSetup maJobSetup
Definition: print.hxx:80
bool mbInPrintPage
Definition: print.hxx:91
void SetPrinterSettingsPreferred(bool bPaperSizeFromSetup)
Definition: print.cxx:1216
VCL_DLLPRIVATE void ImplStartPage()
Definition: print.cxx:1547
Paper GetPaper() const
Definition: print.cxx:1472
virtual tools::Long GetGradientStepCount(tools::Long nMinRect) override
Definition: print.cxx:838
void DrawDeviceBitmapEx(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPtPixel, const Size &rSrcSizePixel, BitmapEx &rBitmapEx) override
Definition: print.cxx:208
OUString GetPaperBinName(sal_uInt16 nPaperBin) const
Definition: print.cxx:1490
void SetWaveLineColors(Color const &rColor, tools::Long) override
Definition: print.cxx:1671
SAL_DLLPRIVATE void ImplPrintTransparent(const Bitmap &rBmp, const Bitmap &rMask, const Point &rDestPt, const Size &rDestSize, const Point &rSrcPtPixel, const Size &rSrcSizePixel)
Definition: print.cxx:97
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:879
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:144
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:398
int nImplSysDialog
Definition: print.cxx:56
static void ImplInitPrnQueueList()
Definition: print.cxx:387
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:155
SalInstance * mpDefInst
Definition: svdata.hxx:392
ImplSVGDIData maGDIData
Definition: svdata.hxx:401
ImplSVAppData maAppData
Definition: svdata.hxx:400
std::unordered_map< int, OUString > maPaperNames
Definition: svdata.hxx:418
VclPtr< OutputDevice > mpLastVirGraphics
Definition: svdata.hxx:222
VclPtr< Printer > mpFirstPrnGraphics
Definition: svdata.hxx:223
std::unique_ptr< ImplPrnQueueList > mpPrinterQueueList
Definition: svdata.hxx:228
std::shared_ptr< vcl::font::PhysicalFontCollection > mxScreenFontList
Definition: svdata.hxx:229
VclPtr< Printer > mpFirstPrinter
Definition: svdata.hxx:227
std::shared_ptr< ImplFontCache > mxScreenFontCache
Definition: svdata.hxx:230
VclPtr< OutputDevice > mpFirstVirGraphics
Definition: svdata.hxx:221
VclPtr< Printer > mpLastPrnGraphics
Definition: svdata.hxx:224
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:152
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:76
vcl::Window * ImplGetDefaultWindow()
Returns either the application window, or the default GL context window.
Definition: svdata.cxx:211
OUString VclResId(TranslateId aId)
Definition: svdata.cxx:260
unsigned char sal_uInt8