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>
29 #include <vcl/toolkit/unowrap.hxx>
30 #include <vcl/svapp.hxx>
31 #include <vcl/sysdata.hxx>
32 
33 #include <salgdi.hxx>
34 #include <window.h>
35 #include <outdev.h>
36 
37 #include <com/sun/star/awt/DeviceCapability.hpp>
38 
39 #ifdef DISABLE_DYNLOADING
40 // Linking all needed LO code into one .so/executable, these already
41 // exist in the tools library, so put them in the anonymous namespace
42 // here to avoid clash...
43 namespace {
44 #endif
45 #ifdef DISABLE_DYNLOADING
46 }
47 #endif
48 
49 // Begin initializer and accessor public functions
50 
52  meOutDevType(eOutDevType),
53  maRegion(true),
55  maTextLineColor( COL_TRANSPARENT ),
56  mxSettings( new AllSettings(Application::GetSettings()) )
57 {
58  mpGraphics = nullptr;
59  mpUnoGraphicsList = nullptr;
60  mpPrevGraphics = nullptr;
61  mpNextGraphics = nullptr;
62  mpMetaFile = nullptr;
63  mpFontInstance = nullptr;
64  mpDeviceFontList = nullptr;
65  mpDeviceFontSizeList = nullptr;
66  mpAlphaVDev = nullptr;
67  mpExtOutDevData = nullptr;
68  mnOutOffX = 0;
69  mnOutOffY = 0;
70  mnOutWidth = 0;
71  mnOutHeight = 0;
72  mnDPIX = 0;
73  mnDPIY = 0;
75  mnTextOffX = 0;
76  mnTextOffY = 0;
77  mnOutOffOrigX = 0;
78  mnOutOffLogicX = 0;
79  mnOutOffOrigY = 0;
80  mnOutOffLogicY = 0;
81  mnEmphasisAscent = 0;
85 
86  if( AllSettings::GetLayoutRTL() ) //#i84553# tip BiDi preference to RTL
88 
90  mbMap = false;
91  mbClipRegion = false;
92  mbBackground = false;
93  mbOutput = true;
94  mbDevOutput = false;
95  mbOutputClipped = false;
100  meTextLanguage = LANGUAGE_SYSTEM; // TODO: get default from configuration?
101  mbLineColor = true;
102  mbFillColor = true;
103  mbInitLineColor = true;
104  mbInitFillColor = true;
105  mbInitFont = true;
106  mbInitTextColor = true;
107  mbInitClipRegion = true;
108  mbClipRegionSet = false;
109  mbNewFont = true;
110  mbTextLines = false;
111  mbTextSpecial = false;
112  mbRefPoint = false;
113  mbEnableRTL = false; // mirroring must be explicitly allowed (typically for windows only)
114 
115  // struct ImplMapRes
116  maMapRes.mnMapOfsX = 0;
117  maMapRes.mnMapOfsY = 0;
118  maMapRes.mnMapScNumX = 1;
119  maMapRes.mnMapScNumY = 1;
122 
123  // struct ImplOutDevData- see #i82615#
124  mpOutDevData.reset(new ImplOutDevData);
125  mpOutDevData->mpRotateDev = nullptr;
126  mpOutDevData->mpRecordLayout = nullptr;
127 
128  // #i75163#
129  mpOutDevData->mpViewTransform = nullptr;
130  mpOutDevData->mpInverseViewTransform = nullptr;
131 }
132 
134 {
135  disposeOnce();
136 }
137 
139 {
140  if ( GetUnoGraphicsList() )
141  {
142  UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper( false );
143  if ( pWrapper )
144  pWrapper->ReleaseAllGraphics( this );
145  delete mpUnoGraphicsList;
146  mpUnoGraphicsList = nullptr;
147  }
148 
149  mpOutDevData->mpRotateDev.disposeAndClear();
150 
151  // #i75163#
153 
154  mpOutDevData.reset();
155 
156  // for some reason, we haven't removed state from the stack properly
157  if ( !maOutDevStateStack.empty() )
158  SAL_WARN( "vcl.gdi", "OutputDevice::~OutputDevice(): OutputDevice::Push() calls != OutputDevice::Pop() calls" );
159  maOutDevStateStack.clear();
160 
161  // release the active font instance
162  mpFontInstance.clear();
163 
164  // remove cached results of GetDevFontList/GetDevSizeList
165  mpDeviceFontList.reset();
166  mpDeviceFontSizeList.reset();
167 
168  // release ImplFontCache specific to this OutputDevice
169  mxFontCache.reset();
170 
171  // release ImplFontList specific to this OutputDevice
172  mxFontCollection.reset();
173 
178 }
179 
181 {
182  return false;
183 }
184 
186 {
188 
189  if (!mpGraphics && !AcquireGraphics())
190  SAL_WARN("vcl.gdi", "No mpGraphics set");
191 
192  return mpGraphics;
193 }
194 
196 {
198 
199  if (!mpGraphics && !AcquireGraphics())
200  SAL_WARN("vcl.gdi", "No mpGraphics set");
201 
202  return mpGraphics;
203 }
204 
206 {
207  mpMetaFile = pMtf;
208 }
209 
210 void OutputDevice::SetSettings( const AllSettings& rSettings )
211 {
212  *mxSettings = rSettings;
213 
214  if( mpAlphaVDev )
215  mpAlphaVDev->SetSettings( rSettings );
216 }
217 
219 {
220  if (!mpGraphics && !AcquireGraphics())
221  return SystemGraphicsData();
222 
223  return mpGraphics->GetGraphicsData();
224 }
225 
226 #if ENABLE_CAIRO_CANVAS
227 
228 bool OutputDevice::SupportsCairo() const
229 {
230  if (!mpGraphics && !AcquireGraphics())
231  return false;
232 
233  return mpGraphics->SupportsCairo();
234 }
235 
237 {
238  if (!mpGraphics && !AcquireGraphics())
239  return cairo::SurfaceSharedPtr();
240  return mpGraphics->CreateSurface(rSurface);
241 }
242 
243 cairo::SurfaceSharedPtr OutputDevice::CreateSurface(int x, int y, int width, int height) const
244 {
245  if (!mpGraphics && !AcquireGraphics())
246  return cairo::SurfaceSharedPtr();
247  return mpGraphics->CreateSurface(*this, x, y, width, height);
248 }
249 
251 {
252  if (!mpGraphics && !AcquireGraphics())
253  return cairo::SurfaceSharedPtr();
254  return mpGraphics->CreateBitmapSurface(*this, rData, rSize);
255 }
256 
257 css::uno::Any OutputDevice::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const
258 {
259  if (!mpGraphics && !AcquireGraphics())
260  return css::uno::Any();
261  return mpGraphics->GetNativeSurfaceHandle(rSurface, rSize);
262 }
263 
264 #endif // ENABLE_CAIRO_CANVAS
265 
267 {
268  const SystemGraphicsData aSysData = GetSystemGfxData();
269  css::uno::Sequence< sal_Int8 > aSeq( reinterpret_cast<sal_Int8 const *>(&aSysData),
270  aSysData.nSize );
271 
272  return css::uno::makeAny(aSeq);
273 }
274 
276 {
277 
278  if ( mpMetaFile )
279  mpMetaFile->AddAction( new MetaRefPointAction( Point(), false ) );
280 
281  mbRefPoint = false;
282  maRefPoint.setX(0);
283  maRefPoint.setY(0);
284 
285  if( mpAlphaVDev )
287 }
288 
289 void OutputDevice::SetRefPoint( const Point& rRefPoint )
290 {
291 
292  if ( mpMetaFile )
293  mpMetaFile->AddAction( new MetaRefPointAction( rRefPoint, true ) );
294 
295  mbRefPoint = true;
296  maRefPoint = rRefPoint;
297 
298  if( mpAlphaVDev )
299  mpAlphaVDev->SetRefPoint( rRefPoint );
300 }
301 
302 sal_uInt16 OutputDevice::GetBitCount() const
303 {
304  // we need a graphics instance
305  if ( !mpGraphics && !AcquireGraphics() )
306  return 0;
307 
308  return mpGraphics->GetBitCount();
309 }
310 
312 {
313  mnOutOffX = nOutOffX;
314 }
315 
317 {
318  mnOutOffY = nOutOffY;
319 }
320 
321 css::uno::Reference< css::awt::XGraphics > OutputDevice::CreateUnoGraphics()
322 {
323  UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper();
324  return pWrapper ? pWrapper->CreateGraphics( this ) : css::uno::Reference< css::awt::XGraphics >();
325 }
326 
327 std::vector< VCLXGraphics* > *OutputDevice::CreateUnoGraphicsList()
328 {
329  mpUnoGraphicsList = new std::vector< VCLXGraphics* >;
330  return mpUnoGraphicsList;
331 }
332 
333 // Helper public function
334 
336 {
337  if( !mpGraphics && !AcquireGraphics() )
338  return false;
339  const bool bHasSupport = mpGraphics->supportsOperation( eType );
340  return bHasSupport;
341 }
342 
343 // Direct OutputDevice drawing public functions
344 
345 void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
346  const Point& rSrcPt, const Size& rSrcSize )
347 {
348  if( ImplIsRecordLayout() )
349  return;
350 
351  if ( RasterOp::Invert == meRasterOp )
352  {
353  DrawRect( tools::Rectangle( rDestPt, rDestSize ) );
354  return;
355  }
356 
357  if ( mpMetaFile )
358  {
359  const Bitmap aBmp( GetBitmap( rSrcPt, rSrcSize ) );
360  mpMetaFile->AddAction( new MetaBmpScaleAction( rDestPt, rDestSize, aBmp ) );
361  }
362 
363  if ( !IsDeviceOutputNecessary() )
364  return;
365 
366  if ( !mpGraphics && !AcquireGraphics() )
367  return;
368 
369  if ( mbInitClipRegion )
370  InitClipRegion();
371 
372  if ( mbOutputClipped )
373  return;
374 
375  tools::Long nSrcWidth = ImplLogicWidthToDevicePixel( rSrcSize.Width() );
376  tools::Long nSrcHeight = ImplLogicHeightToDevicePixel( rSrcSize.Height() );
377  tools::Long nDestWidth = ImplLogicWidthToDevicePixel( rDestSize.Width() );
378  tools::Long nDestHeight = ImplLogicHeightToDevicePixel( rDestSize.Height() );
379 
380  if (nSrcWidth && nSrcHeight && nDestWidth && nDestHeight)
381  {
382  SalTwoRect aPosAry(ImplLogicXToDevicePixel(rSrcPt.X()), ImplLogicYToDevicePixel(rSrcPt.Y()),
383  nSrcWidth, nSrcHeight,
384  ImplLogicXToDevicePixel(rDestPt.X()), ImplLogicYToDevicePixel(rDestPt.Y()),
385  nDestWidth, nDestHeight);
386 
387  const tools::Rectangle aSrcOutRect( Point( mnOutOffX, mnOutOffY ),
389 
390  AdjustTwoRect( aPosAry, aSrcOutRect );
391 
392  if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
393  mpGraphics->CopyBits(aPosAry, *this);
394  }
395 
396  if( mpAlphaVDev )
397  mpAlphaVDev->DrawOutDev( rDestPt, rDestSize, rSrcPt, rSrcSize );
398 }
399 
400 void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
401  const Point& rSrcPt, const Size& rSrcSize,
402  const OutputDevice& rOutDev )
403 {
404  if ( ImplIsRecordLayout() )
405  return;
406 
407  if ( RasterOp::Invert == meRasterOp )
408  {
409  DrawRect( tools::Rectangle( rDestPt, rDestSize ) );
410  return;
411  }
412 
413  if ( mpMetaFile )
414  {
415  if (rOutDev.mpAlphaVDev)
416  {
417  const BitmapEx aBmpEx(rOutDev.GetBitmapEx(rSrcPt, rSrcSize));
418  mpMetaFile->AddAction(new MetaBmpExScaleAction(rDestPt, rDestSize, aBmpEx));
419  }
420  else
421  {
422  const Bitmap aBmp(rOutDev.GetBitmap(rSrcPt, rSrcSize));
423  mpMetaFile->AddAction(new MetaBmpScaleAction(rDestPt, rDestSize, aBmp));
424  }
425  }
426 
427  if ( !IsDeviceOutputNecessary() )
428  return;
429 
430  if ( !mpGraphics && !AcquireGraphics() )
431  return;
432 
433  if ( mbInitClipRegion )
434  InitClipRegion();
435 
436  if ( mbOutputClipped )
437  return;
438 
439  if (rOutDev.mpAlphaVDev)
440  {
441  // alpha-blend source over destination
442  DrawBitmapEx(rDestPt, rDestSize, rOutDev.GetBitmapEx(rSrcPt, rSrcSize));
443  }
444  else
445  {
446  SalTwoRect aPosAry(rOutDev.ImplLogicXToDevicePixel(rSrcPt.X()),
447  rOutDev.ImplLogicYToDevicePixel(rSrcPt.Y()),
448  rOutDev.ImplLogicWidthToDevicePixel(rSrcSize.Width()),
449  rOutDev.ImplLogicHeightToDevicePixel(rSrcSize.Height()),
450  ImplLogicXToDevicePixel(rDestPt.X()),
451  ImplLogicYToDevicePixel(rDestPt.Y()),
452  ImplLogicWidthToDevicePixel(rDestSize.Width()),
453  ImplLogicHeightToDevicePixel(rDestSize.Height()));
454 
455  drawOutDevDirect(rOutDev, aPosAry);
456 
457  // #i32109#: make destination rectangle opaque - source has no alpha
458  if (mpAlphaVDev)
460  }
461 }
462 
463 void OutputDevice::CopyArea( const Point& rDestPt,
464  const Point& rSrcPt, const Size& rSrcSize,
465  bool bWindowInvalidate )
466 {
467  if ( ImplIsRecordLayout() )
468  return;
469 
470  RasterOp eOldRop = GetRasterOp();
472 
473  if ( !IsDeviceOutputNecessary() )
474  return;
475 
476  if ( !mpGraphics && !AcquireGraphics() )
477  return;
478 
479  if ( mbInitClipRegion )
480  InitClipRegion();
481 
482  if ( mbOutputClipped )
483  return;
484 
485  tools::Long nSrcWidth = ImplLogicWidthToDevicePixel( rSrcSize.Width() );
486  tools::Long nSrcHeight = ImplLogicHeightToDevicePixel( rSrcSize.Height() );
487  if (nSrcWidth && nSrcHeight)
488  {
489  SalTwoRect aPosAry(ImplLogicXToDevicePixel(rSrcPt.X()), ImplLogicYToDevicePixel(rSrcPt.Y()),
490  nSrcWidth, nSrcHeight,
491  ImplLogicXToDevicePixel(rDestPt.X()), ImplLogicYToDevicePixel(rDestPt.Y()),
492  nSrcWidth, nSrcHeight);
493 
494  const tools::Rectangle aSrcOutRect( Point( mnOutOffX, mnOutOffY ),
496 
497  AdjustTwoRect( aPosAry, aSrcOutRect );
498 
499  CopyDeviceArea( aPosAry, bWindowInvalidate );
500  }
501 
502  SetRasterOp( eOldRop );
503 
504  if( mpAlphaVDev )
505  mpAlphaVDev->CopyArea( rDestPt, rSrcPt, rSrcSize, bWindowInvalidate );
506 }
507 
508 // Direct OutputDevice drawing protected function
509 
510 void OutputDevice::CopyDeviceArea( SalTwoRect& aPosAry, bool /*bWindowInvalidate*/)
511 {
512  if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0)
513  return;
514 
515  aPosAry.mnDestWidth = aPosAry.mnSrcWidth;
516  aPosAry.mnDestHeight = aPosAry.mnSrcHeight;
517  mpGraphics->CopyBits(aPosAry, *this);
518 }
519 
520 // Direct OutputDevice drawing private function
522 {
523  SalGraphics* pSrcGraphics;
524  if (const OutputDevice* pCheckedSrc = DrawOutDevDirectCheck(rSrcDev))
525  {
526  if (!pCheckedSrc->mpGraphics && !pCheckedSrc->AcquireGraphics())
527  return;
528  pSrcGraphics = pCheckedSrc->mpGraphics;
529  }
530  else
531  pSrcGraphics = nullptr;
532 
533  if (!mpGraphics && !AcquireGraphics())
534  return;
535 
536  // #102532# Offset only has to be pseudo window offset
537  const tools::Rectangle aSrcOutRect(Point(rSrcDev.mnOutOffX, rSrcDev.mnOutOffY),
538  Size(rSrcDev.mnOutWidth, rSrcDev.mnOutHeight));
539 
540  AdjustTwoRect( rPosAry, aSrcOutRect );
541 
542  if ( rPosAry.mnSrcWidth && rPosAry.mnSrcHeight && rPosAry.mnDestWidth && rPosAry.mnDestHeight )
543  {
544  // if this is no window, but rSrcDev is a window
545  // mirroring may be required
546  // because only windows have a SalGraphicsLayout
547  // mirroring is performed here
548  DrawOutDevDirectProcess(rSrcDev, rPosAry, pSrcGraphics);
549  }
550 }
551 
553 {
554  return this == &rSrcDev ? nullptr : &rSrcDev;
555 }
556 
557 void OutputDevice::DrawOutDevDirectProcess(const OutputDevice& rSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics)
558 {
559  if( pSrcGraphics && (pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl) )
560  {
561  SalTwoRect aPosAry2 = rPosAry;
562  pSrcGraphics->mirror( aPosAry2.mnSrcX, aPosAry2.mnSrcWidth, rSrcDev );
563  mpGraphics->CopyBits( aPosAry2, *pSrcGraphics, *this, rSrcDev );
564  return;
565  }
566  if (pSrcGraphics)
567  mpGraphics->CopyBits( rPosAry, *pSrcGraphics, *this, rSrcDev );
568  else
569  mpGraphics->CopyBits( rPosAry, *this );
570 }
571 
573 {
574  return tools::Rectangle( Point( 0, 0 ), GetOutputSizePixel() );
575 }
576 
577 // Layout public functions
578 
579 void OutputDevice::EnableRTL( bool bEnable )
580 {
581  mbEnableRTL = bEnable;
582 
583  if( mpAlphaVDev )
584  mpAlphaVDev->EnableRTL( bEnable );
585 }
586 
588 {
589  bool bRet = false;
590  if( AcquireGraphics() )
591  {
594  {
595  bRet = true;
596  }
597  }
598  return bRet;
599 }
600 
601 // note: the coordinates to be remirrored are in frame coordinates !
602 
603 void OutputDevice::ReMirror( Point &rPoint ) const
604 {
605  rPoint.setX( mnOutOffX + mnOutWidth - 1 - rPoint.X() + mnOutOffX );
606 }
608 {
609  tools::Long nWidth = rRect.Right() - rRect.Left();
610 
611  //long lc_x = rRect.nLeft - mnOutOffX; // normalize
612  //lc_x = mnOutWidth - nWidth - 1 - lc_x; // mirror
613  //rRect.nLeft = lc_x + mnOutOffX; // re-normalize
614 
615  rRect.SetLeft( mnOutOffX + mnOutWidth - nWidth - 1 - rRect.Left() + mnOutOffX );
616  rRect.SetRight( rRect.Left() + nWidth );
617 }
618 
619 void OutputDevice::ReMirror( vcl::Region &rRegion ) const
620 {
621  RectangleVector aRectangles;
622  rRegion.GetRegionRectangles(aRectangles);
623  vcl::Region aMirroredRegion;
624 
625  for (auto & rectangle : aRectangles)
626  {
628  aMirroredRegion.Union(rectangle);
629  }
630 
631  rRegion = aMirroredRegion;
632 
633 }
634 
636 {
638 }
639 
641 {
642  if (!mpOutDevData)
643  return false;
644 
645  return mpOutDevData->mpRecordLayout;
646 }
647 
648 // EPS public function
649 
650 bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
651  const GfxLink& rGfxLink, GDIMetaFile* pSubst )
652 {
653  bool bDrawn(true);
654 
655  if ( mpMetaFile )
656  {
657  GDIMetaFile aSubst;
658 
659  if( pSubst )
660  aSubst = *pSubst;
661 
662  mpMetaFile->AddAction( new MetaEPSAction( rPoint, rSize, rGfxLink, aSubst ) );
663  }
664 
666  return bDrawn;
667 
668  if( mbOutputClipped )
669  return bDrawn;
670 
671  tools::Rectangle aRect( ImplLogicToDevicePixel( tools::Rectangle( rPoint, rSize ) ) );
672 
673  if( !aRect.IsEmpty() )
674  {
675  // draw the real EPS graphics
676  if( rGfxLink.GetData() && rGfxLink.GetDataSize() )
677  {
678  if( !mpGraphics && !AcquireGraphics() )
679  return bDrawn;
680 
681  if( mbInitClipRegion )
682  InitClipRegion();
683 
684  aRect.Justify();
685  bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
686  const_cast<sal_uInt8*>(rGfxLink.GetData()), rGfxLink.GetDataSize(), *this );
687  }
688 
689  // else draw the substitution graphics
690  if( !bDrawn && pSubst )
691  {
692  GDIMetaFile* pOldMetaFile = mpMetaFile;
693 
694  mpMetaFile = nullptr;
695  Graphic( *pSubst ).Draw( this, rPoint, rSize );
696  mpMetaFile = pOldMetaFile;
697  }
698  }
699 
700  if( mpAlphaVDev )
701  mpAlphaVDev->DrawEPS( rPoint, rSize, rGfxLink, pSubst );
702 
703  return bDrawn;
704 }
705 
706 css::awt::DeviceInfo OutputDevice::GetCommonDeviceInfo(Size const& rDevSz) const
707 {
708  css::awt::DeviceInfo aInfo;
709 
710  aInfo.Width = rDevSz.Width();
711  aInfo.Height = rDevSz.Height();
712 
713  Size aTmpSz = LogicToPixel(Size(1000, 1000), MapMode(MapUnit::MapCM));
714  aInfo.PixelPerMeterX = aTmpSz.Width() / 10;
715  aInfo.PixelPerMeterY = aTmpSz.Height() / 10;
716  aInfo.BitsPerPixel = GetBitCount();
717 
718  aInfo.Capabilities = css::awt::DeviceCapability::RASTEROPERATIONS |
719  css::awt::DeviceCapability::GETBITS;
720 
721  return aInfo;
722 }
723 
724 css::awt::DeviceInfo OutputDevice::GetDeviceInfo() const
725 {
726  css::awt::DeviceInfo aInfo = GetCommonDeviceInfo(GetOutputSizePixel());
727 
728  aInfo.LeftInset = 0;
729  aInfo.TopInset = 0;
730  aInfo.RightInset = 0;
731  aInfo.BottomInset = 0;
732 
733  return aInfo;
734 }
735 
736 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 mnDPIScalePercentage
For HiDPI displays, we want to draw elements for a percentage larger.
Definition: outdev.hxx:348
VclPtr< OutputDevice > mpNextGraphics
Next output device in list.
Definition: outdev.hxx:317
tools::Long mnTextOffX
font specific text alignment offsets in pixel units
Definition: outdev.hxx:350
tools::Long mnOutOffLogicX
Additional output offset in logical coordinates, applied in PixelToLogic (used by SetPixelOffset/GetP...
Definition: outdev.hxx:335
SAL_DLLPRIVATE bool ImplIsRecordLayout() const
Definition: outdev.cxx:640
tools::Long mnOutOffOrigY
Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset) ...
Definition: outdev.hxx:337
OutputDevice(const OutputDevice &)=delete
bool mbOutput
Definition: outdev.hxx:377
virtual bool IsVirtual() const
Definition: outdev.cxx:180
Color maTextColor
Definition: outdev.hxx:363
bool SupportsCairo() const
virtual ~OutputDevice() override
Definition: outdev.cxx:133
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual bool supportsOperation(OutDevSupportType) const =0
void Union(const tools::Rectangle &rRegion)
Definition: region.cxx:508
bool mbTextSpecial
Definition: outdev.hxx:390
DrawModeFlags mnDrawMode
Definition: outdev.hxx:354
long Long
void disposeAndClear()
Definition: vclptr.hxx:200
BmpMirrorFlags AdjustTwoRect(SalTwoRect &rTwoRect, const Size &rSizePix)
Definition: rect.cxx:336
bool mbOutputClipped
Definition: outdev.hxx:379
void CopyBits(const SalTwoRect &rPosAry, const OutputDevice &rOutDev)
tools::Long mnOutOffY
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
Definition: outdev.hxx:343
cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr &rSurface) const
Create Surface from given cairo surface.
std::shared_ptr< PhysicalFontCollection > mxFontCollection
Definition: outdev.hxx:321
sal_Int32 mnDPIY
Definition: outdev.hxx:347
tools::Long mnSrcHeight
Definition: salgtype.hxx:44
tools::Long GetWidth() const
std::vector< VCLXGraphics * > * mpUnoGraphicsList
Definition: outdev.hxx:326
std::unique_ptr< ImplDeviceFontSizeList > mpDeviceFontSizeList
Definition: outdev.hxx:323
tools::Long mnSrcWidth
Definition: salgtype.hxx:43
cairo::SurfaceSharedPtr CreateBitmapSurface(const BitmapSystemData &rData, const Size &rSize) const
Create Surface for given bitmap data.
sal_Int32 mnDPIX
Definition: outdev.hxx:346
virtual void SetSettings(const AllSettings &rSettings)
Definition: outdev.cxx:210
bool SupportsOperation(OutDevSupportType) const
Query an OutputDevice to see whether it supports a specific operation.
Definition: outdev.cxx:335
bool mbMap
Definition: outdev.hxx:374
std::vector< VCLXGraphics * > * CreateUnoGraphicsList()
Definition: outdev.cxx:327
virtual void DrawOutDevDirectProcess(const OutputDevice &rSrcDev, SalTwoRect &rPosAry, SalGraphics *pSrcGraphics)
Definition: outdev.cxx:557
tools::Long mnMapScDenomX
Definition: outdevmap.hxx:29
bool mbEnableRTL
Definition: outdev.hxx:392
tools::Long mnEmphasisDescent
Definition: outdev.hxx:353
void SetRight(tools::Long v)
tools::Long mnOutOffOrigX
Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset) ...
Definition: outdev.hxx:333
OutDevSupportType
Definition: vclenum.hxx:198
bool DrawEPS(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void *pPtr, sal_uInt32 nSize, const OutputDevice &rOutDev)
tools::Long mnDestWidth
Definition: salgtype.hxx:47
std::vector< tools::Rectangle > RectangleVector
Definition: region.hxx:37
bool IsEmpty() const
constexpr::Color COL_TRANSPARENT(0xFF, 0xFF, 0xFF, 0xFF)
Color maOverlineColor
Definition: outdev.hxx:365
void SetOutOffYPixel(tools::Long nOutOffY)
Definition: outdev.cxx:316
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
Definition: outdev.cxx:603
tools::Long Left() const
SAL_DLLPRIVATE tools::Long ImplLogicXToDevicePixel(tools::Long nX) const
Convert a logical X coordinate to a device pixel's X coordinate.
Definition: map.cxx:326
void SetLeft(tools::Long v)
sal_uInt32 nSize
Definition: sysdata.hxx:128
RasterOp
Definition: vclenum.hxx:194
OutDevViewType meOutDevViewType
Definition: outdev.hxx:358
AntialiasingFlags mnAntialiasing
Definition: outdev.hxx:371
bool mbBackground
Definition: outdev.hxx:376
virtual Bitmap GetBitmap(const Point &rSrcPt, const Size &rSize) const
tools::Long mnMapScDenomY
Definition: outdevmap.hxx:30
virtual void EnableRTL(bool bEnable=true)
Definition: outdev.cxx:579
bool mbClipRegionSet
Definition: outdev.hxx:387
SystemGraphicsData GetSystemGfxData() const
Definition: outdev.cxx:218
virtual void CopyDeviceArea(SalTwoRect &aPosAry, bool bWindowInvalidate)
Definition: outdev.cxx:510
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:51
std::unique_ptr< AllSettings > mxSettings
Definition: outdev.hxx:368
SalGraphics * mpGraphics
Graphics context to draw on.
Definition: outdev.hxx:315
std::shared_ptr< Surface > SurfaceSharedPtr
Definition: cairo.hxx:36
std::vector< OutDevState > maOutDevStateStack
Definition: outdev.hxx:324
virtual void CopyArea(const Point &rDestPt, const Point &rSrcPt, const Size &rSrcSize, bool bWindowInvalidate=false)
Definition: outdev.cxx:463
SAL_DLLPRIVATE void ImplInvalidateViewTransform()
Invalidate the view transformation.
Definition: map.cxx:254
tools::Long mnDestHeight
Definition: salgtype.hxx:48
void SetRefPoint()
Definition: outdev.cxx:275
void clear()
Definition: vclptr.hxx:190
void SetConnectMetaFile(GDIMetaFile *pMtf)
Definition: outdev.cxx:205
bool IsRTLEnabled() const
Definition: outdev.hxx:1360
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
Definition: graph.cxx:422
virtual tools::Rectangle GetBackgroundComponentBounds() const
Definition: outdev.cxx:572
css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr &rSurface, const basegfx::B2ISize &rSize) const
Return native handle for underlying surface.
OutDevType
Definition: outdev.hxx:277
virtual void dispose() override
Definition: outdev.cxx:138
#define LANGUAGE_SYSTEM
virtual const OutputDevice * DrawOutDevDirectCheck(const OutputDevice &rSrcDev) const
Definition: outdev.cxx:552
virtual bool AcquireGraphics() const =0
Acquire a graphics device that the output device uses to draw on.
std::unique_ptr< ImplDeviceFontList > mpDeviceFontList
Definition: outdev.hxx:322
virtual void EnableRTL(bool bEnable=true) override
Definition: virdev.cxx:395
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
Definition: outdev.cxx:587
virtual bool HasMirroredGraphics() const
Definition: outdev.cxx:635
bool mbInitLineColor
Definition: outdev.hxx:382
tools::Long mnOutHeight
Definition: outdev.hxx:345
tools::Long Width() const
bool mbNewFont
Definition: outdev.hxx:388
SAL_DLLPRIVATE void drawOutDevDirect(const OutputDevice &rSrcDev, SalTwoRect &rPosAry)
Definition: outdev.cxx:521
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:303
SAL_DLLPRIVATE tools::Long ImplLogicWidthToDevicePixel(tools::Long nWidth) const
Convert a logical width to a width in units of device pixels.
Definition: map.cxx:344
SAL_DLLPRIVATE void ImplFillOpaqueRectangle(const tools::Rectangle &rRect)
Used for alpha VDev, to set areas to opaque.
Definition: virdev.cxx:348
bool mbTextLines
Definition: outdev.hxx:389
static bool GetLayoutRTL()
bool mbLineColor
Definition: outdev.hxx:380
std::shared_ptr< cairo_surface_t > CairoSurfaceSharedPtr
Definition: cairo.hxx:34
tools::Long mnMapOfsX
Definition: outdevmap.hxx:25
RasterOp meRasterOp
Definition: outdev.hxx:366
Size GetOutputSizePixel() const
Definition: outdev.hxx:441
bool mbInitTextColor
Definition: outdev.hxx:385
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:232
css::uno::Any GetSystemGfxDataAny() const
Definition: outdev.cxx:266
virtual SystemGraphicsData GetGraphicsData() const =0
void mirror(tools::Long &nX, const OutputDevice &rOutDev) const
virtual sal_uInt16 GetBitCount() const
Definition: outdev.cxx:302
tools::Long Top() const
tools::Long mnMapOfsY
Definition: outdevmap.hxx:26
tools::Long mnEmphasisAscent
Definition: outdev.hxx:352
tools::Long mnSrcX
Definition: salgtype.hxx:41
bool mbRefPoint
Definition: outdev.hxx:391
virtual void dispose()
std::vector< VCLXGraphics * > * GetUnoGraphicsList() const
Definition: outdev.hxx:455
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:828
uno::Sequence< double > maFillColor
VclPtr< OutputDevice > mpPrevGraphics
Previous output device in list.
Definition: outdev.hxx:316
virtual sal_uInt16 GetBitCount() const =0
bool mbFillColor
Definition: outdev.hxx:381
VclPtr< VirtualDevice > mpAlphaVDev
Definition: outdev.hxx:330
def rectangle(l)
ImplMapRes maMapRes
Definition: outdev.hxx:356
bool mbClipRegion
Definition: outdev.hxx:375
tools::Long mnMapScNumY
Definition: outdevmap.hxx:28
css::awt::DeviceInfo GetCommonDeviceInfo(Size const &aDevSize) const
Definition: outdev.cxx:706
unsigned char sal_uInt8
SalLayoutFlags GetLayout() const
Definition: salgdi.hxx:199
void AddAction(const rtl::Reference< MetaAction > &pAction)
Definition: gdimtf.cxx:564
tools::Long mnMapScNumX
Definition: outdevmap.hxx:27
bool mbInitClipRegion
Definition: outdev.hxx:386
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
void GetRegionRectangles(RectangleVector &rTarget) const
Definition: region.cxx:1659
void SetRasterOp(RasterOp eRasterOp)
void SetOutOffXPixel(tools::Long nOutOffX)
Definition: outdev.cxx:311
bool DrawEPS(const Point &rPt, const Size &rSz, const GfxLink &rGfxLink, GDIMetaFile *pSubst=nullptr)
Definition: outdev.cxx:650
SalGraphics const * GetGraphics() const
Get the graphic context that the output device uses to draw on.
Definition: outdev.cxx:195
tools::Long Height() const
css::uno::Reference< css::awt::XGraphics > CreateUnoGraphics()
Definition: outdev.cxx:321
virtual void InitClipRegion()
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
Sequence< sal_Int8 > aSeq
bool mbInitFont
Definition: outdev.hxx:384
RasterOp GetRasterOp() const
Definition: outdev.hxx:616
virtual void DrawOutDev(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPt, const Size &rSrcSize)
Definition: outdev.cxx:345
rtl::Reference< LogicalFontInstance > mpFontInstance
Definition: outdev.hxx:319
bool mbInitFillColor
Definition: outdev.hxx:383
tools::Long mnOutWidth
Definition: outdev.hxx:344
SAL_DLLPRIVATE tools::Rectangle ImplLogicToDevicePixel(const tools::Rectangle &rLogicRect) const
Convert a logical rectangle to a rectangle in physical device pixel units.
Definition: map.cxx:406
tools::Long GetHeight() const
ComplexTextLayoutFlags mnTextLayoutMode
Definition: outdev.hxx:355
bool mbDevOutput
Definition: outdev.hxx:378
BitmapEx GetBitmapEx(const Point &rSrcPt, const Size &rSize) const
Query extended bitmap (with alpha channel, if available).
std::shared_ptr< ImplFontCache > mxFontCache
Definition: outdev.hxx:320
tools::Long mnOutOffX
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
Definition: outdev.hxx:341
#define SAL_WARN(area, stream)
std::unique_ptr< ImplOutDevData > mpOutDevData
Definition: outdev.hxx:325
SAL_DLLPRIVATE tools::Long ImplLogicYToDevicePixel(tools::Long nY) const
Convert a logical Y coordinate to a device pixel's Y coordinate.
Definition: map.cxx:335
vcl::ExtOutDevData * mpExtOutDevData
Definition: outdev.hxx:327
#define DBG_TESTSOLARMUTEX()
tools::Long mnOutOffLogicY
Additional output offset in logical coordinates, applied in PixelToLogic (used by SetPixelOffset/GetP...
Definition: outdev.hxx:339
bool IsDeviceOutputNecessary() const
Definition: outdev.hxx:601
Point maRefPoint
Definition: outdev.hxx:370
SAL_DLLPRIVATE tools::Long ImplLogicHeightToDevicePixel(tools::Long nHeight) const
Convert a logical height to a height in units of device pixels.
Definition: map.cxx:352
tools::Long mnTextOffY
Definition: outdev.hxx:351
virtual css::awt::DeviceInfo GetDeviceInfo() const
Definition: outdev.cxx:724
tools::Long Right() const
GDIMetaFile * mpMetaFile
Definition: outdev.hxx:318
LanguageType meTextLanguage
Definition: outdev.hxx:372