LibreOffice Module vcl (master) 1
outdev.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#include <sal/log.hxx>
22
23#include <tools/debug.hxx>
24#include <vcl/gdimtf.hxx>
25#include <vcl/graph.hxx>
26#include <vcl/metaact.hxx>
27#include <vcl/virdev.hxx>
28#include <vcl/outdev.hxx>
30#include <vcl/svapp.hxx>
31#include <vcl/sysdata.hxx>
32#include <vcl/lazydelete.hxx>
34
35#include <ImplOutDevData.hxx>
37#include <salgdi.hxx>
38#include <window.h>
39
40#include <com/sun/star/awt/DeviceCapability.hpp>
41#include <com/sun/star/awt/XWindow.hpp>
42#include <com/sun/star/rendering/CanvasFactory.hpp>
43#include <com/sun/star/rendering/XSpriteCanvas.hpp>
44
45#ifdef DISABLE_DYNLOADING
46// Linking all needed LO code into one .so/executable, these already
47// exist in the tools library, so put them in the anonymous namespace
48// here to avoid clash...
49namespace {
50#endif
51#ifdef DISABLE_DYNLOADING
52}
53#endif
54
55using namespace ::com::sun::star::uno;
56
57// Begin initializer and accessor public functions
58
60 meOutDevType(eOutDevType),
61 maRegion(true),
63 maTextLineColor( COL_TRANSPARENT ),
64 moSettings( Application::GetSettings() )
65{
66 mpGraphics = nullptr;
67 mpUnoGraphicsList = nullptr;
68 mpPrevGraphics = nullptr;
69 mpNextGraphics = nullptr;
70 mpMetaFile = nullptr;
71 mpFontInstance = nullptr;
72 mpFontFaceCollection = nullptr;
73 mpAlphaVDev = nullptr;
74 mpExtOutDevData = nullptr;
75 mnOutOffX = 0;
76 mnOutOffY = 0;
77 mnOutWidth = 0;
78 mnOutHeight = 0;
79 mnDPIX = 0;
80 mnDPIY = 0;
82 mnTextOffX = 0;
83 mnTextOffY = 0;
84 mnOutOffOrigX = 0;
86 mnOutOffOrigY = 0;
92
93 if( AllSettings::GetLayoutRTL() ) //#i84553# tip BiDi preference to RTL
95
97 mbMap = false;
98 mbClipRegion = false;
99 mbBackground = false;
100 mbOutput = true;
101 mbDevOutput = false;
102 mbOutputClipped = false;
107 meTextLanguage = LANGUAGE_SYSTEM; // TODO: get default from configuration?
108 mbLineColor = true;
109 mbFillColor = true;
110 mbInitLineColor = true;
111 mbInitFillColor = true;
112 mbInitFont = true;
113 mbInitTextColor = true;
114 mbInitClipRegion = true;
115 mbClipRegionSet = false;
116 mbNewFont = true;
117 mbTextLines = false;
118 mbTextSpecial = false;
119 mbRefPoint = false;
120 mbEnableRTL = false; // mirroring must be explicitly allowed (typically for windows only)
121
122 // struct ImplMapRes
129
130 // struct ImplOutDevData- see #i82615#
131 mpOutDevData.reset(new ImplOutDevData);
132 mpOutDevData->mpRotateDev = nullptr;
133 mpOutDevData->mpRecordLayout = nullptr;
134
135 // #i75163#
136 mpOutDevData->mpViewTransform = nullptr;
137 mpOutDevData->mpInverseViewTransform = nullptr;
138}
139
141{
142 disposeOnce();
143}
144
146{
147 if ( GetUnoGraphicsList() )
148 {
150 if ( pWrapper )
151 pWrapper->ReleaseAllGraphics( this );
152 delete mpUnoGraphicsList;
153 mpUnoGraphicsList = nullptr;
154 }
155
156 mpOutDevData->mpRotateDev.disposeAndClear();
157
158 // #i75163#
160
161 mpOutDevData.reset();
162
163 // for some reason, we haven't removed state from the stack properly
164 if ( !maOutDevStateStack.empty() )
165 SAL_WARN( "vcl.gdi", "OutputDevice::~OutputDevice(): OutputDevice::Push() calls != OutputDevice::Pop() calls" );
166 maOutDevStateStack.clear();
167
168 // release the active font instance
169 mpFontInstance.clear();
170
171 // remove cached results of GetDevFontList/GetDevSizeList
172 mpFontFaceCollection.reset();
173
174 // release ImplFontCache specific to this OutputDevice
175 mxFontCache.reset();
176
177 // release ImplFontList specific to this OutputDevice
178 mxFontCollection.reset();
179
184}
185
187{
188 return false;
189}
190
192{
194
195 if (!mpGraphics && !AcquireGraphics())
196 SAL_WARN("vcl.gdi", "No mpGraphics set");
197
198 return mpGraphics;
199}
200
202{
204
205 if (!mpGraphics && !AcquireGraphics())
206 SAL_WARN("vcl.gdi", "No mpGraphics set");
207
208 return mpGraphics;
209}
210
212{
213 mpMetaFile = pMtf;
214}
215
217{
218 *moSettings = rSettings;
219
220 if( mpAlphaVDev )
221 mpAlphaVDev->SetSettings( rSettings );
222}
223
225{
226 if (!mpGraphics && !AcquireGraphics())
227 return SystemGraphicsData();
228 assert(mpGraphics);
229
230 return mpGraphics->GetGraphicsData();
231}
232
234{
235 if (!mpGraphics && !AcquireGraphics())
236 return {};
237 assert(mpGraphics);
238
240}
241
242#if ENABLE_CAIRO_CANVAS
243
245{
246 if (!mpGraphics && !AcquireGraphics())
247 return false;
248 assert(mpGraphics);
249
250 return mpGraphics->SupportsCairo();
251}
252
254{
255 if (!mpGraphics && !AcquireGraphics())
257 assert(mpGraphics);
258 return mpGraphics->CreateSurface(rSurface);
259}
260
261cairo::SurfaceSharedPtr OutputDevice::CreateSurface(int x, int y, int width, int height) const
262{
263 if (!mpGraphics && !AcquireGraphics())
265 assert(mpGraphics);
266 return mpGraphics->CreateSurface(*this, x, y, width, height);
267}
268
270{
271 if (!mpGraphics && !AcquireGraphics())
273 assert(mpGraphics);
274 return mpGraphics->CreateBitmapSurface(*this, rData, rSize);
275}
276
277css::uno::Any OutputDevice::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const
278{
279 if (!mpGraphics && !AcquireGraphics())
280 return css::uno::Any();
281 assert(mpGraphics);
282 return mpGraphics->GetNativeSurfaceHandle(rSurface, rSize);
283}
284
285#endif // ENABLE_CAIRO_CANVAS
286
288{
289 const SystemGraphicsData aSysData = GetSystemGfxData();
290 css::uno::Sequence< sal_Int8 > aSeq( reinterpret_cast<sal_Int8 const *>(&aSysData),
291 aSysData.nSize );
292
293 return css::uno::Any(aSeq);
294}
295
297{
298 if ( mpMetaFile )
299 mpMetaFile->AddAction( new MetaRefPointAction( Point(), false ) );
300
301 mbRefPoint = false;
302 maRefPoint.setX(0);
303 maRefPoint.setY(0);
304
305 if( mpAlphaVDev )
307}
308
309void OutputDevice::SetRefPoint( const Point& rRefPoint )
310{
311 if ( mpMetaFile )
312 mpMetaFile->AddAction( new MetaRefPointAction( rRefPoint, true ) );
313
314 mbRefPoint = true;
315 maRefPoint = rRefPoint;
316
317 if( mpAlphaVDev )
318 mpAlphaVDev->SetRefPoint( rRefPoint );
319}
320
322{
323 if ( mpMetaFile )
324 mpMetaFile->AddAction( new MetaRasterOpAction( eRasterOp ) );
325
326 if ( meRasterOp != eRasterOp )
327 {
328 meRasterOp = eRasterOp;
330
331 if( mpGraphics || AcquireGraphics() )
332 {
333 assert(mpGraphics);
335 }
336 }
337
338 if( mpAlphaVDev )
339 mpAlphaVDev->SetRasterOp( eRasterOp );
340}
341
342void OutputDevice::EnableOutput( bool bEnable )
343{
344 mbOutput = bEnable;
345
346 if( mpAlphaVDev )
347 mpAlphaVDev->EnableOutput( bEnable );
348}
349
351{
352 if ( mnAntialiasing != nMode )
353 {
354 mnAntialiasing = nMode;
355 mbInitFont = true;
356
357 if (mpGraphics)
359 }
360
361 if( mpAlphaVDev )
363}
364
366{
367 mnDrawMode = nDrawMode;
368
369 if (mpAlphaVDev)
370 mpAlphaVDev->SetDrawMode(nDrawMode);
371}
372
374{
375 // we need a graphics instance
376 if ( !mpGraphics && !AcquireGraphics() )
377 return 0;
378 assert(mpGraphics);
379
380 return mpGraphics->GetBitCount();
381}
382
384{
385 mnOutOffX = nOutOffX;
386}
387
389{
390 mnOutOffY = nOutOffY;
391}
392
393css::uno::Reference< css::awt::XGraphics > OutputDevice::CreateUnoGraphics()
394{
396 return pWrapper ? pWrapper->CreateGraphics( this ) : css::uno::Reference< css::awt::XGraphics >();
397}
398
399std::vector< VCLXGraphics* > *OutputDevice::CreateUnoGraphicsList()
400{
401 mpUnoGraphicsList = new std::vector< VCLXGraphics* >;
402 return mpUnoGraphicsList;
403}
404
405// Helper public function
406
408{
409 if( !mpGraphics && !AcquireGraphics() )
410 return false;
411 assert(mpGraphics);
412 const bool bHasSupport = mpGraphics->supportsOperation( eType );
413 return bHasSupport;
414}
415
416// Direct OutputDevice drawing public functions
417
418void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
419 const Point& rSrcPt, const Size& rSrcSize )
420{
421 if( ImplIsRecordLayout() )
422 return;
423
425 {
426 DrawRect( tools::Rectangle( rDestPt, rDestSize ) );
427 return;
428 }
429
430 if ( mpMetaFile )
431 {
432 const Bitmap aBmp( GetBitmap( rSrcPt, rSrcSize ) );
433 mpMetaFile->AddAction( new MetaBmpScaleAction( rDestPt, rDestSize, aBmp ) );
434 }
435
437 return;
438
439 if ( !mpGraphics && !AcquireGraphics() )
440 return;
441 assert(mpGraphics);
442
443 if ( mbInitClipRegion )
445
446 if ( mbOutputClipped )
447 return;
448
449 tools::Long nSrcWidth = ImplLogicWidthToDevicePixel( rSrcSize.Width() );
450 tools::Long nSrcHeight = ImplLogicHeightToDevicePixel( rSrcSize.Height() );
451 tools::Long nDestWidth = ImplLogicWidthToDevicePixel( rDestSize.Width() );
452 tools::Long nDestHeight = ImplLogicHeightToDevicePixel( rDestSize.Height() );
453
454 if (nSrcWidth && nSrcHeight && nDestWidth && nDestHeight)
455 {
456 SalTwoRect aPosAry(ImplLogicXToDevicePixel(rSrcPt.X()), ImplLogicYToDevicePixel(rSrcPt.Y()),
457 nSrcWidth, nSrcHeight,
458 ImplLogicXToDevicePixel(rDestPt.X()), ImplLogicYToDevicePixel(rDestPt.Y()),
459 nDestWidth, nDestHeight);
460
461 AdjustTwoRect( aPosAry, GetOutputRectPixel() );
462
463 if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
464 mpGraphics->CopyBits(aPosAry, *this);
465 }
466
467 if( mpAlphaVDev )
468 mpAlphaVDev->DrawOutDev( rDestPt, rDestSize, rSrcPt, rSrcSize );
469}
470
471void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
472 const Point& rSrcPt, const Size& rSrcSize,
473 const OutputDevice& rOutDev )
474{
475 if ( ImplIsRecordLayout() )
476 return;
477
479 {
480 DrawRect( tools::Rectangle( rDestPt, rDestSize ) );
481 return;
482 }
483
484 if ( mpMetaFile )
485 {
486 if (rOutDev.mpAlphaVDev)
487 {
488 const BitmapEx aBmpEx(rOutDev.GetBitmapEx(rSrcPt, rSrcSize));
489 mpMetaFile->AddAction(new MetaBmpExScaleAction(rDestPt, rDestSize, aBmpEx));
490 }
491 else
492 {
493 const Bitmap aBmp(rOutDev.GetBitmap(rSrcPt, rSrcSize));
494 mpMetaFile->AddAction(new MetaBmpScaleAction(rDestPt, rDestSize, aBmp));
495 }
496 }
497
499 return;
500
501 if ( !mpGraphics && !AcquireGraphics() )
502 return;
503 assert(mpGraphics);
504
505 if ( mbInitClipRegion )
507
508 if ( mbOutputClipped )
509 return;
510
511 if (rOutDev.mpAlphaVDev)
512 {
513 // alpha-blend source over destination
514 DrawBitmapEx(rDestPt, rDestSize, rOutDev.GetBitmapEx(rSrcPt, rSrcSize));
515 }
516 else
517 {
518 SalTwoRect aPosAry(rOutDev.ImplLogicXToDevicePixel(rSrcPt.X()),
519 rOutDev.ImplLogicYToDevicePixel(rSrcPt.Y()),
520 rOutDev.ImplLogicWidthToDevicePixel(rSrcSize.Width()),
521 rOutDev.ImplLogicHeightToDevicePixel(rSrcSize.Height()),
522 ImplLogicXToDevicePixel(rDestPt.X()),
523 ImplLogicYToDevicePixel(rDestPt.Y()),
526
527 drawOutDevDirect(rOutDev, aPosAry);
528
529 // #i32109#: make destination rectangle opaque - source has no alpha
530 if (mpAlphaVDev)
532 }
533}
534
535void OutputDevice::CopyArea( const Point& rDestPt,
536 const Point& rSrcPt, const Size& rSrcSize,
537 bool bWindowInvalidate )
538{
539 if ( ImplIsRecordLayout() )
540 return;
541
542 RasterOp eOldRop = GetRasterOp();
544
546 return;
547
548 if ( !mpGraphics && !AcquireGraphics() )
549 return;
550 assert(mpGraphics);
551
552 if ( mbInitClipRegion )
554
555 if ( mbOutputClipped )
556 return;
557
558 tools::Long nSrcWidth = ImplLogicWidthToDevicePixel( rSrcSize.Width() );
559 tools::Long nSrcHeight = ImplLogicHeightToDevicePixel( rSrcSize.Height() );
560 if (nSrcWidth && nSrcHeight)
561 {
562 SalTwoRect aPosAry(ImplLogicXToDevicePixel(rSrcPt.X()), ImplLogicYToDevicePixel(rSrcPt.Y()),
563 nSrcWidth, nSrcHeight,
564 ImplLogicXToDevicePixel(rDestPt.X()), ImplLogicYToDevicePixel(rDestPt.Y()),
565 nSrcWidth, nSrcHeight);
566
567 AdjustTwoRect( aPosAry, GetOutputRectPixel() );
568
569 CopyDeviceArea( aPosAry, bWindowInvalidate );
570 }
571
572 SetRasterOp( eOldRop );
573
574 if( mpAlphaVDev )
575 mpAlphaVDev->CopyArea( rDestPt, rSrcPt, rSrcSize, bWindowInvalidate );
576}
577
578// Direct OutputDevice drawing protected function
579
580void OutputDevice::CopyDeviceArea( SalTwoRect& aPosAry, bool /*bWindowInvalidate*/)
581{
582 if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0)
583 return;
584
585 aPosAry.mnDestWidth = aPosAry.mnSrcWidth;
586 aPosAry.mnDestHeight = aPosAry.mnSrcHeight;
587 mpGraphics->CopyBits(aPosAry, *this);
588}
589
590// Direct OutputDevice drawing private function
592{
593 SalGraphics* pSrcGraphics;
594 if (const OutputDevice* pCheckedSrc = DrawOutDevDirectCheck(rSrcDev))
595 {
596 if (!pCheckedSrc->mpGraphics && !pCheckedSrc->AcquireGraphics())
597 return;
598 pSrcGraphics = pCheckedSrc->mpGraphics;
599 }
600 else
601 pSrcGraphics = nullptr;
602
603 if (!mpGraphics && !AcquireGraphics())
604 return;
605 assert(mpGraphics);
606
607 // #102532# Offset only has to be pseudo window offset
608
609 AdjustTwoRect( rPosAry, rSrcDev.GetOutputRectPixel() );
610
611 if ( rPosAry.mnSrcWidth && rPosAry.mnSrcHeight && rPosAry.mnDestWidth && rPosAry.mnDestHeight )
612 {
613 // if this is no window, but rSrcDev is a window
614 // mirroring may be required
615 // because only windows have a SalGraphicsLayout
616 // mirroring is performed here
617 DrawOutDevDirectProcess(rSrcDev, rPosAry, pSrcGraphics);
618 }
619}
620
622{
623 return this == &rSrcDev ? nullptr : &rSrcDev;
624}
625
627{
628 if( pSrcGraphics && (pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl) )
629 {
630 SalTwoRect aPosAry2 = rPosAry;
631 pSrcGraphics->mirror( aPosAry2.mnSrcX, aPosAry2.mnSrcWidth, rSrcDev );
632 mpGraphics->CopyBits( aPosAry2, *pSrcGraphics, *this, rSrcDev );
633 return;
634 }
635 if (pSrcGraphics)
636 mpGraphics->CopyBits( rPosAry, *pSrcGraphics, *this, rSrcDev );
637 else
638 mpGraphics->CopyBits( rPosAry, *this );
639}
640
642{
643 return tools::Rectangle( Point( 0, 0 ), GetOutputSizePixel() );
644}
645
646// Layout public functions
647
648void OutputDevice::EnableRTL( bool bEnable )
649{
650 mbEnableRTL = bEnable;
651
652 if( mpAlphaVDev )
653 mpAlphaVDev->EnableRTL( bEnable );
654}
655
657{
658 bool bRet = false;
659 if( AcquireGraphics() )
660 {
663 {
664 bRet = true;
665 }
666 }
667 return bRet;
668}
669
670// note: the coordinates to be remirrored are in frame coordinates !
671
672void OutputDevice::ReMirror( Point &rPoint ) const
673{
674 rPoint.setX( mnOutOffX + mnOutWidth - 1 - rPoint.X() + mnOutOffX );
675}
677{
678 tools::Long nWidth = rRect.Right() - rRect.Left();
679
680 //long lc_x = rRect.nLeft - mnOutOffX; // normalize
681 //lc_x = mnOutWidth - nWidth - 1 - lc_x; // mirror
682 //rRect.nLeft = lc_x + mnOutOffX; // re-normalize
683
684 rRect.SetLeft( mnOutOffX + mnOutWidth - nWidth - 1 - rRect.Left() + mnOutOffX );
685 rRect.SetRight( rRect.Left() + nWidth );
686}
687
689{
690 RectangleVector aRectangles;
691 rRegion.GetRegionRectangles(aRectangles);
692 vcl::Region aMirroredRegion;
693
694 for (auto & rectangle : aRectangles)
695 {
697 aMirroredRegion.Union(rectangle);
698 }
699
700 rRegion = aMirroredRegion;
701
702}
703
705{
707}
708
710{
711 if (!mpOutDevData)
712 return false;
713
714 return mpOutDevData->mpRecordLayout;
715}
716
717css::awt::DeviceInfo OutputDevice::GetCommonDeviceInfo(Size const& rDevSz) const
718{
719 css::awt::DeviceInfo aInfo;
720
721 aInfo.Width = rDevSz.Width();
722 aInfo.Height = rDevSz.Height();
723
724 Size aTmpSz = LogicToPixel(Size(1000, 1000), MapMode(MapUnit::MapMM));
725 aInfo.PixelPerMeterX = aTmpSz.Width();
726 aInfo.PixelPerMeterY = aTmpSz.Height();
727 aInfo.BitsPerPixel = GetBitCount();
728
729 aInfo.Capabilities = css::awt::DeviceCapability::RASTEROPERATIONS |
730 css::awt::DeviceCapability::GETBITS;
731
732 return aInfo;
733}
734
735css::awt::DeviceInfo OutputDevice::GetDeviceInfo() const
736{
737 css::awt::DeviceInfo aInfo = GetCommonDeviceInfo(GetOutputSizePixel());
738
739 aInfo.LeftInset = 0;
740 aInfo.TopInset = 0;
741 aInfo.RightInset = 0;
742 aInfo.BottomInset = 0;
743
744 return aInfo;
745}
746
747Reference< css::rendering::XCanvas > OutputDevice::GetCanvas() const
748{
749 // try to retrieve hard reference from weak member
750 Reference< css::rendering::XCanvas > xCanvas( mxCanvas );
751 // canvas still valid? Then we're done.
752 if( xCanvas.is() )
753 return xCanvas;
754 xCanvas = ImplGetCanvas( false );
755 mxCanvas = xCanvas;
756 return xCanvas;
757}
758
759Reference< css::rendering::XSpriteCanvas > OutputDevice::GetSpriteCanvas() const
760{
761 Reference< css::rendering::XCanvas > xCanvas( mxCanvas );
762 Reference< css::rendering::XSpriteCanvas > xSpriteCanvas( xCanvas, UNO_QUERY );
763 if( xSpriteCanvas.is() )
764 return xSpriteCanvas;
765 xCanvas = ImplGetCanvas( true );
766 mxCanvas = xCanvas;
767 return Reference< css::rendering::XSpriteCanvas >( xCanvas, UNO_QUERY );
768}
769
770// Generic implementation, Window will override.
772{
773 /* Arguments:
774 0: ptr to creating instance (Window or VirtualDevice)
775 1: current bounds of creating instance
776 2: bool, denoting always on top state for Window (always false for VirtualDevice)
777 3: XWindow for creating Window (or empty for VirtualDevice)
778 4: SystemGraphicsData as a streamed Any
779 */
780 Sequence< Any > aArg{
781 Any(reinterpret_cast<sal_Int64>(this)),
782 Any(css::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight )),
783 Any(false),
784 Any(Reference< css::awt::XWindow >()),
786 };
787
788 Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
789
791 css::rendering::CanvasFactory::create( xContext ) );
792 Reference<css::lang::XMultiComponentFactory> xCanvasFactory(xStaticCanvasFactory.get());
793 Reference< css::rendering::XCanvas > xCanvas;
794
795 if(xCanvasFactory.is())
796 {
797 xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext(
798 bSpriteCanvas ?
799 OUString( "com.sun.star.rendering.SpriteCanvas" ) :
800 OUString( "com.sun.star.rendering.Canvas" ),
801 aArg,
802 xContext ),
803 UNO_QUERY );
804 }
805
806 // no factory??? Empty reference, then.
807 return xCanvas;
808}
809
811{
812 css::uno::Reference< css::rendering::XCanvas > xCanvas( mxCanvas );
813 if( xCanvas.is() )
814 {
815 css::uno::Reference< css::lang::XComponent > xCanvasComponent( xCanvas, css::uno::UNO_QUERY );
816 if( xCanvasComponent.is() )
817 xCanvasComponent->dispose();
818 }
819}
820
821/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
AntialiasingFlags
DrawModeFlags
RasterOp
Definition: RasterOp.hxx:23
static bool GetLayoutRTL()
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:234
void AddAction(const rtl::Reference< MetaAction > &pAction)
Definition: gdimtf.cxx:581
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:171
tools::Long mnEmphasisAscent
Definition: outdev.hxx:219
virtual css::awt::DeviceInfo GetDeviceInfo() const
Definition: outdev.cxx:735
ImplMapRes maMapRes
Definition: outdev.hxx:223
std::vector< VCLXGraphics * > * GetUnoGraphicsList() const
Definition: outdev.hxx:333
virtual void InitClipRegion()
SalGraphics const * GetGraphics() const
Get the graphic context that the output device uses to draw on.
Definition: outdev.cxx:201
OutputDevice(const OutputDevice &)=delete
virtual void SetSettings(const AllSettings &rSettings)
Definition: outdev.cxx:216
SAL_DLLPRIVATE tools::Long ImplLogicYToDevicePixel(tools::Long nY) const
Convert a logical Y coordinate to a device pixel's Y coordinate.
Definition: map.cxx:328
tools::Rectangle GetOutputRectPixel() const
Definition: outdev.hxx:325
sal_Int32 mnDPIY
Definition: outdev.hxx:214
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
Definition: bitmapex.cxx:33
tools::Long mnTextOffY
Definition: outdev.hxx:218
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
Definition: outdev.cxx:656
void SetAntialiasing(AntialiasingFlags nMode)
Definition: outdev.cxx:350
tools::Long mnOutOffY
Output offset for device output in pixel (pseudo window offset within window system's frames)
Definition: outdev.hxx:210
void EnableOutput(bool bEnable=true)
Definition: outdev.cxx:342
css::awt::DeviceInfo GetCommonDeviceInfo(Size const &aDevSize) const
Definition: outdev.cxx:717
DrawModeFlags mnDrawMode
Definition: outdev.hxx:221
css::uno::Reference< css::rendering::XSpriteCanvas > GetSpriteCanvas() const
request XSpriteCanvas render interface
Definition: outdev.cxx:759
bool mbOutputClipped
Definition: outdev.hxx:246
bool mbDevOutput
Definition: outdev.hxx:245
RasterOp GetRasterOp() const
Definition: outdev.hxx:497
std::shared_ptr< ImplFontCache > mxFontCache
Definition: outdev.hxx:263
virtual ~OutputDevice() override
Definition: outdev.cxx:140
virtual void dispose() override
Definition: outdev.cxx:145
bool mbFillColor
Definition: outdev.hxx:248
css::uno::WeakReference< css::rendering::XCanvas > mxCanvas
Definition: outdev.hxx:194
virtual bool AcquireGraphics() const =0
Acquire a graphics device that the output device uses to draw on.
tools::Long mnOutOffX
Output offset for device output in pixel (pseudo window offset within window system's frames)
Definition: outdev.hxx:208
tools::Long mnOutOffLogicX
Additional output offset in logical coordinates, applied in PixelToLogic (used by SetPixelOffset/GetP...
Definition: outdev.hxx:202
Size GetOutputSizePixel() const
Definition: outdev.hxx:315
std::unique_ptr< ImplOutDevData > mpOutDevData
Definition: outdev.hxx:190
SAL_DLLPRIVATE bool ImplIsRecordLayout() const
Definition: outdev.cxx:709
bool mbRefPoint
Definition: outdev.hxx:258
std::shared_ptr< vcl::font::PhysicalFontCollection > mxFontCollection
Definition: outdev.hxx:262
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:51
OutDevViewType meOutDevViewType
Definition: outdev.hxx:225
GDIMetaFile * mpMetaFile
Definition: outdev.hxx:186
bool SupportsCairo() const
virtual void DrawOutDevDirectProcess(const OutputDevice &rSrcDev, SalTwoRect &rPosAry, SalGraphics *pSrcGraphics)
Definition: outdev.cxx:626
bool mbMap
Definition: outdev.hxx:241
SystemGraphicsData GetSystemGfxData() const
Definition: outdev.cxx:224
SAL_DLLPRIVATE tools::Long ImplLogicHeightToDevicePixel(tools::Long nHeight) const
Convert a logical height to a height in units of device pixels.
Definition: map.cxx:345
bool mbClipRegion
Definition: outdev.hxx:242
css::uno::Reference< css::awt::XGraphics > CreateUnoGraphics()
Definition: outdev.cxx:393
vcl::text::ComplexTextLayoutFlags mnTextLayoutMode
Definition: outdev.hxx:222
Color maTextColor
Definition: outdev.hxx:230
bool mbNewFont
Definition: outdev.hxx:255
void SetConnectMetaFile(GDIMetaFile *pMtf)
Definition: outdev.cxx:211
virtual void DrawOutDev(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPt, const Size &rSrcSize)
Definition: outdev.cxx:418
SAL_DLLPRIVATE tools::Long ImplLogicWidthToDevicePixel(tools::Long nWidth) const
Convert a logical width to a width in units of device pixels.
Definition: map.cxx:337
virtual sal_uInt16 GetBitCount() const
Definition: outdev.cxx:373
tools::Long mnEmphasisDescent
Definition: outdev.hxx:220
bool mbInitLineColor
Definition: outdev.hxx:249
bool mbTextSpecial
Definition: outdev.hxx:257
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
cairo::SurfaceSharedPtr CreateBitmapSurface(const BitmapSystemData &rData, const Size &rSize) const
Create Surface for given bitmap data.
void SetOutOffYPixel(tools::Long nOutOffY)
Definition: outdev.cxx:388
virtual css::uno::Reference< css::rendering::XCanvas > ImplGetCanvas(bool bSpriteCanvas) const
Definition: outdev.cxx:771
rtl::Reference< LogicalFontInstance > mpFontInstance
Definition: outdev.hxx:187
SAL_DLLPRIVATE void drawOutDevDirect(const OutputDevice &rSrcDev, SalTwoRect &rPosAry)
Definition: outdev.cxx:591
bool mbInitClipRegion
Definition: outdev.hxx:253
void SetRefPoint()
Definition: outdev.cxx:296
LanguageType meTextLanguage
Definition: outdev.hxx:239
RasterOp meRasterOp
Definition: outdev.hxx:233
bool IsRTLEnabled() const
Definition: outdev.hxx:1270
SAL_DLLPRIVATE void ImplDisposeCanvas()
Definition: outdev.cxx:810
std::vector< vcl::State > maOutDevStateStack
Definition: outdev.hxx:189
bool SupportsOperation(OutDevSupportType) const
Query an OutputDevice to see whether it supports a specific operation.
Definition: outdev.cxx:407
css::uno::Any GetSystemGfxDataAny() const
Definition: outdev.cxx:287
bool mbClipRegionSet
Definition: outdev.hxx:254
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:938
AntialiasingFlags mnAntialiasing
Definition: outdev.hxx:238
SAL_DLLPRIVATE void ImplInvalidateViewTransform()
Invalidate the view transformation.
Definition: map.cxx:226
Point maRefPoint
Definition: outdev.hxx:237
void SetRasterOp(RasterOp eRasterOp)
Definition: outdev.cxx:321
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
Definition: outdev.cxx:672
virtual bool HasMirroredGraphics() const
Definition: outdev.cxx:704
cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr &rSurface) const
Create Surface from given cairo surface.
bool mbOutput
Definition: outdev.hxx:244
bool mbTextLines
Definition: outdev.hxx:256
virtual Bitmap GetBitmap(const Point &rSrcPt, const Size &rSize) const
void SetOutOffXPixel(tools::Long nOutOffX)
Definition: outdev.cxx:383
bool IsDeviceOutputNecessary() const
Definition: outdev.hxx:482
virtual void CopyArea(const Point &rDestPt, const Point &rSrcPt, const Size &rSrcSize, bool bWindowInvalidate=false)
Definition: outdev.cxx:535
tools::Long mnOutOffOrigX
Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset)
Definition: outdev.hxx:200
VclPtr< VirtualDevice > mpAlphaVDev
Definition: outdev.hxx:197
sal_Int32 mnDPIScalePercentage
For HiDPI displays, we want to draw elements for a percentage larger.
Definition: outdev.hxx:215
bool mbBackground
Definition: outdev.hxx:243
tools::Long mnOutOffOrigY
Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset)
Definition: outdev.hxx:204
Color maOverlineColor
Definition: outdev.hxx:232
std::unique_ptr< vcl::font::PhysicalFontFaceCollection > mpFontFaceCollection
Definition: outdev.hxx:188
void SetDrawMode(DrawModeFlags nDrawMode)
Definition: outdev.cxx:365
css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr &rSurface, const basegfx::B2ISize &rSize) const
Return native handle for underlying surface.
bool mbEnableRTL
Definition: outdev.hxx:259
std::vector< VCLXGraphics * > * CreateUnoGraphicsList()
Definition: outdev.cxx:399
tools::Long mnTextOffX
font specific text alignment offsets in pixel units
Definition: outdev.hxx:217
std::optional< AllSettings > moSettings
Definition: outdev.hxx:235
css::uno::Reference< css::rendering::XCanvas > GetCanvas() const
request XCanvas render interface
Definition: outdev.cxx:747
tools::Long mnOutOffLogicY
Additional output offset in logical coordinates, applied in PixelToLogic (used by SetPixelOffset/GetP...
Definition: outdev.hxx:206
std::vector< VCLXGraphics * > * mpUnoGraphicsList
Definition: outdev.hxx:191
virtual const OutputDevice * DrawOutDevDirectCheck(const OutputDevice &rSrcDev) const
Definition: outdev.cxx:621
virtual void EnableRTL(bool bEnable=true)
Definition: outdev.cxx:648
bool mbLineColor
Definition: outdev.hxx:247
vcl::ExtOutDevData * mpExtOutDevData
Definition: outdev.hxx:192
virtual tools::Rectangle GetBackgroundComponentBounds() const
Definition: outdev.cxx:641
SAL_DLLPRIVATE tools::Long ImplLogicXToDevicePixel(tools::Long nX) const
Convert a logical X coordinate to a device pixel's X coordinate.
Definition: map.cxx:319
OUString GetRenderBackendName() const
Definition: outdev.cxx:233
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
virtual void CopyDeviceArea(SalTwoRect &aPosAry, bool bWindowInvalidate)
Definition: outdev.cxx:580
tools::Long mnOutHeight
Definition: outdev.hxx:212
BitmapEx GetBitmapEx(const Point &rSrcPt, const Size &rSize) const
Query extended bitmap (with alpha channel, if available).
Definition: bitmapex.cxx:149
virtual bool IsVirtual() const
Definition: outdev.cxx:186
void mirror(tools::Long &nX, const OutputDevice &rOutDev) const
virtual void SetXORMode(bool bSet, bool bInvertOnly)=0
virtual SystemGraphicsData GetGraphicsData() const =0
SalLayoutFlags GetLayout() const
Definition: salgdi.hxx:179
void setAntiAlias(bool bNew)
Definition: salgdi.hxx:83
virtual bool supportsOperation(OutDevSupportType) const =0
void CopyBits(const SalTwoRect &rPosAry, const OutputDevice &rOutDev)
virtual OUString getRenderBackendName() const
virtual sal_uInt16 GetBitCount() const =0
constexpr tools::Long Height() const
constexpr tools::Long Width() const
virtual void ReleaseAllGraphics(OutputDevice *pOutDev)=0
static UnoWrapperBase * GetUnoWrapper(bool bCreateIfNotExists=true)
Get the application's UNO wrapper object.
Definition: svapp.cxx:1592
virtual css::uno::Reference< css::awt::XGraphics > CreateGraphics(OutputDevice *pOutDev)=0
void disposeAndClear()
Definition: vclptr.hxx:200
void clear()
Definition: vclptr.hxx:190
virtual void dispose()
virtual void EnableRTL(bool bEnable=true) override
Definition: virdev.cxx:394
SAL_DLLPRIVATE void ImplFillOpaqueRectangle(const tools::Rectangle &rRect)
Used for alpha VDev, to set areas to opaque.
Definition: virdev.cxx:345
constexpr void SetLeft(tools::Long v)
constexpr void SetRight(tools::Long v)
constexpr tools::Long Right() const
constexpr tools::Long Left() const
Similar to DeleteOnDeinit, the DeleteUnoReferenceOnDeinit template class makes sure that a static UNO...
Definition: lazydelete.hxx:114
css::uno::Reference< I > get()
Definition: lazydelete.hxx:121
void Union(const tools::Rectangle &rRegion)
Definition: region.cxx:507
void GetRegionRectangles(RectangleVector &rTarget) const
Definition: region.cxx:1674
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define DBG_TESTSOLARMUTEX()
DocumentType eType
#define LANGUAGE_SYSTEM
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
def rectangle(l)
std::shared_ptr< Surface > SurfaceSharedPtr
Definition: cairo.hxx:36
std::shared_ptr< cairo_surface_t > CairoSurfaceSharedPtr
Definition: cairo.hxx:34
Reference< XComponentContext > getProcessComponentContext()
long Long
OutDevType
Definition: outdev.hxx:144
uno::Sequence< double > maFillColor
BmpMirrorFlags AdjustTwoRect(SalTwoRect &rTwoRect, const Size &rSizePix)
Definition: rect.cxx:341
std::vector< tools::Rectangle > RectangleVector
Definition: region.hxx:34
tools::Long mnMapScDenomX
Scaling factor - denominator in X direction.
Definition: ImplMapRes.hxx:32
tools::Long mnMapScDenomY
Scaling factor - denominator in Y direction.
Definition: ImplMapRes.hxx:33
tools::Long mnMapScNumY
Scaling factor - numerator in Y direction.
Definition: ImplMapRes.hxx:31
tools::Long mnMapOfsY
Offset in Y direction.
Definition: ImplMapRes.hxx:29
tools::Long mnMapScNumX
Scaling factor - numerator in X direction.
Definition: ImplMapRes.hxx:30
tools::Long mnMapOfsX
Offset in X direction.
Definition: ImplMapRes.hxx:28
tools::Long mnSrcX
Definition: salgtype.hxx:40
tools::Long mnDestWidth
Definition: salgtype.hxx:46
tools::Long mnSrcHeight
Definition: salgtype.hxx:43
tools::Long mnSrcWidth
Definition: salgtype.hxx:42
tools::Long mnDestHeight
Definition: salgtype.hxx:47
sal_uInt32 nSize
Definition: sysdata.hxx:143
signed char sal_Int8
OutDevSupportType
Definition: vclenum.hxx:174