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