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 {
33 
34  vcl::Region aRegion;
35 
36  if ( mpWindowImpl->mbInPaint )
37  aRegion = *(mpWindowImpl->mpPaintRegion);
38  else
39  {
40  aRegion = *(ImplGetWinChildClipRegion());
41  // only this region is in frame coordinates, so re-mirror it
42  // the mpWindowImpl->mpPaintRegion above is already correct (see ImplCallPaint()) !
43  if( ImplIsAntiparallel() )
44  ReMirror ( aRegion );
45  }
46  if ( mbClipRegion )
48  if ( aRegion.IsEmpty() )
49  mbOutputClipped = true;
50  else
51  {
52  mbOutputClipped = false;
53  SelectClipRegion( aRegion );
54  }
55  mbClipRegionSet = true;
56 
57  mbInitClipRegion = false;
58 }
59 
61 {
62  if ( mpWindowImpl->mpBorderWindow )
63  mpWindowImpl->mpBorderWindow->SetParentClipMode( nMode );
64  else
65  {
66  if ( !ImplIsOverlapWindow() )
67  {
68  mpWindowImpl->mnParentClipMode = nMode;
69  if ( nMode & ParentClipMode::Clip )
70  mpWindowImpl->mpParent->mpWindowImpl->mbClipChildren = true;
71  }
72  }
73 }
74 
76 {
77  if ( mpWindowImpl->mpBorderWindow )
78  return mpWindowImpl->mpBorderWindow->GetParentClipMode();
79  else
80  return mpWindowImpl->mnParentClipMode;
81 }
82 
84 {
85  if( mpWindowImpl->mpPaintRegion )
86  {
87  vcl::Region aPixRegion = LogicToPixel( rRegion );
88  vcl::Region aDevPixRegion = ImplPixelToDevicePixel( aPixRegion );
89 
90  vcl::Region aWinChildRegion = *ImplGetWinChildClipRegion();
91  // only this region is in frame coordinates, so re-mirror it
92  if( ImplIsAntiparallel() )
93  {
94  const OutputDevice *pOutDev = GetOutDev();
95  pOutDev->ReMirror( aWinChildRegion );
96  }
97 
98  aDevPixRegion.Intersect( aWinChildRegion );
99  if( ! aDevPixRegion.IsEmpty() )
100  {
101  mpWindowImpl->mpPaintRegion->Union( aDevPixRegion );
102  mbInitClipRegion = true;
103  }
104  }
105 }
106 
108 {
109  vcl::Region aWinClipRegion;
110 
111  if ( mpWindowImpl->mbInitWinClipRegion )
112  const_cast<vcl::Window*>(this)->ImplInitWinClipRegion();
113  aWinClipRegion = mpWindowImpl->maWinClipRegion;
114 
116  vcl::Region aWinRegion( aWinRect );
117 
118  if ( aWinRegion == aWinClipRegion )
119  aWinClipRegion.SetNull();
120 
121  aWinClipRegion.Move( -mnOutOffX, -mnOutOffY );
122 
123  return aWinClipRegion;
124 }
125 
126 
128 {
129  vcl::Region aRegion(true);
130 
131  if ( mpWindowImpl->mbInPaint )
132  {
133  aRegion = *(mpWindowImpl->mpPaintRegion);
134  aRegion.Move( -mnOutOffX, -mnOutOffY );
135  }
136 
137  if ( mbClipRegion )
138  aRegion.Intersect( maRegion );
139 
140  return PixelToLogic( aRegion );
141 }
142 
144 {
145  const vcl::Region aPaintRgn(GetPaintRegion());
146 
147  if (!aPaintRgn.IsNull())
148  rDstRect.Intersection(LogicToPixel(aPaintRgn.GetBoundRect()));
149 }
150 
151 void Window::EnableClipSiblings( bool bClipSiblings )
152 {
153 
154  if ( mpWindowImpl->mpBorderWindow )
155  mpWindowImpl->mpBorderWindow->EnableClipSiblings( bClipSiblings );
156 
157  mpWindowImpl->mbClipSiblings = bClipSiblings;
158 }
159 
160 void Window::ImplClipBoundaries( vcl::Region& rRegion, bool bThis, bool bOverlaps )
161 {
162  if ( bThis )
164  else if ( ImplIsOverlapWindow() )
165  {
166  // clip to frame if required
167  if ( !mpWindowImpl->mbFrame )
168  rRegion.Intersect( tools::Rectangle( Point( 0, 0 ), Size( mpWindowImpl->mpFrameWindow->mnOutWidth, mpWindowImpl->mpFrameWindow->mnOutHeight ) ) );
169 
170  if ( bOverlaps && !rRegion.IsEmpty() )
171  {
172  // Clip Overlap Siblings
173  vcl::Window* pStartOverlapWindow = this;
174  while ( !pStartOverlapWindow->mpWindowImpl->mbFrame )
175  {
176  vcl::Window* pOverlapWindow = pStartOverlapWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
177  while ( pOverlapWindow && (pOverlapWindow != pStartOverlapWindow) )
178  {
179  pOverlapWindow->ImplExcludeOverlapWindows2( rRegion );
180  pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
181  }
182  pStartOverlapWindow = pStartOverlapWindow->mpWindowImpl->mpOverlapWindow;
183  }
184 
185  // Clip Child Overlap Windows
186  ImplExcludeOverlapWindows( rRegion );
187  }
188  }
189  else
191 }
192 
193 bool Window::ImplClipChildren( vcl::Region& rRegion ) const
194 {
195  bool bOtherClip = false;
196  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
197  while ( pWindow )
198  {
199  if ( pWindow->mpWindowImpl->mbReallyVisible )
200  {
201  // read-out ParentClipMode-Flags
202  ParentClipMode nClipMode = pWindow->GetParentClipMode();
203  if ( !(nClipMode & ParentClipMode::NoClip) &&
204  ((nClipMode & ParentClipMode::Clip) || (GetStyle() & WB_CLIPCHILDREN)) )
205  pWindow->ImplExcludeWindowRegion( rRegion );
206  else
207  bOtherClip = true;
208  }
209 
210  pWindow = pWindow->mpWindowImpl->mpNext;
211  }
212 
213  return bOtherClip;
214 }
215 
217 {
218  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
219  while ( pWindow )
220  {
221  if ( pWindow->mpWindowImpl->mbReallyVisible )
222  pWindow->ImplExcludeWindowRegion( rRegion );
223  pWindow = pWindow->mpWindowImpl->mpNext;
224  }
225 }
226 
227 void Window::ImplClipSiblings( vcl::Region& rRegion ) const
228 {
229  vcl::Window* pWindow = ImplGetParent()->mpWindowImpl->mpFirstChild;
230  while ( pWindow )
231  {
232  if ( pWindow == this )
233  break;
234 
235  if ( pWindow->mpWindowImpl->mbReallyVisible )
236  pWindow->ImplExcludeWindowRegion( rRegion );
237 
238  pWindow = pWindow->mpWindowImpl->mpNext;
239  }
240 }
241 
243 {
244  // Build Window Region
245  mpWindowImpl->maWinClipRegion = tools::Rectangle( Point( mnOutOffX, mnOutOffY ),
247  if ( mpWindowImpl->mbWinRegion )
248  mpWindowImpl->maWinClipRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
249 
250  // ClipSiblings
251  if ( mpWindowImpl->mbClipSiblings && !ImplIsOverlapWindow() )
252  ImplClipSiblings( mpWindowImpl->maWinClipRegion );
253 
254  // Clip Parent Boundaries
255  ImplClipBoundaries( mpWindowImpl->maWinClipRegion, false, true );
256 
257  // Clip Children
258  if ( (GetStyle() & WB_CLIPCHILDREN) || mpWindowImpl->mbClipChildren )
259  mpWindowImpl->mbInitChildRegion = true;
260 
261  mpWindowImpl->mbInitWinClipRegion = false;
262 }
263 
265 {
266  if ( !mpWindowImpl->mpFirstChild )
267  {
268  mpWindowImpl->mpChildClipRegion.reset();
269  }
270  else
271  {
272  if ( !mpWindowImpl->mpChildClipRegion )
273  mpWindowImpl->mpChildClipRegion.reset( new vcl::Region( mpWindowImpl->maWinClipRegion ) );
274  else
275  *mpWindowImpl->mpChildClipRegion = mpWindowImpl->maWinClipRegion;
276 
277  ImplClipChildren( *mpWindowImpl->mpChildClipRegion );
278  }
279 
280  mpWindowImpl->mbInitChildRegion = false;
281 }
282 
284 {
285  if ( mpWindowImpl->mbInitWinClipRegion )
287  if ( mpWindowImpl->mbInitChildRegion )
289  if ( mpWindowImpl->mpChildClipRegion )
290  return mpWindowImpl->mpChildClipRegion.get();
291  else
292  return &mpWindowImpl->maWinClipRegion;
293 }
294 
295 
296 bool Window::ImplSysObjClip( const vcl::Region* pOldRegion )
297 {
298  bool bUpdate = true;
299 
300  if ( mpWindowImpl->mpSysObj )
301  {
302  bool bVisibleState = mpWindowImpl->mbReallyVisible;
303 
304  if ( bVisibleState )
305  {
306  vcl::Region* pWinChildClipRegion = ImplGetWinChildClipRegion();
307 
308  if ( !pWinChildClipRegion->IsEmpty() )
309  {
310  if ( pOldRegion )
311  {
312  vcl::Region aNewRegion = *pWinChildClipRegion;
313  pWinChildClipRegion->Intersect( *pOldRegion );
314  bUpdate = aNewRegion == *pWinChildClipRegion;
315  }
316 
317  vcl::Region aRegion = *pWinChildClipRegion;
319  vcl::Region aWinRectRegion( aWinRect );
320 
321  if ( aRegion == aWinRectRegion )
322  mpWindowImpl->mpSysObj->ResetClipRegion();
323  else
324  {
325  aRegion.Move( -mnOutOffX, -mnOutOffY );
326 
327  // set/update clip region
328  RectangleVector aRectangles;
329  aRegion.GetRegionRectangles(aRectangles);
330  mpWindowImpl->mpSysObj->BeginSetClipRegion(aRectangles.size());
331 
332  for (auto const& rectangle : aRectangles)
333  {
334  mpWindowImpl->mpSysObj->UnionClipRegion(
335  rectangle.Left(),
336  rectangle.Top(),
337  rectangle.GetWidth(), // orig nWidth was ((R - L) + 1), same as GetWidth does
338  rectangle.GetHeight()); // same for height
339  }
340 
341  mpWindowImpl->mpSysObj->EndSetClipRegion();
342  }
343  }
344  else
345  bVisibleState = false;
346  }
347 
348  // update visible status
349  mpWindowImpl->mpSysObj->Show( bVisibleState );
350  }
351 
352  return bUpdate;
353 }
354 
356 {
357  if ( mpWindowImpl->mpSysObj && mpWindowImpl->mbInitWinClipRegion )
358  ImplSysObjClip( nullptr );
359 
360  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
361  while ( pWindow )
362  {
363  pWindow->ImplUpdateSysObjChildrenClip();
364  pWindow = pWindow->mpWindowImpl->mpNext;
365  }
366 }
367 
369 {
371 
372  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
373  while ( pWindow )
374  {
375  pWindow->ImplUpdateSysObjOverlapsClip();
376  pWindow = pWindow->mpWindowImpl->mpNext;
377  }
378 }
379 
381 {
382  if ( !ImplIsOverlapWindow() )
383  {
385 
386  // siblings should recalculate their clip region
387  if ( mpWindowImpl->mbClipSiblings )
388  {
389  vcl::Window* pWindow = mpWindowImpl->mpNext;
390  while ( pWindow )
391  {
392  pWindow->ImplUpdateSysObjChildrenClip();
393  pWindow = pWindow->mpWindowImpl->mpNext;
394  }
395  }
396  }
397  else
398  mpWindowImpl->mpFrameWindow->ImplUpdateSysObjOverlapsClip();
399 }
400 
401 bool Window::ImplSetClipFlagChildren( bool bSysObjOnlySmaller )
402 {
403  bool bUpdate = true;
404  if ( mpWindowImpl->mpSysObj )
405  {
406  std::unique_ptr<vcl::Region> pOldRegion;
407  if ( bSysObjOnlySmaller && !mpWindowImpl->mbInitWinClipRegion )
408  pOldRegion.reset(new vcl::Region( mpWindowImpl->maWinClipRegion ));
409 
410  mbInitClipRegion = true;
411  mpWindowImpl->mbInitWinClipRegion = true;
412 
413  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
414  while ( pWindow )
415  {
416  if ( !pWindow->ImplSetClipFlagChildren( bSysObjOnlySmaller ) )
417  bUpdate = false;
418  pWindow = pWindow->mpWindowImpl->mpNext;
419  }
420 
421  if ( !ImplSysObjClip( pOldRegion.get() ) )
422  {
423  mbInitClipRegion = true;
424  mpWindowImpl->mbInitWinClipRegion = true;
425  bUpdate = false;
426  }
427  }
428  else
429  {
430  mbInitClipRegion = true;
431  mpWindowImpl->mbInitWinClipRegion = true;
432 
433  vcl::Window* pWindow = mpWindowImpl->mpFirstChild;
434  while ( pWindow )
435  {
436  if ( !pWindow->ImplSetClipFlagChildren( bSysObjOnlySmaller ) )
437  bUpdate = false;
438  pWindow = pWindow->mpWindowImpl->mpNext;
439  }
440  }
441  return bUpdate;
442 }
443 
444 bool Window::ImplSetClipFlagOverlapWindows( bool bSysObjOnlySmaller )
445 {
446  bool bUpdate = ImplSetClipFlagChildren( bSysObjOnlySmaller );
447 
448  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
449  while ( pWindow )
450  {
451  if ( !pWindow->ImplSetClipFlagOverlapWindows( bSysObjOnlySmaller ) )
452  bUpdate = false;
453  pWindow = pWindow->mpWindowImpl->mpNext;
454  }
455 
456  return bUpdate;
457 }
458 
459 bool Window::ImplSetClipFlag( bool bSysObjOnlySmaller )
460 {
461  if ( !ImplIsOverlapWindow() )
462  {
463  bool bUpdate = ImplSetClipFlagChildren( bSysObjOnlySmaller );
464 
465  vcl::Window* pParent = ImplGetParent();
466  if ( pParent &&
467  ((pParent->GetStyle() & WB_CLIPCHILDREN) || (mpWindowImpl->mnParentClipMode & ParentClipMode::Clip)) )
468  {
469  pParent->mbInitClipRegion = true;
470  pParent->mpWindowImpl->mbInitChildRegion = true;
471  }
472 
473  // siblings should recalculate their clip region
474  if ( mpWindowImpl->mbClipSiblings )
475  {
476  vcl::Window* pWindow = mpWindowImpl->mpNext;
477  while ( pWindow )
478  {
479  if ( !pWindow->ImplSetClipFlagChildren( bSysObjOnlySmaller ) )
480  bUpdate = false;
481  pWindow = pWindow->mpWindowImpl->mpNext;
482  }
483  }
484 
485  return bUpdate;
486  }
487  else
488  return mpWindowImpl->mpFrameWindow->ImplSetClipFlagOverlapWindows( bSysObjOnlySmaller );
489 }
490 
492 {
493  if ( mpWindowImpl->mbInitWinClipRegion )
495 
496  rRegion.Intersect( mpWindowImpl->maWinClipRegion );
497 }
498 
500 {
502  Size( mnOutWidth, mnOutHeight ) ) );
503  if ( mpWindowImpl->mbWinRegion )
504  rRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
505 }
506 
508 {
509  if ( mpWindowImpl->mbWinRegion )
510  {
511  Point aPoint( mnOutOffX, mnOutOffY );
512  vcl::Region aRegion( tools::Rectangle( aPoint,
513  Size( mnOutWidth, mnOutHeight ) ) );
514  aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
515  rRegion.Exclude( aRegion );
516  }
517  else
518  {
519  Point aPoint( mnOutOffX, mnOutOffY );
520  rRegion.Exclude( tools::Rectangle( aPoint,
521  Size( mnOutWidth, mnOutHeight ) ) );
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 ), Size( mpWindowImpl->mpFrameWindow->mnOutWidth, mpWindowImpl->mpFrameWindow->mnOutHeight ) ) );
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  {
656  pWindow = mpWindowImpl->mpFirstChild;
657  while ( pWindow )
658  {
659  if ( pWindow->mpWindowImpl->mbReallyVisible )
660  {
661  aTempRegion = aRegion;
662  pWindow->ImplIntersectWindowRegion( aTempRegion );
663  rRegion.Union( aTempRegion );
664  }
665  pWindow = pWindow->mpWindowImpl->mpNext;
666  }
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
long mnOutOffX
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
Definition: outdev.hxx:342
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:344
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:1669
vcl::Region maRegion
Definition: outdev.hxx:361
bool mbOutputClipped
Definition: outdev.hxx:381
const MapMode & GetMapMode() const
Definition: outdev.hxx:1674
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
vcl::Region GetPaintRegion() const
Definition: paint.cxx:1140
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:915
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:620
SAL_DLLPRIVATE void ImplClipBoundaries(vcl::Region &rRegion, bool bThis, bool bOverlaps)
bool mbClipRegionSet
Definition: outdev.hxx:389
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:604
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:304
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:511
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
Definition: window2.cxx:859
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)
long X() const
vcl::Region GetWindowClipRegionPixel() const
Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1185
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:940
void SaveBackground(VirtualDevice &rSaveDevice, const Point &rPos, const Size &rSize, const Size &) const override
SAL_DLLPRIVATE void ImplUpdateSysObjClip()
ParentClipMode
Definition: window.hxx:257
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:377
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:388
SAL_DLLPRIVATE bool ImplSetClipFlagOverlapWindows(bool bSysObjOnlySmaller=false)
void GetRegionRectangles(RectangleVector &rTarget) const
Definition: region.cxx:1659
::OutputDevice const * GetOutDev() const
Definition: window.cxx:571
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:345
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:942
#define DBG_TESTSOLARMUTEX()
long mnOutHeight
Definition: outdev.hxx:346
SAL_DLLPRIVATE void ImplInitWinClipRegion()
WinBits const WB_CLIPCHILDREN
long Y() const