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 
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 void SalGraphics::CopyArea( long nDestX, long nDestY,
656  long nSrcX, long nSrcY,
657  long nSrcWidth, long nSrcHeight,
658  const OutputDevice *pOutDev )
659 {
660  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
661  {
662  mirror( nDestX, nSrcWidth, pOutDev );
663  mirror( nSrcX, nSrcWidth, pOutDev );
664  }
665  copyArea( nDestX, nDestY, nSrcX, nSrcY, nSrcWidth, nSrcHeight, true/*bWindowInvalidate*/ );
666 }
667 
668 void SalGraphics::CopyBits( const SalTwoRect& rPosAry,
669  SalGraphics* pSrcGraphics, const OutputDevice *pOutDev, const OutputDevice *pSrcOutDev )
670 {
671  if( ( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) ||
672  (pSrcGraphics && ( (pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl) || (pSrcOutDev && pSrcOutDev->IsRTLEnabled()) ) ) )
673  {
674  SalTwoRect aPosAry2 = rPosAry;
675  if( (pSrcGraphics && (pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl)) || (pSrcOutDev && pSrcOutDev->IsRTLEnabled()) )
676  mirror( aPosAry2.mnSrcX, aPosAry2.mnSrcWidth, pSrcOutDev );
677  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
678  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
679  copyBits( aPosAry2, pSrcGraphics );
680  }
681  else
682  copyBits( rPosAry, pSrcGraphics );
683 }
684 
685 void SalGraphics::DrawBitmap( const SalTwoRect& rPosAry,
686  const SalBitmap& rSalBitmap, const OutputDevice *pOutDev )
687 {
688  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
689  {
690  SalTwoRect aPosAry2 = rPosAry;
691  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
692  drawBitmap( aPosAry2, rSalBitmap );
693  }
694  else
695  drawBitmap( rPosAry, rSalBitmap );
696 }
697 
698 void SalGraphics::DrawBitmap( const SalTwoRect& rPosAry,
699  const SalBitmap& rSalBitmap,
700  const SalBitmap& rTransparentBitmap, const OutputDevice *pOutDev )
701 {
702  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
703  {
704  SalTwoRect aPosAry2 = rPosAry;
705  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
706  drawBitmap( aPosAry2, rSalBitmap, rTransparentBitmap );
707  }
708  else
709  drawBitmap( rPosAry, rSalBitmap, rTransparentBitmap );
710 }
711 
712 void SalGraphics::DrawMask( const SalTwoRect& rPosAry,
713  const SalBitmap& rSalBitmap,
714  Color nMaskColor, const OutputDevice *pOutDev )
715 {
716  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
717  {
718  SalTwoRect aPosAry2 = rPosAry;
719  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
720  drawMask( aPosAry2, rSalBitmap, nMaskColor );
721  }
722  else
723  drawMask( rPosAry, rSalBitmap, nMaskColor );
724 }
725 
726 std::shared_ptr<SalBitmap> SalGraphics::GetBitmap( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
727 {
728  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
729  mirror( nX, nWidth, pOutDev );
730  return getBitmap( nX, nY, nWidth, nHeight );
731 }
732 
733 Color SalGraphics::GetPixel( long nX, long nY, const OutputDevice *pOutDev )
734 {
735  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
736  mirror( nX, pOutDev );
737  return getPixel( nX, nY );
738 }
739 
740 void SalGraphics::Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev )
741 {
742  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
743  mirror( nX, nWidth, pOutDev );
744  invert( nX, nY, nWidth, nHeight, nFlags );
745 }
746 
747 void SalGraphics::Invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev )
748 {
749  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
750  {
751  std::unique_ptr<SalPoint[]> pPtAry2(new SalPoint[nPoints]);
752  bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
753  invert( nPoints, bCopied ? pPtAry2.get() : pPtAry, nFlags );
754  }
755  else
756  invert( nPoints, pPtAry, nFlags );
757 }
758 
759 bool SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize, const OutputDevice *pOutDev )
760 {
761  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
762  mirror( nX, nWidth, pOutDev );
763  return drawEPS( nX, nY, nWidth, nHeight, pPtr, nSize );
764 }
765 
767  const Point& aPos, bool& rIsInside, const OutputDevice *pOutDev )
768 {
769  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
770  {
771  Point pt( aPos );
772  tools::Rectangle rgn( rControlRegion );
773  pt.setX( mirror2( pt.X(), pOutDev ) );
774  mirror( rgn, pOutDev );
775  return forWidget()->hitTestNativeControl( ControlType::Scrollbar, nPart, rgn, pt, rIsInside );
776  }
777  else
778  return forWidget()->hitTestNativeControl( ControlType::Scrollbar, nPart, rControlRegion, aPos, rIsInside );
779 }
780 
781 void SalGraphics::mirror( ImplControlValue& rVal, const OutputDevice* pOutDev ) const
782 {
783  switch( rVal.getType() )
784  {
785  case ControlType::Slider:
786  {
787  SliderValue* pSlVal = static_cast<SliderValue*>(&rVal);
788  mirror(pSlVal->maThumbRect,pOutDev);
789  }
790  break;
792  {
793  ScrollbarValue* pScVal = static_cast<ScrollbarValue*>(&rVal);
794  mirror(pScVal->maThumbRect,pOutDev);
795  mirror(pScVal->maButton1Rect,pOutDev);
796  mirror(pScVal->maButton2Rect,pOutDev);
797  }
798  break;
801  {
802  SpinbuttonValue* pSpVal = static_cast<SpinbuttonValue*>(&rVal);
803  mirror(pSpVal->maUpperRect,pOutDev);
804  mirror(pSpVal->maLowerRect,pOutDev);
805  }
806  break;
808  {
809  ToolbarValue* pTVal = static_cast<ToolbarValue*>(&rVal);
810  mirror(pTVal->maGripRect,pOutDev);
811  }
812  break;
813  default: break;
814  }
815 }
816 
817 bool SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion,
818  ControlState nState, const ImplControlValue& aValue,
819  const OUString& aCaption, const OutputDevice *pOutDev)
820 {
821  bool bRet = false;
822  tools::Rectangle aControlRegion(rControlRegion);
823  if (aControlRegion.IsEmpty())
824  return bRet;
825 
826  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
827  {
828  mirror(aControlRegion, pOutDev);
829  std::unique_ptr< ImplControlValue > mirrorValue( aValue.clone());
830  mirror( *mirrorValue, pOutDev );
831  bRet = forWidget()->drawNativeControl(nType, nPart, aControlRegion, nState, *mirrorValue, aCaption);
832  }
833  else
834  bRet = forWidget()->drawNativeControl(nType, nPart, aControlRegion, nState, aValue, aCaption);
835 
836  if (bRet && m_pWidgetDraw)
837  handleDamage(aControlRegion);
838  return bRet;
839 }
840 
842  const ImplControlValue& aValue,
843  tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion, const OutputDevice *pOutDev )
844 {
845  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
846  {
847  tools::Rectangle rgn( rControlRegion );
848  mirror( rgn, pOutDev );
849  std::unique_ptr< ImplControlValue > mirrorValue( aValue.clone());
850  mirror( *mirrorValue, pOutDev );
851  if (forWidget()->getNativeControlRegion(nType, nPart, rgn, nState, *mirrorValue, OUString(), rNativeBoundingRegion, rNativeContentRegion))
852  {
853  mirror( rNativeBoundingRegion, pOutDev, true );
854  mirror( rNativeContentRegion, pOutDev, true );
855  return true;
856  }
857  return false;
858  }
859  else
860  return forWidget()->getNativeControlRegion(nType, nPart, rControlRegion, nState, aValue, OUString(), rNativeBoundingRegion, rNativeContentRegion);
861 }
862 
864  const SalBitmap& rBitmap,
865  const OutputDevice *pOutDev )
866 {
867  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
868  {
869  SalTwoRect aPosAry2 = rPosAry;
870  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
871  return blendBitmap( aPosAry2, rBitmap );
872  }
873  else
874  return blendBitmap( rPosAry, rBitmap );
875 }
876 
878  const SalBitmap& rSrcBitmap,
879  const SalBitmap& rMaskBitmap,
880  const SalBitmap& rAlphaBitmap,
881  const OutputDevice *pOutDev )
882 {
883  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
884  {
885  SalTwoRect aPosAry2 = rPosAry;
886  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
887  return blendAlphaBitmap( aPosAry2, rSrcBitmap, rMaskBitmap, rAlphaBitmap );
888  }
889  else
890  return blendAlphaBitmap( rPosAry, rSrcBitmap, rMaskBitmap, rAlphaBitmap );
891 }
892 
894  const SalBitmap& rSourceBitmap,
895  const SalBitmap& rAlphaBitmap,
896  const OutputDevice *pOutDev )
897 {
898  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
899  {
900  SalTwoRect aPosAry2 = rPosAry;
901  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
902  return drawAlphaBitmap( aPosAry2, rSourceBitmap, rAlphaBitmap );
903  }
904  else
905  return drawAlphaBitmap( rPosAry, rSourceBitmap, rAlphaBitmap );
906 }
907 
909  const basegfx::B2DPoint& rNull,
910  const basegfx::B2DPoint& rX,
911  const basegfx::B2DPoint& rY,
912  const SalBitmap& rSourceBitmap,
913  const SalBitmap* pAlphaBitmap,
914  const OutputDevice* pOutDev)
915 {
916  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
917  {
918  mirror(rNull, pOutDev);
919  mirror(rX, pOutDev);
920  mirror(rY, pOutDev);
921 
922  return drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap);
923  }
924  else
925  {
926  return drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap);
927  }
928 }
929 
930 bool SalGraphics::DrawAlphaRect( long nX, long nY, long nWidth, long nHeight,
931  sal_uInt8 nTransparency, const OutputDevice *pOutDev )
932 {
933  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
934  mirror( nX, nWidth, pOutDev );
935 
936  return drawAlphaRect( nX, nY, nWidth, nHeight, nTransparency );
937 }
938 
939 /* 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:587
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
void Move(long nHorzMoveDelta, long nVertMoveDelta)
std::vector< tools::Rectangle > RectangleVector
Definition: region.hxx:37
bool IsEmpty() const
tools::Rectangle maUpperRect
void setX(long nX)
~SalGraphics() override
bool initWidgetDrawBackends(bool bForce=false)
basegfx::B2DHomMatrix m_aLastMirror
Definition: salgdi.hxx:586
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
NONE
SalLayoutFlags m_nLayout
Definition: salgdi.hxx:583
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:608
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:609
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:199
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
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:622
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)