LibreOffice Module vcl (master)  1
window/clipping.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 <vcl/window.hxx>
21 #include <vcl/virdev.hxx>
22 
23 #include <tools/debug.hxx>
24 
25 #include <salobj.hxx>
26 #include <window.h>
27 
28 namespace vcl {
29 
31 {
32  vcl::Region aClip(GetClipRegion());
34 
35  return aClip;
36 }
37 
39 {
41 
42  vcl::Region aRegion;
43 
44  if ( mpWindowImpl->mbInPaint )
45  aRegion = *(mpWindowImpl->mpPaintRegion);
46  else
47  {
48  aRegion = *(ImplGetWinChildClipRegion());
49  // only this region is in frame coordinates, so re-mirror it
50  // the mpWindowImpl->mpPaintRegion above is already correct (see ImplCallPaint()) !
51  if( ImplIsAntiparallel() )
52  ReMirror ( aRegion );
53  }
54  if ( mbClipRegion )
56  if ( aRegion.IsEmpty() )
57  mbOutputClipped = true;
58  else
59  {
60  mbOutputClipped = false;
61  SelectClipRegion( aRegion );
62  }
63  mbClipRegionSet = true;
64 
65  mbInitClipRegion = false;
66 }
67 
69 {
70  if ( mpWindowImpl->mpBorderWindow )
71  mpWindowImpl->mpBorderWindow->SetParentClipMode( nMode );
72  else
73  {
74  if ( !ImplIsOverlapWindow() )
75  {
76  mpWindowImpl->mnParentClipMode = nMode;
77  if ( nMode & ParentClipMode::Clip )
78  mpWindowImpl->mpParent->mpWindowImpl->mbClipChildren = true;
79  }
80  }
81 }
82 
84 {
85  if ( mpWindowImpl->mpBorderWindow )
86  return mpWindowImpl->mpBorderWindow->GetParentClipMode();
87  else
88  return mpWindowImpl->mnParentClipMode;
89 }
90 
92 {
93  if( !mpWindowImpl->mpPaintRegion )
94  return;
95 
96  vcl::Region aPixRegion = LogicToPixel( rRegion );
97  vcl::Region aDevPixRegion = ImplPixelToDevicePixel( aPixRegion );
98 
99  vcl::Region aWinChildRegion = *ImplGetWinChildClipRegion();
100  // only this region is in frame coordinates, so re-mirror it
101  if( ImplIsAntiparallel() )
102  {
103  const OutputDevice *pOutDev = GetOutDev();
104  pOutDev->ReMirror( aWinChildRegion );
105  }
106 
107  aDevPixRegion.Intersect( aWinChildRegion );
108  if( ! aDevPixRegion.IsEmpty() )
109  {
110  mpWindowImpl->mpPaintRegion->Union( aDevPixRegion );
111  mbInitClipRegion = true;
112  }
113 }
114 
116 {
117  vcl::Region aWinClipRegion;
118 
119  if ( mpWindowImpl->mbInitWinClipRegion )
120  const_cast<vcl::Window*>(this)->ImplInitWinClipRegion();
121  aWinClipRegion = mpWindowImpl->maWinClipRegion;
122 
123  vcl::Region aWinRegion( GetOutputRectPixel() );
124 
125  if ( aWinRegion == aWinClipRegion )
126  aWinClipRegion.SetNull();
127 
128  aWinClipRegion.Move( -mnOutOffX, -mnOutOffY );
129 
130  return aWinClipRegion;
131 }
132 
133 
135 {
136  vcl::Region aRegion(true);
137 
138  if ( mpWindowImpl->mbInPaint )
139  {
140  aRegion = *(mpWindowImpl->mpPaintRegion);
141  aRegion.Move( -mnOutOffX, -mnOutOffY );
142  }
143 
144  if ( mbClipRegion )
145  aRegion.Intersect( maRegion );
146 
147  return PixelToLogic( aRegion );
148 }
149 
151 {
152  const vcl::Region aPaintRgn(GetPaintRegion());
153 
154  if (!aPaintRgn.IsNull())
155  rDstRect.Intersection(LogicToPixel(aPaintRgn.GetBoundRect()));
156 }
157 
158 void Window::EnableClipSiblings( bool bClipSiblings )
159 {
160 
161  if ( mpWindowImpl->mpBorderWindow )
162  mpWindowImpl->mpBorderWindow->EnableClipSiblings( bClipSiblings );
163 
164  mpWindowImpl->mbClipSiblings = bClipSiblings;
165 }
166 
167 void Window::ImplClipBoundaries( vcl::Region& rRegion, bool bThis, bool bOverlaps )
168 {
169  if ( bThis )
171  else if ( ImplIsOverlapWindow() )
172  {
173  // clip to frame if required
174  if ( !mpWindowImpl->mbFrame )
175  rRegion.Intersect( tools::Rectangle( Point( 0, 0 ), mpWindowImpl->mpFrameWindow->GetOutputSizePixel() ) );
176 
177  if ( bOverlaps && !rRegion.IsEmpty() )
178  {
179  // Clip Overlap Siblings
180  vcl::Window* pStartOverlapWindow = this;
181  while ( !pStartOverlapWindow->mpWindowImpl->mbFrame )
182  {
183  vcl::Window* pOverlapWindow = pStartOverlapWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
184  while ( pOverlapWindow && (pOverlapWindow != pStartOverlapWindow) )
185  {
186  pOverlapWindow->ImplExcludeOverlapWindows2( rRegion );
187  pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
188  }
189  pStartOverlapWindow = pStartOverlapWindow->mpWindowImpl->mpOverlapWindow;
190  }
191 
192  // Clip Child Overlap Windows
193  ImplExcludeOverlapWindows( rRegion );
194  }
195  }
196  else
198 }
199 
200 bool Window::ImplClipChildren( vcl::Region& rRegion ) const
201 {
202  bool bOtherClip = false;
203  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
204  while ( pWindow )
205  {
206  if ( pWindow->mpWindowImpl->mbReallyVisible )
207  {
208  // read-out ParentClipMode-Flags
209  ParentClipMode nClipMode = pWindow->GetParentClipMode();
210  if ( !(nClipMode & ParentClipMode::NoClip) &&
211  ((nClipMode & ParentClipMode::Clip) || (GetStyle() & WB_CLIPCHILDREN)) )
212  pWindow->ImplExcludeWindowRegion( rRegion );
213  else
214  bOtherClip = true;
215  }
216 
217  pWindow = pWindow->mpWindowImpl->mpNext;
218  }
219 
220  return bOtherClip;
221 }
222 
224 {
225  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
226  while ( pWindow )
227  {
228  if ( pWindow->mpWindowImpl->mbReallyVisible )
229  pWindow->ImplExcludeWindowRegion( rRegion );
230  pWindow = pWindow->mpWindowImpl->mpNext;
231  }
232 }
233 
234 void Window::ImplClipSiblings( vcl::Region& rRegion ) const
235 {
236  vcl::Window* pWindow = ImplGetParent()->mpWindowImpl->mpFirstChild;
237  while ( pWindow )
238  {
239  if ( pWindow == this )
240  break;
241 
242  if ( pWindow->mpWindowImpl->mbReallyVisible )
243  pWindow->ImplExcludeWindowRegion( rRegion );
244 
245  pWindow = pWindow->mpWindowImpl->mpNext;
246  }
247 }
248 
250 {
251  // Build Window Region
252  mpWindowImpl->maWinClipRegion = GetOutputRectPixel();
253  if ( mpWindowImpl->mbWinRegion )
254  mpWindowImpl->maWinClipRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
255 
256  // ClipSiblings
257  if ( mpWindowImpl->mbClipSiblings && !ImplIsOverlapWindow() )
258  ImplClipSiblings( mpWindowImpl->maWinClipRegion );
259 
260  // Clip Parent Boundaries
261  ImplClipBoundaries( mpWindowImpl->maWinClipRegion, false, true );
262 
263  // Clip Children
264  if ( (GetStyle() & WB_CLIPCHILDREN) || mpWindowImpl->mbClipChildren )
265  mpWindowImpl->mbInitChildRegion = true;
266 
267  mpWindowImpl->mbInitWinClipRegion = false;
268 }
269 
271 {
272  if ( !mpWindowImpl->mpFirstChild )
273  {
274  mpWindowImpl->mpChildClipRegion.reset();
275  }
276  else
277  {
278  if ( !mpWindowImpl->mpChildClipRegion )
279  mpWindowImpl->mpChildClipRegion.reset( new vcl::Region( mpWindowImpl->maWinClipRegion ) );
280  else
281  *mpWindowImpl->mpChildClipRegion = mpWindowImpl->maWinClipRegion;
282 
283  ImplClipChildren( *mpWindowImpl->mpChildClipRegion );
284  }
285 
286  mpWindowImpl->mbInitChildRegion = false;
287 }
288 
290 {
291  if ( mpWindowImpl->mbInitWinClipRegion )
293  if ( mpWindowImpl->mbInitChildRegion )
295  if ( mpWindowImpl->mpChildClipRegion )
296  return mpWindowImpl->mpChildClipRegion.get();
297  else
298  return &mpWindowImpl->maWinClipRegion;
299 }
300 
301 
302 bool Window::ImplSysObjClip( const vcl::Region* pOldRegion )
303 {
304  bool bUpdate = true;
305 
306  if ( mpWindowImpl->mpSysObj )
307  {
308  bool bVisibleState = mpWindowImpl->mbReallyVisible;
309 
310  if ( bVisibleState )
311  {
312  vcl::Region* pWinChildClipRegion = ImplGetWinChildClipRegion();
313 
314  if ( !pWinChildClipRegion->IsEmpty() )
315  {
316  if ( pOldRegion )
317  {
318  vcl::Region aNewRegion = *pWinChildClipRegion;
319  pWinChildClipRegion->Intersect( *pOldRegion );
320  bUpdate = aNewRegion == *pWinChildClipRegion;
321  }
322 
323  vcl::Region aRegion = *pWinChildClipRegion;
324  vcl::Region aWinRectRegion( GetOutputRectPixel() );
325 
326  if ( aRegion == aWinRectRegion )
327  mpWindowImpl->mpSysObj->ResetClipRegion();
328  else
329  {
330  aRegion.Move( -mnOutOffX, -mnOutOffY );
331 
332  // set/update clip region
333  RectangleVector aRectangles;
334  aRegion.GetRegionRectangles(aRectangles);
335  mpWindowImpl->mpSysObj->BeginSetClipRegion(aRectangles.size());
336 
337  for (auto const& rectangle : aRectangles)
338  {
339  mpWindowImpl->mpSysObj->UnionClipRegion(
340  rectangle.Left(),
341  rectangle.Top(),
342  rectangle.GetWidth(), // orig nWidth was ((R - L) + 1), same as GetWidth does
343  rectangle.GetHeight()); // same for height
344  }
345 
346  mpWindowImpl->mpSysObj->EndSetClipRegion();
347  }
348  }
349  else
350  bVisibleState = false;
351  }
352 
353  // update visible status
354  mpWindowImpl->mpSysObj->Show( bVisibleState );
355  }
356 
357  return bUpdate;
358 }
359 
361 {
362  if ( mpWindowImpl->mpSysObj && mpWindowImpl->mbInitWinClipRegion )
363  ImplSysObjClip( nullptr );
364 
365  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
366  while ( pWindow )
367  {
368  pWindow->ImplUpdateSysObjChildrenClip();
369  pWindow = pWindow->mpWindowImpl->mpNext;
370  }
371 }
372 
374 {
376 
377  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
378  while ( pWindow )
379  {
380  pWindow->ImplUpdateSysObjOverlapsClip();
381  pWindow = pWindow->mpWindowImpl->mpNext;
382  }
383 }
384 
386 {
387  if ( !ImplIsOverlapWindow() )
388  {
390 
391  // siblings should recalculate their clip region
392  if ( mpWindowImpl->mbClipSiblings )
393  {
394  vcl::Window* pWindow = mpWindowImpl->mpNext;
395  while ( pWindow )
396  {
397  pWindow->ImplUpdateSysObjChildrenClip();
398  pWindow = pWindow->mpWindowImpl->mpNext;
399  }
400  }
401  }
402  else
403  mpWindowImpl->mpFrameWindow->ImplUpdateSysObjOverlapsClip();
404 }
405 
406 bool Window::ImplSetClipFlagChildren( bool bSysObjOnlySmaller )
407 {
408  bool bUpdate = true;
409  if ( mpWindowImpl->mpSysObj )
410  {
411  std::unique_ptr<vcl::Region> pOldRegion;
412  if ( bSysObjOnlySmaller && !mpWindowImpl->mbInitWinClipRegion )
413  pOldRegion.reset(new vcl::Region( mpWindowImpl->maWinClipRegion ));
414 
415  mbInitClipRegion = true;
416  mpWindowImpl->mbInitWinClipRegion = true;
417 
418  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
419  while ( pWindow )
420  {
421  if ( !pWindow->ImplSetClipFlagChildren( bSysObjOnlySmaller ) )
422  bUpdate = false;
423  pWindow = pWindow->mpWindowImpl->mpNext;
424  }
425 
426  if ( !ImplSysObjClip( pOldRegion.get() ) )
427  {
428  mbInitClipRegion = true;
429  mpWindowImpl->mbInitWinClipRegion = true;
430  bUpdate = false;
431  }
432  }
433  else
434  {
435  mbInitClipRegion = true;
436  mpWindowImpl->mbInitWinClipRegion = true;
437 
438  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
439  while ( pWindow )
440  {
441  if ( !pWindow->ImplSetClipFlagChildren( bSysObjOnlySmaller ) )
442  bUpdate = false;
443  pWindow = pWindow->mpWindowImpl->mpNext;
444  }
445  }
446  return bUpdate;
447 }
448 
449 bool Window::ImplSetClipFlagOverlapWindows( bool bSysObjOnlySmaller )
450 {
451  bool bUpdate = ImplSetClipFlagChildren( bSysObjOnlySmaller );
452 
453  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
454  while ( pWindow )
455  {
456  if ( !pWindow->ImplSetClipFlagOverlapWindows( bSysObjOnlySmaller ) )
457  bUpdate = false;
458  pWindow = pWindow->mpWindowImpl->mpNext;
459  }
460 
461  return bUpdate;
462 }
463 
464 bool Window::ImplSetClipFlag( bool bSysObjOnlySmaller )
465 {
466  if ( !ImplIsOverlapWindow() )
467  {
468  bool bUpdate = ImplSetClipFlagChildren( bSysObjOnlySmaller );
469 
470  vcl::Window* pParent = ImplGetParent();
471  if ( pParent &&
472  ((pParent->GetStyle() & WB_CLIPCHILDREN) || (mpWindowImpl->mnParentClipMode & ParentClipMode::Clip)) )
473  {
474  pParent->mbInitClipRegion = true;
475  pParent->mpWindowImpl->mbInitChildRegion = true;
476  }
477 
478  // siblings should recalculate their clip region
479  if ( mpWindowImpl->mbClipSiblings )
480  {
481  vcl::Window* pWindow = mpWindowImpl->mpNext;
482  while ( pWindow )
483  {
484  if ( !pWindow->ImplSetClipFlagChildren( bSysObjOnlySmaller ) )
485  bUpdate = false;
486  pWindow = pWindow->mpWindowImpl->mpNext;
487  }
488  }
489 
490  return bUpdate;
491  }
492  else
493  return mpWindowImpl->mpFrameWindow->ImplSetClipFlagOverlapWindows( bSysObjOnlySmaller );
494 }
495 
497 {
498  if ( mpWindowImpl->mbInitWinClipRegion )
500 
501  rRegion.Intersect( mpWindowImpl->maWinClipRegion );
502 }
503 
505 {
506  rRegion.Intersect( GetOutputRectPixel() );
507  if ( mpWindowImpl->mbWinRegion )
508  rRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
509 }
510 
512 {
513  if ( mpWindowImpl->mbWinRegion )
514  {
515  vcl::Region aRegion( GetOutputRectPixel() );
516  aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
517  rRegion.Exclude( aRegion );
518  }
519  else
520  {
521  rRegion.Exclude( GetOutputRectPixel() );
522  }
523 }
524 
526 {
527  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
528  while ( pWindow )
529  {
530  if ( pWindow->mpWindowImpl->mbReallyVisible )
531  {
532  pWindow->ImplExcludeWindowRegion( rRegion );
533  pWindow->ImplExcludeOverlapWindows( rRegion );
534  }
535 
536  pWindow = pWindow->mpWindowImpl->mpNext;
537  }
538 }
539 
541 {
542  if ( mpWindowImpl->mbReallyVisible )
543  ImplExcludeWindowRegion( rRegion );
544 
545  ImplExcludeOverlapWindows( rRegion );
546 }
547 
548 void Window::ImplIntersectAndUnionOverlapWindows( const vcl::Region& rInterRegion, vcl::Region& rRegion ) const
549 {
550  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
551  while ( pWindow )
552  {
553  if ( pWindow->mpWindowImpl->mbReallyVisible )
554  {
555  vcl::Region aTempRegion( rInterRegion );
556  pWindow->ImplIntersectWindowRegion( aTempRegion );
557  rRegion.Union( aTempRegion );
558  pWindow->ImplIntersectAndUnionOverlapWindows( rInterRegion, rRegion );
559  }
560 
561  pWindow = pWindow->mpWindowImpl->mpNext;
562  }
563 }
564 
566 {
567  if ( mpWindowImpl->mbReallyVisible )
568  {
569  vcl::Region aTempRegion( rInterRegion );
570  ImplIntersectWindowRegion( aTempRegion );
571  rRegion.Union( aTempRegion );
572  }
573 
574  ImplIntersectAndUnionOverlapWindows( rInterRegion, rRegion );
575 }
576 
577 void Window::ImplCalcOverlapRegionOverlaps( const vcl::Region& rInterRegion, vcl::Region& rRegion ) const
578 {
579  // Clip Overlap Siblings
580  vcl::Window const * pStartOverlapWindow;
581  if ( !ImplIsOverlapWindow() )
582  pStartOverlapWindow = mpWindowImpl->mpOverlapWindow;
583  else
584  pStartOverlapWindow = this;
585  while ( !pStartOverlapWindow->mpWindowImpl->mbFrame )
586  {
587  vcl::Window* pOverlapWindow = pStartOverlapWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
588  while ( pOverlapWindow && (pOverlapWindow != pStartOverlapWindow) )
589  {
590  pOverlapWindow->ImplIntersectAndUnionOverlapWindows2( rInterRegion, rRegion );
591  pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
592  }
593  pStartOverlapWindow = pStartOverlapWindow->mpWindowImpl->mpOverlapWindow;
594  }
595 
596  // Clip Child Overlap Windows
597  if ( !ImplIsOverlapWindow() )
598  mpWindowImpl->mpOverlapWindow->ImplIntersectAndUnionOverlapWindows( rInterRegion, rRegion );
599  else
600  ImplIntersectAndUnionOverlapWindows( rInterRegion, rRegion );
601 }
602 
603 void Window::ImplCalcOverlapRegion( const tools::Rectangle& rSourceRect, vcl::Region& rRegion,
604  bool bChildren, bool bSiblings )
605 {
606  vcl::Region aRegion( rSourceRect );
607  if ( mpWindowImpl->mbWinRegion )
608  rRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
609  vcl::Region aTempRegion;
610  vcl::Window* pWindow;
611 
612  ImplCalcOverlapRegionOverlaps( aRegion, rRegion );
613 
614  // Parent-Boundaries
615  pWindow = this;
616  if ( !ImplIsOverlapWindow() )
617  {
618  pWindow = ImplGetParent();
619  do
620  {
621  aTempRegion = aRegion;
622  pWindow->ImplExcludeWindowRegion( aTempRegion );
623  rRegion.Union( aTempRegion );
624  if ( pWindow->ImplIsOverlapWindow() )
625  break;
626  pWindow = pWindow->ImplGetParent();
627  }
628  while ( pWindow );
629  }
630  if ( pWindow && !pWindow->mpWindowImpl->mbFrame )
631  {
632  aTempRegion = aRegion;
633  aTempRegion.Exclude( tools::Rectangle( Point( 0, 0 ), mpWindowImpl->mpFrameWindow->GetOutputSizePixel() ) );
634  rRegion.Union( aTempRegion );
635  }
636 
637  // Siblings
638  if ( bSiblings && !ImplIsOverlapWindow() )
639  {
640  pWindow = mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild;
641  do
642  {
643  if ( pWindow->mpWindowImpl->mbReallyVisible && (pWindow != this) )
644  {
645  aTempRegion = aRegion;
646  pWindow->ImplIntersectWindowRegion( aTempRegion );
647  rRegion.Union( aTempRegion );
648  }
649  pWindow = pWindow->mpWindowImpl->mpNext;
650  }
651  while ( pWindow );
652  }
653 
654  if ( !bChildren )
655  return;
656 
657  pWindow = mpWindowImpl->mpFirstChild;
658  while ( pWindow )
659  {
660  if ( pWindow->mpWindowImpl->mbReallyVisible )
661  {
662  aTempRegion = aRegion;
663  pWindow->ImplIntersectWindowRegion( aTempRegion );
664  rRegion.Union( aTempRegion );
665  }
666  pWindow = pWindow->mpWindowImpl->mpNext;
667  }
668 }
669 
670 void Window::SaveBackground(VirtualDevice& rSaveDevice, const Point& rPos, const Size& rSize, const Size&) const
671 {
672  MapMode aTempMap(GetMapMode());
673  aTempMap.SetOrigin(Point());
674  rSaveDevice.SetMapMode(aTempMap);
675 
676  if ( mpWindowImpl->mpPaintRegion )
677  {
678  vcl::Region aClip( *mpWindowImpl->mpPaintRegion );
679  const Point aPixPos( LogicToPixel( rPos ) );
680 
681  aClip.Move( -mnOutOffX, -mnOutOffY );
682  aClip.Intersect( tools::Rectangle( aPixPos, LogicToPixel( rSize ) ) );
683 
684  if ( !aClip.IsEmpty() )
685  {
686  const vcl::Region aOldClip( rSaveDevice.GetClipRegion() );
687  const Point aPixOffset( rSaveDevice.LogicToPixel( Point() ) );
688  const bool bMap = rSaveDevice.IsMapModeEnabled();
689 
690  // move clip region to have the same distance to DestOffset
691  aClip.Move( aPixOffset.X() - aPixPos.X(), aPixOffset.Y() - aPixPos.Y() );
692 
693  // set pixel clip region
694  rSaveDevice.EnableMapMode( false );
695  rSaveDevice.SetClipRegion( aClip );
696  rSaveDevice.EnableMapMode( bMap );
697  rSaveDevice.DrawOutDev( Point(), rSize, rPos, rSize, *this );
698  rSaveDevice.SetClipRegion( aOldClip );
699  }
700  }
701  else
702  {
703  rSaveDevice.DrawOutDev( Point(), rSize, rPos, rSize, *this );
704  }
705 
706  rSaveDevice.SetMapMode(MapMode());
707 }
708 
709 } /* namespace vcl */
710 
711 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl::Region GetClipRegion() const
void EnableClipSiblings(bool bClipSiblings=true)
bool IsNull() const
Definition: region.hxx:102
tools::Rectangle & Intersection(const tools::Rectangle &rRect)
void Move(tools::Long nHorzMove, tools::Long nVertMove)
Definition: region.cxx:414
SAL_DLLPRIVATE void ImplIntersectWindowClipRegion(vcl::Region &rRegion)
void Union(const tools::Rectangle &rRegion)
Definition: region.cxx:508
void SetNull()
Definition: region.cxx:1408
ParentClipMode GetParentClipMode() const
bool IsMapModeEnabled() const
Definition: outdev.hxx:1671
vcl::Region maRegion
Definition: outdev.hxx:359
bool mbOutputClipped
Definition: outdev.hxx:379
tools::Long mnOutOffY
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
Definition: outdev.hxx:343
const MapMode & GetMapMode() const
Definition: outdev.hxx:1677
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
vcl::Region GetPaintRegion() const
Definition: paint.cxx:1142
void EnableMapMode(bool bEnable=true)
Definition: map.cxx:538
SAL_DLLPRIVATE void ImplClipAllChildren(vcl::Region &rRegion) const
tools::Rectangle GetBoundRect() const
Definition: region.cxx:1214
SAL_DLLPRIVATE void ImplClipSiblings(vcl::Region &rRegion) const
void SetMapMode()
Definition: map.cxx:546
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
Definition: window2.cxx:924
bool SelectClipRegion(const vcl::Region &, SalGraphics *pGraphics=nullptr)
std::vector< tools::Rectangle > RectangleVector
Definition: region.hxx:37
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
Definition: outdev.cxx:595
SAL_DLLPRIVATE void ImplClipBoundaries(vcl::Region &rRegion, bool bThis, bool bOverlaps)
bool mbClipRegionSet
Definition: outdev.hxx:387
SAL_DLLPRIVATE bool ImplSetClipFlagChildren(bool bSysObjOnlySmaller)
bool IsEmpty() const
Definition: region.cxx:228
SAL_DLLPRIVATE void ImplUpdateSysObjChildrenClip()
SAL_DLLPRIVATE void ImplInitWinChildClipRegion()
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
Definition: outdev.cxx:579
Size GetOutputSize() const
Definition: outdev.hxx:454
void SetOrigin(const Point &rOrigin)
Definition: mapmod.cxx:102
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:303
SAL_DLLPRIVATE void ImplIntersectAndUnionOverlapWindows(const vcl::Region &rInterRegion, vcl::Region &rRegion) const
virtual void InitClipRegion() override
virtual void ClipToPaintRegion(tools::Rectangle &rDstRect) override
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:519
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
Definition: window2.cxx:863
void Intersect(const tools::Rectangle &rRegion)
Definition: region.cxx:584
SAL_DLLPRIVATE void ImplUpdateSysObjOverlapsClip()
void ExpandPaintClipRegion(const vcl::Region &rRegion)
SAL_DLLPRIVATE void ImplCalcOverlapRegion(const tools::Rectangle &rSourceRect, vcl::Region &rRegion, bool bChildren, bool bSiblings)
vcl::Region GetWindowClipRegionPixel() const
Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1049
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:828
void SaveBackground(VirtualDevice &rSaveDevice, const Point &rPos, const Size &rSize, const Size &) const override
SAL_DLLPRIVATE void ImplUpdateSysObjClip()
ParentClipMode
Definition: window.hxx:263
void Exclude(const tools::Rectangle &rRegion)
Definition: region.cxx:675
SAL_DLLPRIVATE void ImplIntersectWindowRegion(vcl::Region &rRegion)
SAL_DLLPRIVATE vcl::Region ImplPixelToDevicePixel(const vcl::Region &rRegion) const
Convert a region in pixel units to a region in device pixel units and coords.
Definition: map.cxx:528
def rectangle(l)
bool mbClipRegion
Definition: outdev.hxx:375
SAL_DLLPRIVATE bool ImplSysObjClip(const vcl::Region *pOldRegion)
SAL_DLLPRIVATE void ImplExcludeWindowRegion(vcl::Region &rRegion)
tools::Rectangle GetOutputRectPixel() const
Definition: outdev.hxx:451
SAL_DLLPRIVATE vcl::Region * ImplGetWinChildClipRegion()
bool mbInitClipRegion
Definition: outdev.hxx:386
SAL_DLLPRIVATE bool ImplSetClipFlagOverlapWindows(bool bSysObjOnlySmaller=false)
void GetRegionRectangles(RectangleVector &rTarget) const
Definition: region.cxx:1659
::OutputDevice const * GetOutDev() const
Definition: window.cxx:578
SAL_DLLPRIVATE void ImplExcludeOverlapWindows(vcl::Region &rRegion) const
virtual void DrawOutDev(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPt, const Size &rSrcSize)
Definition: outdev.cxx:345
SAL_DLLPRIVATE void ImplIntersectAndUnionOverlapWindows2(const vcl::Region &rInterRegion, vcl::Region &rRegion)
SAL_DLLPRIVATE bool ImplSetClipFlag(bool bSysObjOnlySmaller=false)
SAL_DLLPRIVATE bool ImplClipChildren(vcl::Region &rRegion) const
SAL_DLLPRIVATE void ImplExcludeOverlapWindows2(vcl::Region &rRegion)
virtual vcl::Region GetActiveClipRegion() const override
SAL_DLLPRIVATE void ImplCalcOverlapRegionOverlaps(const vcl::Region &rInterRegion, vcl::Region &rRegion) const
tools::Long mnOutOffX
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
Definition: outdev.hxx:341
WinBits GetStyle() const
Definition: window2.cxx:951
#define DBG_TESTSOLARMUTEX()
SAL_DLLPRIVATE void ImplInitWinClipRegion()
WinBits const WB_CLIPCHILDREN
virtual vcl::Region GetOutputBoundsClipRegion() const override