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 {
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  const Bitmap aBmp( rOutDev.GetBitmap( rSrcPt, rSrcSize ) );
419  mpMetaFile->AddAction( new MetaBmpScaleAction( rDestPt, rDestSize, aBmp ) );
420  }
421 
422  if ( !IsDeviceOutputNecessary() )
423  return;
424 
425  if ( !mpGraphics && !AcquireGraphics() )
426  return;
427 
428  if ( mbInitClipRegion )
429  InitClipRegion();
430 
431  if ( mbOutputClipped )
432  return;
433 
434  SalTwoRect aPosAry(rOutDev.ImplLogicXToDevicePixel(rSrcPt.X()),
435  rOutDev.ImplLogicYToDevicePixel(rSrcPt.Y()),
436  rOutDev.ImplLogicWidthToDevicePixel(rSrcSize.Width()),
437  rOutDev.ImplLogicHeightToDevicePixel(rSrcSize.Height()),
438  ImplLogicXToDevicePixel(rDestPt.X()),
439  ImplLogicYToDevicePixel(rDestPt.Y()),
440  ImplLogicWidthToDevicePixel(rDestSize.Width()),
441  ImplLogicHeightToDevicePixel(rDestSize.Height()));
442 
443  if( mpAlphaVDev )
444  {
445  if( rOutDev.mpAlphaVDev )
446  {
447  // alpha-blend source over destination
448  DrawBitmapEx( rDestPt, rDestSize, rOutDev.GetBitmapEx(rSrcPt, rSrcSize) );
449  }
450  else
451  {
452  drawOutDevDirect( &rOutDev, aPosAry );
453 
454  // #i32109#: make destination rectangle opaque - source has no alpha
455  mpAlphaVDev->ImplFillOpaqueRectangle( tools::Rectangle(rDestPt, rDestSize) );
456  }
457  }
458  else
459  {
460  if( rOutDev.mpAlphaVDev )
461  {
462  // alpha-blend source over destination
463  DrawBitmapEx( rDestPt, rDestSize, rOutDev.GetBitmapEx(rSrcPt, rSrcSize) );
464  }
465  else
466  {
467  // no alpha at all, neither in source nor destination device
468  drawOutDevDirect( &rOutDev, aPosAry );
469  }
470  }
471 }
472 
473 void OutputDevice::CopyArea( const Point& rDestPt,
474  const Point& rSrcPt, const Size& rSrcSize,
475  bool bWindowInvalidate )
476 {
477  if ( ImplIsRecordLayout() )
478  return;
479 
480  RasterOp eOldRop = GetRasterOp();
482 
483  if ( !IsDeviceOutputNecessary() )
484  return;
485 
486  if ( !mpGraphics && !AcquireGraphics() )
487  return;
488 
489  if ( mbInitClipRegion )
490  InitClipRegion();
491 
492  if ( mbOutputClipped )
493  return;
494 
495  long nSrcWidth = ImplLogicWidthToDevicePixel( rSrcSize.Width() );
496  long nSrcHeight = ImplLogicHeightToDevicePixel( rSrcSize.Height() );
497  if (nSrcWidth && nSrcHeight)
498  {
499  SalTwoRect aPosAry(ImplLogicXToDevicePixel(rSrcPt.X()), ImplLogicYToDevicePixel(rSrcPt.Y()),
500  nSrcWidth, nSrcHeight,
501  ImplLogicXToDevicePixel(rDestPt.X()), ImplLogicYToDevicePixel(rDestPt.Y()),
502  nSrcWidth, nSrcHeight);
503 
504  const tools::Rectangle aSrcOutRect( Point( mnOutOffX, mnOutOffY ),
506 
507  AdjustTwoRect( aPosAry, aSrcOutRect );
508 
509  CopyDeviceArea( aPosAry, bWindowInvalidate );
510  }
511 
512  SetRasterOp( eOldRop );
513 
514  if( mpAlphaVDev )
515  mpAlphaVDev->CopyArea( rDestPt, rSrcPt, rSrcSize, bWindowInvalidate );
516 }
517 
518 // Direct OutputDevice drawing protected function
519 
520 void OutputDevice::CopyDeviceArea( SalTwoRect& aPosAry, bool /*bWindowInvalidate*/)
521 {
522  if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0)
523  return;
524 
525  aPosAry.mnDestWidth = aPosAry.mnSrcWidth;
526  aPosAry.mnDestHeight = aPosAry.mnSrcHeight;
527  mpGraphics->CopyBits(aPosAry, nullptr, this, nullptr);
528 }
529 
530 // Direct OutputDevice drawing private function
531 
533 {
534  SalGraphics* pSrcGraphics;
535 
536  if ( this == pSrcDev )
537  pSrcGraphics = nullptr;
538  else
539  {
540  if ( (GetOutDevType() != pSrcDev->GetOutDevType()) ||
542  {
543  if ( !pSrcDev->mpGraphics )
544  {
545  if ( !pSrcDev->AcquireGraphics() )
546  return;
547  }
548  pSrcGraphics = pSrcDev->mpGraphics;
549  }
550  else
551  {
552  if ( static_cast<vcl::Window*>(this)->mpWindowImpl->mpFrameWindow == static_cast<const vcl::Window*>(pSrcDev)->mpWindowImpl->mpFrameWindow )
553  pSrcGraphics = nullptr;
554  else
555  {
556  if ( !pSrcDev->mpGraphics )
557  {
558  if ( !pSrcDev->AcquireGraphics() )
559  return;
560  }
561  pSrcGraphics = pSrcDev->mpGraphics;
562 
563  if ( !mpGraphics && !AcquireGraphics() )
564  return;
565  SAL_WARN_IF( !mpGraphics || !pSrcDev->mpGraphics, "vcl.gdi",
566  "OutputDevice::DrawOutDev(): We need more than one Graphics" );
567  }
568  }
569  }
570 
571  // #102532# Offset only has to be pseudo window offset
572  const tools::Rectangle aSrcOutRect( Point( pSrcDev->mnOutOffX, pSrcDev->mnOutOffY ),
573  Size( pSrcDev->mnOutWidth, pSrcDev->mnOutHeight ) );
574 
575  AdjustTwoRect( rPosAry, aSrcOutRect );
576 
577  if ( rPosAry.mnSrcWidth && rPosAry.mnSrcHeight && rPosAry.mnDestWidth && rPosAry.mnDestHeight )
578  {
579  // if this is no window, but pSrcDev is a window
580  // mirroring may be required
581  // because only windows have a SalGraphicsLayout
582  // mirroring is performed here
583  if( (GetOutDevType() != OUTDEV_WINDOW) && pSrcGraphics && (pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl) )
584  {
585  SalTwoRect aPosAry2 = rPosAry;
586  pSrcGraphics->mirror( aPosAry2.mnSrcX, aPosAry2.mnSrcWidth, pSrcDev );
587  mpGraphics->CopyBits( aPosAry2, pSrcGraphics, this, pSrcDev );
588  }
589  else
590  mpGraphics->CopyBits( rPosAry, pSrcGraphics, this, pSrcDev );
591  }
592 }
593 
594 // Layout public functions
595 
596 void OutputDevice::EnableRTL( bool bEnable )
597 {
598  mbEnableRTL = bEnable;
599 
600  if( mpAlphaVDev )
601  mpAlphaVDev->EnableRTL( bEnable );
602 }
603 
605 {
606  bool bRet = false;
607  if( AcquireGraphics() )
608  {
611  {
612  bRet = true;
613  }
614  }
615  return bRet;
616 }
617 
618 // note: the coordinates to be remirrored are in frame coordinates !
619 
620 void OutputDevice::ReMirror( Point &rPoint ) const
621 {
622  rPoint.setX( mnOutOffX + mnOutWidth - 1 - rPoint.X() + mnOutOffX );
623 }
625 {
626  long nWidth = rRect.Right() - rRect.Left();
627 
628  //long lc_x = rRect.nLeft - mnOutOffX; // normalize
629  //lc_x = mnOutWidth - nWidth - 1 - lc_x; // mirror
630  //rRect.nLeft = lc_x + mnOutOffX; // re-normalize
631 
632  rRect.SetLeft( mnOutOffX + mnOutWidth - nWidth - 1 - rRect.Left() + mnOutOffX );
633  rRect.SetRight( rRect.Left() + nWidth );
634 }
635 
636 void OutputDevice::ReMirror( vcl::Region &rRegion ) const
637 {
638  RectangleVector aRectangles;
639  rRegion.GetRegionRectangles(aRectangles);
640  vcl::Region aMirroredRegion;
641 
642  for (auto & rectangle : aRectangles)
643  {
645  aMirroredRegion.Union(rectangle);
646  }
647 
648  rRegion = aMirroredRegion;
649 
650 }
651 
653 {
655 }
656 
658 {
659  if (!mpOutDevData)
660  return false;
661 
662  return mpOutDevData->mpRecordLayout;
663 }
664 
665 // EPS public function
666 
667 bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
668  const GfxLink& rGfxLink, GDIMetaFile* pSubst )
669 {
670  bool bDrawn(true);
671 
672  if ( mpMetaFile )
673  {
674  GDIMetaFile aSubst;
675 
676  if( pSubst )
677  aSubst = *pSubst;
678 
679  mpMetaFile->AddAction( new MetaEPSAction( rPoint, rSize, rGfxLink, aSubst ) );
680  }
681 
683  return bDrawn;
684 
685  if( mbOutputClipped )
686  return bDrawn;
687 
688  tools::Rectangle aRect( ImplLogicToDevicePixel( tools::Rectangle( rPoint, rSize ) ) );
689 
690  if( !aRect.IsEmpty() )
691  {
692  // draw the real EPS graphics
693  if( rGfxLink.GetData() && rGfxLink.GetDataSize() )
694  {
695  if( !mpGraphics && !AcquireGraphics() )
696  return bDrawn;
697 
698  if( mbInitClipRegion )
699  InitClipRegion();
700 
701  aRect.Justify();
702  bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
703  const_cast<sal_uInt8*>(rGfxLink.GetData()), rGfxLink.GetDataSize(), this );
704  }
705 
706  // else draw the substitution graphics
707  if( !bDrawn && pSubst )
708  {
709  GDIMetaFile* pOldMetaFile = mpMetaFile;
710 
711  mpMetaFile = nullptr;
712  Graphic( *pSubst ).Draw( this, rPoint, rSize );
713  mpMetaFile = pOldMetaFile;
714  }
715  }
716 
717  if( mpAlphaVDev )
718  mpAlphaVDev->DrawEPS( rPoint, rSize, rGfxLink, pSubst );
719 
720  return bDrawn;
721 }
722 
723 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long Width() const
OutDevType GetOutDevType() const
Definition: outdev.hxx:522
long mnOutOffX
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
Definition: outdev.hxx:342
sal_Int32 mnDPIScalePercentage
For HiDPI displays, we want to draw elements for a percentage larger.
Definition: outdev.hxx:349
long mnSrcWidth
Definition: salgtype.hxx:52
VclPtr< OutputDevice > mpNextGraphics
Next output device in list.
Definition: outdev.hxx:318
long GetWidth() const
long GetHeight() const
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
SAL_DLLPRIVATE bool ImplIsRecordLayout() const
Definition: outdev.cxx:657
long mnSrcHeight
Definition: salgtype.hxx:53
void mirror(long &nX, const OutputDevice *pOutDev) const
OutputDevice(const OutputDevice &)=delete
bool mbOutput
Definition: outdev.hxx:379
virtual bool IsVirtual() const
Definition: outdev.cxx:183
Color maTextColor
Definition: outdev.hxx:365
bool SupportsCairo() const
long mnEmphasisAscent
Definition: outdev.hxx:353
ImplThresholdRes maThresRes
Definition: outdev.hxx:358
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:344
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:392
DrawModeFlags mnDrawMode
Definition: outdev.hxx:355
void disposeAndClear()
Definition: vclptr.hxx:200
BmpMirrorFlags AdjustTwoRect(SalTwoRect &rTwoRect, const Size &rSizePix)
Definition: rect.cxx:317
long mnMapOfsY
Definition: outdevmap.hxx:26
bool mbOutputClipped
Definition: outdev.hxx:381
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:322
sal_Int32 mnDPIY
Definition: outdev.hxx:348
std::vector< VCLXGraphics * > * mpUnoGraphicsList
Definition: outdev.hxx:327
long mnDestWidth
Definition: salgtype.hxx:56
std::unique_ptr< ImplDeviceFontSizeList > mpDeviceFontSizeList
Definition: outdev.hxx:324
cairo::SurfaceSharedPtr CreateBitmapSurface(const BitmapSystemData &rData, const Size &rSize) const
Create Surface for given bitmap data.
sal_Int32 mnDPIX
Definition: outdev.hxx:347
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:376
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:394
long mnOutOffOrigX
Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset) ...
Definition: outdev.hxx:334
OutDevSupportType
Definition: vclenum.hxx:195
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:367
long Right() const
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
Definition: outdev.cxx:620
virtual void ReleaseAllGraphics(OutputDevice *pOutDev)=0
void setX(long nX)
sal_uInt32 nSize
Definition: sysdata.hxx:131
RasterOp
Definition: vclenum.hxx:191
OutDevViewType meOutDevViewType
Definition: outdev.hxx:360
AntialiasingFlags mnAntialiasing
Definition: outdev.hxx:373
bool mbBackground
Definition: outdev.hxx:378
virtual Bitmap GetBitmap(const Point &rSrcPt, const Size &rSize) const
long Top() const
virtual void EnableRTL(bool bEnable=true)
Definition: outdev.cxx:596
bool mbClipRegionSet
Definition: outdev.hxx:389
SystemGraphicsData GetSystemGfxData() const
Definition: outdev.cxx:221
void setY(long nY)
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:520
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:32
std::unique_ptr< AllSettings > mxSettings
Definition: outdev.hxx:370
SalGraphics * mpGraphics
Graphics context to draw on.
Definition: outdev.hxx:316
std::shared_ptr< Surface > SurfaceSharedPtr
Definition: cairo.hxx:36
std::vector< OutDevState > maOutDevStateStack
Definition: outdev.hxx:325
virtual void CopyArea(const Point &rDestPt, const Point &rSrcPt, const Size &rSrcSize, bool bWindowInvalidate=false)
Definition: outdev.cxx:473
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:1353
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
Definition: graph.cxx:438
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:338
OutDevType
Definition: outdev.hxx:278
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:336
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:323
virtual void EnableRTL(bool bEnable=true) override
Definition: virdev.cxx:387
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
Definition: outdev.cxx:604
long mnMapScNumX
Definition: outdevmap.hxx:27
void SetRight(long v)
virtual bool HasMirroredGraphics() const
Definition: outdev.cxx:652
bool mbInitLineColor
Definition: outdev.hxx:384
bool mbNewFont
Definition: outdev.hxx:390
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:304
SAL_DLLPRIVATE void ImplFillOpaqueRectangle(const tools::Rectangle &rRect)
Used for alpha VDev, to set areas to opaque.
Definition: virdev.cxx:340
bool mbTextLines
Definition: outdev.hxx:391
static bool GetLayoutRTL()
void SetOutOffYPixel(long nOutOffY)
Definition: outdev.cxx:319
bool mbLineColor
Definition: outdev.hxx:382
std::shared_ptr< cairo_surface_t > CairoSurfaceSharedPtr
Definition: cairo.hxx:34
RasterOp meRasterOp
Definition: outdev.hxx:368
bool mbInitTextColor
Definition: outdev.hxx:387
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:238
css::uno::Any GetSystemGfxDataAny() const
Definition: outdev.cxx:269
virtual SystemGraphicsData GetGraphicsData() const =0
virtual sal_uInt16 GetBitCount() const
Definition: outdev.cxx:305
long X() const
bool mbRefPoint
Definition: outdev.hxx:393
virtual void dispose()
std::vector< VCLXGraphics * > * GetUnoGraphicsList() const
Definition: outdev.hxx:455
virtual css::uno::Reference< css::awt::XGraphics > CreateGraphics(OutputDevice *pOutDev)=0
uno::Sequence< double > maFillColor
VclPtr< OutputDevice > mpPrevGraphics
Previous output device in list.
Definition: outdev.hxx:317
virtual sal_uInt16 GetBitCount() const =0
bool mbFillColor
Definition: outdev.hxx:383
VclPtr< VirtualDevice > mpAlphaVDev
Definition: outdev.hxx:331
def rectangle(l)
long mnMapScDenomY
Definition: outdevmap.hxx:30
ImplMapRes maMapRes
Definition: outdev.hxx:357
bool mbClipRegion
Definition: outdev.hxx:377
long mnOutOffLogicY
Additional output offset in logical coordinates, applied in PixelToLogic (used by SetPixelOffset/GetP...
Definition: outdev.hxx:340
#define SAL_WARN_IF(condition, area, stream)
unsigned char sal_uInt8
SalLayoutFlags GetLayout() const
Definition: salgdi.hxx:199
void AddAction(const rtl::Reference< MetaAction > &pAction)
Definition: gdimtf.cxx:539
bool mbInitClipRegion
Definition: outdev.hxx:388
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:667
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()
bool mbInitFont
Definition: outdev.hxx:386
RasterOp GetRasterOp() const
Definition: outdev.hxx:604
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
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:320
bool mbInitFillColor
Definition: outdev.hxx:385
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:351
long mnEmphasisDescent
Definition: outdev.hxx:354
long mnOutWidth
Definition: outdev.hxx:345
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
ComplexTextLayoutFlags mnTextLayoutMode
Definition: outdev.hxx:356
bool mbDevOutput
Definition: outdev.hxx:380
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:321
#define SAL_WARN(area, stream)
void SetOutOffXPixel(long nOutOffX)
Definition: outdev.cxx:314
std::unique_ptr< ImplOutDevData > mpOutDevData
Definition: outdev.hxx:326
vcl::ExtOutDevData * mpExtOutDevData
Definition: outdev.hxx:328
#define DBG_TESTSOLARMUTEX()
static UnoWrapperBase * GetUnoWrapper(bool bCreateIfNotExists=true)
Get the application's UNO wrapper object.
Definition: svapp.cxx:1433
long mnMapScNumY
Definition: outdevmap.hxx:28
long mnOutHeight
Definition: outdev.hxx:346
long mnMapOfsX
Definition: outdevmap.hxx:25
bool IsDeviceOutputNecessary() const
Definition: outdev.hxx:589
Point maRefPoint
Definition: outdev.hxx:372
long mnTextOffY
Definition: outdev.hxx:352
long Y() const
GDIMetaFile * mpMetaFile
Definition: outdev.hxx:319
SAL_DLLPRIVATE void drawOutDevDirect(const OutputDevice *pSrcDev, SalTwoRect &rPosAry)
Definition: outdev.cxx:532
LanguageType meTextLanguage
Definition: outdev.hxx:374