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 
124  vcl::Region aWinRegion( aWinRect );
125 
126  if ( aWinRegion == aWinClipRegion )
127  aWinClipRegion.SetNull();
128 
129  aWinClipRegion.Move( -mnOutOffX, -mnOutOffY );
130 
131  return aWinClipRegion;
132 }
133 
134 
136 {
137  vcl::Region aRegion(true);
138 
139  if ( mpWindowImpl->mbInPaint )
140  {
141  aRegion = *(mpWindowImpl->mpPaintRegion);
142  aRegion.Move( -mnOutOffX, -mnOutOffY );
143  }
144 
145  if ( mbClipRegion )
146  aRegion.Intersect( maRegion );
147 
148  return PixelToLogic( aRegion );
149 }
150 
152 {
153  const vcl::Region aPaintRgn(GetPaintRegion());
154 
155  if (!aPaintRgn.IsNull())
156  rDstRect.Intersection(LogicToPixel(aPaintRgn.GetBoundRect()));
157 }
158 
159 void Window::EnableClipSiblings( bool bClipSiblings )
160 {
161 
162  if ( mpWindowImpl->mpBorderWindow )
163  mpWindowImpl->mpBorderWindow->EnableClipSiblings( bClipSiblings );
164 
165  mpWindowImpl->mbClipSiblings = bClipSiblings;
166 }
167 
168 void Window::ImplClipBoundaries( vcl::Region& rRegion, bool bThis, bool bOverlaps )
169 {
170  if ( bThis )
172  else if ( ImplIsOverlapWindow() )
173  {
174  // clip to frame if required
175  if ( !mpWindowImpl->mbFrame )
176  rRegion.Intersect( tools::Rectangle( Point( 0, 0 ), Size( mpWindowImpl->mpFrameWindow->mnOutWidth, mpWindowImpl->mpFrameWindow->mnOutHeight ) ) );
177 
178  if ( bOverlaps && !rRegion.IsEmpty() )
179  {
180  // Clip Overlap Siblings
181  vcl::Window* pStartOverlapWindow = this;
182  while ( !pStartOverlapWindow->mpWindowImpl->mbFrame )
183  {
184  vcl::Window* pOverlapWindow = pStartOverlapWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
185  while ( pOverlapWindow && (pOverlapWindow != pStartOverlapWindow) )
186  {
187  pOverlapWindow->ImplExcludeOverlapWindows2( rRegion );
188  pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
189  }
190  pStartOverlapWindow = pStartOverlapWindow->mpWindowImpl->mpOverlapWindow;
191  }
192 
193  // Clip Child Overlap Windows
194  ImplExcludeOverlapWindows( rRegion );
195  }
196  }
197  else
199 }
200 
201 bool Window::ImplClipChildren( vcl::Region& rRegion ) const
202 {
203  bool bOtherClip = false;
204  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
205  while ( pWindow )
206  {
207  if ( pWindow->mpWindowImpl->mbReallyVisible )
208  {
209  // read-out ParentClipMode-Flags
210  ParentClipMode nClipMode = pWindow->GetParentClipMode();
211  if ( !(nClipMode & ParentClipMode::NoClip) &&
212  ((nClipMode & ParentClipMode::Clip) || (GetStyle() & WB_CLIPCHILDREN)) )
213  pWindow->ImplExcludeWindowRegion( rRegion );
214  else
215  bOtherClip = true;
216  }
217 
218  pWindow = pWindow->mpWindowImpl->mpNext;
219  }
220 
221  return bOtherClip;
222 }
223 
225 {
226  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
227  while ( pWindow )
228  {
229  if ( pWindow->mpWindowImpl->mbReallyVisible )
230  pWindow->ImplExcludeWindowRegion( rRegion );
231  pWindow = pWindow->mpWindowImpl->mpNext;
232  }
233 }
234 
235 void Window::ImplClipSiblings( vcl::Region& rRegion ) const
236 {
237  vcl::Window* pWindow = ImplGetParent()->mpWindowImpl->mpFirstChild;
238  while ( pWindow )
239  {
240  if ( pWindow == this )
241  break;
242 
243  if ( pWindow->mpWindowImpl->mbReallyVisible )
244  pWindow->ImplExcludeWindowRegion( rRegion );
245 
246  pWindow = pWindow->mpWindowImpl->mpNext;
247  }
248 }
249 
251 {
252  // Build Window Region
253  mpWindowImpl->maWinClipRegion = tools::Rectangle( Point( mnOutOffX, mnOutOffY ),
255  if ( mpWindowImpl->mbWinRegion )
256  mpWindowImpl->maWinClipRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
257 
258  // ClipSiblings
259  if ( mpWindowImpl->mbClipSiblings && !ImplIsOverlapWindow() )
260  ImplClipSiblings( mpWindowImpl->maWinClipRegion );
261 
262  // Clip Parent Boundaries
263  ImplClipBoundaries( mpWindowImpl->maWinClipRegion, false, true );
264 
265  // Clip Children
266  if ( (GetStyle() & WB_CLIPCHILDREN) || mpWindowImpl->mbClipChildren )
267  mpWindowImpl->mbInitChildRegion = true;
268 
269  mpWindowImpl->mbInitWinClipRegion = false;
270 }
271 
273 {
274  if ( !mpWindowImpl->mpFirstChild )
275  {
276  mpWindowImpl->mpChildClipRegion.reset();
277  }
278  else
279  {
280  if ( !mpWindowImpl->mpChildClipRegion )
281  mpWindowImpl->mpChildClipRegion.reset( new vcl::Region( mpWindowImpl->maWinClipRegion ) );
282  else
283  *mpWindowImpl->mpChildClipRegion = mpWindowImpl->maWinClipRegion;
284 
285  ImplClipChildren( *mpWindowImpl->mpChildClipRegion );
286  }
287 
288  mpWindowImpl->mbInitChildRegion = false;
289 }
290 
292 {
293  if ( mpWindowImpl->mbInitWinClipRegion )
295  if ( mpWindowImpl->mbInitChildRegion )
297  if ( mpWindowImpl->mpChildClipRegion )
298  return mpWindowImpl->mpChildClipRegion.get();
299  else
300  return &mpWindowImpl->maWinClipRegion;
301 }
302 
303 
304 bool Window::ImplSysObjClip( const vcl::Region* pOldRegion )
305 {
306  bool bUpdate = true;
307 
308  if ( mpWindowImpl->mpSysObj )
309  {
310  bool bVisibleState = mpWindowImpl->mbReallyVisible;
311 
312  if ( bVisibleState )
313  {
314  vcl::Region* pWinChildClipRegion = ImplGetWinChildClipRegion();
315 
316  if ( !pWinChildClipRegion->IsEmpty() )
317  {
318  if ( pOldRegion )
319  {
320  vcl::Region aNewRegion = *pWinChildClipRegion;
321  pWinChildClipRegion->Intersect( *pOldRegion );
322  bUpdate = aNewRegion == *pWinChildClipRegion;
323  }
324 
325  vcl::Region aRegion = *pWinChildClipRegion;
327  vcl::Region aWinRectRegion( aWinRect );
328 
329  if ( aRegion == aWinRectRegion )
330  mpWindowImpl->mpSysObj->ResetClipRegion();
331  else
332  {
333  aRegion.Move( -mnOutOffX, -mnOutOffY );
334 
335  // set/update clip region
336  RectangleVector aRectangles;
337  aRegion.GetRegionRectangles(aRectangles);
338  mpWindowImpl->mpSysObj->BeginSetClipRegion(aRectangles.size());
339 
340  for (auto const& rectangle : aRectangles)
341  {
342  mpWindowImpl->mpSysObj->UnionClipRegion(
343  rectangle.Left(),
344  rectangle.Top(),
345  rectangle.GetWidth(), // orig nWidth was ((R - L) + 1), same as GetWidth does
346  rectangle.GetHeight()); // same for height
347  }
348 
349  mpWindowImpl->mpSysObj->EndSetClipRegion();
350  }
351  }
352  else
353  bVisibleState = false;
354  }
355 
356  // update visible status
357  mpWindowImpl->mpSysObj->Show( bVisibleState );
358  }
359 
360  return bUpdate;
361 }
362 
364 {
365  if ( mpWindowImpl->mpSysObj && mpWindowImpl->mbInitWinClipRegion )
366  ImplSysObjClip( nullptr );
367 
368  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
369  while ( pWindow )
370  {
371  pWindow->ImplUpdateSysObjChildrenClip();
372  pWindow = pWindow->mpWindowImpl->mpNext;
373  }
374 }
375 
377 {
379 
380  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
381  while ( pWindow )
382  {
383  pWindow->ImplUpdateSysObjOverlapsClip();
384  pWindow = pWindow->mpWindowImpl->mpNext;
385  }
386 }
387 
389 {
390  if ( !ImplIsOverlapWindow() )
391  {
393 
394  // siblings should recalculate their clip region
395  if ( mpWindowImpl->mbClipSiblings )
396  {
397  vcl::Window* pWindow = mpWindowImpl->mpNext;
398  while ( pWindow )
399  {
400  pWindow->ImplUpdateSysObjChildrenClip();
401  pWindow = pWindow->mpWindowImpl->mpNext;
402  }
403  }
404  }
405  else
406  mpWindowImpl->mpFrameWindow->ImplUpdateSysObjOverlapsClip();
407 }
408 
409 bool Window::ImplSetClipFlagChildren( bool bSysObjOnlySmaller )
410 {
411  bool bUpdate = true;
412  if ( mpWindowImpl->mpSysObj )
413  {
414  std::unique_ptr<vcl::Region> pOldRegion;
415  if ( bSysObjOnlySmaller && !mpWindowImpl->mbInitWinClipRegion )
416  pOldRegion.reset(new vcl::Region( mpWindowImpl->maWinClipRegion ));
417 
418  mbInitClipRegion = true;
419  mpWindowImpl->mbInitWinClipRegion = true;
420 
421  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
422  while ( pWindow )
423  {
424  if ( !pWindow->ImplSetClipFlagChildren( bSysObjOnlySmaller ) )
425  bUpdate = false;
426  pWindow = pWindow->mpWindowImpl->mpNext;
427  }
428 
429  if ( !ImplSysObjClip( pOldRegion.get() ) )
430  {
431  mbInitClipRegion = true;
432  mpWindowImpl->mbInitWinClipRegion = true;
433  bUpdate = false;
434  }
435  }
436  else
437  {
438  mbInitClipRegion = true;
439  mpWindowImpl->mbInitWinClipRegion = true;
440 
441  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
442  while ( pWindow )
443  {
444  if ( !pWindow->ImplSetClipFlagChildren( bSysObjOnlySmaller ) )
445  bUpdate = false;
446  pWindow = pWindow->mpWindowImpl->mpNext;
447  }
448  }
449  return bUpdate;
450 }
451 
452 bool Window::ImplSetClipFlagOverlapWindows( bool bSysObjOnlySmaller )
453 {
454  bool bUpdate = ImplSetClipFlagChildren( bSysObjOnlySmaller );
455 
456  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
457  while ( pWindow )
458  {
459  if ( !pWindow->ImplSetClipFlagOverlapWindows( bSysObjOnlySmaller ) )
460  bUpdate = false;
461  pWindow = pWindow->mpWindowImpl->mpNext;
462  }
463 
464  return bUpdate;
465 }
466 
467 bool Window::ImplSetClipFlag( bool bSysObjOnlySmaller )
468 {
469  if ( !ImplIsOverlapWindow() )
470  {
471  bool bUpdate = ImplSetClipFlagChildren( bSysObjOnlySmaller );
472 
473  vcl::Window* pParent = ImplGetParent();
474  if ( pParent &&
475  ((pParent->GetStyle() & WB_CLIPCHILDREN) || (mpWindowImpl->mnParentClipMode & ParentClipMode::Clip)) )
476  {
477  pParent->mbInitClipRegion = true;
478  pParent->mpWindowImpl->mbInitChildRegion = true;
479  }
480 
481  // siblings should recalculate their clip region
482  if ( mpWindowImpl->mbClipSiblings )
483  {
484  vcl::Window* pWindow = mpWindowImpl->mpNext;
485  while ( pWindow )
486  {
487  if ( !pWindow->ImplSetClipFlagChildren( bSysObjOnlySmaller ) )
488  bUpdate = false;
489  pWindow = pWindow->mpWindowImpl->mpNext;
490  }
491  }
492 
493  return bUpdate;
494  }
495  else
496  return mpWindowImpl->mpFrameWindow->ImplSetClipFlagOverlapWindows( bSysObjOnlySmaller );
497 }
498 
500 {
501  if ( mpWindowImpl->mbInitWinClipRegion )
503 
504  rRegion.Intersect( mpWindowImpl->maWinClipRegion );
505 }
506 
508 {
510  Size( mnOutWidth, mnOutHeight ) ) );
511  if ( mpWindowImpl->mbWinRegion )
512  rRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
513 }
514 
516 {
517  if ( mpWindowImpl->mbWinRegion )
518  {
519  Point aPoint( mnOutOffX, mnOutOffY );
520  vcl::Region aRegion( tools::Rectangle( aPoint,
521  Size( mnOutWidth, mnOutHeight ) ) );
522  aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
523  rRegion.Exclude( aRegion );
524  }
525  else
526  {
527  Point aPoint( mnOutOffX, mnOutOffY );
528  rRegion.Exclude( tools::Rectangle( aPoint,
529  Size( mnOutWidth, mnOutHeight ) ) );
530  }
531 }
532 
534 {
535  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
536  while ( pWindow )
537  {
538  if ( pWindow->mpWindowImpl->mbReallyVisible )
539  {
540  pWindow->ImplExcludeWindowRegion( rRegion );
541  pWindow->ImplExcludeOverlapWindows( rRegion );
542  }
543 
544  pWindow = pWindow->mpWindowImpl->mpNext;
545  }
546 }
547 
549 {
550  if ( mpWindowImpl->mbReallyVisible )
551  ImplExcludeWindowRegion( rRegion );
552 
553  ImplExcludeOverlapWindows( rRegion );
554 }
555 
556 void Window::ImplIntersectAndUnionOverlapWindows( const vcl::Region& rInterRegion, vcl::Region& rRegion ) const
557 {
558  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
559  while ( pWindow )
560  {
561  if ( pWindow->mpWindowImpl->mbReallyVisible )
562  {
563  vcl::Region aTempRegion( rInterRegion );
564  pWindow->ImplIntersectWindowRegion( aTempRegion );
565  rRegion.Union( aTempRegion );
566  pWindow->ImplIntersectAndUnionOverlapWindows( rInterRegion, rRegion );
567  }
568 
569  pWindow = pWindow->mpWindowImpl->mpNext;
570  }
571 }
572 
574 {
575  if ( mpWindowImpl->mbReallyVisible )
576  {
577  vcl::Region aTempRegion( rInterRegion );
578  ImplIntersectWindowRegion( aTempRegion );
579  rRegion.Union( aTempRegion );
580  }
581 
582  ImplIntersectAndUnionOverlapWindows( rInterRegion, rRegion );
583 }
584 
585 void Window::ImplCalcOverlapRegionOverlaps( const vcl::Region& rInterRegion, vcl::Region& rRegion ) const
586 {
587  // Clip Overlap Siblings
588  vcl::Window const * pStartOverlapWindow;
589  if ( !ImplIsOverlapWindow() )
590  pStartOverlapWindow = mpWindowImpl->mpOverlapWindow;
591  else
592  pStartOverlapWindow = this;
593  while ( !pStartOverlapWindow->mpWindowImpl->mbFrame )
594  {
595  vcl::Window* pOverlapWindow = pStartOverlapWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
596  while ( pOverlapWindow && (pOverlapWindow != pStartOverlapWindow) )
597  {
598  pOverlapWindow->ImplIntersectAndUnionOverlapWindows2( rInterRegion, rRegion );
599  pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
600  }
601  pStartOverlapWindow = pStartOverlapWindow->mpWindowImpl->mpOverlapWindow;
602  }
603 
604  // Clip Child Overlap Windows
605  if ( !ImplIsOverlapWindow() )
606  mpWindowImpl->mpOverlapWindow->ImplIntersectAndUnionOverlapWindows( rInterRegion, rRegion );
607  else
608  ImplIntersectAndUnionOverlapWindows( rInterRegion, rRegion );
609 }
610 
611 void Window::ImplCalcOverlapRegion( const tools::Rectangle& rSourceRect, vcl::Region& rRegion,
612  bool bChildren, bool bSiblings )
613 {
614  vcl::Region aRegion( rSourceRect );
615  if ( mpWindowImpl->mbWinRegion )
616  rRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
617  vcl::Region aTempRegion;
618  vcl::Window* pWindow;
619 
620  ImplCalcOverlapRegionOverlaps( aRegion, rRegion );
621 
622  // Parent-Boundaries
623  pWindow = this;
624  if ( !ImplIsOverlapWindow() )
625  {
626  pWindow = ImplGetParent();
627  do
628  {
629  aTempRegion = aRegion;
630  pWindow->ImplExcludeWindowRegion( aTempRegion );
631  rRegion.Union( aTempRegion );
632  if ( pWindow->ImplIsOverlapWindow() )
633  break;
634  pWindow = pWindow->ImplGetParent();
635  }
636  while ( pWindow );
637  }
638  if ( pWindow && !pWindow->mpWindowImpl->mbFrame )
639  {
640  aTempRegion = aRegion;
641  aTempRegion.Exclude( tools::Rectangle( Point( 0, 0 ), Size( mpWindowImpl->mpFrameWindow->mnOutWidth, mpWindowImpl->mpFrameWindow->mnOutHeight ) ) );
642  rRegion.Union( aTempRegion );
643  }
644 
645  // Siblings
646  if ( bSiblings && !ImplIsOverlapWindow() )
647  {
648  pWindow = mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild;
649  do
650  {
651  if ( pWindow->mpWindowImpl->mbReallyVisible && (pWindow != this) )
652  {
653  aTempRegion = aRegion;
654  pWindow->ImplIntersectWindowRegion( aTempRegion );
655  rRegion.Union( aTempRegion );
656  }
657  pWindow = pWindow->mpWindowImpl->mpNext;
658  }
659  while ( pWindow );
660  }
661 
662  if ( !bChildren )
663  return;
664 
665  pWindow = mpWindowImpl->mpFirstChild;
666  while ( pWindow )
667  {
668  if ( pWindow->mpWindowImpl->mbReallyVisible )
669  {
670  aTempRegion = aRegion;
671  pWindow->ImplIntersectWindowRegion( aTempRegion );
672  rRegion.Union( aTempRegion );
673  }
674  pWindow = pWindow->mpWindowImpl->mpNext;
675  }
676 }
677 
678 void Window::SaveBackground(VirtualDevice& rSaveDevice, const Point& rPos, const Size& rSize, const Size&) const
679 {
680  MapMode aTempMap(GetMapMode());
681  aTempMap.SetOrigin(Point());
682  rSaveDevice.SetMapMode(aTempMap);
683 
684  if ( mpWindowImpl->mpPaintRegion )
685  {
686  vcl::Region aClip( *mpWindowImpl->mpPaintRegion );
687  const Point aPixPos( LogicToPixel( rPos ) );
688 
689  aClip.Move( -mnOutOffX, -mnOutOffY );
690  aClip.Intersect( tools::Rectangle( aPixPos, LogicToPixel( rSize ) ) );
691 
692  if ( !aClip.IsEmpty() )
693  {
694  const vcl::Region aOldClip( rSaveDevice.GetClipRegion() );
695  const Point aPixOffset( rSaveDevice.LogicToPixel( Point() ) );
696  const bool bMap = rSaveDevice.IsMapModeEnabled();
697 
698  // move clip region to have the same distance to DestOffset
699  aClip.Move( aPixOffset.X() - aPixPos.X(), aPixOffset.Y() - aPixPos.Y() );
700 
701  // set pixel clip region
702  rSaveDevice.EnableMapMode( false );
703  rSaveDevice.SetClipRegion( aClip );
704  rSaveDevice.EnableMapMode( bMap );
705  rSaveDevice.DrawOutDev( Point(), rSize, rPos, rSize, *this );
706  rSaveDevice.SetClipRegion( aOldClip );
707  }
708  }
709  else
710  {
711  rSaveDevice.DrawOutDev( Point(), rSize, rPos, rSize, *this );
712  }
713 
714  rSaveDevice.SetMapMode(MapMode());
715 }
716 
717 } /* namespace vcl */
718 
719 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl::Region GetClipRegion() const
long mnOutOffX
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
Definition: outdev.hxx:340
void EnableClipSiblings(bool bClipSiblings=true)
bool IsNull() const
Definition: region.hxx:102
tools::Rectangle & Intersection(const tools::Rectangle &rRect)
SAL_DLLPRIVATE void ImplIntersectWindowClipRegion(vcl::Region &rRegion)
long mnOutOffY
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
Definition: outdev.hxx:342
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
const MapMode & GetMapMode() const
Definition: outdev.hxx:1677
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
vcl::Region GetPaintRegion() const
Definition: paint.cxx:1146
void EnableMapMode(bool bEnable=true)
Definition: map.cxx:647
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:655
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
Definition: window2.cxx:926
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:604
SAL_DLLPRIVATE void ImplClipBoundaries(vcl::Region &rRegion, bool bThis, bool bOverlaps)
bool mbClipRegionSet
Definition: outdev.hxx:387
void Move(long nHorzMove, long nVertMove)
Definition: region.cxx:414
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:588
Size GetOutputSize() const
Definition: outdev.hxx:450
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:302
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:510
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
Definition: window2.cxx:865
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:1187
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:942
void SaveBackground(VirtualDevice &rSaveDevice, const Point &rPos, const Size &rSize, const Size &) const override
SAL_DLLPRIVATE void ImplUpdateSysObjClip()
ParentClipMode
Definition: window.hxx:256
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:637
def rectangle(l)
bool mbClipRegion
Definition: outdev.hxx:375
SAL_DLLPRIVATE bool ImplSysObjClip(const vcl::Region *pOldRegion)
SAL_DLLPRIVATE void ImplExcludeWindowRegion(vcl::Region &rRegion)
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:576
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:348
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
long mnOutWidth
Definition: outdev.hxx:343
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
WinBits GetStyle() const
Definition: window2.cxx:953
#define DBG_TESTSOLARMUTEX()
long mnOutHeight
Definition: outdev.hxx:344
SAL_DLLPRIVATE void ImplInitWinClipRegion()
WinBits const WB_CLIPCHILDREN
virtual vcl::Region GetOutputBoundsClipRegion() const override