LibreOffice Module vcl (master)  1
salgdilayout.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 <memory>
21 #include <config_features.h>
22 #include <sal/log.hxx>
23 #if HAVE_FEATURE_OPENGL
24 #include <openglgdiimpl.hxx>
25 #include <opengl/zone.hxx>
26 #include <desktop/exithelper.h>
27 #ifdef _WIN32
28 #include <svsys.h>
29 #endif
30 #endif
31 #include <salgdi.hxx>
32 #include <salframe.hxx>
36 
37 // The only common SalFrame method
38 
40 {
41  // mirror frame coordinates at parent
42  SalFrame *pParent = GetParent();
43  if( pParent && AllSettings::GetLayoutRTL() )
44  {
46  int parent_x = aGeom.nX - pParent->maGeometry.nX;
47  aGeom.nX = pParent->maGeometry.nX + pParent->maGeometry.nWidth - maGeometry.nWidth - parent_x;
48  return aGeom;
49  }
50  else
51  return maGeometry;
52 }
53 
55 : m_nLayout( SalLayoutFlags::NONE ),
56  m_aLastMirror(),
57  m_aLastMirrorW(0),
58  m_bAntiAliasB2DDraw(false)
59 {
60  // read global RTL settings
63 }
64 
66 {
67  bool bFileDefinitionsWidgetDraw = !!getenv("VCL_DRAW_WIDGETS_FROM_FILE");
68 
69  if (bFileDefinitionsWidgetDraw || bForce)
70  {
72  auto pFileDefinitionWidgetDraw = static_cast<vcl::FileDefinitionWidgetDraw*>(m_pWidgetDraw.get());
73  if (!pFileDefinitionWidgetDraw->isActive())
74  {
75  m_pWidgetDraw.reset();
76  return false;
77  }
78  return true;
79  }
80  return false;
81 }
82 
83 SalGraphics::~SalGraphics() COVERITY_NOEXCEPT_FALSE
84 {
85 }
86 
87 #if HAVE_FEATURE_OPENGL
88 
89 namespace
90 {
91  void disableOpenGLAndTerminateForRestart()
92  {
94 #ifdef _WIN32
95  TerminateProcess(GetCurrentProcess(), EXITHELPER_NORMAL_RESTART);
96 #endif
97  }
98 }
99 
101 {
102  OpenGLSalGraphicsImpl *pImpl = dynamic_cast<OpenGLSalGraphicsImpl*>(GetImpl());
103  if (pImpl)
104  {
105  // If we notice that OpenGL is broken the first time being called, it is not too late to call
106  // disableOpenGLAndTerminateForRestart(). The first time this will be called is from displaying
107  // the splash screen, so if OpenGL is broken, it is "early enough" for us to be able to disable
108  // OpenGL and terminate bluntly with EXITHELPER_NORMAL_RESTART, thus causing the wrapper process
109  // to restart us, then without using OpenGL.
110  static bool bFirstCall = true;
112  if (!xRet.is() && bFirstCall)
113  disableOpenGLAndTerminateForRestart();
114  bFirstCall = false;
115  return xRet;
116  }
117  return nullptr;
118 }
119 
120 #endif
121 
123  const basegfx::B2DPoint& /* rNull */,
124  const basegfx::B2DPoint& /* rX */,
125  const basegfx::B2DPoint& /* rY */,
126  const SalBitmap& /* rSourceBitmap */,
127  const SalBitmap* /* pAlphaBitmap */)
128 {
129  // here direct support for transformed bitmaps can be implemented
130  return false;
131 }
132 
133 long SalGraphics::mirror2( long x, const OutputDevice *pOutDev ) const
134 {
135  mirror(x, pOutDev);
136  return x;
137 }
138 
139 inline long SalGraphics::GetDeviceWidth(const OutputDevice* pOutDev) const
140 {
141  return (pOutDev && pOutDev->IsVirtual())
142  ? pOutDev->GetOutputWidthPixel() : GetGraphicsWidth();
143 }
144 
145 void SalGraphics::mirror( long& x, const OutputDevice *pOutDev ) const
146 {
147  const long w = GetDeviceWidth(pOutDev);
148  if( w )
149  {
150  if( pOutDev && pOutDev->ImplIsAntiparallel() )
151  {
152  OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev);
153  // mirror this window back
155  {
156  long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
157  x = devX + (x - pOutDevRef->GetOutOffXPixel());
158  }
159  else
160  {
161  long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
162  x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - 1;
163  }
164  }
166  x = w-1-x;
167  }
168 }
169 
170 void SalGraphics::mirror( long& x, long nWidth, const OutputDevice *pOutDev, bool bBack ) const
171 {
172  const long w = GetDeviceWidth(pOutDev);
173  if( w )
174  {
175  if( pOutDev && pOutDev->ImplIsAntiparallel() )
176  {
177  OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev);
178  // mirror this window back
180  {
181  long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
182  if( bBack )
183  x = x - devX + pOutDevRef->GetOutOffXPixel();
184  else
185  x = devX + (x - pOutDevRef->GetOutOffXPixel());
186  }
187  else
188  {
189  long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
190  if( bBack )
191  x = devX + (pOutDevRef->GetOutputWidthPixel() + devX) - (x + nWidth);
192  else
193  x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - nWidth;
194  }
195  }
197  x = w-nWidth-x;
198  }
199 }
200 
201 bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev ) const
202 {
203  const long w = GetDeviceWidth(pOutDev);
204  if( w )
205  {
206  sal_uInt32 i, j;
207 
208  if( pOutDev && pOutDev->ImplIsAntiparallel() )
209  {
210  OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev);
211  // mirror this window back
213  {
214  long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
215  for( i=0, j=nPoints-1; i<nPoints; i++,j-- )
216  {
217  pPtAry2[j].mnX = devX + (pPtAry[i].mnX - pOutDevRef->GetOutOffXPixel());
218  pPtAry2[j].mnY = pPtAry[i].mnY;
219  }
220  }
221  else
222  {
223  long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
224  for( i=0, j=nPoints-1; i<nPoints; i++,j-- )
225  {
226  pPtAry2[j].mnX = pOutDevRef->GetOutputWidthPixel() - (pPtAry[i].mnX - devX) + pOutDevRef->GetOutOffXPixel() - 1;
227  pPtAry2[j].mnY = pPtAry[i].mnY;
228  }
229  }
230  }
232  {
233  for( i=0, j=nPoints-1; i<nPoints; i++,j-- )
234  {
235  pPtAry2[j].mnX = w-1-pPtAry[i].mnX;
236  pPtAry2[j].mnY = pPtAry[i].mnY;
237  }
238  }
239  return true;
240  }
241  else
242  return false;
243 }
244 
245 void SalGraphics::mirror( vcl::Region& rRgn, const OutputDevice *pOutDev ) const
246 {
247  if( rRgn.HasPolyPolygonOrB2DPolyPolygon() )
248  {
249  const basegfx::B2DPolyPolygon aPolyPoly(mirror(rRgn.GetAsB2DPolyPolygon(), pOutDev));
250 
251  rRgn = vcl::Region(aPolyPoly);
252  }
253  else
254  {
255  RectangleVector aRectangles;
256  rRgn.GetRegionRectangles(aRectangles);
257  rRgn.SetEmpty();
258 
259  for (auto & rectangle : aRectangles)
260  {
261  mirror(rectangle, pOutDev);
262  rRgn.Union(rectangle);
263  }
264 
265  //ImplRegionInfo aInfo;
266  //bool bRegionRect;
267  //Region aMirroredRegion;
268  //long nX, nY, nWidth, nHeight;
269 
270  //bRegionRect = rRgn.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
271  //while ( bRegionRect )
272  //{
273  // Rectangle aRect( Point(nX, nY), Size(nWidth, nHeight) );
274  // mirror( aRect, pOutDev, bBack );
275  // aMirroredRegion.Union( aRect );
276  // bRegionRect = rRgn.ImplGetNextRect( aInfo, nX, nY, nWidth, nHeight );
277  //}
278  //rRgn = aMirroredRegion;
279  }
280 }
281 
282 void SalGraphics::mirror( tools::Rectangle& rRect, const OutputDevice *pOutDev, bool bBack ) const
283 {
284  long nWidth = rRect.GetWidth();
285  long x = rRect.Left();
286  long x_org = x;
287 
288  mirror( x, nWidth, pOutDev, bBack );
289  rRect.Move( x - x_org, 0 );
290 }
291 
292 basegfx::B2DPoint SalGraphics::mirror( const basegfx::B2DPoint& i_rPoint, const OutputDevice* i_pOutDev ) const
293 {
294  const basegfx::B2DHomMatrix& rMirror(getMirror(i_pOutDev));
295 
296  if(rMirror.isIdentity())
297  {
298  return i_rPoint;
299  }
300  else
301  {
302  return rMirror * i_rPoint;
303  }
304 }
305 
307 {
308  const basegfx::B2DHomMatrix& rMirror(getMirror(i_pOutDev));
309 
310  if(rMirror.isIdentity())
311  {
312  return i_rPoly;
313  }
314  else
315  {
316  basegfx::B2DPolyPolygon aRet(i_rPoly);
317  aRet.transform(rMirror);
318  aRet.flip();
319  return aRet;
320  }
321 }
322 
324 {
325  // get mirroring transformation
326  const long w = GetDeviceWidth(i_pOutDev);
327  SAL_WARN_IF( !w, "vcl", "missing graphics width" );
328 
329  if(w != m_aLastMirrorW)
330  {
331  const_cast<SalGraphics*>(this)->m_aLastMirrorW = w;
332 
333  if(w)
334  {
335  if(nullptr != i_pOutDev && !i_pOutDev->IsRTLEnabled())
336  {
337  // Original code was (removed here already pOutDevRef->i_pOutDev):
338  // // mirror this window back
339  // double devX = w-i_pOutDev->GetOutputWidthPixel()-i_pOutDev->GetOutOffXPixel(); // re-mirrored mnOutOffX
340  // aRet.setX( devX + (i_rPoint.getX() - i_pOutDev->GetOutOffXPixel()) );
341  // I do not really understand the comment 'mirror this window back', so cannot guarantee
342  // that this works as before, but I have reduced this (by re-placing and re-formatting) to
343  // a simple translation:
345  w - i_pOutDev->GetOutputWidthPixel() - (2 * i_pOutDev->GetOutOffXPixel()),
346  0.0);
347  }
348  else
349  {
350  // Original code was:
351  // aRet.setX( w-1-i_rPoint.getX() );
352  // -mirror X -> scale(-1.0, 1.0)
353  // -translate X -> translate(w-1, 0); but already mirrored, so use translate(1-w, 0)
354  // Checked this one, works as expected.
356  -1.0,
357  1.0,
358  1-w,
359  0.0);
360  }
361  }
362  else
363  {
364  const_cast<SalGraphics*>(this)->m_aLastMirror.identity();
365  }
366  }
367 
368  return m_aLastMirror;
369 }
370 
372 {
373  // add mirroring transformation to i_rMatrix
374  const basegfx::B2DHomMatrix& rMirror(getMirror(pOutDev));
375 
376  // Apply mirror to given matrix by multiply from left ('after' i_rMatrix).
377  // Identity checks and fast-paths are in the operator
378  return rMirror * i_rMatrix;
379 }
380 
381 bool SalGraphics::SetClipRegion( const vcl::Region& i_rClip, const OutputDevice *pOutDev )
382 {
383  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
384  {
385  vcl::Region aMirror( i_rClip );
386  mirror( aMirror, pOutDev );
387  return setClipRegion( aMirror );
388  }
389  return setClipRegion( i_rClip );
390 }
391 
392 void SalGraphics::DrawPixel( long nX, long nY, const OutputDevice *pOutDev )
393 {
394  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
395  mirror( nX, pOutDev );
396  drawPixel( nX, nY );
397 }
398 
399 void SalGraphics::DrawPixel( long nX, long nY, Color nColor, const OutputDevice *pOutDev )
400 {
401  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
402  mirror( nX, pOutDev );
403  drawPixel( nX, nY, nColor );
404 }
405 
406 void SalGraphics::DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev )
407 {
408  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
409  {
410  mirror( nX1, pOutDev );
411  mirror( nX2, pOutDev );
412  }
413  drawLine( nX1, nY1, nX2, nY2 );
414 }
415 
416 void SalGraphics::DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
417 {
418  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
419  mirror( nX, nWidth, pOutDev );
420  drawRect( nX, nY, nWidth, nHeight );
421 }
422 
423 void SalGraphics::DrawPolyLine( sal_uInt32 nPoints, SalPoint const * pPtAry, const OutputDevice *pOutDev )
424 {
425  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
426  {
427  std::unique_ptr<SalPoint[]> pPtAry2(new SalPoint[nPoints]);
428  bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
429  drawPolyLine( nPoints, bCopied ? pPtAry2.get() : pPtAry );
430  }
431  else
432  drawPolyLine( nPoints, pPtAry );
433 }
434 
435 void SalGraphics::DrawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
436 {
437  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
438  {
439  std::unique_ptr<SalPoint[]> pPtAry2(new SalPoint[nPoints]);
440  bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
441  drawPolygon( nPoints, bCopied ? pPtAry2.get() : pPtAry );
442  }
443  else
444  drawPolygon( nPoints, pPtAry );
445 }
446 
447 void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry, const OutputDevice *pOutDev )
448 {
449  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
450  {
451  // TODO: optimize, reduce new/delete calls
452  std::unique_ptr<SalPoint*[]> pPtAry2( new SalPoint*[nPoly] );
453  sal_uLong i;
454  for(i=0; i<nPoly; i++)
455  {
456  sal_uLong nPoints = pPoints[i];
457  pPtAry2[i] = new SalPoint[ nPoints ];
458  mirror( nPoints, pPtAry[i], pPtAry2[i], pOutDev );
459  }
460 
461  drawPolyPolygon( nPoly, pPoints, const_cast<PCONSTSALPOINT*>(pPtAry2.get()) );
462 
463  for(i=0; i<nPoly; i++)
464  delete [] pPtAry2[i];
465  }
466  else
467  drawPolyPolygon( nPoly, pPoints, pPtAry );
468 }
469 
471  const basegfx::B2DHomMatrix& rObjectToDevice,
472  const basegfx::B2DPolyPolygon& i_rPolyPolygon,
473  double i_fTransparency,
474  const OutputDevice* i_pOutDev)
475 {
476  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
477  {
478  // mirroring set
479  const basegfx::B2DHomMatrix& rMirror(getMirror(i_pOutDev));
480 
481  if(!rMirror.isIdentity())
482  {
483  if(rObjectToDevice.isIdentity())
484  {
485  // There is no ObjectToDevice transformation set. We can just
486  // use rMirror, that would be the result of the linear combination
487  return drawPolyPolygon(
488  rMirror,
489  i_rPolyPolygon,
490  i_fTransparency);
491  }
492  else
493  {
494  // Create the linear combination
495  basegfx::B2DHomMatrix aLinearCombination(rObjectToDevice);
496  basegfx::B2DHomMatrix aObjectToDeviceInv(rObjectToDevice);
497 
498  aLinearCombination = rMirror * aLinearCombination;
499  aObjectToDeviceInv.invert();
500  aLinearCombination = aObjectToDeviceInv * aLinearCombination;
501 
502  return drawPolyPolygon(
503  aLinearCombination,
504  i_rPolyPolygon,
505  i_fTransparency);
506  }
507  }
508  }
509 
510  return drawPolyPolygon(
511  rObjectToDevice,
512  i_rPolyPolygon,
513  i_fTransparency);
514 }
515 
516 bool SalGraphics::DrawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry, const OutputDevice* pOutDev )
517 {
518  bool bResult = false;
519  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
520  {
521  std::unique_ptr<SalPoint[]> pPtAry2(new SalPoint[nPoints]);
522  bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
523  bResult = drawPolyLineBezier( nPoints, bCopied ? pPtAry2.get() : pPtAry, pFlgAry );
524  }
525  else
526  bResult = drawPolyLineBezier( nPoints, pPtAry, pFlgAry );
527  return bResult;
528 }
529 
530 bool SalGraphics::DrawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry, const OutputDevice* pOutDev )
531 {
532  bool bResult = false;
533  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
534  {
535  std::unique_ptr<SalPoint[]> pPtAry2(new SalPoint[nPoints]);
536  bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
537  bResult = drawPolygonBezier( nPoints, bCopied ? pPtAry2.get() : pPtAry, pFlgAry );
538  }
539  else
540  bResult = drawPolygonBezier( nPoints, pPtAry, pFlgAry );
541  return bResult;
542 }
543 
544 bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 i_nPoly, const sal_uInt32* i_pPoints,
545  const SalPoint* const* i_pPtAry, const PolyFlags* const* i_pFlgAry, const OutputDevice* i_pOutDev )
546 {
547  bool bRet = false;
548  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
549  {
550  // TODO: optimize, reduce new/delete calls
551  std::unique_ptr<SalPoint*[]> pPtAry2( new SalPoint*[i_nPoly] );
552  sal_uLong i;
553  for(i=0; i<i_nPoly; i++)
554  {
555  sal_uLong nPoints = i_pPoints[i];
556  pPtAry2[i] = new SalPoint[ nPoints ];
557  mirror( nPoints, i_pPtAry[i], pPtAry2[i], i_pOutDev );
558  }
559 
560  bRet = drawPolyPolygonBezier( i_nPoly, i_pPoints, const_cast<PCONSTSALPOINT const *>(pPtAry2.get()), i_pFlgAry );
561 
562  for(i=0; i<i_nPoly; i++)
563  delete [] pPtAry2[i];
564  }
565  else
566  bRet = drawPolyPolygonBezier( i_nPoly, i_pPoints, i_pPtAry, i_pFlgAry );
567  return bRet;
568 }
569 
571  const basegfx::B2DHomMatrix& rObjectToDevice,
572  const basegfx::B2DPolygon& i_rPolygon,
573  double i_fTransparency,
574  const basegfx::B2DVector& i_rLineWidth,
575  basegfx::B2DLineJoin i_eLineJoin,
576  css::drawing::LineCap i_eLineCap,
577  double i_fMiterMinimumAngle,
578  bool bPixelSnapHairline,
579  const OutputDevice* i_pOutDev)
580 {
581  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
582  {
583  // mirroring set
584  const basegfx::B2DHomMatrix& rMirror(getMirror(i_pOutDev));
585 
586  if(!rMirror.isIdentity())
587  {
588  // If we really have a mirroring to apply, we *could*
589  // use the ::mirror call to modify the B2DPolygon (and
590  // prepare the LineWidth scaling), but we also
591  // can add that mirroring to rObjectToDevice transformation
592  // by using linear combination of transformations and stay
593  // on having the transformation
594  if(rObjectToDevice.isIdentity())
595  {
596  // There is no ObjectToDevice transformation set. We can just
597  // use rMirror, that would be the result of the linear combination
598  return drawPolyLine(
599  rMirror,
600  i_rPolygon,
601  i_fTransparency,
602  i_rLineWidth,
603  i_eLineJoin,
604  i_eLineCap,
605  i_fMiterMinimumAngle,
606  bPixelSnapHairline);
607  }
608  else
609  {
610  // To create the linear combination, we need to
611  // - multiply with rObjectToDevice to get to device-coordinates
612  // (what is a simple copy)
613  // - apply rMirror (multiply from left)
614  // - multiply with inverse of rObjectToDevice to get back from
615  // device-coordinates to object-coordinates
616  // this only makes sense to do when we *have* an ObjectToDevice
617  // transformation, so optimize that
618  basegfx::B2DHomMatrix aLinearCombination(rObjectToDevice);
619  basegfx::B2DHomMatrix aObjectToDeviceInv(rObjectToDevice);
620 
621  aLinearCombination = rMirror * aLinearCombination;
622  aObjectToDeviceInv.invert();
623  aLinearCombination = aObjectToDeviceInv * aLinearCombination;
624 
625  return drawPolyLine(
626  aLinearCombination,
627  i_rPolygon,
628  i_fTransparency,
629  i_rLineWidth,
630  i_eLineJoin,
631  i_eLineCap,
632  i_fMiterMinimumAngle,
633  bPixelSnapHairline);
634  }
635  }
636  }
637 
638  // no mirroring set (or identity), use standard call
639  return drawPolyLine(
640  rObjectToDevice,
641  i_rPolygon,
642  i_fTransparency,
643  i_rLineWidth,
644  i_eLineJoin,
645  i_eLineCap,
646  i_fMiterMinimumAngle,
647  bPixelSnapHairline);
648 }
649 
650 bool SalGraphics::DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient )
651 {
652  return drawGradient( rPolyPoly, rGradient );
653 }
654 
655 bool SalGraphics::DrawGradient(basegfx::B2DPolyPolygon const & rPolyPolygon, SalGradient const & rSalGradient)
656 {
657  return implDrawGradient(rPolyPolygon, rSalGradient);
658 }
659 
660 void SalGraphics::CopyArea( long nDestX, long nDestY,
661  long nSrcX, long nSrcY,
662  long nSrcWidth, long nSrcHeight,
663  const OutputDevice *pOutDev )
664 {
665  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
666  {
667  mirror( nDestX, nSrcWidth, pOutDev );
668  mirror( nSrcX, nSrcWidth, pOutDev );
669  }
670  copyArea( nDestX, nDestY, nSrcX, nSrcY, nSrcWidth, nSrcHeight, true/*bWindowInvalidate*/ );
671 }
672 
673 void SalGraphics::CopyBits( const SalTwoRect& rPosAry,
674  SalGraphics* pSrcGraphics, const OutputDevice *pOutDev, const OutputDevice *pSrcOutDev )
675 {
676  if( ( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) ||
677  (pSrcGraphics && ( (pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl) || (pSrcOutDev && pSrcOutDev->IsRTLEnabled()) ) ) )
678  {
679  SalTwoRect aPosAry2 = rPosAry;
680  if( (pSrcGraphics && (pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl)) || (pSrcOutDev && pSrcOutDev->IsRTLEnabled()) )
681  mirror( aPosAry2.mnSrcX, aPosAry2.mnSrcWidth, pSrcOutDev );
682  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
683  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
684  copyBits( aPosAry2, pSrcGraphics );
685  }
686  else
687  copyBits( rPosAry, pSrcGraphics );
688 }
689 
690 void SalGraphics::DrawBitmap( const SalTwoRect& rPosAry,
691  const SalBitmap& rSalBitmap, const OutputDevice *pOutDev )
692 {
693  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
694  {
695  SalTwoRect aPosAry2 = rPosAry;
696  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
697  drawBitmap( aPosAry2, rSalBitmap );
698  }
699  else
700  drawBitmap( rPosAry, rSalBitmap );
701 }
702 
703 void SalGraphics::DrawBitmap( const SalTwoRect& rPosAry,
704  const SalBitmap& rSalBitmap,
705  const SalBitmap& rTransparentBitmap, const OutputDevice *pOutDev )
706 {
707  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
708  {
709  SalTwoRect aPosAry2 = rPosAry;
710  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
711  drawBitmap( aPosAry2, rSalBitmap, rTransparentBitmap );
712  }
713  else
714  drawBitmap( rPosAry, rSalBitmap, rTransparentBitmap );
715 }
716 
717 void SalGraphics::DrawMask( const SalTwoRect& rPosAry,
718  const SalBitmap& rSalBitmap,
719  Color nMaskColor, const OutputDevice *pOutDev )
720 {
721  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
722  {
723  SalTwoRect aPosAry2 = rPosAry;
724  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
725  drawMask( aPosAry2, rSalBitmap, nMaskColor );
726  }
727  else
728  drawMask( rPosAry, rSalBitmap, nMaskColor );
729 }
730 
731 std::shared_ptr<SalBitmap> SalGraphics::GetBitmap( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
732 {
733  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
734  mirror( nX, nWidth, pOutDev );
735  return getBitmap( nX, nY, nWidth, nHeight );
736 }
737 
738 Color SalGraphics::GetPixel( long nX, long nY, const OutputDevice *pOutDev )
739 {
740  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
741  mirror( nX, pOutDev );
742  return getPixel( nX, nY );
743 }
744 
745 void SalGraphics::Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev )
746 {
747  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
748  mirror( nX, nWidth, pOutDev );
749  invert( nX, nY, nWidth, nHeight, nFlags );
750 }
751 
752 void SalGraphics::Invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev )
753 {
754  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
755  {
756  std::unique_ptr<SalPoint[]> pPtAry2(new SalPoint[nPoints]);
757  bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
758  invert( nPoints, bCopied ? pPtAry2.get() : pPtAry, nFlags );
759  }
760  else
761  invert( nPoints, pPtAry, nFlags );
762 }
763 
764 bool SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize, const OutputDevice *pOutDev )
765 {
766  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
767  mirror( nX, nWidth, pOutDev );
768  return drawEPS( nX, nY, nWidth, nHeight, pPtr, nSize );
769 }
770 
772  const Point& aPos, bool& rIsInside, const OutputDevice *pOutDev )
773 {
774  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
775  {
776  Point pt( aPos );
777  tools::Rectangle rgn( rControlRegion );
778  pt.setX( mirror2( pt.X(), pOutDev ) );
779  mirror( rgn, pOutDev );
780  return forWidget()->hitTestNativeControl( ControlType::Scrollbar, nPart, rgn, pt, rIsInside );
781  }
782  else
783  return forWidget()->hitTestNativeControl( ControlType::Scrollbar, nPart, rControlRegion, aPos, rIsInside );
784 }
785 
786 void SalGraphics::mirror( ImplControlValue& rVal, const OutputDevice* pOutDev ) const
787 {
788  switch( rVal.getType() )
789  {
790  case ControlType::Slider:
791  {
792  SliderValue* pSlVal = static_cast<SliderValue*>(&rVal);
793  mirror(pSlVal->maThumbRect,pOutDev);
794  }
795  break;
797  {
798  ScrollbarValue* pScVal = static_cast<ScrollbarValue*>(&rVal);
799  mirror(pScVal->maThumbRect,pOutDev);
800  mirror(pScVal->maButton1Rect,pOutDev);
801  mirror(pScVal->maButton2Rect,pOutDev);
802  }
803  break;
806  {
807  SpinbuttonValue* pSpVal = static_cast<SpinbuttonValue*>(&rVal);
808  mirror(pSpVal->maUpperRect,pOutDev);
809  mirror(pSpVal->maLowerRect,pOutDev);
810  }
811  break;
813  {
814  ToolbarValue* pTVal = static_cast<ToolbarValue*>(&rVal);
815  mirror(pTVal->maGripRect,pOutDev);
816  }
817  break;
818  default: break;
819  }
820 }
821 
822 bool SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion,
823  ControlState nState, const ImplControlValue& aValue,
824  const OUString& aCaption, const OutputDevice *pOutDev)
825 {
826  bool bRet = false;
827  tools::Rectangle aControlRegion(rControlRegion);
828  if (aControlRegion.IsEmpty())
829  return bRet;
830 
831  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
832  {
833  mirror(aControlRegion, pOutDev);
834  std::unique_ptr< ImplControlValue > mirrorValue( aValue.clone());
835  mirror( *mirrorValue, pOutDev );
836  bRet = forWidget()->drawNativeControl(nType, nPart, aControlRegion, nState, *mirrorValue, aCaption);
837  }
838  else
839  bRet = forWidget()->drawNativeControl(nType, nPart, aControlRegion, nState, aValue, aCaption);
840 
841  if (bRet && m_pWidgetDraw)
842  handleDamage(aControlRegion);
843  return bRet;
844 }
845 
847  const ImplControlValue& aValue,
848  tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion, const OutputDevice *pOutDev )
849 {
850  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
851  {
852  tools::Rectangle rgn( rControlRegion );
853  mirror( rgn, pOutDev );
854  std::unique_ptr< ImplControlValue > mirrorValue( aValue.clone());
855  mirror( *mirrorValue, pOutDev );
856  if (forWidget()->getNativeControlRegion(nType, nPart, rgn, nState, *mirrorValue, OUString(), rNativeBoundingRegion, rNativeContentRegion))
857  {
858  mirror( rNativeBoundingRegion, pOutDev, true );
859  mirror( rNativeContentRegion, pOutDev, true );
860  return true;
861  }
862  return false;
863  }
864  else
865  return forWidget()->getNativeControlRegion(nType, nPart, rControlRegion, nState, aValue, OUString(), rNativeBoundingRegion, rNativeContentRegion);
866 }
867 
869  const SalBitmap& rBitmap,
870  const OutputDevice *pOutDev )
871 {
872  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
873  {
874  SalTwoRect aPosAry2 = rPosAry;
875  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
876  return blendBitmap( aPosAry2, rBitmap );
877  }
878  else
879  return blendBitmap( rPosAry, rBitmap );
880 }
881 
883  const SalBitmap& rSrcBitmap,
884  const SalBitmap& rMaskBitmap,
885  const SalBitmap& rAlphaBitmap,
886  const OutputDevice *pOutDev )
887 {
888  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
889  {
890  SalTwoRect aPosAry2 = rPosAry;
891  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
892  return blendAlphaBitmap( aPosAry2, rSrcBitmap, rMaskBitmap, rAlphaBitmap );
893  }
894  else
895  return blendAlphaBitmap( rPosAry, rSrcBitmap, rMaskBitmap, rAlphaBitmap );
896 }
897 
899  const SalBitmap& rSourceBitmap,
900  const SalBitmap& rAlphaBitmap,
901  const OutputDevice *pOutDev )
902 {
903  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
904  {
905  SalTwoRect aPosAry2 = rPosAry;
906  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
907  return drawAlphaBitmap( aPosAry2, rSourceBitmap, rAlphaBitmap );
908  }
909  else
910  return drawAlphaBitmap( rPosAry, rSourceBitmap, rAlphaBitmap );
911 }
912 
914  const basegfx::B2DPoint& rNull,
915  const basegfx::B2DPoint& rX,
916  const basegfx::B2DPoint& rY,
917  const SalBitmap& rSourceBitmap,
918  const SalBitmap* pAlphaBitmap,
919  const OutputDevice* pOutDev)
920 {
921  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
922  {
923  mirror(rNull, pOutDev);
924  mirror(rX, pOutDev);
925  mirror(rY, pOutDev);
926 
927  return drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap);
928  }
929  else
930  {
931  return drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap);
932  }
933 }
934 
935 bool SalGraphics::DrawAlphaRect( long nX, long nY, long nWidth, long nHeight,
936  sal_uInt8 nTransparency, const OutputDevice *pOutDev )
937 {
938  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
939  mirror( nX, nWidth, pOutDev );
940 
941  return drawAlphaRect( nX, nY, nWidth, nHeight, nTransparency );
942 }
943 
944 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SalFrame * GetParent() const =0
virtual bool drawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap)=0
Render bitmap with alpha channel.
long mnSrcWidth
Definition: salgtype.hxx:52
virtual long GetGraphicsWidth() const =0
long GetWidth() const
unsigned long nWidth
Definition: salgeom.hxx:31
bool DrawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap, const OutputDevice *pOutDev)
virtual bool drawTransformedBitmap(const basegfx::B2DPoint &rNull, const basegfx::B2DPoint &rX, const basegfx::B2DPoint &rY, const SalBitmap &rSourceBitmap, const SalBitmap *pAlphaBitmap)=0
draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system ...
void mirror(long &nX, const OutputDevice *pOutDev) const
rtl::Reference< OpenGLContext > GetOpenGLContext() const
Check that our mpImpl is OpenGL and return the context, otherwise NULL.
virtual bool IsVirtual() const
Definition: outdev.cxx:183
virtual bool blendAlphaBitmap(const SalTwoRect &, const SalBitmap &rSrcBitmap, const SalBitmap &rMaskBitmap, const SalBitmap &rAlphaBitmap)=0
Draw the bitmap by blending using the mask and alpha channel.
void DrawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor, const OutputDevice *pOutDev)
SalFrameGeometry GetGeometry() const
ControlType getType() const
void Union(const tools::Rectangle &rRegion)
Definition: region.cxx:508
long GetDeviceWidth(const OutputDevice *pOutDev) const
long GetOutOffXPixel() const
Definition: outdev.hxx:445
sal_uIntPtr sal_uLong
virtual void copyArea(long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, bool bWindowInvalidate)=0
bool DrawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const SalPoint *const *pPtAry, const PolyFlags *const *pFlgAry, const OutputDevice *pOutDev)
virtual void invert(long nX, long nY, long nWidth, long nHeight, SalInvert nFlags)=0
virtual bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const SalPoint *const *pPtAry, const PolyFlags *const *pFlgAry)=0
tools::Rectangle maButton2Rect
void CopyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics, const OutputDevice *pOutDev, const OutputDevice *pSrcOutDev)
long mnDestWidth
Definition: salgtype.hxx:56
long m_aLastMirrorW
Definition: salgdi.hxx:596
long mnSrcX
Definition: salgtype.hxx:50
virtual bool blendBitmap(const SalTwoRect &, const SalBitmap &rBitmap)=0
Blend the bitmap with the current buffer.
long mnY
Definition: salgtype.hxx:43
void DrawRect(long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev)
bool DrawEPS(long nX, long nY, long nWidth, long nHeight, void *pPtr, sal_uInt32 nSize, const OutputDevice *pOutDev)
float x
tools::Rectangle maLowerRect
virtual void drawPolygon(sal_uInt32 nPoints, const SalPoint *pPtAry)=0
virtual bool drawPolyLineBezier(sal_uInt32 nPoints, const SalPoint *pPtAry, const PolyFlags *pFlgAry)=0
NONE
void Move(long nHorzMoveDelta, long nVertMoveDelta)
std::vector< tools::Rectangle > RectangleVector
Definition: region.hxx:37
virtual bool implDrawGradient(basegfx::B2DPolyPolygon const &, SalGradient const &)
Definition: salgdi.hxx:492
bool IsEmpty() const
tools::Rectangle maUpperRect
void setX(long nX)
bool initWidgetDrawBackends(bool bForce=false)
basegfx::B2DHomMatrix m_aLastMirror
Definition: salgdi.hxx:595
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
virtual bool hitTestNativeControl(ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, const Point &aPos, bool &rIsInside)
Query if a position is inside the native widget part.
void DrawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const OutputDevice *pOutDev)
bool DrawGradient(const tools::PolyPolygon &rPolyPoly, const Gradient &rGradient)
void DrawPolyLine(sal_uInt32 nPoints, SalPoint const *pPtAry, const OutputDevice *pOutDev)
void DrawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, PCONSTSALPOINT *pPtAry, const OutputDevice *pOutDev)
void DrawPolygon(sal_uInt32 nPoints, const SalPoint *pPtAry, const OutputDevice *pOutDev)
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap)=0
long mnX
Definition: salgtype.hxx:42
SalLayoutFlags m_nLayout
Definition: salgdi.hxx:592
virtual Color getPixel(long nX, long nY)=0
virtual bool setClipRegion(const vcl::Region &)=0
bool IsRTLEnabled() const
Definition: outdev.hxx:1354
bool BlendBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const OutputDevice *pOutDev)
static void hardDisable()
Called from a signal handler or watchdog thread if we get a crash or hang in some GL code...
virtual ImplControlValue * clone() const
void SetEmpty()
Definition: region.cxx:1417
tools::Rectangle maButton1Rect
bool DrawTransformedBitmap(const basegfx::B2DPoint &rNull, const basegfx::B2DPoint &rX, const basegfx::B2DPoint &rY, const SalBitmap &rSourceBitmap, const SalBitmap *pAlphaBitmap, const OutputDevice *pOutDev)
bool BlendAlphaBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalSrcBitmap, const SalBitmap &rSalMaskBitmap, const SalBitmap &rSalAlphaBitmap, const OutputDevice *pOutDev)
virtual bool getNativeControlRegion(ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, ControlState eState, const ImplControlValue &aValue, const OUString &aCaption, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion)
Get the native control regions for the control part.
int i
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
Definition: outdev.cxx:604
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:304
rtl::Reference< OpenGLContext > GetOpenGLContext()
static bool GetLayoutRTL()
void transform(const basegfx::B2DHomMatrix &rMatrix)
SalFrameGeometry maGeometry
absolute, unmirrored values
Definition: salframe.hxx:127
sal_Int32 w
std::unique_ptr< vcl::WidgetDrawInterface > m_pWidgetDraw
Definition: salgdi.hxx:617
virtual std::shared_ptr< SalBitmap > getBitmap(long nX, long nY, long nWidth, long nHeight)=0
bool DrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, const OutputDevice *pOutDev)
SalInvert
Definition: salgtype.hxx:84
bool isIdentity() const
bool SetClipRegion(const vcl::Region &, const OutputDevice *pOutDev)
virtual SalGraphicsImpl * GetImpl() const =0
virtual void copyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics)=0
long X() const
tools::Rectangle maThumbRect
void DrawPixel(long nX, long nY, const OutputDevice *pOutDev)
virtual bool drawNativeControl(ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, ControlState eState, const ImplControlValue &aValue, const OUString &aCaptions)
Draw the requested control.
long GetOutputWidthPixel() const
Definition: outdev.hxx:443
vcl::WidgetDrawInterface * forWidget()
Definition: salgdi.hxx:618
ControlType
These types are all based on the supported variants vcl/salnativewidgets.hxx and must be kept in-sync...
SalLayoutFlags
Definition: outdev.hxx:121
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
void CopyArea(long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, const OutputDevice *pOutDev)
def rectangle(l)
virtual void drawRect(long nX, long nY, long nWidth, long nHeight)=0
bool HitTestNativeScrollbar(ControlPart nPart, const tools::Rectangle &rControlRegion, const Point &aPos, bool &rIsInside, const OutputDevice *pOutDev)
virtual bool drawPolygonBezier(sal_uInt32 nPoints, const SalPoint *pPtAry, const PolyFlags *pFlgAry)=0
virtual void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, PCONSTSALPOINT *pPtAry)=0
void Invert(long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev)
const basegfx::B2DHomMatrix & getMirror(const OutputDevice *pOutDev) const
#define SAL_WARN_IF(condition, area, stream)
unsigned char sal_uInt8
SalLayoutFlags GetLayout() const
Definition: salgdi.hxx:200
long mnDestX
Definition: salgtype.hxx:54
bool GetNativeControlRegion(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion, const OutputDevice *pOutDev)
Color GetPixel(long nX, long nY, const OutputDevice *pOutDev)
void GetRegionRectangles(RectangleVector &rTarget) const
Definition: region.cxx:1659
virtual void drawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor)=0
virtual void drawLine(long nX1, long nY1, long nX2, long nY2)=0
bool HasPolyPolygonOrB2DPolyPolygon() const
Definition: region.hxx:110
~SalGraphics() COVERITY_NOEXCEPT_FALSE override
long Left() const
virtual void drawPixel(long nX, long nY)=0
virtual void drawPolyLine(sal_uInt32 nPoints, const SalPoint *pPtAry)=0
basegfx::B2DPolyPolygon GetAsB2DPolyPolygon() const
Definition: region.cxx:1289
long mirror2(long nX, const OutputDevice *pOutDev) const
tools::Rectangle maGripRect
virtual bool drawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency)=0
Render solid rectangle with given transparency.
void DrawLine(long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev)
std::shared_ptr< SalBitmap > GetBitmap(long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev)
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
bool DrawPolyLineBezier(sal_uInt32 nPoints, const SalPoint *pPtAry, const PolyFlags *pFlgAry, const OutputDevice *pOutDev)
virtual bool drawEPS(long nX, long nY, long nWidth, long nHeight, void *pPtr, sal_uInt32 nSize)=0
virtual bool drawGradient(const tools::PolyPolygon &rPolyPoly, const Gradient &rGradient)=0
tools::Rectangle maThumbRect
virtual void handleDamage(const tools::Rectangle &rDamagedRegion)
Handle damage done by drawing with a widget draw override.
Definition: salgdi.hxx:631
bool DrawPolygonBezier(sal_uInt32 nPoints, const SalPoint *pPtAry, const PolyFlags *pFlgAry, const OutputDevice *pOutDev)
PolyFlags
bool DrawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency, const OutputDevice *pOutDev)