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;
297  return mpWindowImpl->maWinClipRegion;
298 }
299 
300 bool Window::ImplSysObjClip( const vcl::Region* pOldRegion )
301 {
302  bool bUpdate = true;
303 
304  if ( mpWindowImpl->mpSysObj )
305  {
306  bool bVisibleState = mpWindowImpl->mbReallyVisible;
307 
308  if ( bVisibleState )
309  {
310  vcl::Region& rWinChildClipRegion = ImplGetWinChildClipRegion();
311 
312  if (!rWinChildClipRegion.IsEmpty())
313  {
314  if ( pOldRegion )
315  {
316  vcl::Region aNewRegion = rWinChildClipRegion;
317  rWinChildClipRegion.Intersect(*pOldRegion);
318  bUpdate = aNewRegion == rWinChildClipRegion;
319  }
320 
321  vcl::Region aRegion = rWinChildClipRegion;
322  vcl::Region aWinRectRegion( GetOutputRectPixel() );
323 
324  if ( aRegion == aWinRectRegion )
325  mpWindowImpl->mpSysObj->ResetClipRegion();
326  else
327  {
328  aRegion.Move( -mnOutOffX, -mnOutOffY );
329 
330  // set/update clip region
331  RectangleVector aRectangles;
332  aRegion.GetRegionRectangles(aRectangles);
333  mpWindowImpl->mpSysObj->BeginSetClipRegion(aRectangles.size());
334 
335  for (auto const& rectangle : aRectangles)
336  {
337  mpWindowImpl->mpSysObj->UnionClipRegion(
338  rectangle.Left(),
339  rectangle.Top(),
340  rectangle.GetWidth(), // orig nWidth was ((R - L) + 1), same as GetWidth does
341  rectangle.GetHeight()); // same for height
342  }
343 
344  mpWindowImpl->mpSysObj->EndSetClipRegion();
345  }
346  }
347  else
348  bVisibleState = false;
349  }
350 
351  // update visible status
352  mpWindowImpl->mpSysObj->Show( bVisibleState );
353  }
354 
355  return bUpdate;
356 }
357 
359 {
360  if ( mpWindowImpl->mpSysObj && mpWindowImpl->mbInitWinClipRegion )
361  ImplSysObjClip( nullptr );
362 
363  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
364  while ( pWindow )
365  {
366  pWindow->ImplUpdateSysObjChildrenClip();
367  pWindow = pWindow->mpWindowImpl->mpNext;
368  }
369 }
370 
372 {
374 
375  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
376  while ( pWindow )
377  {
378  pWindow->ImplUpdateSysObjOverlapsClip();
379  pWindow = pWindow->mpWindowImpl->mpNext;
380  }
381 }
382 
384 {
385  if ( !ImplIsOverlapWindow() )
386  {
388 
389  // siblings should recalculate their clip region
390  if ( mpWindowImpl->mbClipSiblings )
391  {
392  vcl::Window* pWindow = mpWindowImpl->mpNext;
393  while ( pWindow )
394  {
395  pWindow->ImplUpdateSysObjChildrenClip();
396  pWindow = pWindow->mpWindowImpl->mpNext;
397  }
398  }
399  }
400  else
401  mpWindowImpl->mpFrameWindow->ImplUpdateSysObjOverlapsClip();
402 }
403 
404 bool Window::ImplSetClipFlagChildren( bool bSysObjOnlySmaller )
405 {
406  bool bUpdate = true;
407  if ( mpWindowImpl->mpSysObj )
408  {
409  std::unique_ptr<vcl::Region> pOldRegion;
410  if ( bSysObjOnlySmaller && !mpWindowImpl->mbInitWinClipRegion )
411  pOldRegion.reset(new vcl::Region( mpWindowImpl->maWinClipRegion ));
412 
413  mbInitClipRegion = true;
414  mpWindowImpl->mbInitWinClipRegion = true;
415 
416  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
417  while ( pWindow )
418  {
419  if ( !pWindow->ImplSetClipFlagChildren( bSysObjOnlySmaller ) )
420  bUpdate = false;
421  pWindow = pWindow->mpWindowImpl->mpNext;
422  }
423 
424  if ( !ImplSysObjClip( pOldRegion.get() ) )
425  {
426  mbInitClipRegion = true;
427  mpWindowImpl->mbInitWinClipRegion = true;
428  bUpdate = false;
429  }
430  }
431  else
432  {
433  mbInitClipRegion = true;
434  mpWindowImpl->mbInitWinClipRegion = true;
435 
436  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
437  while ( pWindow )
438  {
439  if ( !pWindow->ImplSetClipFlagChildren( bSysObjOnlySmaller ) )
440  bUpdate = false;
441  pWindow = pWindow->mpWindowImpl->mpNext;
442  }
443  }
444  return bUpdate;
445 }
446 
447 bool Window::ImplSetClipFlagOverlapWindows( bool bSysObjOnlySmaller )
448 {
449  bool bUpdate = ImplSetClipFlagChildren( bSysObjOnlySmaller );
450 
451  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
452  while ( pWindow )
453  {
454  if ( !pWindow->ImplSetClipFlagOverlapWindows( bSysObjOnlySmaller ) )
455  bUpdate = false;
456  pWindow = pWindow->mpWindowImpl->mpNext;
457  }
458 
459  return bUpdate;
460 }
461 
462 bool Window::ImplSetClipFlag( bool bSysObjOnlySmaller )
463 {
464  if ( !ImplIsOverlapWindow() )
465  {
466  bool bUpdate = ImplSetClipFlagChildren( bSysObjOnlySmaller );
467 
468  vcl::Window* pParent = ImplGetParent();
469  if ( pParent &&
470  ((pParent->GetStyle() & WB_CLIPCHILDREN) || (mpWindowImpl->mnParentClipMode & ParentClipMode::Clip)) )
471  {
472  pParent->mbInitClipRegion = true;
473  pParent->mpWindowImpl->mbInitChildRegion = true;
474  }
475 
476  // siblings should recalculate their clip region
477  if ( mpWindowImpl->mbClipSiblings )
478  {
479  vcl::Window* pWindow = mpWindowImpl->mpNext;
480  while ( pWindow )
481  {
482  if ( !pWindow->ImplSetClipFlagChildren( bSysObjOnlySmaller ) )
483  bUpdate = false;
484  pWindow = pWindow->mpWindowImpl->mpNext;
485  }
486  }
487 
488  return bUpdate;
489  }
490  else
491  return mpWindowImpl->mpFrameWindow->ImplSetClipFlagOverlapWindows( bSysObjOnlySmaller );
492 }
493 
495 {
496  if ( mpWindowImpl->mbInitWinClipRegion )
498 
499  rRegion.Intersect( mpWindowImpl->maWinClipRegion );
500 }
501 
503 {
504  rRegion.Intersect( GetOutputRectPixel() );
505  if ( mpWindowImpl->mbWinRegion )
506  rRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
507 }
508 
510 {
511  if ( mpWindowImpl->mbWinRegion )
512  {
513  vcl::Region aRegion( GetOutputRectPixel() );
514  aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
515  rRegion.Exclude( aRegion );
516  }
517  else
518  {
519  rRegion.Exclude( GetOutputRectPixel() );
520  }
521 }
522 
524 {
525  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
526  while ( pWindow )
527  {
528  if ( pWindow->mpWindowImpl->mbReallyVisible )
529  {
530  pWindow->ImplExcludeWindowRegion( rRegion );
531  pWindow->ImplExcludeOverlapWindows( rRegion );
532  }
533 
534  pWindow = pWindow->mpWindowImpl->mpNext;
535  }
536 }
537 
539 {
540  if ( mpWindowImpl->mbReallyVisible )
541  ImplExcludeWindowRegion( rRegion );
542 
543  ImplExcludeOverlapWindows( rRegion );
544 }
545 
546 void Window::ImplIntersectAndUnionOverlapWindows( const vcl::Region& rInterRegion, vcl::Region& rRegion ) const
547 {
548  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
549  while ( pWindow )
550  {
551  if ( pWindow->mpWindowImpl->mbReallyVisible )
552  {
553  vcl::Region aTempRegion( rInterRegion );
554  pWindow->ImplIntersectWindowRegion( aTempRegion );
555  rRegion.Union( aTempRegion );
556  pWindow->ImplIntersectAndUnionOverlapWindows( rInterRegion, rRegion );
557  }
558 
559  pWindow = pWindow->mpWindowImpl->mpNext;
560  }
561 }
562 
564 {
565  if ( mpWindowImpl->mbReallyVisible )
566  {
567  vcl::Region aTempRegion( rInterRegion );
568  ImplIntersectWindowRegion( aTempRegion );
569  rRegion.Union( aTempRegion );
570  }
571 
572  ImplIntersectAndUnionOverlapWindows( rInterRegion, rRegion );
573 }
574 
575 void Window::ImplCalcOverlapRegionOverlaps( const vcl::Region& rInterRegion, vcl::Region& rRegion ) const
576 {
577  // Clip Overlap Siblings
578  vcl::Window const * pStartOverlapWindow;
579  if ( !ImplIsOverlapWindow() )
580  pStartOverlapWindow = mpWindowImpl->mpOverlapWindow;
581  else
582  pStartOverlapWindow = this;
583  while ( !pStartOverlapWindow->mpWindowImpl->mbFrame )
584  {
585  vcl::Window* pOverlapWindow = pStartOverlapWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
586  while ( pOverlapWindow && (pOverlapWindow != pStartOverlapWindow) )
587  {
588  pOverlapWindow->ImplIntersectAndUnionOverlapWindows2( rInterRegion, rRegion );
589  pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
590  }
591  pStartOverlapWindow = pStartOverlapWindow->mpWindowImpl->mpOverlapWindow;
592  }
593 
594  // Clip Child Overlap Windows
595  if ( !ImplIsOverlapWindow() )
596  mpWindowImpl->mpOverlapWindow->ImplIntersectAndUnionOverlapWindows( rInterRegion, rRegion );
597  else
598  ImplIntersectAndUnionOverlapWindows( rInterRegion, rRegion );
599 }
600 
601 void Window::ImplCalcOverlapRegion( const tools::Rectangle& rSourceRect, vcl::Region& rRegion,
602  bool bChildren, bool bSiblings )
603 {
604  vcl::Region aRegion( rSourceRect );
605  if ( mpWindowImpl->mbWinRegion )
606  rRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
607  vcl::Region aTempRegion;
608  vcl::Window* pWindow;
609 
610  ImplCalcOverlapRegionOverlaps( aRegion, rRegion );
611 
612  // Parent-Boundaries
613  pWindow = this;
614  if ( !ImplIsOverlapWindow() )
615  {
616  pWindow = ImplGetParent();
617  do
618  {
619  aTempRegion = aRegion;
620  pWindow->ImplExcludeWindowRegion( aTempRegion );
621  rRegion.Union( aTempRegion );
622  if ( pWindow->ImplIsOverlapWindow() )
623  break;
624  pWindow = pWindow->ImplGetParent();
625  }
626  while ( pWindow );
627  }
628  if ( pWindow && !pWindow->mpWindowImpl->mbFrame )
629  {
630  aTempRegion = aRegion;
631  aTempRegion.Exclude( tools::Rectangle( Point( 0, 0 ), mpWindowImpl->mpFrameWindow->GetOutputSizePixel() ) );
632  rRegion.Union( aTempRegion );
633  }
634 
635  // Siblings
636  if ( bSiblings && !ImplIsOverlapWindow() )
637  {
638  pWindow = mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild;
639  do
640  {
641  if ( pWindow->mpWindowImpl->mbReallyVisible && (pWindow != this) )
642  {
643  aTempRegion = aRegion;
644  pWindow->ImplIntersectWindowRegion( aTempRegion );
645  rRegion.Union( aTempRegion );
646  }
647  pWindow = pWindow->mpWindowImpl->mpNext;
648  }
649  while ( pWindow );
650  }
651 
652  if ( !bChildren )
653  return;
654 
655  pWindow = mpWindowImpl->mpFirstChild;
656  while ( pWindow )
657  {
658  if ( pWindow->mpWindowImpl->mbReallyVisible )
659  {
660  aTempRegion = aRegion;
661  pWindow->ImplIntersectWindowRegion( aTempRegion );
662  rRegion.Union( aTempRegion );
663  }
664  pWindow = pWindow->mpWindowImpl->mpNext;
665  }
666 }
667 
668 void Window::SaveBackground(VirtualDevice& rSaveDevice, const Point& rPos, const Size& rSize, const Size&) const
669 {
670  MapMode aTempMap(GetMapMode());
671  aTempMap.SetOrigin(Point());
672  rSaveDevice.SetMapMode(aTempMap);
673 
674  if ( mpWindowImpl->mpPaintRegion )
675  {
676  vcl::Region aClip( *mpWindowImpl->mpPaintRegion );
677  const Point aPixPos( LogicToPixel( rPos ) );
678 
679  aClip.Move( -mnOutOffX, -mnOutOffY );
680  aClip.Intersect( tools::Rectangle( aPixPos, LogicToPixel( rSize ) ) );
681 
682  if ( !aClip.IsEmpty() )
683  {
684  const vcl::Region aOldClip( rSaveDevice.GetClipRegion() );
685  const Point aPixOffset( rSaveDevice.LogicToPixel( Point() ) );
686  const bool bMap = rSaveDevice.IsMapModeEnabled();
687 
688  // move clip region to have the same distance to DestOffset
689  aClip.Move( aPixOffset.X() - aPixPos.X(), aPixOffset.Y() - aPixPos.Y() );
690 
691  // set pixel clip region
692  rSaveDevice.EnableMapMode( false );
693  rSaveDevice.SetClipRegion( aClip );
694  rSaveDevice.EnableMapMode( bMap );
695  rSaveDevice.DrawOutDev( Point(), rSize, rPos, rSize, *this );
696  rSaveDevice.SetClipRegion( aOldClip );
697  }
698  }
699  else
700  {
701  rSaveDevice.DrawOutDev( Point(), rSize, rPos, rSize, *this );
702  }
703 
704  rSaveDevice.SetMapMode(MapMode());
705 }
706 
707 } /* namespace vcl */
708 
709 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl::Region GetClipRegion() const
void EnableClipSiblings(bool bClipSiblings=true)
SAL_DLLPRIVATE vcl::Region & ImplGetWinChildClipRegion()
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:1684
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:1690
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
vcl::Region GetPaintRegion() const
Definition: paint.cxx:1124
void EnableMapMode(bool bEnable=true)
Definition: map.cxx:508
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:516
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
Definition: window2.cxx:925
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:607
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:591
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:508
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
Definition: window2.cxx:864
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:1021
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:800
void SaveBackground(VirtualDevice &rSaveDevice, const Point &rPos, const Size &rSize, const Size &) const override
SAL_DLLPRIVATE void ImplUpdateSysObjClip()
ParentClipMode
Definition: window.hxx:250
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:498
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
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:353
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:952
#define DBG_TESTSOLARMUTEX()
SAL_DLLPRIVATE void ImplInitWinClipRegion()
WinBits const WB_CLIPCHILDREN
virtual vcl::Region GetOutputBoundsClipRegion() const override