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();
223 
224  return mpGraphics->GetGraphicsData();
225 }
226 
227 #if ENABLE_CAIRO_CANVAS
228 
229 bool OutputDevice::SupportsCairo() const
230 {
231  if (!mpGraphics && !AcquireGraphics())
232  return false;
234 
235  return mpGraphics->SupportsCairo();
236 }
237 
239 {
240  if (!mpGraphics && !AcquireGraphics())
241  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();
251  return mpGraphics->CreateSurface(*this, x, y, width, height);
252 }
253 
255 {
256  if (!mpGraphics && !AcquireGraphics())
257  return cairo::SurfaceSharedPtr();
259  return mpGraphics->CreateBitmapSurface(*this, rData, rSize);
260 }
261 
262 css::uno::Any OutputDevice::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const
263 {
264  if (!mpGraphics && !AcquireGraphics())
265  return css::uno::Any();
267  return mpGraphics->GetNativeSurfaceHandle(rSurface, rSize);
268 }
269 
270 #endif // ENABLE_CAIRO_CANVAS
271 
273 {
274  const SystemGraphicsData aSysData = GetSystemGfxData();
275  css::uno::Sequence< sal_Int8 > aSeq( reinterpret_cast<sal_Int8 const *>(&aSysData),
276  aSysData.nSize );
277 
278  return css::uno::makeAny(aSeq);
279 }
280 
282 {
283 
284  if ( mpMetaFile )
285  mpMetaFile->AddAction( new MetaRefPointAction( Point(), false ) );
286 
287  mbRefPoint = false;
288  maRefPoint.setX(0);
289  maRefPoint.setY(0);
290 
291  if( mpAlphaVDev )
293 }
294 
295 void OutputDevice::SetRefPoint( const Point& rRefPoint )
296 {
297 
298  if ( mpMetaFile )
299  mpMetaFile->AddAction( new MetaRefPointAction( rRefPoint, true ) );
300 
301  mbRefPoint = true;
302  maRefPoint = rRefPoint;
303 
304  if( mpAlphaVDev )
305  mpAlphaVDev->SetRefPoint( rRefPoint );
306 }
307 
308 sal_uInt16 OutputDevice::GetBitCount() const
309 {
310  // we need a graphics instance
311  if ( !mpGraphics && !AcquireGraphics() )
312  return 0;
314 
315  return mpGraphics->GetBitCount();
316 }
317 
319 {
320  mnOutOffX = nOutOffX;
321 }
322 
324 {
325  mnOutOffY = nOutOffY;
326 }
327 
328 css::uno::Reference< css::awt::XGraphics > OutputDevice::CreateUnoGraphics()
329 {
331  return pWrapper ? pWrapper->CreateGraphics( this ) : css::uno::Reference< css::awt::XGraphics >();
332 }
333 
334 std::vector< VCLXGraphics* > *OutputDevice::CreateUnoGraphicsList()
335 {
336  mpUnoGraphicsList = new std::vector< VCLXGraphics* >;
337  return mpUnoGraphicsList;
338 }
339 
340 // Helper public function
341 
343 {
344  if( !mpGraphics && !AcquireGraphics() )
345  return false;
347  const bool bHasSupport = mpGraphics->supportsOperation( eType );
348  return bHasSupport;
349 }
350 
351 // Direct OutputDevice drawing public functions
352 
353 void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
354  const Point& rSrcPt, const Size& rSrcSize )
355 {
356  if( ImplIsRecordLayout() )
357  return;
358 
359  if ( RasterOp::Invert == meRasterOp )
360  {
361  DrawRect( tools::Rectangle( rDestPt, rDestSize ) );
362  return;
363  }
364 
365  if ( mpMetaFile )
366  {
367  const Bitmap aBmp( GetBitmap( rSrcPt, rSrcSize ) );
368  mpMetaFile->AddAction( new MetaBmpScaleAction( rDestPt, rDestSize, aBmp ) );
369  }
370 
371  if ( !IsDeviceOutputNecessary() )
372  return;
373 
374  if ( !mpGraphics && !AcquireGraphics() )
375  return;
377 
378  if ( mbInitClipRegion )
379  InitClipRegion();
380 
381  if ( mbOutputClipped )
382  return;
383 
384  tools::Long nSrcWidth = ImplLogicWidthToDevicePixel( rSrcSize.Width() );
385  tools::Long nSrcHeight = ImplLogicHeightToDevicePixel( rSrcSize.Height() );
386  tools::Long nDestWidth = ImplLogicWidthToDevicePixel( rDestSize.Width() );
387  tools::Long nDestHeight = ImplLogicHeightToDevicePixel( rDestSize.Height() );
388 
389  if (nSrcWidth && nSrcHeight && nDestWidth && nDestHeight)
390  {
391  SalTwoRect aPosAry(ImplLogicXToDevicePixel(rSrcPt.X()), ImplLogicYToDevicePixel(rSrcPt.Y()),
392  nSrcWidth, nSrcHeight,
393  ImplLogicXToDevicePixel(rDestPt.X()), ImplLogicYToDevicePixel(rDestPt.Y()),
394  nDestWidth, nDestHeight);
395 
396  AdjustTwoRect( aPosAry, GetOutputRectPixel() );
397 
398  if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
399  mpGraphics->CopyBits(aPosAry, *this);
400  }
401 
402  if( mpAlphaVDev )
403  mpAlphaVDev->DrawOutDev( rDestPt, rDestSize, rSrcPt, rSrcSize );
404 }
405 
406 void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
407  const Point& rSrcPt, const Size& rSrcSize,
408  const OutputDevice& rOutDev )
409 {
410  if ( ImplIsRecordLayout() )
411  return;
412 
413  if ( RasterOp::Invert == meRasterOp )
414  {
415  DrawRect( tools::Rectangle( rDestPt, rDestSize ) );
416  return;
417  }
418 
419  if ( mpMetaFile )
420  {
421  if (rOutDev.mpAlphaVDev)
422  {
423  const BitmapEx aBmpEx(rOutDev.GetBitmapEx(rSrcPt, rSrcSize));
424  mpMetaFile->AddAction(new MetaBmpExScaleAction(rDestPt, rDestSize, aBmpEx));
425  }
426  else
427  {
428  const Bitmap aBmp(rOutDev.GetBitmap(rSrcPt, rSrcSize));
429  mpMetaFile->AddAction(new MetaBmpScaleAction(rDestPt, rDestSize, aBmp));
430  }
431  }
432 
433  if ( !IsDeviceOutputNecessary() )
434  return;
435 
436  if ( !mpGraphics && !AcquireGraphics() )
437  return;
439 
440  if ( mbInitClipRegion )
441  InitClipRegion();
442 
443  if ( mbOutputClipped )
444  return;
445 
446  if (rOutDev.mpAlphaVDev)
447  {
448  // alpha-blend source over destination
449  DrawBitmapEx(rDestPt, rDestSize, rOutDev.GetBitmapEx(rSrcPt, rSrcSize));
450  }
451  else
452  {
453  SalTwoRect aPosAry(rOutDev.ImplLogicXToDevicePixel(rSrcPt.X()),
454  rOutDev.ImplLogicYToDevicePixel(rSrcPt.Y()),
455  rOutDev.ImplLogicWidthToDevicePixel(rSrcSize.Width()),
456  rOutDev.ImplLogicHeightToDevicePixel(rSrcSize.Height()),
457  ImplLogicXToDevicePixel(rDestPt.X()),
458  ImplLogicYToDevicePixel(rDestPt.Y()),
459  ImplLogicWidthToDevicePixel(rDestSize.Width()),
460  ImplLogicHeightToDevicePixel(rDestSize.Height()));
461 
462  drawOutDevDirect(rOutDev, aPosAry);
463 
464  // #i32109#: make destination rectangle opaque - source has no alpha
465  if (mpAlphaVDev)
467  }
468 }
469 
470 void OutputDevice::CopyArea( const Point& rDestPt,
471  const Point& rSrcPt, const Size& rSrcSize,
472  bool bWindowInvalidate )
473 {
474  if ( ImplIsRecordLayout() )
475  return;
476 
477  RasterOp eOldRop = GetRasterOp();
479 
480  if ( !IsDeviceOutputNecessary() )
481  return;
482 
483  if ( !mpGraphics && !AcquireGraphics() )
484  return;
486 
487  if ( mbInitClipRegion )
488  InitClipRegion();
489 
490  if ( mbOutputClipped )
491  return;
492 
493  tools::Long nSrcWidth = ImplLogicWidthToDevicePixel( rSrcSize.Width() );
494  tools::Long nSrcHeight = ImplLogicHeightToDevicePixel( rSrcSize.Height() );
495  if (nSrcWidth && nSrcHeight)
496  {
497  SalTwoRect aPosAry(ImplLogicXToDevicePixel(rSrcPt.X()), ImplLogicYToDevicePixel(rSrcPt.Y()),
498  nSrcWidth, nSrcHeight,
499  ImplLogicXToDevicePixel(rDestPt.X()), ImplLogicYToDevicePixel(rDestPt.Y()),
500  nSrcWidth, nSrcHeight);
501 
502  AdjustTwoRect( aPosAry, GetOutputRectPixel() );
503 
504  CopyDeviceArea( aPosAry, bWindowInvalidate );
505  }
506 
507  SetRasterOp( eOldRop );
508 
509  if( mpAlphaVDev )
510  mpAlphaVDev->CopyArea( rDestPt, rSrcPt, rSrcSize, bWindowInvalidate );
511 }
512 
513 // Direct OutputDevice drawing protected function
514 
515 void OutputDevice::CopyDeviceArea( SalTwoRect& aPosAry, bool /*bWindowInvalidate*/)
516 {
517  if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0)
518  return;
519 
520  aPosAry.mnDestWidth = aPosAry.mnSrcWidth;
521  aPosAry.mnDestHeight = aPosAry.mnSrcHeight;
522  mpGraphics->CopyBits(aPosAry, *this);
523 }
524 
525 // Direct OutputDevice drawing private function
527 {
528  SalGraphics* pSrcGraphics;
529  if (const OutputDevice* pCheckedSrc = DrawOutDevDirectCheck(rSrcDev))
530  {
531  if (!pCheckedSrc->mpGraphics && !pCheckedSrc->AcquireGraphics())
532  return;
533  pSrcGraphics = pCheckedSrc->mpGraphics;
534  }
535  else
536  pSrcGraphics = nullptr;
537 
538  if (!mpGraphics && !AcquireGraphics())
539  return;
541 
542  // #102532# Offset only has to be pseudo window offset
543 
544  AdjustTwoRect( rPosAry, rSrcDev.GetOutputRectPixel() );
545 
546  if ( rPosAry.mnSrcWidth && rPosAry.mnSrcHeight && rPosAry.mnDestWidth && rPosAry.mnDestHeight )
547  {
548  // if this is no window, but rSrcDev is a window
549  // mirroring may be required
550  // because only windows have a SalGraphicsLayout
551  // mirroring is performed here
552  DrawOutDevDirectProcess(rSrcDev, rPosAry, pSrcGraphics);
553  }
554 }
555 
557 {
558  return this == &rSrcDev ? nullptr : &rSrcDev;
559 }
560 
561 void OutputDevice::DrawOutDevDirectProcess(const OutputDevice& rSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics)
562 {
563  if( pSrcGraphics && (pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl) )
564  {
565  SalTwoRect aPosAry2 = rPosAry;
566  pSrcGraphics->mirror( aPosAry2.mnSrcX, aPosAry2.mnSrcWidth, rSrcDev );
567  mpGraphics->CopyBits( aPosAry2, *pSrcGraphics, *this, rSrcDev );
568  return;
569  }
570  if (pSrcGraphics)
571  mpGraphics->CopyBits( rPosAry, *pSrcGraphics, *this, rSrcDev );
572  else
573  mpGraphics->CopyBits( rPosAry, *this );
574 }
575 
577 {
578  return tools::Rectangle( Point( 0, 0 ), GetOutputSizePixel() );
579 }
580 
581 // Layout public functions
582 
583 void OutputDevice::EnableRTL( bool bEnable )
584 {
585  mbEnableRTL = bEnable;
586 
587  if( mpAlphaVDev )
588  mpAlphaVDev->EnableRTL( bEnable );
589 }
590 
592 {
593  bool bRet = false;
594  if( AcquireGraphics() )
595  {
598  {
599  bRet = true;
600  }
601  }
602  return bRet;
603 }
604 
605 // note: the coordinates to be remirrored are in frame coordinates !
606 
607 void OutputDevice::ReMirror( Point &rPoint ) const
608 {
609  rPoint.setX( mnOutOffX + mnOutWidth - 1 - rPoint.X() + mnOutOffX );
610 }
612 {
613  tools::Long nWidth = rRect.Right() - rRect.Left();
614 
615  //long lc_x = rRect.nLeft - mnOutOffX; // normalize
616  //lc_x = mnOutWidth - nWidth - 1 - lc_x; // mirror
617  //rRect.nLeft = lc_x + mnOutOffX; // re-normalize
618 
619  rRect.SetLeft( mnOutOffX + mnOutWidth - nWidth - 1 - rRect.Left() + mnOutOffX );
620  rRect.SetRight( rRect.Left() + nWidth );
621 }
622 
623 void OutputDevice::ReMirror( vcl::Region &rRegion ) const
624 {
625  RectangleVector aRectangles;
626  rRegion.GetRegionRectangles(aRectangles);
627  vcl::Region aMirroredRegion;
628 
629  for (auto & rectangle : aRectangles)
630  {
632  aMirroredRegion.Union(rectangle);
633  }
634 
635  rRegion = aMirroredRegion;
636 
637 }
638 
640 {
642 }
643 
645 {
646  if (!mpOutDevData)
647  return false;
648 
649  return mpOutDevData->mpRecordLayout;
650 }
651 
652 // EPS public function
653 
654 bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
655  const GfxLink& rGfxLink, GDIMetaFile* pSubst )
656 {
657  bool bDrawn(true);
658 
659  if ( mpMetaFile )
660  {
661  GDIMetaFile aSubst;
662 
663  if( pSubst )
664  aSubst = *pSubst;
665 
666  mpMetaFile->AddAction( new MetaEPSAction( rPoint, rSize, rGfxLink, aSubst ) );
667  }
668 
670  return bDrawn;
671 
672  if( mbOutputClipped )
673  return bDrawn;
674 
675  tools::Rectangle aRect( ImplLogicToDevicePixel( tools::Rectangle( rPoint, rSize ) ) );
676 
677  if( !aRect.IsEmpty() )
678  {
679  // draw the real EPS graphics
680  if( rGfxLink.GetData() && rGfxLink.GetDataSize() )
681  {
682  if( !mpGraphics && !AcquireGraphics() )
683  return bDrawn;
685 
686  if( mbInitClipRegion )
687  InitClipRegion();
688 
689  aRect.Justify();
690  bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
691  const_cast<sal_uInt8*>(rGfxLink.GetData()), rGfxLink.GetDataSize(), *this );
692  }
693 
694  // else draw the substitution graphics
695  if( !bDrawn && pSubst )
696  {
697  GDIMetaFile* pOldMetaFile = mpMetaFile;
698 
699  mpMetaFile = nullptr;
700  Graphic( *pSubst ).Draw( this, rPoint, rSize );
701  mpMetaFile = pOldMetaFile;
702  }
703  }
704 
705  if( mpAlphaVDev )
706  mpAlphaVDev->DrawEPS( rPoint, rSize, rGfxLink, pSubst );
707 
708  return bDrawn;
709 }
710 
711 css::awt::DeviceInfo OutputDevice::GetCommonDeviceInfo(Size const& rDevSz) const
712 {
713  css::awt::DeviceInfo aInfo;
714 
715  aInfo.Width = rDevSz.Width();
716  aInfo.Height = rDevSz.Height();
717 
718  Size aTmpSz = LogicToPixel(Size(1000, 1000), MapMode(MapUnit::MapCM));
719  aInfo.PixelPerMeterX = aTmpSz.Width() / 10;
720  aInfo.PixelPerMeterY = aTmpSz.Height() / 10;
721  aInfo.BitsPerPixel = GetBitCount();
722 
723  aInfo.Capabilities = css::awt::DeviceCapability::RASTEROPERATIONS |
724  css::awt::DeviceCapability::GETBITS;
725 
726  return aInfo;
727 }
728 
729 css::awt::DeviceInfo OutputDevice::GetDeviceInfo() const
730 {
731  css::awt::DeviceInfo aInfo = GetCommonDeviceInfo(GetOutputSizePixel());
732 
733  aInfo.LeftInset = 0;
734  aInfo.TopInset = 0;
735  aInfo.RightInset = 0;
736  aInfo.BottomInset = 0;
737 
738  return aInfo;
739 }
740 
741 /* 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:644
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
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
void disposeAndClear()
Definition: vclptr.hxx:200
BmpMirrorFlags AdjustTwoRect(SalTwoRect &rTwoRect, const Size &rSizePix)
Definition: rect.cxx:341
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:342
bool mbMap
Definition: outdev.hxx:374
std::vector< VCLXGraphics * > * CreateUnoGraphicsList()
Definition: outdev.cxx:334
virtual void DrawOutDevDirectProcess(const OutputDevice &rSrcDev, SalTwoRect &rPosAry, SalGraphics *pSrcGraphics)
Definition: outdev.cxx:561
tools::Long mnMapScDenomX
Definition: outdevmap.hxx:31
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:196
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 tools::Long Width() const
Color maOverlineColor
Definition: outdev.hxx:365
void SetOutOffYPixel(tools::Long nOutOffY)
Definition: outdev.cxx:323
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
Definition: outdev.cxx:607
tools::Long Left() const
virtual void ReleaseAllGraphics(OutputDevice *pOutDev)=0
SAL_DLLPRIVATE tools::Long ImplLogicXToDevicePixel(tools::Long nX) const
Convert a logical X coordinate to a device pixel's X coordinate.
Definition: map.cxx:296
void SetLeft(tools::Long v)
sal_uInt32 nSize
Definition: sysdata.hxx:143
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
RasterOp
Definition: vclenum.hxx:192
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:32
virtual void EnableRTL(bool bEnable=true)
Definition: outdev.cxx:583
bool mbClipRegionSet
Definition: outdev.hxx:387
SystemGraphicsData GetSystemGfxData() const
Definition: outdev.cxx:218
virtual void CopyDeviceArea(SalTwoRect &aPosAry, bool bWindowInvalidate)
Definition: outdev.cxx:515
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:470
SAL_DLLPRIVATE void ImplInvalidateViewTransform()
Invalidate the view transformation.
Definition: map.cxx:224
tools::Long mnDestHeight
Definition: salgtype.hxx:48
void SetRefPoint()
Definition: outdev.cxx:281
void clear()
Definition: vclptr.hxx:190
void SetConnectMetaFile(GDIMetaFile *pMtf)
Definition: outdev.cxx:205
bool IsRTLEnabled() const
Definition: outdev.hxx:1366
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
Definition: graph.cxx:427
virtual tools::Rectangle GetBackgroundComponentBounds() const
Definition: outdev.cxx:576
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:556
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:591
virtual bool HasMirroredGraphics() const
Definition: outdev.cxx:639
bool mbInitLineColor
Definition: outdev.hxx:382
tools::Long mnOutHeight
Definition: outdev.hxx:345
bool mbNewFont
Definition: outdev.hxx:388
SAL_DLLPRIVATE void drawOutDevDirect(const OutputDevice &rSrcDev, SalTwoRect &rPosAry)
Definition: outdev.cxx:526
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:314
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:27
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:233
css::uno::Any GetSystemGfxDataAny() const
Definition: outdev.cxx:272
virtual SystemGraphicsData GetGraphicsData() const =0
void mirror(tools::Long &nX, const OutputDevice &rOutDev) const
virtual sal_uInt16 GetBitCount() const
Definition: outdev.cxx:308
tools::Long Top() const
tools::Long mnMapOfsY
Definition: outdevmap.hxx:28
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:459
virtual css::uno::Reference< css::awt::XGraphics > CreateGraphics(OutputDevice *pOutDev)=0
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:800
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:30
css::awt::DeviceInfo GetCommonDeviceInfo(Size const &aDevSize) const
Definition: outdev.cxx:711
constexpr tools::Long Height() const
unsigned char sal_uInt8
SalLayoutFlags GetLayout() const
Definition: salgdi.hxx:210
void AddAction(const rtl::Reference< MetaAction > &pAction)
Definition: gdimtf.cxx:564
tools::Rectangle GetOutputRectPixel() const
Definition: outdev.hxx:451
tools::Long mnMapScNumX
Definition: outdevmap.hxx:29
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:318
bool DrawEPS(const Point &rPt, const Size &rSz, const GfxLink &rGfxLink, GDIMetaFile *pSubst=nullptr)
Definition: outdev.cxx:654
SalGraphics const * GetGraphics() const
Get the graphic context that the output device uses to draw on.
Definition: outdev.cxx:195
css::uno::Reference< css::awt::XGraphics > CreateUnoGraphics()
Definition: outdev.cxx:328
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:620
virtual void DrawOutDev(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPt, const Size &rSrcSize)
Definition: outdev.cxx:353
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:376
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:305
vcl::ExtOutDevData * mpExtOutDevData
Definition: outdev.hxx:327
#define DBG_TESTSOLARMUTEX()
static UnoWrapperBase * GetUnoWrapper(bool bCreateIfNotExists=true)
Get the application's UNO wrapper object.
Definition: svapp.cxx:1484
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:605
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:322
tools::Long mnTextOffY
Definition: outdev.hxx:351
virtual css::awt::DeviceInfo GetDeviceInfo() const
Definition: outdev.cxx:729
tools::Long Right() const
GDIMetaFile * mpMetaFile
Definition: outdev.hxx:318
LanguageType meTextLanguage
Definition: outdev.hxx:372